[linux-usb-devel] Building 2.5/2.6 under a 2.4 kernel

2003-08-15 Thread Simon Block
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).

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


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:

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?

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?

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 

[linux-usb-devel] Newbie: tarballs, 2.6 and building a driver

2003-08-14 Thread Simon Block
Hi All,

I'm new to building Linux drivers but not new to device drivers, o I need
some specific help for the RedHat platform. I have RH 9 (2.4) installed and
setup for driver development. I have all the CD's.

I need to extract the kernel tarball to my home directory for development.
Where is the kernel tarball? I presume it is a kernel-xxx-xx-xx.tar.Z type
file? I have the RedHat 9 disks so I presume it is on one of them or on my
system already?

I have worked out how to build the drivers tree I think and I discovered the
binaries under the /lib directory. Once I have my driver's source code under
my own directory under usb/serial, how do I build it? Do I have to go and
add an entry for it to all the Makefiles and configuration files or can I
just write a Makefile for my single driver? Does someone have a development
Makefile for this purpose?

Ok, how do I go about getting 2.6 kernel? The auto-update application thingy
in RH gives me the option to update the kernel and sources to a later
version of 2.4, but not 2.6. I guess version 2.6 is still experimental? 

How can I update the kernel and sources? Will this overwrite the sources in
/usr/src or add another directory and symbolically link to it? Will there be
a tarball somewhere I can then use to build my own development directory
from the 2.6 kernel?

Cheers and thanks for any help!

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/psa0013ave/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