On Fri, 15 Aug 2003 13:39:05 -0700 "Simon Block" <[EMAIL PROTECTED]> wrote:
| Hi All, | | I am attempting to get setup for the kernel development of a USB serial | driver. I am currently running on RH-9. Please bear with me as I have tried | posting to the kernel-newbies.com list but the list appears to be read-only | and no HOWTO's I have looked at are relevant. | | I have downloaded a kernel tar-ball and extracted it under my home | directory. I still have a few questions about development under this tree. | | Here is where I am so far: | | I am currently booted on 2.4.20-6smp (redhat). I downloaded the | tarball: linux-2.6.0-test2.tar.bz2 and have extracted it under my home | directory. After this step I was successfully able to do the following steps | (with gcc version 3.2.2): | . make oldconfig (left most options as default) | . make bzImage | | then I tried: | . make modules | | At the "make modules" stage I get a build failure. Below is a dump of the | last screen of the failure. It was building for perhaps 20 minutes before | bailing out. There were many warnings throughout the build (see below). Slow machine or lots of modules (?). | I get similar errors if I try to build a 2.5 kernel (2.5.75). I saw a post | somewhere about needing to do the following steps between the "make bzImage" | and "make modules", however it did not work: | | make bzImage | cp .conf .conf.save | make clean | make mrproper | make clean | cp .conf.save .conf | make modules Nope, you need to do this (save your current .config file) if you run 'make mrproper', but you don't need to run 'make mrproper' between make bzImage and make modules (normally). | BUILD_DUMP_BEGIN: | drivers/char/istallion.c: In function `stli_startbrd': | drivers/char/istallion.c:4231: warning: `flags' might be used uninitialized | in this function | drivers/char/istallion.c: In function `stli_memread': | drivers/char/istallion.c:4798: warning: `flags' might be used uninitialized | in this function | drivers/char/istallion.c: In function `stli_memwrite': | drivers/char/istallion.c:4852: warning: `flags' might be used uninitialized | in this function | drivers/char/istallion.c: In function `stli_portcmdstats': | drivers/char/istallion.c:4970: warning: `flags' might be used uninitialized | in this function | CC [M] drivers/char/ip2.o | drivers/char/ip2.c: In function `init_module': | drivers/char/ip2.c:57: warning: `MOD_INC_USE_COUNT' is deprecated (declared | at include/linux/module.h:482) | drivers/char/ip2.c:67: warning: `MOD_DEC_USE_COUNT' is deprecated (declared | at include/linux/module.h:494) | CC [M] drivers/char/ip2main.o | drivers/char/ip2main.c: In function `ip2_ioctl': | drivers/char/ip2main.c:2140: warning: implicit declaration of function | `save_flags' | drivers/char/ip2main.c:2140: warning: implicit declaration of function `cli' | drivers/char/ip2main.c:2142: warning: implicit declaration of function | `restore_flags' | drivers/char/ip2main.c:1976: warning: `flags' might be used uninitialized in | this function | drivers/char/ip2main.c: At top level: | drivers/char/ip2/i2cmd.c:142: warning: `ct89' defined but not used | CC [M] drivers/char/riscom8.o | In file included from drivers/char/riscom8.c:51: | drivers/char/riscom8.h:84: field `tqueue' has incomplete type | drivers/char/riscom8.h:85: field `tqueue_hangup' has incomplete type | drivers/char/riscom8.c:84: warning: type defaults to `int' in declaration of | `DECLARE_TASK_QUEUE' | drivers/char/riscom8.c:84: warning: parameter names (without types) in | function declaration | drivers/char/riscom8.c:135: confused by earlier errors, bailing out | make[2]: *** [drivers/char/riscom8.o] Error 1 | make[1]: *** [drivers/char] Error 2 | make: *** [drivers] Error 2 | [EMAIL PROTECTED] linux-2.6.0-test2]$ | BUILD_DUMP_END: Yes, these mean that many APIs have changed from 2.4 to 2.6, but you can still build a 2.6 kernel on a system that is running 2.4. | So it appears that the general rule is you cannot build a 2.5.x or 2.6.x | kernel from a 2.4.x kernel!! I know that this cannot be the case and I must | have misinterpreted something somewhere? Yes, lots of people do it. | So this is one stumbling box I have not found a HOWTO or anything to suggest | that it should be more difficult than this. I have tried posting to the | kernel-newbies.com list but the list appears to be read-only. Am I supposed | to upgrade the binutils first? From where? Once I get past this stage I | think what I am supposed to do is install the kernel in the /boot directory, | add it to my GRUB configuration and boot from it. Right? You begin with this: http://www.kernel.org/pub/linux/kernel/people/davej/misc/post-halloween-2.5.txt and also look at linux/Documentation/Changes file. also linux/Documentation/modules.txt and kbuild/makefiles.txt | This kind of doesn't make sense because all the headers in | /usr/src/linux-xxx will be out of synch with the binary kernel running? Does | this not matter for driver development? Right, those headers aren't used/needed for driver development. | One website suggested a build command line for just building a driver | as: | | gcc -o mymod.o -Wall -W -O2 -DMODULE -D__KERNEL__ -I/lib/modules/`uname | -r`/build/include -c my_mod.c See here: http://lwn.net/Articles/21823/ Here's all that you really need for an external module Makefile: # makefile for procfs_ex/proc*.c # Randy Dunlap, 2003-02-21 # usage: # cd /path/to/kernel/source/ && make SUBDIRS=/path/to/source/procfs_ex/ modules obj-m := module1.o module2.o # etc. clean-files := *.o *.ko *.mod.c # fini; | to be executed from the driver directory (e.g. ./drivers/usb/serial). This | does not work if I am trying to build a 2.6 kernel from a 2.4 system. So I | guess I have to build and boot from the 2.6 kernel and the try and build the | separate modules. If I can install and boot from a new 2.6 kernel will the | appropriate headers magically find their way to /lib/modules/`uname | -r`/build/include which will be /lib/modules/2.6.0-test2/build/include ?? | | As I am looking at starting a new module I will not be able to use the | existing makefiles. Is this command line option the best one? | | Thanks for any help. So far my first kernel development experience with | Linux has not been a pleasant one. ;( -- ~Randy ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel