home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / os / linux / 10410 < prev    next >
Encoding:
Internet Message Format  |  1992-09-10  |  2.5 KB

  1. Path: sparky!uunet!haven.umd.edu!darwin.sura.net!ra!tantalus!eric
  2. From: eric@tantalus.dell.com (Eric Youngdale)
  3. Newsgroups: comp.os.linux
  4. Subject: Re: 0.97pl4 breaks SCSI extended partition code
  5. Message-ID: <3566@ra.nrl.navy.mil>
  6. Date: 10 Sep 92 22:05:12 GMT
  7. References: <3555@ra.nrl.navy.mil> <716179383snx@prism.demon.co.uk>
  8. Sender: usenet@ra.nrl.navy.mil
  9. Distribution: world
  10. Organization: Naval Research Laboratory
  11. Lines: 41
  12.  
  13. In article <716179383snx@prism.demon.co.uk> david@prism.demon.co.uk (David Metcalfe) writes:
  14. >I've tried the patch out and it also cures my problem.  It's
  15. >interesting that the extended partition could be read first time with
  16. >0.97pl2 but not with pl4.  There must have been a small change in the
  17. >timing.
  18.  
  19.     No, the problem is more insidious than that.  Drew kind of hinted 
  20. at it when he swore at the bootstrap loader, but I will explain.
  21.  
  22.     Previously, the array sd_sizes was uninitialized, which means that
  23. it was in the bss section.  A normal C program can count on data items
  24. in the bss section as being initialized to 0, but this is not always the
  25. case with the kernel.  It really depends a lot on the bootstrap loader.
  26. It appears as if lilo is able to zero the bss section, but shoelace does not.
  27. As I recall, if you boot your kernel from a floppy, then the bss is not cleared
  28. as well.  I could be all wet on this, though.
  29.  
  30.     This being said, what was happening was that the sd_sizes array was
  31. initialized with junk when the system was trying to read the partition tables.
  32. If that junk happened to be 0, then you would be unable to read the partition
  33. table for the extended partition, and if it was non-zero (and positive??),
  34. then linux would be able to read the parition table.  A seemingly unrelated
  35. change would shift things around in memory, and thus could lead to the
  36. partition size apparently becoming 0.
  37.  
  38.     Note that once the partition tables have been read, then the data
  39. is read out from the partition structures, and sd_sizes is set to the correct
  40. numbers.
  41.  
  42.     The way the kernel is supposed to work, blk_size[8] should be NULL
  43. until the partition tables have been read.  Just after sd_sizes is set to the
  44. correct numbers, then blk_size[8] is set to point to sd_sizes.  As long as
  45. blk_size[8] == 0, then the test in make_request() is skipped.
  46.  
  47.     I am beginning to wonder if there is a way for the kernel itself to
  48. clear the bss section before anything really gets going.  This problem is a
  49. fairly easy trap to fall into, and it can easily lead to spurious behavior.
  50.  
  51. --
  52. Eric Youngdale
  53. eric@tantalus.nrl.navy.mil
  54.