I've been googling this for a long time and I'm surprised I haven't found a solution but I haven't come across a full list of BIOS disk identifiers. I mean those ones for INT 13h, like 0x80 - First HDD. Could anybody give me a complete table of them?
P.S. Sorry for my English (I'm from Russia).
BIOS disk IDs
Re: BIOS disk IDs
They are dynamically assigned by BIOS every time when PC boots, so there can't be any static list. You can ask BIOS about accessible IDs (sometimes you can even get additional information via EDD BIOS services) but IMHO these numbers should be used only in bootloader (that receives boot drive ID from BIOS and should just use this number).velikiyv4 wrote:I mean those ones for INT 13h, like 0x80 - First HDD. Could anybody give me a complete table of them?
Re: BIOS disk IDs
Well then, if I want to determine how to read a sector from the boot drive, how do I know what type of drive it is? AFAIK, BIOS only gives me such an ID so the only way to read it is to use INT 13h. But after I switch to protected mode and/or set my own IDT I can't do that anymore. So how do I know the type of the boot drive so I can read it?Nable wrote:They are dynamically assigned by BIOS every time when PC boots, so there can't be any static list. You can ask BIOS about accessible IDs (sometimes you can even get additional information via EDD BIOS services) but IMHO these numbers should be used only in bootloader (that receives boot drive ID from BIOS and should just use this number).velikiyv4 wrote:I mean those ones for INT 13h, like 0x80 - First HDD. Could anybody give me a complete table of them?
-
- Member
- Posts: 134
- Joined: Thu Aug 18, 2005 11:00 pm
- Location: Sol. Earth. Europe. Romania. Bucuresti
- Contact:
Re: BIOS disk IDs
You detect them
Send an Identify command to IDE HDD's for example.
There are similar methods for CD-ROM's USB disks, SATA etc
Send an Identify command to IDE HDD's for example.
There are similar methods for CD-ROM's USB disks, SATA etc
Ambition is a lame excuse for the ones not brave enough to be lazy; Solar_OS http://www.oby.ro/os/
Re: BIOS disk IDs
Early stage of bootloader should use this number and int 0x13 to load modules for next stage (that setups protected mode and works with native drivers) or to load OS kernel and its modules directly. Then your kernel (that works in protected or long mode) setups native drivers, redetects connected devices on it's own and mounts filesystems. Then boot device can be determined by some disk signatures or configuration files. Note that boot device that is accessed via 0x13 may be a virtual one, e.g. when you are booting from network or emulated floppy (such emulation is often used to boot legacy OSes from CDs and USB sticks).
Re: BIOS disk IDs
The short answer is that there is no link between the BIOS drive number and the physical boot device. You'll have to come up with a way of finding the boot device after you've switched to 32-bit mode.
Or, you can just load everything you need in your boot loader before switching to 32-bit mode. If you need to load anything above 1MB, you will need to load it under 1MB first, then switch to 32-bit mode, then copy it above 1MB, and then switch back to 16-bit mode. Or you can use something like unreal mode.
Or, you can just load everything you need in your boot loader before switching to 32-bit mode. If you need to load anything above 1MB, you will need to load it under 1MB first, then switch to 32-bit mode, then copy it above 1MB, and then switch back to 16-bit mode. Or you can use something like unreal mode.
Project: OZone
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott