Page 1 of 1
Boot question
Posted: Fri Jan 18, 2008 6:49 am
by crazygray1
When the computer starts up what is the drive number of the boot drive?
Posted: Fri Jan 18, 2008 6:57 am
by Combuster
DL
Re: Boot question
Posted: Fri Jan 18, 2008 9:18 am
by Brendan
Hi,
crazygray1 wrote:When the computer starts up what is the drive number of the boot drive?
There is no set drive number - it could be the first floppy, the first hard drive, a CD-ROM (with floppy emulation, hard disk emulation or no emulation), a network card, flash memory/USB, etc.
Where possible (e.g. when the BIOS boots some from some sort of storage device that actually has a drive number), the BIOS tells the boot loader which drive number the storage device is (or which drive number the emulated storage device is) in the DL register.
Often the drive number is either 0x00 (first floppy drive or an emulated floppy drive) or 0x80 (first hard drive or an emulated hard drive). Even for hard drives and floppy drives this isn't always the case - for example, a boot manager could boot (chain load) the second floppy drive and tell the boot loader it booted from drive 0x01.
Cheers,
Brendan
Posted: Fri Jan 18, 2008 4:18 pm
by crazygray1
So I can have something like this at the beginning of my code?
Posted: Fri Jan 18, 2008 8:02 pm
by neon
Yep.