Page 1 of 1

Boot device interrupt?

Posted: Sat Nov 15, 2008 12:30 pm
by furryfreak
Hi, Does anyone know of an interrupt that returns the boot devices drive number? (the one put in DL for most int 0x13 functions).
The reason is because I want to be able to boot from both MBR and GPT partitions. At the moment I'm having to loop through each device checking what type of partition table it uses, reading the first sector of each partition entry, and then check for a signature I've put in the bootloader. Unfortunately, this just wont all fit in 510 bytes, no matter how heavily optimized. If i knew which drive was being booted from, I wouldn't have to loop through every single one.

Re: Boot device interrupt?

Posted: Sat Nov 15, 2008 12:34 pm
by 01000101
The boot device ID is stored in DL on bootup, so if you just save that to a known location or variable, then you can reuse it later.

Re: Boot device interrupt?

Posted: Sat Nov 15, 2008 12:43 pm
by furryfreak
Really? nice one, thanks for the fast reply!