Hi All,Don't do make mrproper here.
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).
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
The order should in the same order as the README file.
Kernel 2.6 is build differently, so read the readme file.
make mrproper
make clean
make menuconfig
make (no separate make bzImage, make modules)
make modules_install
cp ...bzImage to /boot, and edit lilo/grub appropriately to load it on next boot.
reboot system.
make mrproper make clean cp .conf.save .conf make modules
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
Not everything builds in kernel 2.6 yet. Do a "make menuconfig" and only select the modules you really need.
No true. You can build 2.6 kernels from 2.4.x kernels, just read the README files first.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:
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?
That will not work on kernel 2.6So 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?
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?
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
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. ;( sab
------------------------------------------------------- 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