flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > How to enumerate drives using interrupt? |
Author |
|
smiddy 16 Jun 2015, 11:33
There a lot of solutions to this. If you think about it, from a BIOS perspective, not all of the 0 thru 255 will be used. So what is the most practical? Check 0 thru 3 (use CMOS) for floppy drives, then start at 80h until you get no more drives for HDD, then start at each of 90h, A0h, B0h, C0h, D0h, E0h, and F0h for CD/BDs. That cuts it down quite a bit.
|
|||
16 Jun 2015, 11:33 |
|
irvan_herz 16 Jun 2015, 12:50
smiddy wrote: There a lot of solutions to this. If you think about it, from a BIOS perspective, not all of the 0 thru 255 will be used. So what is the most practical? Check 0 thru 3 (use CMOS) for floppy drives, then start at 80h until you get no more drives for HDD, then start at each of 90h, A0h, B0h, C0h, D0h, E0h, and F0h for CD/BDs. That cuts it down quite a bit. Okey, now I am wondering. where I can find reference about BIOS drive number like that? I have searched in RBIL and google and found incomplete explanation.. |
|||
16 Jun 2015, 12:50 |
|
smiddy 16 Jun 2015, 18:47
There are several references, not one specific to enumerating drives. Start with the boot process, where once the PC boots, it places the boot drive number in the DL. Then look up CMOS and drive numbers, you will find some references to floppies and hard drives. The most obscure and ambiguous is/are compact disc/bluray discs. In my own personal experience, the CD/BDs will most likely start at E0h or F0h, but there are times I've seem them at A0h too, which is why I mentioned the ones in between. Oh, and 90h can sometimes be a hard drive (see DOSBox's interfaces; but if yuo don't use DOSBox, don't sweat that one).
So, to be clear, there are many references, all over the place, not one specific one. Your enumeration method/requirement would require you to seek out many different sources to determine how they all work together. They were all developed in different times, and patched together since the 1970's-ish. BIOS, itself, doesn't care about the drive number, per se. What I provided is a convention, not really a standard. |
|||
16 Jun 2015, 18:47 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.