Skip to content

ilobilo/ilobilix

Repository files navigation

Ilobilix

Second attempt at making an OS

Building and Running

Make sure you have following programs installed:

  • meson
  • ninja
  • clang/clang++ (version >= 17)
  • lld
  • llvm
  • xorriso
  • tar
  • xbstrap
  • qemu-system-x86_64
  • qemu-system-aarch64

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:

  1. Clone this repo with:
    git clone --depth=1 https://github.com/ilobilo/ilobilix

  2. Currently you have to manually build the sysroot:

  • Set the architecture in boostrap.yml
  • mkdir build-sysroot
  • pushd build-sysroot
  • xbstrap init ..
  • xbstrap install base
  • If symlink named sysroot 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$/sysroot
    For example:
    ln -s build-sysroot/system-root ../sysroot
  • popd
  1. Set up the build system:
    meson setup builddir --cross-file cross-files/meson-kernel-clang-(x86_64/aarch64)(-ccache).cross-file -Doptions=values

  2. Build and run the kernel:
    ninja -C builddir <see Ninja Targets>

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:

  • run_(bios/uefi)_debug: Runs QEMU with -d int and -monitor telnet:127.0.0.1:12345. If gdb option is enabled, adds -s -S
  • If target is not specified and architecture supports bios mode, run_bios will be used, otherwise run_uefi.

Options

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

Discord Server

https://discord.gg/fM5GK3RpS7

Resources and Projects:

TODO

  • Serial
  • GDT
  • IDT
  • TSS
  • PCI
  • PCIe
  • MSI
  • MSI-X
  • Modules x86_64
  • Modules aarch64
  • DTB
  • PS/2
  • PMM
  • VMM (5 and 4 level)
  • Heap
  • ACPI
  • LAPIC
  • IOAPIC
  • uACPI
  • VFS
  • TMPFS
  • DEVTMPFS
  • PROCFS
  • SYSFS
  • USTAR
  • ILAR
  • AHCI
  • NVME
  • Block Device Interface
  • EchFS
  • EXT2
  • FAT32
  • HPET
  • PIT
  • RTC
  • LAPIC Timer
  • Generic Timer
  • SMP
  • Scheduler x86_64
  • Scheduler aarch64
  • System calls x86_64
  • System calls aarch64
  • Permissions
  • MMAP
  • FDs
  • CDEV
  • FBDEV
  • TTY
  • PTY
  • ELF
  • Userspace
  • Signals
  • mlibc
  • RTL8139
  • RTL8169
  • E1000 (100E 153A and 10EA)
  • Ethernet
  • ARP
  • IPv4
  • ICMPv4
  • TCP
  • UDP

Packages

  • libiconv
  • libintl
  • zlib
  • file
  • ncurses
  • readline
  • bash
  • coreutils
  • nano