From: Zdenek Radouch (zdenek@ksr.com)
Date: 12/20/92


From: zdenek@ksr.com (Zdenek Radouch)
Subject: Re: IMPORTANT [BUG in 0.99] Re: [ANNOUNCE]: linux version 0.99
Date: 20 Dec 1992 13:42:17 EST

Lars Wirzenius writes:

[about questionable initialization of a static pointer to NULL]

>In normal C programs, yes, but the kernel is a bit special. Like, for
>instance, who is going to do the initialization? Normally it is the
>kernel (which zeroes out all memory before it is given to a user
>process), the linker (which loads the pre-initialized variables from a
>file, i.e. those variables which are given an explicit initializer),
>and possbily the C startup code. Trouble is, none of these are active
>when the kernel is booting...

Sounds more like a slight design problem, or perhaps a "feature".
Normally, the primary bootstrap code, before doing anything else, loads
either itself or a kernel or a secondary boot code into memory (from a PROM
or from a device). An integral part of this loading process is to initialize
BSS. That way the loaded object can be written as any other piece of C code.
Actually, even the loader itself can be written in C (I've written one myself),
you just have to make sure there is no static data in the code.

I can't think of a reason for the kernel loader to skip the BSS initialization.
And, as the bug more than clearly demonstrates, there are quite a few reasons
to keep the kernel coding standard.

This reminded me that I was questioning why the linux kernel uses floating
point code (I seem to remember a message posted, implying that it is used).
Generally, there is no need for any floating point code in
operating systems and absence of the floating point code eliminates all
difficulties with handling the coprocessors or emulation code.
-Z