From owner-freebsd-hackers Mon Jul 5 5:32:25 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from citadel.cdsec.com (citadel.cdsec.com [192.96.22.18]) by hub.freebsd.org (Postfix) with ESMTP id 8DF9614F76 for ; Mon, 5 Jul 1999 05:32:16 -0700 (PDT) (envelope-from gram@cequrux.com) Received: (from nobody@localhost) by citadel.cdsec.com (8.9.3/8.9.3) id OAA20788; Mon, 5 Jul 1999 14:31:59 +0200 (SAST) Received: by citadel via recvmail id 20724; Mon Jul 5 14:31:29 1999 Message-ID: <3780A65B.DE517E1F@cdsec.com> Date: Mon, 05 Jul 1999 14:34:35 +0200 From: Graham Wheeler Organization: Cequrux Technologies X-Mailer: Mozilla 4.08 [en] (X11; I; FreeBSD 2.2.8-RELEASE i386) MIME-Version: 1.0 To: Robert Nordier Cc: hackers@freebsd.org Subject: Re: Porting LILO to FreeBSD References: <199907021925.VAA16275@ceia.nordier.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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