Message from discussion When many hard disks exist how does BIOS choose which one to boot
Received: by 10.68.235.4 with SMTP id ui4mr1408680pbc.3.1333178199610;
Sat, 31 Mar 2012 00:16:39 -0700 (PDT)
From: James Harris <james.harri...@gmail.com>
Subject: Re: When many hard disks exist how does BIOS choose which one to boot
Date: Sat, 31 Mar 2012 00:16:39 -0700 (PDT)
X-Trace: posting.google.com 1333178199 16093 127.0.0.1 (31 Mar 2012 07:16:39 GMT)
NNTP-Posting-Date: Sat, 31 Mar 2012 07:16:39 +0000 (UTC)
Injection-Info: r9g2000yqd.googlegroups.com; posting-host=22.214.171.124; posting-account=Ss8wVAkAAADjaLf6nhKZFuysJxWaHI9Z
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:126.96.36.199)
Gecko/20120216 Firefox/3.6.27 ( .NET CLR 3.5.30729),gzip(gfe)
Content-Type: text/plain; charset=ISO-8859-1
On Mar 25, 9:26=A0pm, Bernhard Schornak <schor...@web.de> wrote:
> James Harris wrote:
> > On Mar 5, 6:15 am, Bernhard Schornak<schor...@web.de> =A0wrote:
> > ...
> >> The executed MBR
> >> always can read the partition table residing in the same
> >> 512 byte just on top of its code, and it can call INT 13
> >> function 08 to retrieve the current drive.
> > I don't understand this. According to RBIL the BIOS interrupt call you
> > mention returns disk parameters but has to be passed the disk drive id
> > as an input. So rather than returning the drive id it seems to require
> > it.
> Start with drive 00. Read MBR and compare its partition
> table with the one you've got. Repeat until all entries
> are equal. It is very unlikely that all drives have the
> same partition table. At least the bootable flag should
> differ if the remaining 65 byte of any other drive were
That's not the same as using int 0x13-08 and I don't think it is
necessary. See below.
> This seems to be the -only- way to determine from which
> drive a machine was booted.
Why not use DL? From the early IBM BIOS I think this was set to
identify the drive that the boot sector was loaded from. Initially it
was 0x80 for the hard disk and 0x00 for the floppy. Later it was
extended to support more than one disk of each type. The value passed
in that register should be the disk number that the BIOS uses so the
MBR code (or that on a floppy) can use int 0x13 calls using that
> Most BIOS'es load the first detected bootable partition
> and start it.
Well, they load the first bootable *bootsector* and start it (though
how they identify whether an initial sector is bootable or not is the
principal subject of this thread). With a normally partitioned disk I
don't think BIOSes load anything from any partition.
> Hence, a time consuming comparison can be
> skipped by evaluating the bootable flags of all drives,
*Drives* don't have bootable flags. Maybe you mean the partitions on
> The first match -should- be the boot partition...
If you mean to scan drives in order and the first one with a bootable
partition should be the one chosen, maybe. I don't know if we can
depend on the BIOS using the same order for numbering as it does for
booting, though, so this may not work in all cases.
This may be a moot point anyway. If DL can be used to identify to MBR
code which disk it was loaded from none of the complex identification
options are necessary.