insane-adding-machines / frosted

Frosted: Free POSIX OS for tiny embedded devices
GNU General Public License v2.0
213 stars 39 forks source link

Fatfs refactor #127

Closed brabo closed 6 years ago

brabo commented 7 years ago

Porting required functionality from ChaN's full fatfs to support to support a.o. #124 and #71 . This is a WIP until otherwise mentioned.

brabo commented 7 years ago

need to rework read and write at this point. read apparently just reads sequential sectors to read a file, so it looks like the fact that fdoom usually can load the wad file is purely coincidental. we need to get the fat entry (get_fat) once we reach the end of a cluster (which can be after each sector). i speculate that the reason fdoom works is that we use freshly formatted fat partitions which make it that by coicidence the clusters are sequential for its fat entry. in write we need to stretch the fat chain if needed by using create_chain.

i now will be mostly offline and not working on this for maybe up to a week. i will resume after. if anyone feels very courageous, i hope the information i gave here suffices to proceed with this task. open/creat can be added later, it will add some data to file objects which then read/write will need to check.