9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "David Leimbach" <leimy2k@gmail.com>
To: "Fans of the OS Plan 9 from Bell Labs" <9fans@cse.psu.edu>
Subject: Re: [9fans] Grub Boot Problem
Date: Tue, 28 Mar 2006 11:56:09 -0800	[thread overview]
Message-ID: <3e1162e60603281156w670994dpfb17bc436dbfc3d4@mail.gmail.com> (raw)
In-Reply-To: <dff0bfa04d1bc2bcf9200a1f1e38c50b@swtch.com>

On 3/28/06, Russ Cox <rsc@swtch.com> 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. 
(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


      parent reply	other threads:[~2006-03-28 19:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-27  9:23 Laurent Malvert
2006-03-27 12:41 ` Russ Cox
2006-03-27 13:04   ` David.Eckhardt, Dave Eckhardt
2006-03-27 13:19     ` Russ Cox
2006-03-28  5:35       ` Laurent Malvert
2006-03-28  6:27         ` Laurent Malvert
2006-03-28  7:03           ` Skip Tavakkolian
2006-03-28  7:48             ` Laurent Malvert
2006-03-28  5:30   ` Laurent Malvert
2006-03-28 16:19     ` Russ Cox
2006-03-28 16:46       ` matt
2006-03-28 19:56       ` David Leimbach [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3e1162e60603281156w670994dpfb17bc436dbfc3d4@mail.gmail.com \
    --to=leimy2k@gmail.com \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).