blob: 3150dc74874f29eb2dcec68f2867aee01808bf1b [file] [log] [blame]
swissChilie00e88a2021-05-30 17:54:26 -07001Building Bluejay
2================
3
4Bluejay uses the home-grown ``Jmk`` build system, which is basically just a GNU
5m4 script that generates makefiles from ``Jmk`` files --- makefiles with some
6custom macros.
7
8To build a fresh clone of Bluejay the first thing you will need to do is run
9``bin/jmk`` to generate your makefiles for you. You should get some output like
10this:
11
12.. code-block::
13
14 Processing ./boot/initrd/Jmk
15 Processing ./src/kernel/dri/ata_pio/Jmk
16 Processing ./src/kernel/dri/ahci/Jmk
17 Processing ./src/kernel/dri/pci/Jmk
18 Processing ./src/kernel/Jmk
19 Processing ./src/mkinitrd/Jmk
20 Processing ./src/lisp/Jmk
21
22Then just build using ``src/kernel/Makefile``. There are a few additional
23targets for your convenience:
24
25- ``qemu`` builds and launches the kernel using QEMU's SeaBIOS
26- ``qemu-iso`` builds a GRUB ISO and launches using QEMU
27- ``install`` builds a GRUB ISO and installs it to ``boot/bluejay.iso``
28- ``debug`` launches kernel in QEMU and launches GDB in the terminal.
29- ``debug-wait`` launches kernel in QEMU and starts a GDB server on ``localhost:1234``.
30 This is recommended if you want to debug since you can connect to it from vscode or
31 any other IDE. ``.vscode/launch.json`` is set up to work with this so you can debug
32 the kernel very easily.
33
34In order to build Bluejay you will need the following dependencies::
35
36 gcc gcc-multilib nasm qemu-system-i386 make m4 python3 awk
37
38There are some additional dependencies for building a GRUB ISO but I don't
swissChili4418ca52021-06-14 17:36:00 -070039remember them at the time of writing.
swissChilicaa24782021-07-19 14:29:58 -070040
41Common Issues
42-------------
43
44If when launching Bluejay in QEMU with ``make qemu`` you see the message ::
45
46 [ DEBUG ] mb.mods_addr = <whatever>, 0x<whatever>
47
48Followed by a page fault (``#PF``), your QEMU is out of date. You can either run
49the GRUB ISO (with ``make qemu-iso``), which is slower, or upgrade your QEMU to
50at least version 6.0.
51
52This is because prior to 6.0 QEMU's integrated bootloader did not support
53multiboot modules. This message is caused by the kernel attempting to read a
54module that was loaded incorrectly.