FAT12 Question
FAT12 Question
Where can I get an official FAT12 file system specification?
Thanks in advance.
Thanks in advance.
http://www.osdever.net/documents/fatgen ... ?the_id=40
You should have looked for them yourself first their really not that hard to find.
Jules
You should have looked for them yourself first their really not that hard to find.
Jules
- Brynet-Inc
- Member
- Posts: 2426
- Joined: Tue Oct 17, 2006 9:29 pm
- Libera.chat IRC: brynet
- Location: Canada
- Contact:
Re: answer
That was kinda rude, I believe he was only trying to help you.renovatio wrote:isn't that reference about FAT32???? i need about fat12... but thanks anyway!!!!!!!!!!
Re: answer
and I gave you what was necessary, you just needed to read on a bit...Brynet-Inc wrote:That was kinda rude, I believe he was only trying to help you.renovatio wrote:isn't that reference about FAT32???? i need about fat12... but thanks anyway!!!!!!!!!!
Jules
answer and question
Answer:
i'm sorry if i sounded rude... sincerely i am argentinian and am not the best speaking english... that's why maybe i didn't expressed well.... anyway, i'm really pleased for that information....
Question:
I wrote a program in asm to read a FAT:
AL = Numbers of sectors to read: Dividing the number of root entrys by bytes per sector will tell us how many sectors the root entry uses.
FATSize = (Num Fats * Sector Per FAT (9) + Reserved Sector + BootSector) = 19
CH & CL = FATSize to CHS
But I can't read any file name.... Is there any problem in my code???
Thanks for reading...
i'm sorry if i sounded rude... sincerely i am argentinian and am not the best speaking english... that's why maybe i didn't expressed well.... anyway, i'm really pleased for that information....
Question:
I wrote a program in asm to read a FAT:
Code: Select all
org 100h
mov ah, 2h
mov al, 14
mov bx, fat
mov ch, 1
mov cl, 1
mov dh, 0
mov dl, 0
int 13h
mov si, fat
print_again:
mov al, [si]
mov ah, 0eh
int 10h
mov ah, 0h
int 16h
inc si
jmp print_again
fat:
times 7168 db 0
FATSize = (Num Fats * Sector Per FAT (9) + Reserved Sector + BootSector) = 19
CH & CL = FATSize to CHS
But I can't read any file name.... Is there any problem in my code???
Thanks for reading...
Under which OS are you running this program?
You begin with org 100h so it's looks like a .COM-program running under DOS. Do you run it under a stand-alone DOS or DOSbox from Windows?
About function 2 int 13h:
- Are you use you are reading the right sectors of the rootdir?
You are reading cyliner 1 sector 1. It depends on the geometry of your floppy (720k, 1440k, etc..) which absolute sector number is addressed with cylinder 1 sector 1. I don't think your rootdir begins at cylinder 1 sector 1 it's just a guess.
You need to read the bootsector (first sector of a floppy, cyl=0, head=0, sect=1) and calculate the absolute sector number of your rootdir. You need to convert that number to the parameters in CH, CL and CH.
- Are you sure no errors occured? You don't check for it (cf=1). When there is an error, you have to retry sometimes because some errors occur then the motor of your floppydrive didn't fully spin up.
Geometry 18 sectors, 2 heads and 80 cylinders (18x2x80=2880; 2880x512/1024=1.44mb).
9 sectors per FAT is a normal value with 1.44mb floppy's.
So you can expect the first sector of the rootdirectory to be 1 + 9 x 2 = 19. But don't assume. It's ok to use 19 for testing purposes, but some floppy's can have reserved sectors.
So you need to read from absolute sector 19 (count from zero).
There are 18 x 2 = 36 sectors per cylinder. Sector 19 is at cylinder 0.
There are 18 sectors per head. So you want to read from head number 1 and sector number 1. Function 2 int 13h counts sector number from 1, so you need sector 2 (1+1).
Read from head 1 and sector 2:
You are reading with parameters ch=1, cl=1, dh=0, so cylinder 1, sector 0 (1-1=0, because int 13h function 2 counts sectornumbers from 1), head 0. Cylinder 1 means addressing absolute sector number 1 x 2 x 18 + 0 = 36 on a 1.44mb floppy. That's far beyond the rootdir, at the area with files and other directories, so you get garbage.
Tip: Search for some information about how geometry of disks work.
You begin with org 100h so it's looks like a .COM-program running under DOS. Do you run it under a stand-alone DOS or DOSbox from Windows?
About function 2 int 13h:
You are reading cylinder 1, sector 1, head 0 of disk #0, so you are reading from a floppy.AH = 02h
AL = number of sectors to read (must be nonzero)
CH = low eight bits of cylinder number
CL = sector number 1-63 (bits 0-5)
high two bits of cylinder (bits 6-7, hard disk only)
DH = head number
DL = drive number (bit 7 set for hard disk)
ES:BX -> data buffer
Return:CF set on error
if AH = 11h (corrected ECC error), AL = burst length
CF clear if successful
AH = status (see #00234)
AL = number of sectors transferred (only valid if CF set for some
BIOSes)
- Are you use you are reading the right sectors of the rootdir?
You are reading cyliner 1 sector 1. It depends on the geometry of your floppy (720k, 1440k, etc..) which absolute sector number is addressed with cylinder 1 sector 1. I don't think your rootdir begins at cylinder 1 sector 1 it's just a guess.
You need to read the bootsector (first sector of a floppy, cyl=0, head=0, sect=1) and calculate the absolute sector number of your rootdir. You need to convert that number to the parameters in CH, CL and CH.
- Are you sure no errors occured? You don't check for it (cf=1). When there is an error, you have to retry sometimes because some errors occur then the motor of your floppydrive didn't fully spin up.
I assume you use an ordinary 1.44 mb floppy.FATSize = (Num Fats * Sector Per FAT (9) + Reserved Sector + BootSector) = 19
CH & CL = FATSize to CHS
Geometry 18 sectors, 2 heads and 80 cylinders (18x2x80=2880; 2880x512/1024=1.44mb).
9 sectors per FAT is a normal value with 1.44mb floppy's.
So you can expect the first sector of the rootdirectory to be 1 + 9 x 2 = 19. But don't assume. It's ok to use 19 for testing purposes, but some floppy's can have reserved sectors.
So you need to read from absolute sector 19 (count from zero).
There are 18 x 2 = 36 sectors per cylinder. Sector 19 is at cylinder 0.
There are 18 sectors per head. So you want to read from head number 1 and sector number 1. Function 2 int 13h counts sector number from 1, so you need sector 2 (1+1).
Read from head 1 and sector 2:
Code: Select all
mov ch,0 ; low eight bits of cylinder number
mov cl,2; CL = sector number 1-63 (bits 0-5) high two bits of cylinder (bits 6-7, hard disk only)
mov dh,1 ; DH = head number
Tip: Search for some information about how geometry of disks work.
Last edited by svdmeer on Sun Jun 08, 2008 10:53 am, edited 2 times in total.