Complete.Org: Mailing Lists: Archives: discussion: November 1998:
Re: [aclug-L] Kernel transportability
Home

Re: [aclug-L] Kernel transportability

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: aclug-L@xxxxxxxxxxxx
Subject: Re: [aclug-L] Kernel transportability
From: John Goerzen <jgoerzen@xxxxxxxxxxxx>
Date: Tue, 17 Nov 1998 06:36:30 -0600
Reply-to: aclug-L@xxxxxxxxxxxx

On Tue, Nov 17, 1998 at 06:29:31AM -0600, Nate Bargmann wrote:

> kernel and the C library.  My assumption (mistake?) is that since the
> kernel is written mostly in C that it must use the services of whatever
> library /lib/libc.so points to.  Does it not, or does it simply

The kernel simply doesn't use anything in the C library.  The C library is
used only for non-kernel items (so-called "user-land" programs).

In C, some things translate down to assembler (machine instructions) pretty
easily -- assignments (a = 5), comparisons (is x greater than 9?), etc. 
Other things, like comparing strings, do not.  The C library (in general)
provides the implementation for these things that do not translate directly
to assembler code.  This includes most function calls in C, for those of you
familiar with the language.

The kernel either has no need for these calls, or provides its own
scaled-down version of them.  For instance, the kernel doesn't need to use
the strtok() library call, which is used to parse strings.  This is just not
a kernel function.  The kernel does have its own scaled-down version of
printf(), which it uses to display console messages and log things with
sysklogd.

> statically link all the relavant libc code?  Logically, I can see where
> the kernel cannot rely on a dynamically linked library as it does many
> things before the file systems are mounted.  Also, I can see that if the
> kernel uses statically linked code in its C routines, that would allow
> it to run on a glibc based system even if compiled on a libc5 based
> system.  Have I guessed right?

Nope :-)  The kernel just doesn't use the C library at all.

-- 
John Goerzen   Linux, Unix consulting & programming   jgoerzen@xxxxxxxxxxxx |
Developer, Debian GNU/Linux (Free powerful OS upgrade)       www.debian.org |
----------------------------------------------------------------------------+
Visit the Air Capital Linux Users Group on the web at http://www.aclug.org
---
This is the Air Capitol Linux Users Group discussion list.  If you
want to unsubscribe, send the word "unsubscribe" to
aclug-L-request@xxxxxxxxxxxx.  If you want to post to the list, send your
message to aclug-L@xxxxxxxxxxxx.



[Prev in Thread] Current Thread [Next in Thread]