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

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
Bender
Member
Member
Posts: 449
Joined: Wed Aug 21, 2013 3:53 am
Libera.chat IRC: bender|
Location: Asia, Singapore

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

Post 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
"In a time of universal deceit - telling the truth is a revolutionary act." -- George Orwell
(R3X Runtime VM)(CHIP8 Interpreter OS)
User avatar
bwat
Member
Member
Posts: 359
Joined: Fri Jul 03, 2009 6:21 am

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

Post 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.
Every universe of discourse has its logical structure --- S. K. Langer.
User avatar
Bender
Member
Member
Posts: 449
Joined: Wed Aug 21, 2013 3:53 am
Libera.chat IRC: bender|
Location: Asia, Singapore

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

Post 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,
"In a time of universal deceit - telling the truth is a revolutionary act." -- George Orwell
(R3X Runtime VM)(CHIP8 Interpreter OS)
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

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

Post 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.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
Post Reply