linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [RFC] Splitting kernel headers and deprecating __KERNEL__
@ 2004-11-27 19:43 Dan Kegel
  2004-11-27 21:06 ` Sam Ravnborg
  0 siblings, 1 reply; 184+ messages in thread
From: Dan Kegel @ 2004-11-27 19:43 UTC (permalink / raw)
  To: Linux Kernel Mailing List

Alexander Stohr wrote:
>> Matthew Wilcox wrote:
>> > Indeed.  We could also make this transparent to userspace by using a script
>> > to copy the user-* headers to /usr/include.  Something like this:
> 
> some administrator would like to only create symlinks for saving disk space.
> 
> others would like a true "install" with copying files so that they can delete
> the kernel sources anytime they do want.
> 
> for me i would install all those kernel realted files into 
> the well known /lib/modules/<kernel-version>. 

IMHO the script should let you install the headers
wherever you like.  In particular, in crosstool,
I would like to install the headers somewhere like
/opt/crosstool/$TARGET/include rather than /usr/include.
- Dan

-- 
Trying to get a job as a c++ developer?  See http://kegel.com/academy/getting-hired.html

^ permalink raw reply	[flat|nested] 184+ messages in thread
* Re: [RFC] Splitting kernel headers and deprecating __KERNEL__
@ 2004-11-30  1:43 Jean Tourrilhes
  2004-11-30  4:22 ` Linus Torvalds
  0 siblings, 1 reply; 184+ messages in thread
From: Jean Tourrilhes @ 2004-11-30  1:43 UTC (permalink / raw)
  To: Linux kernel mailing list, David Howells, Jeff Garzik,
	Linus Torvalds, Mariusz Mazur, H. Peter Anvin

David Howells wrote :
> We've been discussing splitting the kernel headers into userspace API headers
> and kernel internal headers and deprecating the __KERNEL__ macro.

Linus Torvalds wrote :
> On Mon, 29 Nov 2004, Alexandre Oliva wrote:
> >
> > - Linux gets to define the ABI between kernel and userland, and
> >   userland must duplicate the contents of headers in which the kernel
> >   defines the kernel<->userland ABI, tracking changes in them in the
> >   hope that nothing falls through the cracks
> 
> This is unquestionably true. The kernel obviously _does_ define the ABI, 
> and userland just lives with it. At some point you have to track things, 
> just because new features etc just can't be sanely handled any other way. 
> 
> That said, I think we can make the tracking _easier_. 

	Nice discussion, but nobody is discussing my main concern,
even if Linus come close to it.
	On my box, I do have multiple kernels. Some 2.4.X, some 2.6.X,
I may even find some 2.2.X on some of my boxes. Depending on what I
do, and the bug reports send to me, I boot one of these kernel or
another. Because Linus is so productive, I update my kernel
frequently, without changing the user space. I know that some
distributions are also offering various kernel versions, and let the
user choose.
	So, which kernel ABI should be present on my system in
/usr/include/linux and /usr/include/asm ? Should I use the ABI from
2.6.X, 2.4.X or 2.2.X ? Should I take the time to create a sanitised
version of the kernel header every time I install a new kernel, even
though I may revert back to the previous kernel ? Should I recompile
applications using kernel headers at each kernel upgrade ?
	Currently, it doesn't matter, as so few applications are using
those headers, and most changes are highly backward compatible. And
the application that are deeply intimate with the kernel probably do
run-time tracking of features already, so don't really need those
headers...

	However, I believe we need to at least ask this question, even
if I don't think we will come up with a good answer...

	Have fun...

	Jean

^ permalink raw reply	[flat|nested] 184+ messages in thread
[parent not found: <34Xo6-2P0-19@gated-at.bofh.it>]
* [RFC] Splitting kernel headers and deprecating __KERNEL__
@ 2004-11-25 15:13 David Howells
  2004-11-25 15:23 ` David Woodhouse
                   ` (10 more replies)
  0 siblings, 11 replies; 184+ messages in thread
From: David Howells @ 2004-11-25 15:13 UTC (permalink / raw)
  To: torvalds, hch, matthew, dwmw2, aoliva; +Cc: linux-kernel, libc-hacker


We've been discussing splitting the kernel headers into userspace API headers
and kernel internal headers and deprecating the __KERNEL__ macro. This will
permit a cleaner interface between the kernel and userspace; and one that's
easier to keep up to date.

