Page 1 of 1

Determine which drive was booted?

Posted: Sat May 27, 2006 8:53 pm
by Tyrel
Hey,
I'm trying to write a generic boot sector that can be used on hard drives and floppy disks with little change. The question I have is:

Is there a way to ask BIOS which drive the boot sector was loaded from?

That way I know which drive to load the second-stage bootloader from, etc.

Thanks,
Tyrel

Re:Determine which drive was booted?

Posted: Sat May 27, 2006 9:16 pm
by blip
Most BIOSes put the drive number in DL when they execute the boot code.

Re:Determine which drive was booted?

Posted: Sat May 27, 2006 9:23 pm
by Tyrel
blip wrote: Most BIOSes put the drive number in DL when they execute the boot code.
Oh yeah... I think I already knew that at one point. Silly brain.
Thanks.