Page 1 of 1

Free Space on Floppy Disk? Is INT 0x13 the right way?

Posted: Fri Oct 18, 2013 10:18 am
by Bender
Is there a BIOS Function that returns free and used space on a "FAT12" floppy drive?
To my knowledge INT 0x13 is used for this stuff.
The floppy drive of my os is DISK 1 (A:), DL=0x00
INT 13h AH=02h: Read Sectors From Drive
AH 02h
AL Sectors To Read Count
CH Cylinder
CL Sector
DH Head
DL Drive (0x00)
ES:BX Buffer Address Pointer
And then calculate the empty sectors, which will be free and subtract it from the total size (1.44MB),
Is this the correct way to do this?
Or any other call/method can achieve this?
PS: I have searched whole of wikipedia,osdev with BIOS Calls INT0x10,INT0x13,INT0x21 and nothing gave me what I
needed
I am very sorry if I am being silly, I apologize to all those who have OSes that run in 64 bit Protected Mode with Memory Protection
,Multitasking,GCC Port,NASM Port,BASH Port,Advantage of Multiple cores etc.
~Help would be appreciated

Re: Free Space on Floppy Disk? Is INT 0x13 the right way?

Posted: Fri Oct 18, 2013 10:29 am
by bwat
You need to read a good book on OS design that covers file systems (most will). There's a whole thread to help you choose.

Re: Free Space on Floppy Disk? Is INT 0x13 the right way?

Posted: Fri Oct 18, 2013 9:54 pm
by Bender
Oooo I see...
This means that the BIOS itself doesn't provide functions for checking free space on floppy disk?
So I have to write an FDD Driver for that. Right?
Thanks,

Re: Free Space on Floppy Disk? Is INT 0x13 the right way?

Posted: Fri Oct 18, 2013 11:23 pm
by Love4Boobies
No. A FDD driver would only be useful for controlling FDD's. However, drives don't know anything about files or file systems just like RAM doesn't know anything about data types, memory allocation, etc. You need to write file system drivers to interpret and maintain the on-disk structures.