Page 1 of 1
Get disk parameters
Posted: Mon Aug 13, 2012 9:50 pm
by VolTeK
Did the 8086 have
http://www.ctyme.com/intr/rb-0621.htm
Or something like it? How else can i get a floppy drive or disk parameters if the link does not exist for it?
Would i be better off getting data when the user asks to check the drive, load the bootloader and get data from it?
Re: Get disk parameters
Posted: Mon Aug 13, 2012 10:44 pm
by Kazinsal
If you're using your own bootloader, you can pass a pointer to the BPB (provided you're using FAT) and the kernel could grab data directly from that when it first boots. Load the boot sector when a different disk is inserted and read from its BPB.
Considering the header for that function includes "(PC,XT286,CONV,PS,ESDI,SCSI)", I'd say the 8086 based IBM PCs include it. No guarantees for clones though.
Re: Get disk parameters
Posted: Tue Aug 14, 2012 12:14 am
by VolTeK
Blacklight wrote:If you're using your own bootloader, you can pass a pointer to the BPB (provided you're using FAT) and the kernel could grab data directly from that when it first boots.
What's the point if the location of the BPB in any FAT bootloader is the same? Ill have a design that reads my own bootloader, like it reads everyone else's to save space.
Blacklight wrote: Load the boot sector when a different disk is inserted and read from its BPB.
Sounds like an idea, The kernel has its own process, during this loop when the floppy drive is ejected or has new media it will parse the bootloader of the new disk.
Blacklight wrote:XT286
Is what discourages me, i figure XT286 AND UP use it, but what about the XT before the XT286
Re: Get disk parameters
Posted: Tue Aug 14, 2012 12:49 am
by bewing
From the second sentence of your own link: "For systems predating the IBM AT, this call is only valid for hard disks."
For floppies, I'd say -- try reading track 1 through n. When it fails, that's your maximum cylinder number. Then try reading side 2 of the disk. If it fails, it's single sided. Then you know.