The time has come for a kernel interfacing library layer

Nathan Hawkins utsl at quic.net
Mon May 9 16:55:26 PDT 2005


There's already an ABI version in every binary.
(src/lib/csu/common/crtbrand.c) NetBSD has some good docs about it
here:
http://www.netbsd.org/Documentation/kernel/elf-notes.html

FreeBSD has put it into binaries since sometime during 4.x.
Unfortunately, no-one ever taught the kernel to look at it. If you add
support for reading those ABI note sections, you can mostly obsolete
brandelf, and make the kernel do a better job of identifying binaries
for the emulator.


Also, Linux is doing something similar in order to make use of
sysenter/syscall instructions. There's some info here:
http://www.win.tue.nl/~aeb/linux/lk/lk-4.html#vsyscalls

Amongst other things, it mentions use of %gs to reach the syscall gate
page. That method nicely avoids the whole issue of linking libc to your
library. It is also applicable to the linux emulation, and could allow
moving that into userspace. Granted, for linux binaries, that requires a
recent glibc compiled with the right option...

	---Nathan


On Mon, May 09, 2005 at 07:54:47AM -0700, Matthew Dillon wrote:
>     The kernel would select which layer file to map based on the ABI
>     version of the program (based on the section name) verses the ABI
>     version of the kernel.  Theoretically this means that we can then 
>     change system calls in the kernel, like the stat structure, and still
>     provide compatibility functions for programs expecting older ABIs.
>     And, theoretically, we can also run programs expecting newer ABIs 
>     on older systems by providing the appropriate syscall layer to
>     translate the ABIs.





More information about the Kernel mailing list