From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <3e1162e60603281156w670994dpfb17bc436dbfc3d4@mail.gmail.com> Date: Tue, 28 Mar 2006 11:56:09 -0800 From: "David Leimbach" To: "Fans of the OS Plan 9 from Bell Labs" <9fans@cse.psu.edu> Subject: Re: [9fans] Grub Boot Problem In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: Topicbox-Message-UUID: 24821b32-ead1-11e9-9d60-3106f5b1d025 On 3/28/06, Russ Cox wrote: > > I think I get what you mean, but why would it swap the drive letters ? > > I mean if grub already found the right partition and started it, why > > would it then mess up while calling 9load ? > > PCs are only meant to boot from the first hard drive. > Grub does some kind of magic that I don't fully understand > to convince the BIOS to pretend that the second hard drive > is the first and vice versa. If that doesn't get through to > pbs/pbslba or gets through the wrong way, then pbs/pbslba > could easily end up looking at the wrong disk for the 9fat > partition. > > Russ > > It's really not that magical. The BIOS itself has to map interrupt 0x13 (which is originally the floppy controller from way back before hard disks were available in PCs) to 0x40. Then 0x13 has to deal with things that are really floppy requests and subsequently call 0x40.=20 (bit 7 being high in the DL register meant it was a hard disk... anything else was a floppy drive) Replacing interrupt handlers in DOS was very commonplace. It should be possible to remap which disk is being booted from (CMOS parameters do this, and so can GRUB, just like you could in DOS.) 0x80 is typically C: 0x81 is typically D: Machines (and BIOSes) after 1995 typically could support 4 drives. Hmmm, that semester of 16bit PC assembly in college just came in handy I guess.... (I admit, I had to look at my notes :-) It used to be fun to rewrite the keyboard interrupt (0x9 IIRC) such that it would dork around with the vga panning registers everytime someone hit spacebar. DOS was so hackable. Dave