What we've come up with is this:

 (1) Create new directories in the linux sources to shadow existing include
     directories:

	NEW DIRECTORY		DIRECTORY SHADOWED
	=============		==================
	include/user/		include/linux/
	include/user-*/		include/asm-*/

     Note that this doesn't take account of the other directories under
     include/, but I don't think they're relevant.

 (2) Take each file from the shadowed directory. If it has any userspace
     relevant stuff, then:

     (a) Transfer this stuff into a file of the same name in the new
	 directory. So, for example, the syscall number list from
	 include/asm-i386/unistd.h will be transferred to
	 include/user-i386/unistd.h.

     (b) Make kernel file #include the user file. So:

		[include/asm-i386/unistd.h]
		...
		#include <user-i386/unistd.h>
		...

     (c) Where a user header file requires something from another header file
	 (such as a type), that file should include a suitable user header file
	 directly:

		[include/user-i386/termio.h]
		...
		#include <user/types.h>
		...

     (d) stdint types should be used where possible.

		[include/user-i386/termios.h]
		struct winsize {
			uint16_t ws_row;
			uint16_t ws_col;
			uint16_t ws_xpixel;
			uint16_t ws_ypixel;
		};

     (e) These header files should be bounded with __USER_XXXXX_H conditionals:

		[include/user-i386/termios.h]
		#ifndef __USER_I386_TERMIOS_H
		#define __USER_I386_TERMIOS_H
		...
		#endif /*  __USER_I386_TERMIOS_H */

 (3) Remove all #if(n)def __KERNEL__ clauses.

 (4) Remove the -D__KERNEL__ from the master kernel Makefile.

 (5) For userspace use (such as for glibc), the appropriate include/user*/
     directories should be selected and installed in /usr/include/ or wherever,
     and symlinks made. For example, on i386 arch boxes, you might find:

	SOURCE			INSTALLED AS
	======================	============
	include/user/		/usr/include/user/
	include/user-i386/	/usr/include/user-i386/
				/usr/include/linux -> user
				/usr/include/asm -> user-i386

 (6) On multi-arch archs (such as ppc64 which can also support ppc), you might
     find:

	SOURCE			INSTALLED AS
	======================	============
	include/user/		/usr/include/user/
	include/user-ppc/	/usr/include/user-ppc/
	include/user-ppc64/	/usr/include/user-ppc64/
				/usr/include/linux -> user
				/usr/include/asm-ppc -> user-ppc
				/usr/include/asm-ppc64 -> user-ppc64

     And then /usr/include/asm/ might contain files that do arch-size dependent
     switching between user-ppc and user-ppc64.


David

^ permalink raw reply	[flat|nested] 184+ messages in thread

end of thread, other threads:[~2004-12-16  1:21 UTC | newest]

Thread overview: 184+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-27 19:43 [RFC] Splitting kernel headers and deprecating __KERNEL__ Dan Kegel
2004-11-27 21:06 ` Sam Ravnborg
  -- strict thread matches above, loose matches on Subject: below --
2004-11-30  1:43 Jean Tourrilhes
2004-11-30  4:22 ` Linus Torvalds
2004-11-30  6:51   ` H. Peter Anvin
     [not found] <34Xo6-2P0-19@gated-at.bofh.it>
     [not found] ` <35i9f-2vZ-25@gated-at.bofh.it>
     [not found]   ` <35iLS-2Uo-1@gated-at.bofh.it>
     [not found]     ` <35kb6-46Q-25@gated-at.bofh.it>
2004-11-28  0:55       ` ak
2004-11-28 13:32         ` Arnd Bergmann
2004-11-25 15:13 David Howells
2004-11-25 15:23 ` David Woodhouse
2004-11-25 16:54 ` Matthew Wilcox
2004-11-25 18:17   ` David Woodhouse
2004-11-27  3:24     ` Greg KH
2004-11-28 23:37       ` Paul Mackerras
2004-11-29  1:28         ` Linus Torvalds
2004-11-29  4:36           ` Jeff Garzik
2004-11-29  4:57             ` Al Viro
2004-11-29  5:27               ` Tim Hockin
2004-11-29  7:51             ` Arjan van de Ven
2004-12-05  0:49             ` Rob Landley
2004-12-05  2:26               ` Andries Brouwer
2004-12-05 13:19                 ` David Greaves
2004-12-05 15:57                   ` Andries Brouwer
2004-12-05 23:05                     ` Rob Landley
2004-12-06  9:56                       ` Andries Brouwer
2004-11-29  9:42           ` David Woodhouse
2004-11-30  8:08             ` Alex Riesen
2004-11-30  8:57               ` Alex Riesen
2004-12-01 11:46             ` Ralf Baechle
2004-12-02  1:21               ` H. Peter Anvin
2004-11-29  9:53           ` Paul Mackerras
2004-11-29  9:57             ` Arjan van de Ven
2004-11-29 10:01               ` David Woodhouse
2004-11-29 11:41           ` Mariusz Mazur
2004-11-29 17:09           ` Alexandre Oliva
2004-11-29 17:41             ` Linus Torvalds
2004-11-29 22:44               ` Al Viro
2004-12-01 11:36                 ` Roman Zippel
     [not found]               ` <oract0thnj.fsf@livre.redhat.lsd.ic.unicamp.br>
