So I have to implement a flat file system for an assignment I have where I have to make a shell of some kind in which the user has some functions he can use for creating and managing a file system. I gave to also make a file service, a block service and a directory service.
I made my shell where the user can call some functions (my_mkfs my_mount my_unmount my_quit my_help my_ls my_cp my_mv my_rm( my_df my_cat my_echo ).
The user decides when calling my_mkfs how many blocks and what size each block has to make the disk (i.e 10240 blocks of 1024 bytes each = 10MB). The block service has to move everything in blocks. So I did up to the point I create the file which will be my file system.
Now I am stucked. I know I am supposed to create the superblock where I will store my basic structures (a table which will indicate if a block is being used or not so char bitmap[blocks], a file allocation table where each cell is a block and has the index for the next block where the file being stored is continued or EOF if it is the last block - I will use a global index like in dos where it is loaded in ram so int FAT[blocks] and a directory table where I have my records of all the files in my file system)
but I dont have any idea of how to do anything. Is there any tutorial or any link of how to proceed.
Currently I am between writing the above directly into the "disk" and since I know how much space it will take to have all the read/write function for data to being done after the
or making files for these where I store them like any file but I have them hidden... In any case I am stucked as to how I am supposed to write in blocks...
And how am I to write them? I think that the write function works with char pointers right? Is there any way to write the structures themselves?