home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / os / linux / 21298 < prev    next >
Encoding:
Text File  |  1992-12-22  |  2.0 KB  |  40 lines

  1. Newsgroups: comp.os.linux
  2. From: jes@grendel.demon.co.uk (Jim Segrave)
  3. Path: sparky!uunet!pipex!demon!grendel.demon.co.uk!jes
  4. Subject: Re: IMPORTANT [BUG in 0.99] Re: [ANNOUNCE]: linux version 0.99
  5. Keywords: kernel linux 0.99
  6. References: <1992Dec14.192204.16359@klaava.Helsinki.FI> <1992Dec19.193230.282@grendel.demon.co.uk> <1992Dec19.222324.22106@klaava.Helsinki.FI>
  7. Organization: Segrave Software Services
  8. Date: Sun, 20 Dec 1992 20:41:14 +0000
  9. Message-ID: <1992Dec20.204114.147@grendel.demon.co.uk>
  10. Sender: usenet@demon.co.uk
  11. Lines: 27
  12.  
  13. In article <1992Dec19.222324.22106@klaava.Helsinki.FI> wirzeniu@klaava.Helsinki.FI (Lars Wirzenius) writes:
  14. >In normal C programs, yes, but the kernel is a bit special.  Like, for
  15. >instance, who is going to do the initialization?  Normally it is the
  16. >kernel (which zeroes out all memory before it is given to a user
  17. >process), the linker (which loads the pre-initialized variables from a
  18. >file, i.e. those variables which are given an explicit initializer),
  19. >and possbily the C startup code.  Trouble is, none of these are active
  20. >when the kernel is booting...
  21.  
  22. Hmm... Obviously data with explicit initialisers is getting loaded from the
  23. kernel image (I'm sure gcc doesn't generate startup code to individually
  24. initialise static data). And I assume that the size of the kernel - code, 
  25. initialised data, and uninitialised statics is available at the a.out
  26. stage. Shouldn't there be some way for setup.S to determine the size of
  27. the uninitialised data area and have it zero this out (which is adequate, 
  28. since gcc's version of a NULL pointer is all bits zero)?
  29.  
  30. It's not a major issue, but if you're used to programming in C, I think
  31. you may tend to assume that all statics are set to the apporpriate form
  32. of zero, so I could see kernel hackers getting caught on this more than
  33. once in the future. I just sort of assumed that the kernel did some 
  34. sort of a memset to the end of it's data area when it loaded, hence my
  35. query.
  36.  
  37. -- 
  38. Jim Segrave - Segrave Software Services       (jes@grendel.demon.co.uk)
  39.  
  40.