Re: Portable binary drivers

Christer Weinigel (wingel@cendio.se)
Tue, 7 Dec 1999 22:33:25 +0100


Alan Cox wrote:
> You either keep two files, or you carefully set up that file so that it
> has ifdef __KERNEL__ wrappers and can be used.

This is what I'm been doing. The problem I had before was that I was
compiling an application for another machine (using a different kernel
from the one installed in /usr/src/linux) and this application needed
an include file from include/linux which had changed between these two
kernel versions and thus it was important to get the correct one.

So what I needed was a file in /usr/src/linux-whatever/include/linux,
but adding "-I/usr/src/linux-whatever/include" broke the build since
the linux/include/net directory hid the one in /usr/include/linux.

I belive that what I did in the end was to create my own include
directory which had its own linux- and asm-directory with symlinks to
the /usr/src/linux-whatever tree.

> The whole point of seperating glibc/kernel includes is that glibc presents
> a platform that is not neccessarily what the kernel provides. It isolates
> apps from kernel changes.

Yes I agree, but sometimes a driver has to know about the specific
driver. But no user space application should ever include anything
from the include/linux directory unless it wants to get to the
definition of a specific driver's ioctl interface.

Hmm, I wonder what I'm trying to change really. I suppose I would
like the include/net and include/scsi directories in the linux tree to
be renamed do include/knet and include/kscsi or something like that to
avoid the name clashes with /usr/include.

/Christer (being grumpy. Maybe I ought to sleep :-)

-- 
Christer Weinigel		Cendio Systems AB
Email:	wingel@cendio.se	Teknikringen 8
Phone:	+46-13-21 46 00		583 30  Linköping
Fax:	+46-13-21 47 00		Sweden
[please note that Signum Support has changed its name to Cendio Systems]

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/