On the Bios Parameter Block of the floppy I'm using I find the string "FAT12 ".
So I'm tring to implement the FAT12.
Now I can read the different directory entries.
At http://www.brokenthorn.com/Resources/OSDev6.html you can find:
This should be the structure for a FAT Directory Entries.* Bytes 0-7 : DOS File name (Padded with spaces)
* Bytes 8-10 : DOS File extension (Padded with spaces)
* Bytes 11 : File attributes. This is a bit pattern:
o Bit 0 : Read Only
o Bit 1 : Hidden
o Bit 2 : System
o Bit 3 : Volume Label
o Bit 4 : This is a subdirectory
o Bit 5 : Archive
o Bit 6 : Device (Internal use)
o Bit 6 : Unused
* Bytes 12 : Unused
* Bytes 13 : Create time in ms
* Bytes 14-15 : Created time, using the following format:
o Bit 0-4 : Seconds (0-29)
o Bit 5-10 : Minutes (0-59)
o Bit 11-15 : Hours (0-23)
* Bytes 16-17 : Created year in the following format:
o Bit 0-4 : Year (0=1980; 127=2107
o Bit 5-8 : Month (1=January; 12=December)
o Bit 9-15 : Hours (0-23)
* Bytes 18-19 : Last access date (Uses same format as above)
* Bytes 20-21 : EA Index (Used in OS/2 and NT, dont worry about it)
* Bytes 22-23 : Last Modified time (See byte 14-15 for format)
* Bytes 24-25 : Last modified date (See bytes 16-17 for format)
* Bytes 26-27 : First Cluster
* Bytes 28-32 : File Size
On my floppy I expect to find 3 entries:
But there isn't this on my floppy...dos wrote: . <dir>
.. <dir>
boot <dir>
On an hexadecimal editor, I find one entry with the name of the dir coded with utf-16 (b.o.o.t). The second entry is the same name with capital letters (BOOT) coded with ascii.
Why? Maybe beacause I formatted the image with linux, and it's now using vfat that is different from fat?