fat32 only partially working
-
- Member
- Posts: 2566
- Joined: Sun Jan 14, 2007 9:15 pm
- Libera.chat IRC: miselin
- Location: Sydney, Australia (I come from a land down under!)
- Contact:
That's EOF - means the root directory only takes up one cluster of space.
You need to read the sector that the entry points to (offset in FAT + start of data area). Each of the entries in the root directory are 32-byte structures pointing to a file.
Try to find Microsoft's FAT doc. It's sort of useful, given the fact that FAT is a Microsoft abomination. 80% of my FAT driver comes from that document.
You need to read the sector that the entry points to (offset in FAT + start of data area). Each of the entries in the root directory are 32-byte structures pointing to a file.
Try to find Microsoft's FAT doc. It's sort of useful, given the fact that FAT is a Microsoft abomination. 80% of my FAT driver comes from that document.
That's quite possibly the only sane design decision in the whole filesystem.supagu wrote:okay problem has been solved, i had a major flaw in my understanding of how this was working. The fat entry was the first 32bits of each cluster, but its like a table before the data area!
![Wink ;)](./images/smilies/icon_wink.gif)
The real problem with goto is not with the control transfer, but with environments. Properly tail-recursive closures get both right.
okay i've run in to a bit of another problem, how to determine is a directory is valid.
I've got a fat32 filesystem set up by windows 98, when i deleted some files/directories my OS is still showing that they exist (but thier name is corrupt)
in the MS fat32 doco it says the first later of dirname (dirname[0]) determines if a file/directory is valid or not. But in my case it doesnt.
?
I've got a fat32 filesystem set up by windows 98, when i deleted some files/directories my OS is still showing that they exist (but thier name is corrupt)
in the MS fat32 doco it says the first later of dirname (dirname[0]) determines if a file/directory is valid or not. But in my case it doesnt.
?
Also, if you see 0x05, you should translate it into 0xE5, since 0xE5 is a valid character in a filename, but it's number is reserved for encoding deleted entries.frank wrote:if the first character in a file or directory name is 0xe5 then that file or directory has been deleted and is no longer valid.
The real problem with goto is not with the control transfer, but with environments. Properly tail-recursive closures get both right.
okay, i can make directoys and they show up in windows 3.11 and windows 98, how ever they wont let open the file saying it has already been removed.
Also trying to delete the folder fails.
the onlything that looks different in the directory strucutres is the cluster number (ive even tried ripping the modified/created dates/time out of an existing win98 directory)
my folders are being created around cluster 2, 3, 4 etc... while the clusternumber from win98 apears to be random and much higher so im wondering if it doesnt like this?
Also trying to delete the folder fails.
the onlything that looks different in the directory strucutres is the cluster number (ive even tried ripping the modified/created dates/time out of an existing win98 directory)
my folders are being created around cluster 2, 3, 4 etc... while the clusternumber from win98 apears to be random and much higher so im wondering if it doesnt like this?
-
- Member
- Posts: 2566
- Joined: Sun Jan 14, 2007 9:15 pm
- Libera.chat IRC: miselin
- Location: Sydney, Australia (I come from a land down under!)
- Contact:
I meant the value at an arbitary entry in the FAT table. For instance, cluster entry 30 might be 0x0000, means you don't need to go any further (there is never another entry after a null).
What I also meant was that the value in the 'cluster' field of the directory entry is always 0 if there is no data in the file. As soon as data is put into the file, the cluster entry is changed back to the proper value.
I know, because I wrote 'create file' functions that worked. I just couldn't get my write functions to work (mainly because I couldn't figure out how to allocate more space for the file in the FAT).
Read the Microsoft FAT docs. Everything you need is there. Believe me, that's where I wrote my driver from. A hex editor also helps.
What I also meant was that the value in the 'cluster' field of the directory entry is always 0 if there is no data in the file. As soon as data is put into the file, the cluster entry is changed back to the proper value.
I know, because I wrote 'create file' functions that worked. I just couldn't get my write functions to work (mainly because I couldn't figure out how to allocate more space for the file in the FAT).
Read the Microsoft FAT docs. Everything you need is there. Believe me, that's where I wrote my driver from. A hex editor also helps.