Boot device interrupt?
Posted: Sat Nov 15, 2008 12:30 pm
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.
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.