Skip to content

rafalmiel/cykusz-rs

Repository files navigation

CI CI

cykusz-rs

Intro

cykusz-rs is a toy operating system written in Rust programming language.

cykusz-screen0.webm

Kernel

Core features

  • x86_64 monolithic kernel
  • 4-level paging
  • Preemptive per-cpu scheduler
  • ACPI (ioapic, lapic, acpica)
  • VM (elf loader, shared memory, COW)
  • Filesystem (ext2)
  • Page / Inode / Directory cache
  • TTY with ansi escape codes
  • Network Stack (e1000, ETH, ARP, IP, UDP, TCP, ICMP, DHCP, DNS)
  • IPC: Pipes / Unix Sockets / SHM

Drivers

  • VESA framebuffer
  • PS/2: Keyboard / Mouse
  • Storage: IDE / AHCI
  • Networking: e1000
  • Sound: Intel HDA

Userspace

  • libc (mlibc port)
  • Exec / fork
  • Threads
  • Thread local storage
  • Fs mount/umount
  • Posix signals
  • Futexes
  • Shared libs

Ports

Libs

Apps

Building OS

You will need following packages to compile and run the os:

  • rust (rustup)
  • build-essential
  • nasm
  • qemu
  • grub2
  • parted
  • e2fsprogs
  • docker

(!!) Please make sure your user is part of the disk and docker groups

sudo usermod -aG disk docker
newgrp - # or relogin

Building:

Sysroot

As an initial step we need to build the sysroot with ported software, and most importantly llvm/rust cross-compiler that will be required to build rust userspace programs.

The build will be done using docker and it will take a long time. In case something fails, you can find the logs in the sysroot/logs directory.

git clone https://github.com/rafalmiel/cykusz-rs.git --recursive

cd cykusz-rs
./bootstrap.sh

Kenrel

Once we have sysroot built, rebuilding kernel will be fairly quick with:

make

Running

qemu

make run

VirtualBox

# Run only once to import the image into VirtualBox
./create_vbox_image.sh

make vbox

bochs

make bochs