On Thu, 20 Nov 2003 12:09:54 +0800 lrd <[EMAIL PROTECTED]> wrote: | Randy.Dunlap wrote: | > | > How did you build the driver module? (what commands) | My make files are from the book 'Linux Device Driver 2nd Edition'. I | just change the source file name to mine. I know this book only focuses | on 2.4, then, should I do any additional works for 2.6? | BTW: These make files work fine for 2.4.
Ah, finally I asked the right questions. Those commands are not correct for building modules in Linux 2.6. See linux/Documentation/kbuild/makefiles.txt and .../modules.txt for how to build modules in 2.6. Here's a simple, easy example Makefile that works: # makefile for whatever/skeletondriver.c # usage: # cd /path/to/kernel/source/ && make SUBDIRS=/path/to/source/whatever/ modules obj-m := skeletondriver.o clean-files := *.o *.ko *.mod.c # fini; | > Where is the driver source file? in the linux/ tree or outside it? | I put it out of the source tree. Same answer as above. | > What other files are generated when you build the driver module? | Only *one* source file which is derived from usb-skeleton.c. I seperate | 2.4 & 2.6 codes with #if...#else...#endif. Building modules in 2.6 should generate a modulename.mod.c source file also. -- ~Randy ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/ _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
