FAT can't read big files.
Posted: Fri Jun 08, 2018 7:34 am
Hello everyone,
Like I have said in my other topic I am still a beginner in developing operating systems. I have been working on a simple os now for 2 months or so and I am very happy with the things it can currently do. The next big thing I wanted for my os was a simple filesystem, the most common one seamed FAT32 so I chose that. The only things it can currently do is listing the first 16 items of the root directory, it can also read the contents of a file given by its filename (only 8.3 filenames). Reading a file works as expected until it gets above the size of a cluster. For some reason the first couple bytes are gone from the data, here is a example:
So I have a file named "MEGA.TXT" which contains only the word "MEGA, " a lot of times. When I read the file I get the following output:
My fat reading code: https://github.com/Remco123/OSDev-Simpl ... t.cpp#L161
And the ata code: https://github.com/Remco123/OSDev-Simpl ... a.cpp#L102
and obviously the repo: https://github.com/Remco123/OSDev-Simple/
Any help would be much appreciated
Like I have said in my other topic I am still a beginner in developing operating systems. I have been working on a simple os now for 2 months or so and I am very happy with the things it can currently do. The next big thing I wanted for my os was a simple filesystem, the most common one seamed FAT32 so I chose that. The only things it can currently do is listing the first 16 items of the root directory, it can also read the contents of a file given by its filename (only 8.3 filenames). Reading a file works as expected until it gets above the size of a cluster. For some reason the first couple bytes are gone from the data, here is a example:
So I have a file named "MEGA.TXT" which contains only the word "MEGA, " a lot of times. When I read the file I get the following output:
Until this happens:MEGA, MEGA, MEGA, MEGA, MEGA, MEGA, MEGA, MEGA, MEGA, MEGA, MEGA
MEGA, MEGA, MEGA, MEGA, MEGA, MEGA, MEGA, MEGA, MEGA, MEGA, MEGA
MEGA, MEGA, MEGA, MEGA, MEGA, MEGA, MEGA, MEGA, MEGA, MEGA, MEGA
etc.
Every time it starts reading from the next cluster the first couple bytes are gone.MEGA, MEGA, MEGA, MEGA, MEGA, MEGA, MEGA, MEGA, MEGA, MEGA, MEGA
MEGA, MEGA, MEGA, MEGA, MEGA, MEGA, MEGA, MEGA, MEGA, MEGA, Finding next cluster
Next cluster: 213
EGA, MEGA, MEGA, MEGA, MEGA, MEGA, MEGA, MEGA, MEGA, MEGA, MEGA
MEGA, MEGA, MEGA, MEGA, MEGA, MEGA, MEGA, MEGA, MEGA, MEGA, MEGA
MEGA, MEGA, MEGA, MEGA, MEGA, MEGA, MEGA, MEGA, MEGA, MEGA, MEGA
etc.
My fat reading code: https://github.com/Remco123/OSDev-Simpl ... t.cpp#L161
And the ata code: https://github.com/Remco123/OSDev-Simpl ... a.cpp#L102
and obviously the repo: https://github.com/Remco123/OSDev-Simple/
Any help would be much appreciated