home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / unix / bsd / 4374 < prev    next >
Encoding:
Text File  |  1992-08-18  |  5.3 KB  |  124 lines

  1. Newsgroups: comp.unix.bsd
  2. Path: sparky!uunet!sun-barr!ames!agate!tfs.com!tfs.com!julian
  3. From: julian@tfs.com (Julian Elischer)
  4. Subject: Re: SUMMARY of answers to: "how to label partition to 386BSD?"
  5. Message-ID: <1992Aug19.003546.16728@tfs.com>
  6. Summary: more on partitioning a drive
  7. Organization: TRW Financial Systems
  8. References: <1992Aug13.231848.7930@access.usask.ca>
  9. Distribution: comp
  10. Date: Wed, 19 Aug 1992 00:35:46 GMT
  11. Lines: 111
  12.  
  13. In article <1992Aug13.231848.7930@access.usask.ca> israel@dvinci.USask.Ca (Israel Oznovich) writes:
  14. >--------------------------------------------------------------------
  15. >--------------------------------------------------------------------
  16. >A few days ago I posted the following question to this newsgroup:
  17. >"how to label a partition for 386BSD?"
  18. >I got many responses, all of them informative and helpful;
  19. >I also got messages urging me to summarize the answers and re-post.
  20. >Thank you Henrik Storner, Rick J Weldon, Frank Terhaar-Yonkers,
  21. >Brian D. Carlstrom, Spaceman Spiff, and more...
  22. >Here goes.
  23. >Israel.
  24. [ lots of useful information deleted]
  25.  
  26. I have gone through a painful but rewarding week in which
  27. I have broken and ficed just about every structure on my disk
  28. in an attempt to have concurrent mach and 386bsd partitions.
  29.  
  30. I post here some of the highlights to save others from going through
  31. the same "delightful' experience.
  32.  
  33.  
  34. First:
  35.  
  36. Mach has an fdisk utility which beats up the DOS partition table.
  37. I used it to change various things in the DOS boot block (block 0)
  38. but others could use the DOS norton stuff and DOS fdisk to do the same things.
  39. Using this utility it was possible for me to totally confuse myself because
  40. it allowed the figures for partitions to be totally inconsistant if I type them
  41. in that way 8-)
  42.  
  43. things to know that I discovered the hard way:
  44.  
  45. 386BSD must have it's partition starting on a cylinder boundary.
  46. This must be a REAL cylinder boundary, not a funny one as created by
  47. block translation stuff. (see STAGE2 later)
  48.  
  49. The boot code uses the adapter's idea of the disk geometry, so
  50. whatever you have set into the BIOS (which will be used by the BIOS
  51. to initialise the adapter should have the right number of heads and sectors
  52. per track. The number of cylinders is totally unimportant as long as it 
  53. is large enough to cover your DOS partition, and the boot blocks of
  54. any other partitions you may have.
  55. e.g.
  56.  
  57. I have a drive of 1222 cylinders, 15 heads (1 for servo I guess) and 34 sectors
  58. per track. I told the adapter to format with 1 slip-sector per track so I get
  59. final figures of 1222 x 15 x 33.
  60.  
  61. If I try to use these figures, the BIOS won't work, but one of the options
  62. I get given by the format utility is 1023 x 15 x 33. I use this as
  63. it has enough cylinders to reach as far as my mach partition's boot blocks.
  64. (I set my disk up with 769 xylinders for 386BSD and 453 cylinders for MACH.)
  65.  
  66. Because the 386BSD partition must start on a cylinder boundary, it starts
  67. on block 495. (the first cylinder is effectively lost except for the BOOT BLOCK)
  68.  
  69. STAGE1:
  70. So, the FIRST boot block (os-bs in this case) uses the BIOS to load the
  71. first block of the 386BSD boot code.
  72. This requires that the bytes in the BOOT BLOCK 
  73. that give the start cylinder and sector (and head) for the partition match
  74. the start sector number IN THE DISK GEOMETRY that you last told the BIOS.
  75.  
  76. STAGE2:
  77. The second stage boot just loads sectors 2-16 on whatever track it is already
  78. set up for (The reason that the BSD partition must be on a cylinder boundary).
  79.  
  80. STAGE3:
  81. The third stage boot actually has the disklabel embedded in it and uses it
  82. as a source of the information as to the disk geometry. It can read
  83. the partitions where-ever they may be.
  84.  
  85. STAGE4, (THE KERNEL)
  86. The final stage is the kernel itself. Before it can read the disklabel, it
  87. has no idea of what the disk looks like. A catch 22 as it needs to know
  88. the layout before it can read the disklabel if the disklabel is not
  89. on the first cylinder. It solves this by horrible means.
  90. What it does is to read the DOS bootblock and assume that the end of the 
  91. BSD partition in on the last block of the last track of the last cylinder
  92. in that partition. It then assumes uses the sector number and head number
  93. of that last block as if they were the number of sectors and number of heads,
  94. which allows the kernel to calculate the required cylinder number etc. for
  95. the disklabel, which it then reads in.
  96.  
  97. SO all in all, you need 4 different sets of data to agree to get your
  98. kernel successfully booted in 386BSD.!
  99.  
  100.  
  101. MACH does the 2nd and 3rd and 4th steps differently.
  102. They use the BIOS in all the bootstrap stages, not touching the hardware at 
  103. all. In the kernel, they use the cylinder, head and sector numbers given
  104. in the bootblock (sector 0) for the partition start, but add 29 to the
  105. sector number (They do assume you have more than 30 sectors per track on the 
  106. disk) to find the 'disklabel'.
  107.  
  108.  
  109.  
  110.  
  111. Incidentally, I found that by extending the disklabels of mach and 386BSD
  112. to each other's areas, I can cross mount the partitions.
  113.  
  114. (e.g. MACH can mount the BSD partitions).
  115.  
  116.  
  117. +----------------------------------+       ______ _  __
  118. |   __--_|\  Julian Elischer       |       \     U \/ / On assignment
  119. |  /       \ julian@tfs.com        +------>x   USA    \ in a very strange
  120. | (   OZ    ) 2118 Milvia st. Berkeley CA. \___   ___ | country !
  121. +- X_.---._/  USA+(510) 704-3137(wk)           \_/   \\            
  122.           v
  123.  
  124.