:floppy_disk: 一个最小、实验性和"玩具"的单体内核,用于学习操作系统开发 // 正在开发中
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-toolsNote: The recommended way to work on this project is to use Docker.
This project contains git submodules. You have to clone the main project as well as the submodules, either by using this command:
$ git clone --recurse-submodules or by using this command if you already have a copy of this git repository:
$ git submodule update --initUse Docker with the provided
Dockerfile. You can either use the
willdurand/arvernos-toolchain image from DockerHub or
build your own:
$ docker build -t willdurand/arvernos-toolchain .
[...]You can then use it with docker run:
…Note: The output of the make help command may contain different commands
depending on the architecture and board configured.
Install Homebrew, then run the following commands:
$ brew install nasm xorriso qemu llvm u-boot-toolsThe 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//dist/ or
build///dist/ folder.
To build the image in debug mode, run:
$ make clean ; make debugTo compile the OS in debug mode, build the image, and start qemu with the OS
loaded, run:
$ make clean ; make run-debugNote: Some boards aren't supported in QEMU.
When running make run-debug, the QEMU monitor can be accessed over TCP on
port 5555. You can use tools like telnet or nc:
$ telnet 127.0.0.1 5555In 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:
# Enable the debug logs for the "net" and "fs" modules
$ make clean ; make run-debug ENABLE_NET_DEBUG=1 ENABLE_FS_DEBUG=1The 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:
$ llvm-symbolizer --obj=build/x86_64/dist/kernel-x86_64.bin 0x01163B3
print_selftest_header
/path/to/ArvernOS/src/kernel/kshell/selftest.c:12:3
selftest
/path/to/ArvernOS/src/kernel/kshell/selftest.c:30:3$ llvm-addr2line -e build/x86_64/dist/kernel-x86_64.bin 01163B3
/path/to/ArvernOS/src/kernel/kshell/selftest.c:12Use 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.
Note: 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:
$ make clean ; make run-releaseconfig files are used to configure how a build works. The content must be
compatible with make. Here is an example:
# LLVM config on MacOS with Homebrew
LLVM_PREFIX = /usr/local/opt/llvm@13/bin/
LLVM_SUFFIX =
# Always enable the Undefined Behavior sanitizer
UBSAN = 1
# Logging
ENABLE_CORE_DEBUG = 1
ENABLE_PROC_DEBUG = 1
ENABLE_SYS_DEBUG = 1
ENABLE_USERLAND_DEBUG = 1ArvernOS 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).
暂无开放 Issues,或尚未同步最近议题。