swissChili | 4418ca5 | 2021-06-14 17:36:00 -0700 | [diff] [blame] | 1 | Bluejay Filesystem |
| 2 | ================== |
| 3 | |
| 4 | Filesystem drivers are still a work in progress. To test a file system you will |
| 5 | want to create and mount a virtual block device. The makefile in ``src/kernel`` |
swissChili | e9fec8b | 2021-06-22 13:59:33 -0700 | [diff] [blame] | 6 | will generate an ``hd0_ext2.img`` EXT2 disk image for you automatically. The |
| 7 | default size is 32 megabytes, but you can create your own of any size if you |
| 8 | want. Once the image has been created it will be loaded by QEMU automatically. |
swissChili | 4418ca5 | 2021-06-14 17:36:00 -0700 | [diff] [blame] | 9 | |
| 10 | In order to write to the virtual hard disk from your host operating system you |
| 11 | should mount it. The ``make mount`` command in ``src/kernel`` mount the image to |
swissChili | e9fec8b | 2021-06-22 13:59:33 -0700 | [diff] [blame] | 12 | ``$(BLUEJAY_ROOT)/mnt``. If you are using an EXT2 filesystem you should probably |
| 13 | change the owner of that directory once it is mounted so that you can write to |
| 14 | it. |
swissChili | 4418ca5 | 2021-06-14 17:36:00 -0700 | [diff] [blame] | 15 | |
| 16 | Virtual Filesystem |
| 17 | ------------------ |
| 18 | |
| 19 | The Bluejay VFS is heavily inspired by UNIX. It relies on inodes and a tree of |
| 20 | file nodes. The source can be found in ``src/kernel/vfs.c``. This also exports a |
| 21 | very low-level API for dealing with files -- including the usual read(), |
| 22 | write(), readdir(), etc -- but this should not be used for much longer. A high |
| 23 | level API utilizing file descriptors will be implemented to make this simpler. |