blob: fc8a02525adb72d091fc74b703d3ce2e09d3f1b2 [file] [log] [blame]
swissChili4418ca52021-06-14 17:36:00 -07001Bluejay Filesystem
2==================
3
4Filesystem drivers are still a work in progress. To test a file system you will
5want to create and mount a virtual block device. The makefile in ``src/kernel``
6will generate an ``hd0.img`` EXT2 disk image for you automatically. The default
7size is 32 megabytes, but you can create your own of any size if you want. Once
8the image has been created it will be loaded by QEMU automatically.
9
10In order to write to the virtual hard disk from your host operating system you
11should 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
13to the current user. This operation uses ``sudo`` internally, you will be
14prompted for your password.
15
16Virtual Filesystem
17------------------
18
19The Bluejay VFS is heavily inspired by UNIX. It relies on inodes and a tree of
20file nodes. The source can be found in ``src/kernel/vfs.c``. This also exports a
21very low-level API for dealing with files -- including the usual read(),
22write(), readdir(), etc -- but this should not be used for much longer. A high
23level API utilizing file descriptors will be implemented to make this simpler.