Determine which drive was booted?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Tyrel

Determine which drive was booted?

Post 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
blip

Re:Determine which drive was booted?

Post by blip »

Most BIOSes put the drive number in DL when they execute the boot code.
Tyrel

Re:Determine which drive was booted?

Post 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.
Post Reply