Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 05 Jul 1999 14:34:35 +0200
From:      Graham Wheeler <gram@cequrux.com>
To:        Robert Nordier <rnordier@nordier.com>
Cc:        hackers@freebsd.org
Subject:   Re: Porting LILO to FreeBSD
Message-ID:  <3780A65B.DE517E1F@cdsec.com>
References:  <199907021925.VAA16275@ceia.nordier.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Robert Nordier wrote:

> A Microsoft-style MBR gets the drive number from the byte at offset
> 0 of the partition entry (field dp_flag of structure dos_partition
> in /sys/sys/disklabel.h).  This is usually known as the "active
> flag", and all standard fdisk utilities set this to 0x80 (corresponding
> to BIOS fixed drive 0) when flagging a partition as active.
> 
> This can be patched by hand to some other value (eg. 0x81 for BIOS
> fixed drive 1) but in a standard pre-Win95 OSR2 MBR this causes
> problems, as the MBR code validates the partition table entries,
> and will respond to the 0x81 with the message "Invalid partition
> table" followed by a hang.

Man, I wish I read this earlier on the weekend. One of the things I
tried doing was haxing the FreeBSD fdisk program so that I could
pass a different value for the flag as a command line argument. After
doing this, I got just that behaviour. Unfortunately, so many other
things had been tweaked by this stage (I had already clobbered the
DOS boot sector once and had managed to reconstruct it by hand with a
bit of trial and error) that I ended up doing more damage in my attempt
to get the machine to boot again...


> The easiest approach, probably adopted by LILO, is to install a
> wrapper around the BIOS int 0x13 services and just change drive
> numbers as they go by.

That's exactly what LILO does, I believe.
-- 
Dr Graham Wheeler                          E-mail: gram@cequrux.com
Cequrux Technologies                       Phone:  +27(21)423-6065/6/7
Firewalls/Virtual Private Networks         Fax:    +27(21)24-3656
Data/Network Security Specialists          WWW:   
http://www.cequrux.com/


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3780A65B.DE517E1F>