LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Porting driver to kernel 2.6 (https://www.linuxquestions.org/questions/linux-software-2/porting-driver-to-kernel-2-6-a-356528/)

jhoya 08-24-2005 11:25 AM

Porting driver to kernel 2.6
 
Hello,
I've just bought an FXO card (winmodem like) to use with Asterisk, but the drivers only complie with Kernel 2.4. I

Attempts to complie this on FC3 (kernel 2.6) of course produce loads of errors like "modversions.h not found". Googlin says something about kbuild (!?)

I am no expert in compiling stuff, so here goes the original Makefile in case somebody can give me a hand on the changes to make this work.

Thank for reading.


#edit these settings
ZAPTEL_SOURCE=/usr/src/zaptel
KERNEL_SOURCE=/usr/src/linux-2.4

#these shouldn't be changed
MODULE=wcfxo2-helper.o
MODULE_CORE=wcfxo2-core.o
MODULE_MAIN=wcfxo2-module.o
DRIVER=wcfxo2.o

all: $(MODULE) $(DRIVER) install

install:
install -D -m 644 $(MODULE) /lib/modules/`uname -r`/misc/$(MODULE) ;
install -D -m 644 $(DRIVER) /lib/modules/`uname -r`/misc/$(DRIVER) ;
/sbin/depmod -a
clean:
rm -f $(MODULE_MAIN) $(MODULE) $(DRIVER)

$(MODULE): wcfxo2-module.c
gcc -O6 -DMODULE -D__KERNEL__ -DEXPORT_SYMTAB -Wall -I. -Wstrict-prototypes -fomit-frame-pointer -I$(KERNEL_SOURCE)/include -DMODVERSIONS -include $(KERNEL_SOURCE)/include/linux/modversions.h -c wcfxo2-module.c
ld -r $(MODULE_CORE) $(MODULE_MAIN) -o $(MODULE)
$(DRIVER): wcfxo2.c
gcc -I/usr/src/linux-2.4/include -O6 -DMODULE -D__KERNEL__ -DEXPORT_SYMTAB -I/usr/src/linux/drivers/net -Wall -I. -Wstrict-prototypes -fomit-frame-pointer -I/usr/src/linux/drivers/net/wan -I/usr/src/linux/include -I/usr/src/linux/include/net -DMODVERSIONS -include /usr/src/linux-2.4/include/linux/modversions.h -I$(ZAPTEL_SOURCE) -DSTANDALONE_ZAPATA -c wcfxo2.c


All times are GMT -5. The time now is 07:47 AM.