Subject: Re: Boot an IDE drive on port-i386 - pardon
To: Martin Weber <Ephaeton@gmx.net>
From: Rick Byers <rb-netbsd@BigScaryChildren.net>
List: port-i386
Date: 08/05/2001 10:37:55
The "start" address should be 63, not 0 (it's not taken automatically from
the cyl/head/sect info).  Also, if the kernel thinks wd0a starts at sector
0, then I believe installboot (and disklabel) will overwrite your
partition table.  Use fdisk to set the start of the partition to sector 63
(and install the bootselect code if you like).  Then write a disklabel
with wd0a starting at sector 63.  Check fdisk to make sure the partition
table hasn't changed (i.e. the disklabel was written to the beginning of
the Netbsd partition instead of the beginning of the drive).  Then use
installboot to install the NetBSD bootblocks to the beginning of the
NetBSD partition (NOT the beginning of the drive).  Double-check fdisk
again - it should not have changed.

It is theoretically possible to setup your system with the NetBSD
partition starting at sector 0 if its the only OS on the drive - NetBSD
uses the partition table mainly for compatability with others OSes.  As
long as the code at the beginning of the drive knows how to boot the
system, it won't matter what fdisk thinks the partition table looks like.
However, to make this less confusing (and probably to make the bootselect
code work nicer), its just easier to use the partition table and reserve
the first 63 sectors for it.

Hope this helps,
	Rick

On Sun, 5 Aug 2001, Martin Weber wrote:

> > The above should have:
> >     start 63, size 19807137 (9671 MB), flag 0x80
> >         beg: cylinder    0, head   1, sector  1
>
> I changed it accordingly. But something's strange here :
>
> sysid 169 (NetBSD)
>     start 0, size 19807200 (9671 MB), flag 0x80
>         beg: cylinder    0, head   1, sector  1
>         end: cylinder 1021, head 254, sector 63
>
> phaeton# /usr/mdec/installboot -f /usr/mdec/biosboot.sym /dev/rwd0a
>
> phaeton# fdisk wd0
> NetBSD disklabel disk geometry:
> cylinders: 16383 heads: 16 sectors/track: 63 (1008 sectors/cylinder)
>
> BIOS disk geometry:
> cylinders: 1022 heads: 255 sectors/track: 63 (16065 sectors/cylinder)
>
> Partition table:
> 0: <UNUSED>
> 1: <UNUSED>
> 2: <UNUSED>
> 3: sysid 169 (NetBSD)
>     start 0, size 16 (0 MB), flag 0x80
>         beg: cylinder    0, head   0, sector  1
>         end: cylinder    0, head   0, sector 16
>
> I mean huh ? Am I drunk or what ? *scratch*
>
> Martin Weber
>