Boot device interrupt?

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
User avatar
furryfreak
Member
Member
Posts: 28
Joined: Mon Nov 03, 2008 12:45 pm
Location: SW England

Boot device interrupt?

Post 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.
User avatar
01000101
Member
Member
Posts: 1599
Joined: Fri Jun 22, 2007 12:47 pm
Contact:

Re: Boot device interrupt?

Post 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.
User avatar
furryfreak
Member
Member
Posts: 28
Joined: Mon Nov 03, 2008 12:45 pm
Location: SW England

Re: Boot device interrupt?

Post by furryfreak »

Really? nice one, thanks for the fast reply!
Post Reply