How to access ALL the mass storage devices through BIOS?

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
Kolodez
Posts: 9
Joined: Wed Jul 27, 2016 5:37 am

How to access ALL the mass storage devices through BIOS?

Post by Kolodez »

Hi!
E.g. with INT 13, AH=0x42, I can read a mass storage device. The "drive number" of the boot device is provides through DL to the bootstrap code.
But is there a way I can list all the other mass storage devices attached (HDDs, SDDs, USB drives), identify them and get their drive numbers?
It seems like a standard question, but I looked for it, and maybe I was just too stupid to find the answer?
Thank you for your help.
Octocontrabass
Member
Member
Posts: 5586
Joined: Mon Mar 25, 2013 7:01 pm

Re: How to access ALL the mass storage devices through BIOS?

Post by Octocontrabass »

You can't access all storage devices through the BIOS. You can only access the storage devices the BIOS knows how to access.

You can find out how many of those there are by reading the byte at address 0x475 (in the BDA). Drives are numbered sequentially, starting at 0x80.

After that, you can use whichever INT 0x13 calls you want to identify the drives.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: How to access ALL the mass storage devices through BIOS?

Post by Combuster »

Octocontrabass wrote:You can only access the storage devices the BIOS knows how to access.
... and then only whatever it is willing to present to you. Expect having just your boot drive and one (other) harddisk.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Post Reply