VSOS is a really-basic, portable, hobby operating system written in C.
- bootstrap with
qemu-system-aarch -M virt(arm64) - return from interrupt at EL1 context (arm64)
- console driver (PL011 UART)
-
printk(arm64) - cooperative multitasking (arm64)
- system-timer driver (arm64)
- virtual memory at EL1 context (arm64)
- interruptible process sleep (arm64)
- bitmap based allocator
-
SYS_read(arm64) -
SYS_write(arm64) - initial shell (arm64)
- ELF loader (arm64)
- virtual memory at EL0 context (arm64)
- zygote user process (arm64)
-
O_NONBLOCKandSYS_select(arm64) - block device driver (arm64)
- file system (arm64)
- ARCHITECTURE.md - System architecture
- DESIGN.md - System design
- Build and usage instructions - See sections below
On Ubuntu 25.04, we need these dependencies:
sudo apt install build-essential clang clangd lld llvm ninja-build qemu-system-armWe use ninja for building. To build the kernel and the shell, type:
ninjaThis process produces kernel.elf, the kernel. The build process (see ninja.build)
embeds the shell ELF binary inside the kernel itself.
To remove all built artifacts, use:
ninja -t cleanWe use qemu-system-aarch64 -M virt for testing.
This is the only system supported by VSOS.
qemu-system-aarch64 \
-M virt \
-cpu cortex-a53 \
-nographic \
-kernel kernel.elfTo investigate errors, obtain more detailed logs using:
qemu-system-aarch64 \
-M virt \
-cpu cortex-a53 \
-d in_asm,cpu,int,guest_errors -D qemu.log \
-nographic \
-kernel kernel.elfThis invocation will produce extensive logs inside the qemu.log file.
You will frequently need to correlate the logs with the kernel disassembly.
To obtain the kernel disassembly, use:
llvm-objdump -d --no-show-raw-insn -M no-aliases kernel.elfor:
readelf -a kernel.elfSPDX-License-Identifier: MIT
Portions of this code derive from nuta/operating-system-in-1000-lines.
