|
ArvernOS
|
ArvernOS (formerly known as "willOS") is a minimal and experimental monolithic kernel (not really an Operating System because it cannot do a lot of things currently).
The main goal of this project is to learn about operating systems, kernel development, different architectures and improve my C skills. ArvernOS is a monolithic (and hopefully modular) kernel with a unified homemade libc/libk, and userland programs.
The roadmap isn't clearly defined yet and it mainly depends on what I'd like to work on when I have time to spend on this project.
ArvernOS supports the architectures and boards listed below. Support for different architectures and boards are organized into two tiers, each with a different set of guarantees.
Tier 1 is the reference implementation and very likely the most advanced.
Current Tier 1 archs/boards:
Tier 2 is guaranteed to build but not all features have been implemented yet. Features are defined by the reference implementation and once feature parity is achieved, an architecture and/or board should move to Tier 1. Boards for which we cannot run enough tests in CI (e.g., because QEMU does not support the board) should stay in Tier 2, though.
Current Tier 2 archs/boards:
This section (and its sub-sections) are written for everyone interested in building and working on ArvernOS.
The following dependencies are required to build this project:
llvm (version 17 currently)makeqemu (version >= 5)If you want to work on the x86_64 architecture, you'll need the following extra dependencies:
nasmgrub-mkrescuexorrisoIf you want to work on ARM architectures (aarch32 or aarch64), you'll need the following extra dependencies:
gcc-arm-none-eabiu-boot-toolsThis project contains git submodules. You have to clone the main project as well as the submodules, either by using this command:
or by using this command if you already have a copy of this git repository:
Use Docker with the provided Dockerfile. You can either use the willdurand/arvernos-toolchain image from DockerHub or build your own:
You can then use it with docker run:
make help command may contain different commands depending on the architecture and board configured.Install Homebrew, then run the following commands:
The tools/install-linux-deps script is used to install the dependencies. It is currently used by both the Dockerfile and Circle CI.
You first need to install the development dependencies in order to build ArvernOS. The different final files are located in the build/<arch>/dist/ or build/<arch>/<board>/dist/ folder.
To build the image in debug mode, run:
To compile the OS in debug mode, build the image, and start qemu with the OS loaded, run:
When running make run-debug, the QEMU monitor can be accessed over TCP on port 5555. You can use tools like telnet or nc:
In debug mode, logging very likely uses the serial port COM1 to write various debugging information. QEMU is configured to write the output of this serial port to a logfile in ./log/. DEBUG level logs are not necessarily written by default, though, and it is possible to enable DEBUG logs for specific modules like this:
The available debug variables are:
ENABLE_CONFIG_DEBUGENABLE_CORE_DEBUGENABLE_FS_DEBUGENABLE_MMU_DEBUGENABLE_NET_DEBUGENABLE_PROC_DEBUGENABLE_SYS_DEBUGENABLE_USERLAND_DEBUGLog files may contain stack traces without debug symbols if the symbols haven't been loaded:
Use the tools/fix-stacktrace.py script to add missing symbol names to the output:
In addition, you might want to find the corresponding line of code in the source files by using llvm-addr2line or llvm-symbolizer:
Use make gdb to run the project in debug mode with QEMU configured to wait for gdb to connect. This has been tested with vim (:Termdebug) and VS Code.
A sensible configuration is automatically generated when this command is executed (see also: make gdbinit). If a file named .gdbinit.local exists in the project's root directory, its content will be appended to the generated .gdbinit file.
make gdb calls make run-debug under the hood so all configuration options are also supported. For example, it is possible to run make gdb KERNEL_CMDLINE="kshell selftest".To compile the OS in release mode, build the image, and start qemu with the OS loaded, run:
config files are used to configure how a build works. The content must be compatible with make. Here is an example:
ArvernOS is released under the MIT License. See the bundled LICENSE file for details. In addition, some parts of this project have their own licenses attached (either in the source files or in a LICENSE file next to them).