Skip to content

Running it

Everything goes through the top-level GNUmakefile. If you have the tree, you never need to type a QEMU command by hand.

Terminal window
make all # userspace, kernel, then a bootable ISO
make run # QEMU: q35, UEFI, KVM, 4 cores

make run opens a local window, so it needs an X or Wayland session. Over SSH, use the headless path instead.

The run targets attach sata-disk.img, a persistent 5G EFS disk, and the kernel prefers it over the live root carried inside the ISO, which is what you want while developing, since files survive a reboot. The ISO alone boots too; see Downloads for the plain QEMU invocation and On real hardware for installing to a disk.

Target What it does
make run q35 + UEFI + KVM, 4 cores, virtio-gpu, e1000e, xHCI, Intel HDA
make run-single the same, on one core
make run-big the same, on sixteen
make run-gdb TCG, one core, paused with a gdbserver on :1234
make gdb attach rust-gdb with the project’s .gdbinit
make run-capture dump network traffic to /tmp/edos.pcap
make run-storage attach a USB mass-storage disk
make run-headless no local display: VNC for you, QMP for scripts
make test boot with --features sched-test and exit through isa-debug-exit

The kernel mounts the root filesystem, then spawns bin/edos-init, which starts the window manager, the taskbar and a terminal. From the shell:

/ $ uname -a
EDOS 0.1.0 x86_64
/ $ free
total(KiB) used(KiB) free(KiB)
Mem: 2067888 133724 1934164
Frames: 516972 33431 483541
Page size: 4096 B

ls /bin lists everything available. ping, dns and wget work against the real internet through QEMU’s user networking.

scripts/edos-vm boots the same ISO headless and exposes two channels: VNC for a human, and QMP for scripts.

Terminal window
make run-headless # prints the VNC display and the QMP socket
scripts/edos-vm shot desktop.png # PNG of the guest framebuffer
scripts/edos-vm click 400 300 # focus a window before typing into it
scripts/edos-vm type 'ls /bin' --enter
scripts/edos-vm log -n 40 # tail the guest serial log
scripts/edos-vm stop

To watch it, forward the VNC port and point a viewer at localhost:5901:

Terminal window
ssh -L 5901:127.0.0.1:5901 <host>

Three properties of the guest will otherwise waste your time: the keyboard layout, the relative-only mouse, and click-to-focus. Driving the VM covers all three.

The serial console is written to run_log.txt in the repository root, truncated on every start, so the file always describes the current run. That is the first place to look.

Resolve an address from a panic with:

Terminal window
addr2line -e kernel/target/x86_64-unknown-none/debug/edos-kernel -f 0xffffffff8009c422