Skip to content

An x86-64 kernel with ~100% Rust (originally) in a week. `async` inside!

License

Notifications You must be signed in to change notification settings

BugenZhao/litchi-rs

Repository files navigation

litchi-rs

An x86-64 kernel with ~100% Rust (originally) in a week. The continuation of Litchi.

Screenshot

Try it

Make sure the Rust toolchains and qemu-system-x86_64 are installed, then simply execute...

make qemu PROFILE=release

Roadmap

Booting

  • Bare-metal UEFI application.
  • In-memory ELF program loader.
  • Locate kernel executable with UEFI's simple file system.
  • Jump into the kernel.
  • Prepare BootInfo and pass to the kernel.
  • ...

Kernel Initializations

  • Serial logger.
  • Global Descriptor Table & Task State Segment.
  • Physical frame allocator, based on the boot info.
  • Kernel page table.
  • Kernel heap allocation & extern crate alloc.
  • Resolve ACPI table for interrupts & multiprocessors.
  • Trap handlers for critical faults.
  • Local APIC for the timer interrupt.
  • IO APIC for the UART serial.
  • Bootstrap application processors.
  • ...

User Tasks

  • Load embedded ELF user programs.
  • RAII-style user memory allocator and mapper.
  • User library to provide init code.
  • Switch to user mode.
  • Frame-preserving timer interrupt handler for preemption.
  • Round-robin task scheduler.
  • System calls with shared memory.
  • User heap allocator.
  • Task recycling.
  • Idle task with kernel privilege.
  • Basic priority-based scheduler.
  • File or device resource management.
  • Blocking system calls.
  • A basic userspace shell.
  • Task spawning and forking.
  • Synchronization primitives.
  • Asynchronous IO.
  • ...

Other Kernel Functionalities

  • Event-driven UART serial input handler.
  • Kernel task with async Rust!
  • Multiprocessors.
  • Simple file systems.
  • IPC mechanisms.
  • ...

References

About

An x86-64 kernel with ~100% Rust (originally) in a week. `async` inside!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published