How tanmaygadge/riscv-os works
This is a small bare-metal RISC-V kernel. Its visible workflow initializes physical memory and page tables, enables the MMU, installs the runtime allocator, then enables timer traps and reports ticks over UART. Memory management includes physical-page allocation, virtual-range allocation, and page mapping/unmapping. The excerpts establish the main calls among these components; boot assembly behavior and other unsampled implementation details are not inferred.
Main entry points: main.rs Kernel startup · paging.rs Page tables · pmm.rs Physical allocator · trap.rs Trap handling
Components 7
Kernel runtime
- Kernel startup
src/main.rs
Memory management
- Page tables
src/paging.rs - Physical allocator
src/pmm.rs - Virtual ranges
src/pmm.rs
Diagnostics and traps
- Trap handling
src/trap.rs - UART output
src/uart.rs
Other components
- RISC-V platform
Connections 9
- RISC-V platform → Kernel startup: boots
- Kernel startup → Physical allocator: initializes
src/main.rs - Kernel startup → Page tables: builds mappings
src/main.rs - Kernel startup → Virtual ranges: initializes pool
src/main.rs - Kernel startup → Trap handling: enables traps
src/main.rs - Kernel startup → UART output: prints status
src/main.rs - Page tables → Physical allocator: allocates pages
src/paging.rs - Physical allocator → Page tables: maps and unmaps
src/pmm.rs - Trap handling → UART output: prints diagnostics
src/trap.rs