I read somewhere on the Internet that before switching to 0x7c00, the BIOS loads the "disk number" of the loaded device in% dl. But what is this "disk number"? Is a BIOS number assigned to each device connected to the computer? If so, how can I find out which number is the assigned device?
Reading the source code of GRUB. I found that when% dl has bits 0x80 and 0x70, it overwrites the entire register 0x80. Why is this? Here is the code:
jmp 3f /* grub-setup may overwrite this jump */ testb $0x80, %dl jz 2f 3: /* Ignore %dl different from 0-0x0f and 0x80-0x8f. */ testb $0x70, %dl jz 1f 2: movb $0x80, %dl 1:
By the way. Is there a detailed resource in the process of downloading a PC on the Internet? Especially about what the BIOS does before giving control over the bootloader, as well as the standard codes used to communicate with it (for example, this "disk number"). I was hoping to write my own bootloader, and everything I found was too vague, but not technical enough to tell the exact state of the computer when my bootloader started working.
source share