From 16124277eea356ac5b15e1f064c9f113f3dd7637 Mon Sep 17 00:00:00 2001 From: Liam Kerr Date: Mon, 9 Feb 2026 19:20:25 +0000 Subject: [PATCH] Update Roadmap --- README.md | 52 ++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 44 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index f1a2b48..e9ad96a 100644 --- a/README.md +++ b/README.md @@ -2,17 +2,53 @@ RISC-V Operating System. -## Roadmap -[x] Machine Mode initialization +## Kernel Development Roadmap -[x] UART Driver +### Phase 1: Foundations & Memory Management (Current) +- [x] **Bootstrapping**: RISC-V `entry.S` and kernel entry point. +- [x] **UART Driver**: Basic serial communication for debugging. +- [x] **Panic System**: Kernel panic mechanism for fatal errors. +- [x] **Physical Memory**: Page-level allocator (free list based). +- [x] **Kernel Heap**: `kmalloc`/`kfree` with: + - [x] Splitting of large blocks. + - [x] Doubly-linked list headers. + - [x] Bidirectional coalescing (Iterative). +- [~] **String Library**: Complete `lib/string.c` (`memset`, `memcpy`, `strcmp`, `strlen`). +- [~] **Formatted Printing**: Robust `kprintf` implementation for hex and decimal. -[X] Trap / Panic +### Phase 2: Hardware Interfacing & Traps +- [ ] **Trap Handling**: + - [~] Setup `mtvec` (Machine Trap Vector). + - [ ] Assembly "trampoline" to save/restore registers. + - [~] C dispatcher for exceptions and interrupts. +- [ ] **Timer Interrupts**: + - [ ] Interface with RISC-V CLINT (Core Local Interrupter). + - [ ] Implement a system heartbeat (ticks). +- [ ] **External Interrupts**: Setup PLIC (Platform-Level Interrupt Controller). -[x] Heap Allocator with coalescing +### Phase 3: Multitasking & Scheduling +- [ ] **Task Structure**: Define `task_struct` (PID, State, Stack Pointer, Priority). +- [ ] **Context Switching**: Assembly logic to switch register sets between tasks. +- [ ] **Scheduler**: + - [ ] Implement a Round-Robin scheduling algorithm. + - [ ] Task lifecycle management (Create, Yield, Terminate). +- [ ] **Synchronization**: Basic Spinlocks or Semaphores for resource protection. -[ ] Context Switching / Multi-threading +### Phase 4: Virtual Memory +- [ ] **Sv39 Paging**: + - [ ] Walk the 3-level page table structure. + - [ ] Map/Unmap functions for virtual addresses. +- [ ] **Kernel/User Separation**: Isolate kernel memory from user processes. +- [ ] **Higher Half Kernel**: Remap kernel to upper virtual memory. -[ ] Timer Interrupts (Round Robin) +### Phase 5: Userspace & System Calls +- [ ] **User Mode Jump**: Switch CPU to User (U) mode. +- [ ] **ECALL Interface**: + - [ ] Implement system call dispatcher. + - [ ] Basic syscalls: `write`, `exit`, `getpid`, `fork`. +- [ ] **ELF Loader**: Read and execute simple static binaries. -[ ] User Mode (U-Mode) transition \ No newline at end of file +### Phase 6: Filesystem & Shell +- [ ] **VFS Layer**: Abstract File System interface. +- [ ] **Initial RAM Disk (initrd)**: Load basic files into memory. +- [ ] **User Shell**: Interactive CLI to execute commands and scripts. \ No newline at end of file