How leonmmcoset/leonos works
Project type and purpose
• LeonOS is a small, educational, monolithic operating system for x86 PCs, written in Rust.
• It targets emulators such as Bochs (bochsrc.disk) and produces bootable disk images (build/*.img).
• Provides basic kernel services (memory, processes, file system, drivers) plus a user‐space shell and utilities.
File structure
• Top-level crates:
– mbr: first-stage bootloader (512-byte MBR in assembly/Rust)
– loader & loader2: second and third stage loaders, switch to protected mode, set up paging
– kernel: core OS (drivers, VFS, scheduler, syscalls, thread/process mgmt, shell)
– common: shared library code (data structures, paging, context, device abstractions)
– user: a template for building ring-3 user programs
– cat, echo, grep: userland utilities that link against common & user crates
– rrt: a runtime crate (maybe for testing or special utilities)
• build.rs, linker scripts (.ld, .json) orchestrate builds per crate.
• build/ folder holds generated binaries (mbr.bin, loader.bin, kernel.bin) and disk images.
• tests/ contains Rust integration/unit tests for kernel subsystems.