1
0
Fork
You've already forked D3OS
0
No description
  • Rust 91.5%
  • C 8%
  • Assembly 0.4%
  • Shell 0.1%
2025年10月31日 13:29:15 +01:00
.github/workflows using old window manager state due to performance problems 2025年09月24日 16:20:19 +02:00
.idea kernel/syscalls: Do not save callee-saved registers; kernel: Make sure fs/gs registers are always loaded correctly 2025年10月21日 16:18:19 +02:00
.vscode Write a bit about debugging applications 2025年10月24日 14:35:17 +02:00
.zed Write a bit about debugging applications 2025年10月24日 14:35:17 +02:00
docs Merge branch 'gui' into development 2025年10月01日 13:40:40 +02:00
loader Add iPXE instructions 2025年10月30日 16:21:32 +01:00
media added logo 2025年01月19日 12:10:40 +01:00
os Setup thread environment completely in user space 2025年10月31日 13:29:15 +01:00
.gitignore Add iPXE instructions 2025年10月30日 16:21:32 +01:00
.gitkeep fix and adapt window manager to current D3OS state 2025年09月24日 16:16:38 +02:00
Cargo.lock library/concurrent: Store thread start time as TimeDelta struct 2025年10月22日 15:40:01 +02:00
Cargo.toml Merge branch 'gui' into development 2025年10月01日 13:40:40 +02:00
d3os_application.json Fix warning; Compile for x86_64-v3 2025年10月21日 14:24:19 +02:00
d3os_kernel.json Fix warning; Compile for x86_64-v3 2025年10月21日 14:24:19 +02:00
LICENSE Initial commit 2023年04月01日 14:08:07 +02:00
Makefile.toml Update towboot to 0.10 2025年10月30日 16:16:53 +01:00
qemu-pci.sh Add instructions on how to pass a real device to the VM 2025年07月10日 18:02:06 +02:00
README.md Add iPXE instructions 2025年10月30日 16:21:32 +01:00
run.sh Added project files 2025年09月24日 17:45:07 +02:00
rust-toolchain.toml Fix warning; Compile for x86_64-v3 2025年10月21日 14:24:19 +02:00
rustfmt.toml added two convenient functions in vmm 2025年06月28日 10:06:17 +02:00

A new distributed operating system for data centers, developed by the operating systems group of the department of computer science at Heinrich Heine University Düsseldorf

Requirements

For building D3OS, the following packages for Debian/Ubuntu based systems (or their equivalent packages on other distributions) need to be installed:

apt install rustup build-essential nasm dosfstools wget qemu-system-x86

This has been tested on Ubuntu 24.04.

For macOS, the same can be achieved with:

xcode-select --install
brew install rustup dosfstools nasm x86_64-elf-gcc gnu-tar wget qemu
brew link --force rustup

This has been tested on macOS 14.

rustup will download a rust nightly toolchain on the first compile.

To run the build, the commands cargo-make and cargo-license are required. Install them with:

cargo install --no-default-features cargo-make cargo-license

Build and Run

To build D3OS and run it in QEMU, just execute:

cargo make --no-workspace

To build a release version of D3OS (much faster) and run it in QEMU, just execute:

cargo make --no-workspace --profile production

To only build the bootable image d3os.img, run:

cargo make --no-workspace image

Debugging

In a terminal with gdb

Open a terminal and compile and start D3OS in qemu halted by gdb with the following commands:

cargo make --no-workspace clean
cargo make --no-workspace debug

Open another terminal and start gdb with:

cargo make --no-workspace gdb

This will fire booting D3OS and stop in boot.rs::start.

Setting a breakpoint in gdb:

break kernel::naming::api::init

This way, a single application can also be debugged:

add-symbol-file loader/initrd/bin/hello
break main

For further commands check GDB Quick Reference.

In your editor

The repository contains debug configurations for RustRover, Visual Studio Code and Zed. To debug userspace applications, you might need to modify them.

Creating a bootable USB stick

Using towboot

D3OS uses towboot which is already installed after you have successfully compiled D3OS.

Use following command (in the D3OS directory) to create a bootable media for the device referenced by /mnt/external

$ towbootctl install /mnt/external --removable -- -config towboot.toml

Using balenaEtcher

Write the file d3os.img using balenaEtcher to your USB stick.

Repeatedly booting on a physical device

If you're trying to fix a bug, the workflow of "building D3OS, plugging a USB stick into your development device, flashing it, plugging the USB stick into your target device, boot" can get annoying.

If you do have a working network connection between these devices, this can get easier:

  1. grab towboot.efi (from the GitHub releases or with ./towbootctl extract --x86-64 loader/towboot.efi) and place it into loader/towboot.efi
  2. grab ipxe.efi and place it on a USB stick under /BOOT/EFI/BOOTX64.EFI (or on a FAT partition on the target device)
  3. put the following into /autoexec.ipxe:
#!ipxe
dhcp
chain http://IP_OF_YOUR_HOST:8000/command.ipxe
  1. cd loader/; python3 -m http.server
  2. compile D3OS and boot with the created stick

This way, you only need to recompile and reboot the target, no need to re-flash.

Passing an existing PCI device to the VM

To use a real device with QEMU, change the Makefile so that it uses ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/qemu-pci.sh instead of qemu-system-x86_64. Also take a look at that script and fill in the constants at the top.

If you want to run D3OS on a different device, build with cargo make --no-workspace image and copy over qemu-pci.sh, RELEASEX64_OVMF.fd and d3os.img. Run it with ./qemu-pci.sh -bios RELEASEX64_OVMF.fd -hda d3os.img.