How julien-cpsn/retos works
Main Components
• Host & Hypervisor
– QEMU x86_64 (BIOS/UEFI)
– Host‐side network (TAP interface created by create_tap_interface.sh)
• Bootloader
– Invokes kernel binary (src/bin/qemu_bios.rs or qemu_uefi.rs)
– Sets CPU to 64-bit mode, loads kernel image
• Kernel Core
– Initialization: GDT, IDT, paging (kernel/src/interrupts, kernel/src/memory)
– Memory manager & allocator (heap_allocator.rs, allocator.rs)
– Scheduler/task executor & async runtime (kernel/src/task/executor.rs, task.rs)
– Logging & clock (logger.rs, clock.rs)
• Hardware Abstraction & Drivers
– PCI & ACPI enumeration (pci.rs, acpi.rs)
– Interrupt controllers (APIC, PIC modules)
– Device drivers:
· NICs: E1000, RTL8139 (kernel/src/devices/drivers)
· USB: xHCI (kernel/src/devices/xhci.rs)
· PS/2 keyboard (keyboard.rs under task or driver)
• Terminal & CLI
– Terminal abstraction (kernel/src/terminal/terminal.rs)
– Embedded‐CLI framework and built-in commands (clear, echo, lspci, scanpci, ps, top, uptime, shutdown)
• Utilities & Tests
– ping.py (host‐side network test)
– create_tap_interface.sh (network bridge setup)
Relationships & Data Flows
– Show Kernel Core initializing subsystems in sequence (GDT/IDT → Paging → Memory Allocator → Scheduler).
– Indicate interrupt flow: hardware → PIC/APIC → IDT → interrupt handlers in kernel.
– Show the Scheduler/Executor dispatching tasks (keyboard input, CLI commands, network packet I/O).
– Represent the Terminal subsystem atop drivers, issuing commands that invoke kernel services.
– For networking, show QEMU’s virtual NIC → host TAP interface → driver (E1000/RTL8139) → future TCP/IP stack.
Architectural Patterns & Principles
– Layered design: Bootloader → Kernel Core → HAL (drivers) → User Interface (CLI).
– Modularity via Rust crates: separate modules for memory, interrupts, devices, tasks, terminal.
– Asynchronous tasks model: executor schedules I/O and command tasks.
– Use of external crates: x86_64 for low‐level CPU structures, bootloader crate, embedded‐cli‐rs, goolog.
Technologies & Frameworks
– Rust / Cargo ecosystem (.cargo/config.toml, Cargo.toml)
– QEMU virtualization (BIOS/UEFI)
– Rust OS‐dev crates: x86_64, bootloader, pic8259, pci_types, embedded‐cli‐rs, goolog
– Network TAP interface (create_tap_interface.sh)