[SOLVED] FAT32 write support
Posted: Thu Aug 24, 2017 9:58 am
Hello everyone,
i implemented fat32 read support in my kernel, and it is now working fine (except that i did not implemented reading a file at a specific offset, but anyway).
I wanted to fully implement fat32 support, so i need file and directory creation, file writing, and file and directory deletion.
I read the FAT article on the wiki, and the FAT32 one by Requimrar, but i did not find them useful for write support.
I have read the microsoft "fatgen103.doc" document, but again even if read support, and lfn stuff is really clear i could not find useful information for write support.
I have 3 questions :
- How do i find an 'empty' or free to use cluster on the drive ? Do i need to look in the FAT, and where ?
- How do i create a directory or a file ? I am supposed to create a new entry in the FAT, right ? but how do i do that ? (where to write it, with what data)
- How do i allocate a cluster for a file or a directory, if the file data becomes too big for the current cluster ? (that cluster address must then be written in the FAT, right ? so that we can follow the cluster chain)
I tried to understand the concepts behind the file system, but i can't deny that i don't really know what are the data in the FAT itself, as all i've done for now using the fat is following cluster chain.
Thanks for using your time for me (and sorry if my english is bad) !
i implemented fat32 read support in my kernel, and it is now working fine (except that i did not implemented reading a file at a specific offset, but anyway).
I wanted to fully implement fat32 support, so i need file and directory creation, file writing, and file and directory deletion.
I read the FAT article on the wiki, and the FAT32 one by Requimrar, but i did not find them useful for write support.
I have read the microsoft "fatgen103.doc" document, but again even if read support, and lfn stuff is really clear i could not find useful information for write support.
I have 3 questions :
- How do i find an 'empty' or free to use cluster on the drive ? Do i need to look in the FAT, and where ?
- How do i create a directory or a file ? I am supposed to create a new entry in the FAT, right ? but how do i do that ? (where to write it, with what data)
- How do i allocate a cluster for a file or a directory, if the file data becomes too big for the current cluster ? (that cluster address must then be written in the FAT, right ? so that we can follow the cluster chain)
I tried to understand the concepts behind the file system, but i can't deny that i don't really know what are the data in the FAT itself, as all i've done for now using the fat is following cluster chain.
Thanks for using your time for me (and sorry if my english is bad) !