2004-11-29 23:00                 ` Linus Torvalds
2004-11-30  0:45                   ` H. Peter Anvin
2004-11-30  5:31                   ` Herbert Poetzl
2004-11-30  6:44                   ` bert hubert
2004-11-30 21:22                   ` Alexandre Oliva
2004-11-30 22:22                     ` Linus Torvalds
2004-11-30 22:57                       ` Alexandre Oliva
2004-11-30 23:12                         ` Linus Torvalds
2004-12-01 19:41                           ` Alexandre Oliva
2004-12-01 19:54                             ` Matthew Wilcox
2004-12-02  3:58                             ` Linus Torvalds
2004-12-02  4:28                               ` Bernd Eckenfels
2004-12-02  5:11                                 ` Peter Williams
2004-12-02 11:30                                   ` Tomas Carnecky
2004-12-02 22:17                                     ` Peter Williams
2004-12-02  9:29                               ` Pekka Enberg
2004-12-02 15:35                                 ` Linus Torvalds
2004-12-02 21:46                                   ` Pekka Enberg
2004-11-30 15:35               ` David Woodhouse
2004-11-30 15:58                 ` Linus Torvalds
2004-11-30 16:28                   ` David Woodhouse
2004-11-30 16:53                     ` Linus Torvalds
2004-11-30 17:52                       ` David Woodhouse
2004-11-30 18:21                         ` Linus Torvalds
2004-11-30 20:28                           ` Mariusz Mazur
2004-11-30 20:47                             ` Linus Torvalds
2004-11-30 22:33                               ` Sam Ravnborg
2004-11-30 22:44                                 ` Mariusz Mazur
2004-11-30 23:03                                   ` Al Viro
2004-11-30 23:08                                     ` Mariusz Mazur
2004-12-01  5:23                                       ` Sam Ravnborg
2004-12-01 10:52                                         ` Mariusz Mazur
2004-12-01 18:08                                           ` Sam Ravnborg
2004-11-30 23:13                                     ` Alexandre Oliva
2004-11-30 23:36                                     ` Chris Friesen
2004-12-01  5:50                               ` H. Peter Anvin
2004-11-30 22:48                           ` Matt Mackall
2004-11-30 22:51                             ` Christoph Hellwig
2004-11-30 23:09                               ` Chris Friesen
2004-11-30 23:35                                 ` Matt Mackall
2004-12-01  0:23                                 ` Miquel van Smoorenburg
2004-11-30 22:55                             ` Linus Torvalds
2004-11-30 23:29                               ` Matt Mackall
2004-12-03  1:03                                 ` Krzysztof Halasa
2004-11-30 23:51                               ` David Woodhouse
2004-11-30 17:55                       ` Al Viro
2004-11-30 16:33                 ` David Howells
2004-11-30 16:57                   ` Linus Torvalds
2004-11-30 15:33             ` David Howells
2004-11-30 15:51               ` Linus Torvalds
2004-11-30 20:47                 ` Alexandre Oliva
2004-11-30 20:56                   ` Linus Torvalds
2004-11-30 21:30                     ` Alexandre Oliva
2004-11-30 21:39                       ` Alexandre Oliva
2004-11-30 23:33                         ` Matthew Wilcox
2004-11-30 22:25                       ` Linus Torvalds
2004-11-30 22:34                         ` David Woodhouse
2004-11-30 22:51                           ` Linus Torvalds
2004-11-30 23:50                             ` David Woodhouse
2004-12-01  0:10                               ` Linus Torvalds
2004-12-01  0:18                                 ` Linus Torvalds
2004-12-01  8:10                                   ` Arjan van de Ven
2004-12-01  0:24                                 ` David Woodhouse
2004-12-01  0:37                                   ` Linus Torvalds
2004-12-01  0:47                                     ` David Woodhouse
2004-12-01  0:57                                       ` Linus Torvalds
2004-12-01  1:06                                         ` David Woodhouse
2004-12-01  1:23                                           ` Linus Torvalds
2004-12-01  6:48                                           ` BAIN
2004-11-30 22:52                         ` Mariusz Mazur
2004-11-30 23:05                           ` Linus Torvalds
2004-11-30 23:05                         ` Alexandre Oliva
2004-11-30 16:18               ` David Howells
2004-12-14  5:51           ` Werner Almesberger
2004-12-14 15:49             ` Linus Torvalds
2004-12-14 16:50               ` Werner Almesberger
2004-12-14 17:58                 ` Linus Torvalds
2004-12-14 21:46                   ` Werner Almesberger
2004-12-14 21:58                     ` Linus Torvalds
2004-12-14 23:49                     ` Krzysztof Halasa
2004-12-15  0:09                       ` Werner Almesberger
2004-12-16  0:58                         ` Krzysztof Halasa
2004-12-14 19:23                 ` Horst von Brand
2004-12-14 19:45                   ` Sam Ravnborg
2004-12-14 19:58                     ` Linus Torvalds
2004-12-14 20:25                       ` Andreas Schwab
2004-12-14 20:33                         ` Linus Torvalds
2004-12-14 16:55               ` Andreas Schwab
2004-12-14 17:59                 ` Linus Torvalds
2004-11-27 20:39   ` Sam Ravnborg
2004-11-25 18:20 ` Alexandre Oliva
2004-11-25 21:01   ` Matthew Wilcox
2004-11-25 22:35     ` David Woodhouse
2004-11-26 11:42       ` Alexandre Oliva
2004-11-27  0:13       ` Andreas Steinmetz
2004-11-27  0:26         ` David Woodhouse
2004-11-27  0:30           ` Andreas Steinmetz
2004-11-27  0:38             ` David Woodhouse
2004-11-26 11:47     ` Alexandre Oliva
2004-11-26 11:53       ` David Woodhouse
2004-11-27 16:12       ` Krzysztof Halasa
2004-11-26 11:58   ` David Howells
2004-11-26 12:00     ` David Woodhouse
2004-11-26 14:19       ` Matthew Wilcox
2004-11-26 14:33         ` David Woodhouse
2004-11-27 12:10           ` Alexander Stohr
2004-11-27  3:46         ` Adam Heath
2004-11-30 12:18         ` Horst von Brand
2004-11-29 16:34     ` Alexandre Oliva
2004-11-25 18:45 ` Matthew Wilcox
2004-11-26 11:52 ` David Howells
2004-11-26 23:56 ` Grzegorz Kulewski
2004-11-27  1:27   ` Tomas Carnecky
2004-11-27  1:41     ` Grzegorz Kulewski
2004-11-27  2:03       ` Tomas Carnecky
2004-11-27  3:07 ` Kyle Moffett
2004-11-27  4:29 ` Tonnerre
2004-11-27  3:51   ` Matthew Wilcox
2004-11-27 16:47     ` Randy.Dunlap
2004-11-27 17:16       ` David Woodhouse
2004-11-27 22:53         ` Arnd Bergmann
2004-11-27 23:12           ` David Woodhouse
2004-11-27 23:27           ` Randy.Dunlap
2004-11-27 23:32             ` David Woodhouse
2004-11-27 23:56               ` Arnd Bergmann
2004-11-28  7:13           ` Arjan van de Ven
2004-11-28 12:03             ` Arnd Bergmann
2004-11-28 12:19               ` Arjan van de Ven
2004-11-28 16:34                 ` Kevin Puetz
2004-11-28 12:28               ` Wichert Akkerman
2004-11-28 12:44                 ` Arjan van de Ven
2004-11-28 16:21             ` Jakub Jelinek
2004-11-28  7:20           ` Christoph Hellwig
2004-11-27  4:05   ` Chris Friesen
2004-11-27  4:30   ` Tomas Carnecky
2004-11-27 21:03 ` Sam Ravnborg
2004-11-27 21:11   ` Andreas Steinmetz
2004-11-27 21:19     ` Sam Ravnborg
2004-11-27 21:49       ` Andreas Steinmetz
2004-11-27 23:21         ` Arnd Bergmann
2004-11-28 13:24           ` Andreas Steinmetz
2004-11-28 13:40             ` Arnd Bergmann
2004-11-29 11:08 ` David Howells
2004-11-29 20:01 ` H. Peter Anvin
2004-11-30  0:34   ` Kyle Moffett
2004-11-30  0:51     ` H. Peter Anvin
2004-12-14  7:07   ` Werner Almesberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).