README.md

thymos

License

A simple 64-bit hobby operating system written from scratch in C23. Currently only supports x86 but might support RISC-V and ARM in the near future.

Features #

  • Supports UEFI thanks to Limine and works on real hardware
  • Small kernel setup GDT (Global Descriptor Table)
  • IDT (Interrupt Descriptor Table) for handling software/hardware interrupts
  • 8259 PIC driver for handling monitoring hardware interrupts
  • Basic video driver that works with a linear framebuffer provided by Limine
  • Basic PS/2 keyboard driver and a shell for user input

Try it #

Watch the showcase/demo here to see what this operating system is currently capable of. I wouldn't be surprised if you're unimpressed because there's nothing fancy going on 😃

  • Download thymos.iso from the latest release in the releases page
  • Download QEMU to emulate the OS
  • Run qemu-system-x86_64 -cdrom thymos.iso to boot thymos in QEMU

Bare-metal #

  • Download thymos.iso from the latest release in the releases page
  • Flash thymos.iso to a flash drive
  • Plug into computer and boot into flash drive. The steps required to do this depends on the hardware

Development #

Setting everything up #

It's recommended you have the Nix package manager installed along with flakes enabled since the primary development environment is set up with a Nix flake.

After installing Nix and enabling flakes, just run nix develop in the root of the project directory. Run nix flake update to update all flake dependencies to use the latest version of all packages that the development environment provides.

If you can't or don't want to use Nix then you'll need to download the following tools manually -> - zig - To compile the kernel itself. It's written in Zig obviously - qemu - For emulating the OS to rapidly test it duh - gcc - To use makefiles and for compiling Limine binaries - wget - For fetching dependencies e.g. ssfn.h - xorriso - For creating the ISO

Makefile Commands #

# Fetch required libraries/dependencies
# IMPORTANT: RUN THIS COMMAND BEFORE TRYING TO BUILD THE OS
make fetchDeps

# Build
make                                            - Compile and run/emulate the OS using QEMU
make kernel                                     - Compile the kernel
make iso                                        - Create bootable ISO image
make run                                        - Run/Emulate the OS using QEMU
make run target="<architecture>" cpu="<cpu>"    - Supported architectures - 'x86_64', 'riscv64' and 'aarch64'

# Remove build output and other useless artifacts
make clean

TODO #

  • Memory management
  • Filesystem drivers
  • Networking
  • LibC and porting software
  • More modern APIC driver instead of 8259 PIC driver
  • ACPI for power management

Acknowledgements #

  • Limine - Multiprotocol bootloader and boot manager
  • SSFN - Text renderer
  • Tiny Printf - Tiny and non-dependent complete printf implementation