Second attempt at making an OS
Make sure you have following programs installed:
Note: you may need more packages to build the sysroot, such as flex bison automake autoconf autopoint gperf help2man texinfo libgmp-dev libmpc-dev libmpfr-dev etc
On debian based systems, I recommend installing llvm, clang and lld from here: https://apt.llvm.org
If you are on a up-to-date Debian based system (Ubuntu, linux mint, Pop_os!, etc) you can install most of them with this command:
sudo apt install clang lld llvm xorriso tar qemu-system-x86 qemu-system-arm
For meson, ninja and xbstrap, first make sure you have python and python-pip installed and then run:
python -m pip install meson ninja xbstrap
Follow these steps to build and run the os:
Clone this repo with:
git clone --depth=1 https://github.com/ilobilo/ilobilix
Currently you have to manually build the sysroot:
boostrap.ymlmkdir build-sysrootpushd build-sysrootxbstrap init ..xbstrap install basesysroot does not exist in ilobilix source that links to build-sysroot/system-root, then create it with:ln -s $BUILD_SYSROOT_DIR$/system-root $KERNEL_DIR$/sysrootln -s build-sysroot/system-root ../sysrootpopdSet up the build system:
meson setup builddir --cross-file cross-files/meson-kernel-clang-(x86_64/aarch64)(-ccache).cross-file -Doptions=values
Build and run the kernel:
ninja -C builddir <see Ninja Targets>
| Target Name | Description |
|---|---|
| run_bios | Run with legacy BIOS (only on x86_64) |
| run_bios_debug | Same but with debugging enabled |
| run_uefi | Run with UEFI |
| run_uefi_debug | Same but with debugging enabled |
| norun | Do not run the OS |
Notes:
-d int and -monitor telnet:127.0.0.1:12345. If gdb option is enabled, adds -s -Srun_bios will be used, otherwise run_uefi.| Project options | Default Value | Description |
|---|---|---|
| kernel_cflags | Extra c compiler arguments for kernel | |
| kernel_cxxflags | Extra cpp compiler arguments for kernel | |
| modules_cflags | Extra c compiler arguments for modules | |
| modules_cxxflags | Extra cpp compiler arguments for modules | |
| kernel_ubsan | false | Enable ubsanitizer in kernel |
| modules_ubsan | false | Enable ubsanitizer in modules |
| 5lvl_paging | false | Enable 5 level paging in kernel |
| syscall_debug | false | Print syscall log in serial console |
| gdb | false | Add -s -S to QEMU when debugging |
| noaccel | false | Disable QEMU accelerators |
| vnc | false | Start QEMU VNC server on 127.0.0.1:5901 |
https://discord.gg/fM5GK3RpS7