Thanks to visit codestin.com
Credit goes to Github.com

Skip to content
/ thymos Public

64-bit hobby operating system written from scratch in Zig

License

Notifications You must be signed in to change notification settings

thymea/thymos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

thymos

License Repo Size

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

Features

  • Works on real hardware and supports UEFI as well
  • 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 :)

Virtual (Recommended)

  • 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

make fetchDeps

# Build
make                                            - Compile and emulate the operating system in QEMU (x86)
make kernel                                     - Build the kernel
make iso                                        - Create bootable ISO image
make run                                        - Emulate the operating system (x86)
make run target="<architecture>" cpu="<cpu>"    - Supported architectures are `x86_64`, `riscv64` and `aarch64`
                                                - Default CPUs are already set so you don't have to manually set them

# Remove build output, cache and project dependencies e.g. Limine
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 - Modern, advanced, portable, multiprotocol bootloader and boot manager
  • SSFN - Very fast, efficient and lightweight text renderer
  • Tiny Printf - Tiny, fast, non-dependent and fully loaded printf implementation for embedded systems.

Contributors

Made with contrib.rocks

About

64-bit hobby operating system written from scratch in Zig

Resources

License

Stars

Watchers

Forks

Packages

No packages published