Get disk parameters

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
User avatar
VolTeK
Member
Member
Posts: 815
Joined: Sat Nov 15, 2008 2:37 pm
Location: The Fire Nation

Get disk parameters

Post 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?
User avatar
Kazinsal
Member
Member
Posts: 559
Joined: Wed Jul 13, 2011 7:38 pm
Libera.chat IRC: Kazinsal
Location: Vancouver
Contact:

Re: Get disk parameters

Post 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.
User avatar
VolTeK
Member
Member
Posts: 815
Joined: Sat Nov 15, 2008 2:37 pm
Location: The Fire Nation

Re: Get disk parameters

Post 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 ;)
User avatar
bewing
Member
Member
Posts: 1401
Joined: Wed Feb 07, 2007 1:45 pm
Location: Eugene, OR, US

Re: Get disk parameters

Post 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.
Post Reply