Skip to content

ASecondOne/rust_os

Repository files navigation

rust_os

A tiny hobby OS kernel in Rust that boots with GRUB and plays an animated ASCII parrot (inspired by the old curl parrot.live vibe).

Project Status

This project is archived and no longer actively maintained.

What It Does

  • Boots a 32-bit no_std Rust kernel via Multiboot2 + GRUB
  • Sets up basic PIC/IDT/PIT timer interrupts
  • Writes directly to VGA text memory (0xb8000)
  • Loops through colored ASCII parrot frames forever

Toolchain

  • Rust nightly (nightly-2023-10-01, pinned in rust-toolchain.toml)
  • Custom Rust target: i686-unknown-none.json
  • build-std for core and compiler_builtins
  • Linker script: linker.ld

Requirements

  • rustup + Cargo
  • grub-mkrescue (and its ISO backend, usually xorriso)
  • qemu-system-x86_64 (only needed for scripts/run_iso.sh)
  • Bash

Quick Start

Build kernel + bootable ISO:

scripts/build_iso.sh

Output:

  • target/rust_os.iso

Build + run in QEMU:

scripts/run_iso.sh

Scripts

  • scripts/build_iso.sh
    • Runs cargo build --target i686-unknown-none.json
    • Copies kernel + GRUB config into an ISO root
    • Creates target/rust_os.iso with grub-mkrescue
  • scripts/run_iso.sh
    • Calls scripts/build_iso.sh
    • Boots ISO with QEMU (-display gtk)

Manual Build (without scripts)

cargo build --target i686-unknown-none.json

Kernel ELF output:

  • target/i686-unknown-none/debug/rust_os

Project Layout

  • src/main.rs - kernel entry and animation loop
  • src/boot.s - Multiboot2 header + _start
  • src/interrupts.rs / src/interrupts.s - IDT, PIC/PIT setup, IRQ0 handler
  • src/timer.rs - tick counter + hlt-based sleep
  • src/vga.rs - VGA text mode writer
  • iso/boot/grub/grub.cfg - GRUB menu entry
  • i686-unknown-none.json - custom compilation target
  • linker.ld - kernel memory layout and section placement

Notes

  • scripts/run_iso.sh uses -display gtk; run it in a GUI session.
  • If you only want an artifact, scripts/build_iso.sh is enough.

License

MIT - see LICENSE.

About

An small Rust os.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors