cvs commit: doc/en_US.ISO8859-1/books/handbook/boot chapter.sgml

John Baldwin jhb at FreeBSD.org
Mon Sep 12 20:50:11 PDT 2005


On Sep 12, 2005, at 8:02 PM, Gary W. Swearingen wrote:

> John Baldwin <jhb at FreeBSD.org> writes:
>
>> The first sentence has a mismatch between subject and verb ("The 
>> FreeBSD
>> MBR ... are").  Also, a better explanation is something more along 
>> the lines
>
> Here it is with the "...":
>
> +      <para>The MBR installed by FreeBSD's installer and by 
> boot0cfg(8)
> +        are
>
> AFAIK, that is an permissible English abbreviation of this:
>
>    The MBR installed by FreeBSD's installer and
>    the MBR installed by boot0cfg(8) are ...
>
>    ^^^^^^^^^^^^^^^^^-------(implied)
>
> The second "by" in my sentence is the clue that I've omitted the
> second "the MBR installed" so as to not repeat it.

Nah, I don't think it is a valid abbreviation unless you used 'MBRs'.  
The
simple rule is if you cut out all the descriptive phrases and get down 
to
just the subject and verb they should agree.  Hence "The MBR ... are".

> If I had used "MBRs", I would have omitted the second "by" and the
> sentence would be ambiguous about weather each program installs
> multiple MBRs.  But on second thought, that would probably be OK,
> since everyone knows they only install one.  When I edit that file
> again, or if I get more requests, I'll probably change it, but I don't
> think it's required by the grammar.

I think the correct interpretation is that each program installs boot 
code.
fdisk lets you edit the partition table, but boot0cfg does not.  If you 
want
to leave the current sentence, I would much prefer 's/are/is/' to 
's/MBR/MBRs/'.

>> that the MBR, strictly speaking, is just the 4-entry table at the end 
>> of the
>> first sector.  The boot code prior to the MBR is not part of the MBR.
>
> Who else says that?  I don't recall ever seeing the partition table
> called the MBR in 20+ years.  The Master Boot Record has also been
> called the master boot sector (1,150,000 times in Google).

On floppies the first sector is not called an MBR.  Floppies still have 
boot
code, but they don't have a partition (slice) table.  This has been 
true for
a long time in DOS days in that only hard drives had a MBR with a 
partition
table vs. floppies which just have a simple boot sector.

>> The
>> way that booting off a disk works when using BIOS is that it loads 
>> the first
>> sector off of the device to a fixed memory offset (0x7c00 IIRC) and 
>> if it
>> ends with 0xAA55 it assumes it is valid and starts executing it at the
>> beginning.  This is a bit more complicated in that some SCSI 
>> controllers
>> expect the first sector of a hard disk to contain an MBR so that the
>> controller's BIOS can guess at the geometry the BIOS is using for the 
>> disk.
>> Traditionally, slices are supposed to start and end on cylinder 
>> boundaries
>> meaning that the entire first cylinder (63 sectors on all but really 
>> old hard
>> disks) is available for use by the boot code (which is how boot0ext 
>> is two
>> sectors in length).  I'm not sure if any BIOSes actually enforce that
>> requirement however.
>
> OK, but the first cylinder is usually 16*63 or 255*63 sectors these
> days.  I don't know about who's tradition it is to have primary
> partitions with cylinder boundaries, but I do know that I've often
> seen my first one start with the 64'th sector.

Yes, it is a tradition that DOS at least used to enforce.  Note that 
when we
had the old dangerously dedicated mode disks their slice actually 
started at
sector 0, and boot1 contained the MBR partition table.

> I am curious about your statement about "boot0ext" which I've never
> heard of (but I now see /usr/src/sys/boot/i386/boot0ext/Makefile). If
> there is some two sectors thing, where is it and what installs it?

I wrote it. :)  It is an expanded version of boot0 that has a larger
description table and has logic to choose at runtime whether to use LBA 
or
CHS when talking to the drive via the BIOS.  It was the default boot0 
back
in the 4.x days but was reverted because it didn't work on a handful of
machines.  Later David added it back as boot0ext.S (in the boot0 
directory).

> I've been lead to believe that boot0cfg installs /boot/boot0 which is
> only one sector and have never read anything about it using the second
> sector too.  That should be in the manpage, if true.

boot0cfg can handle both the old boot0 and boot0ext.  Note that when phk
recently updated boot0cfg to use g_ctl verbs there was a subthread
specifically about making sure it handled boot0ext ok.

> Is there something other than the "MBR...are" and the "MBR = first
> sector" that you think needs to be changed?

I think the MBR is the first sector, just that the boot code is not
necessarily limited to 446 bytes in the first sector.  I think it is 
most
useful to think of the MBR as the slice table just as we think of the 
BSD
label as the 8 entry partition table and consider the boot1/boot2 boot
code as not strictly being part of the label.

-- 
John Baldwin <jhb at FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org



More information about the cvs-all mailing list