Subject: Re: CVS commit: src
To: None <rvb@cs.cmu.edu>
From: Wolfgang Solfrank <ws@tools.de>
List: tech-install
Date: 10/01/1998 18:48:58
Hi,

> > 2. If it doesn't find a valid mbr (i.e. the magic number in the last two
> > bytes of sector 0 are not 55 aa, the mbr is initialized with valid boot
> > code _and_ a zeroed out partition table.  This is almost what was done
> > 
> > 3. fdisk -i initializes the code part of the mbr, but leaves the partition
> > table alone.
> 
> As I said, making fdisk behave like DOS fdisk is completely reasonable.
> 1., 2. & 3. are fine.

Ok, so far.  But if we agree on this, why would you say below:

> This is what needs to be discussed.  I believe the sysinst goal was to
> do a complete install.  You are proposing that the mbr initialization
> should not be done by sysinst.  On the plus side, this is safe.  You
> are much less likely to blow away other OS's, if the sysinst tool just
> installs netbsd into a preestablished area.  On the minus side, the
> boot diskette can not immediately start up sysinst.  You need to go to
> a shell so the user can do a fdisk if necessary.  Then he would run
> sysinst by hand.

Huh?

Either the disk already has a valid mbr, including boot code, a valid
partition table (whether this already contains a NetBSD (165 or 169)
partition or not) _and_ a valid magic number in the last 2 bytes, then
you don't need to initialize it.

Or your disk doesn't have a valid mbr, i.e. the last 2 bytes don't have
a valid magic number.  Then the new fdisk (after my changes) will
automagically initialize the boot code, an empty partition table and
the magic number during the first time it writes the mbr to disk.

Actually it will initialize its incore data structures even if it
doesn't write to disk, so it will tell sysinst that the partition table
is empty.  With sysinst, you then add a NetBSD partition, and when
sysinst calls fdisk again to write this partition (using the fdisk -u...
below the fdisk -i you removed), fdisk will initialize the mbr on disk.

No need for the user to run fdisk himself.

> Clearly, the old code was broken and in a number of other ways, too.  Let's
> just fix it.

Agreed.  But I can't see, how the new code is broken (apart from the
problem to determine the bios geometry that is, but that's a somewhat
separate problem).

Ciao,
Wolfgang
-- 
ws@TooLs.DE     (Wolfgang Solfrank, TooLs GmbH) 	+49-228-985800