View Single Post
Old 08-14-2008, 05:45 PM   #2
Antartica
Evangelist
Antartica ought to be getting tired of karma fortunes by now.Antartica ought to be getting tired of karma fortunes by now.Antartica ought to be getting tired of karma fortunes by now.Antartica ought to be getting tired of karma fortunes by now.Antartica ought to be getting tired of karma fortunes by now.Antartica ought to be getting tired of karma fortunes by now.Antartica ought to be getting tired of karma fortunes by now.Antartica ought to be getting tired of karma fortunes by now.Antartica ought to be getting tired of karma fortunes by now.Antartica ought to be getting tired of karma fortunes by now.Antartica ought to be getting tired of karma fortunes by now.
 
Antartica's Avatar
 
Posts: 423
Karma: 1517132
Join Date: Jun 2006
Location: Madrid, Spain
Device: quaderno, remarkable2, yotaphone2, prs950, iliad, onhandpc, newton
Quote:
Originally Posted by illiad_fan View Post
After that I try to compile this driver on crosstool for Iliad, but not sucessful. Is there any one know how to do this? Please help me!
Thank you very much.
When you say "crosstool", you mean the unofficial toolchain? As I understand it, crosstool is used to produce a toolchain, but then you use the toolchain for compiling (not crosstool).

Anyway, you are right in that you have to compile the driver using an arm toolchain.

You must take care of the following:
1. Use the same kernel sources that iRex used (same patches; if that is not possible, then you can just "fake" the version string with a reasonably similar kernel source tree)
2. Use the same ".config" in the kernel sources tree, and do a "make oldconfig dep" to prepare the sources.
3. Use a Makefile prepared for out-of-tree drivers. I have used in the past one ripped from the bttv modules. Mine is as follows:

Code:
# Makefile for this module
#
# Sanely ripped from bttv driver ;-)
#
# Modified for kernel 2.4.x
#################################################
# config

# currently running kernel
#CURRENT=$(shell uname -r)
CURRENT=2.4.18

# where the kernel sources are located
KERNEL_LOCATION=/usr/src/linux-$(CURRENT)

#################################################
# some magic for using linux kernel settings
# when compiling module(s)


# Independent modules
M_OBJS       = mydriver.o
# Modules on whom other relay to work
MX_OBJS      = 
# Flags, defines (-Dname) and other usefull stuff
EXTRA_CFLAGS = -I/usr/src/extra_headers -DLINUX

here:
        DIR=`pwd`; (cd $(KERNEL_LOCATION); make SUBDIRS=$$DIR modules)

install:
        su -c "cp -v $(M_OBJS) $(MX_OBJS) /lib/modules/$(CURRENT)/misc"

modules: mydriver.o


clean:
        -rm -f $(M_OBJS) $(MX_OBJS) .*.o.flags *~

include $(KERNEL_LOCATION)/Rules.make
This one is for compiling a driver with source file "mydriver.c" and generate a kernel module for kernel 2.4.x named "mydriver.o" (".ko" is how kernel modules are named in kernel 2.6, but for earlier kernels they were ".o").

Hope that helps.

P.S: In the wiki page for compiling a toolchain for the iliad there are instruction on where to download the kernel sources for the iliad. See
https://wiki.mobileread.com/wiki/Note...sing_crosstool
Antartica is offline   Reply With Quote