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`` |
| 6 | will generate an ``hd0.img`` EXT2 disk image for you automatically. The default |
| 7 | size is 32 megabytes, but you can create your own of any size if you want. Once |
| 8 | the image has been created it will be loaded by QEMU automatically. |
| 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 |
| 12 | ``$(BLUEJAY_ROOT)/mnt``. It will automatically give read and write permissions |
| 13 | to the current user. This operation uses ``sudo`` internally, you will be |
| 14 | prompted for your password. |
| 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. |