Os 2020 handles the FAT 32 file system, here is how to retrieve / modify files from the os.
To modify the file system, just modify the file fs/fs and build the os. This file is created at the building of this os and you can also sync Os 2020's files (see next section for details).
Here are steps to modify files from your os (after a first build) :
- Go to fs and create the modification directory :
cd fs && mkdir vfs
- Mount the file system image :
sudo mount fs vfs
- Modify / create some files with root privileges :
sudo sh -c 'cd vfs && mkdir dir && echo "File content" > dir/file'
- You can now unmount the file system :
cd .. && sudo umount vfs
- Rebuild the os and run it :
cd .. && make run
There is a script scripts/getfs.sh that can be runned from the root of this repo which copies the file system from bin/os to fs/fs.
The file system is 64MiB wide but this size is the minimal size, you can change the size in the makefile or just create another image of different size in fs/fs. Be carefull, set clusters of size 512.
The Fat32 driver handles only sectors of size 512 and clusters of 1 sector.