blob: 3632c6f137fbca0d28d310fe3c2e806344b1c3b2 [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``
swissChilie9fec8b2021-06-22 13:59:33 -07006will generate an ``hd0_ext2.img`` EXT2 disk image for you automatically. The
7default size is 32 megabytes, but you can create your own of any size if you
8want. Once the image has been created it will be loaded by QEMU automatically.
swissChili4418ca52021-06-14 17:36:00 -07009
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
swissChilie9fec8b2021-06-22 13:59:33 -070012``$(BLUEJAY_ROOT)/mnt``. If you are using an EXT2 filesystem you should probably
13change the owner of that directory once it is mounted so that you can write to
14it.
swissChili4418ca52021-06-14 17:36:00 -070015
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.
swissChilicaa24782021-07-19 14:29:58 -070024
25Filesystem Drivers
26------------------
27
28The current filesystem driver(s) available in Bluejay are:
29
30- ``ext2``
31 - Read-only support, write support is in progress
32
33Creating a Virtual Drive in QEMU
34--------------------------------
35
36By default ``make qemu`` will load ``hd0_$(FS).img`` as the virtual hard drive
37for Bluejay. ``FS`` defaults to ``ext2`` but can be set in your ``Jmk.options``
38to any value. If this file does not exist it will be created using
39``mkfs.$(FS)``, ie ``mkfs.ext2`` by default. The default size of the file system
40is 35 megabytes, although you can create one of any size manually if you want.
4135 megabytes is plenty for testing though.
42
43The ``make mount`` command will mount the current virtual hard drive in
44``$(ROOT)/mnt`` (where ``$(ROOT)`` is the root directory of the Bluejay sources,
45not ``/``). This command requires superuser privileges. If you want to give your
46(host) user account write permissions use ``chown -R user:group /path/to/mnt``
47where ``user`` and ``group`` are the user and group you want to own the files.
48
49Currently Bluejay ignores file permissions so it doesn't matter who you set the
50owner to.