diff options
| author | Richard Qin <richard.qin.x@gmail.com> | 2025-12-14 00:18:06 +0800 |
|---|---|---|
| committer | Richard Qin <richard.qin.x@gmail.com> | 2025-12-14 00:18:06 +0800 |
| commit | d1fdfc0c903cebbf460b5cea944e0aa1390c717e (patch) | |
| tree | d5e3890fa41f35fc74026f231959adb7181ca327 | |
| parent | 28fd88e0dd66728b22cd792deb5a1e8636f36ed3 (diff) | |
| download | lume-d1fdfc0c903cebbf460b5cea944e0aa1390c717e.tar.gz lume-d1fdfc0c903cebbf460b5cea944e0aa1390c717e.tar.xz | |
Add the README to provide a detailed explanation of the project
| -rw-r--r-- | README.md | 94 | ||||
| -rwxr-xr-x | build/kernel.elf | bin | 20704 -> 20704 bytes | |||
| -rw-r--r-- | build/src/kernel/main.o | bin | 7976 -> 7976 bytes | |||
| -rw-r--r-- | src/kernel/main.cc | 2 |
4 files changed, 95 insertions, 1 deletions
@@ -0,0 +1,94 @@ +# Lume +> Luminescence in the Deep Night + +Lume is a multitasking operating system kernel built for the RISC-V 64 architecture.Developed from the ground up, it was created to explore the art of modern operating system. + +## Architecture Overview + +The initialization sequence of Lume follows modern OS design principles: + +* 1.Boot: entry.asm sets up the initial stack and prepares the C++ environment. + +* 2.Discovery: The FDT parser probes the DTB for hardware layout information. + +* 3.Memory: Establishes physical and virtual memory mappings. + +* 4.Asynchrony: Installs the Trap Handler and enables the SBI timer interrupt. + +* 5.Concurrency: Initializes the Process Manager and enters the scheduler loop to run tasks. + +## Roadmap + +### Phase 1: Foundation (Current Status) + +- [x] Bootloader & Entry: Successful hand-off from OpenSBI to Kernel. + +- [x] FDT Parsing: Dynamic hardware discovery via Device Tree. + +- [x] Physical Memory Management: Basic page-frame allocator. + +- [x] Basic Traps: Handling supervisor-mode exceptions and interrupts. + +### Phase 2: Memory & Process Management +- [x] Virtual Memory: Full SV39 page table implementation with kernel/user space separation. + +- [ ] Slab Allocator: Efficient kernel-level object allocation (kmalloc). + +- [ ] Process Lifecycle: Implementation of fork(), exec(), and exit(). + +- [x] Preemptive Scheduling: Priority-based or Round-robin scheduler. + +### Phase 3: I/O & File System +- [ ] VirtIO Drivers: Support for VirtIO-Block and VirtIO-Net devices. + +- [ ] Virtual File System (VFS): Abstract layer for multiple file system support. + +- [ ] Initial Ramdisk (initrd): Loading a basic user-space environment during boot. + +- [ ] Fat32/Ext2 Support: Persistent storage capabilities. + +Phase 4: User Space & Stability +- [ ] System Call Interface: Standardized API for user-space applications. + +- [ ] User-mode Shell: A basic CLI to interact with the kernel. + +- [ ] Multicore (SMP): Booting secondary harts and implementing spinlocks/mutexes. + +- [ ] C Standard Library (nolibc): Providing a runtime for user-level C programs. + +## Quick Start +### Requirements +* riscv64-linux-gnu-gcc toolchain +* QEMU (riscv64) +### Build and Run +~~~bash +make clean +make all +make run +~~~ +When you see the following output, Lumen has successfully illuminated your hardware: +~~~bash +[Lume OS Kernel] Booted in S-Mode. +2025 Richard Qin + + +[Boot] Kernel started. +PMM: Initializing from[Boot] PMM initialized. +[Boot] Kernel page table created. +[Boot] MMU ENABLED! We are now using virtual addresses. +[Trap] Initialized stvec to: 0x0000000080200090 +[Boot] Trap Handler Installed. +[Boot] Timer Interrupt Enabled. +[Boot] ProcManager Initialized. +[Proc] Created thread: Task A +[Proc] Created thread: Task B +[Kernel] Scheduler Starting... +[Proc] Scheduler started. +... +~~~ + +## License +This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. + +## +Richard Qin Dec 2025
\ No newline at end of file diff --git a/build/kernel.elf b/build/kernel.elf Binary files differindex 56cd68a..d498d4f 100755 --- a/build/kernel.elf +++ b/build/kernel.elf diff --git a/build/src/kernel/main.o b/build/src/kernel/main.o Binary files differindex 44d666e..f6bd81b 100644 --- a/build/src/kernel/main.o +++ b/build/src/kernel/main.o diff --git a/src/kernel/main.cc b/src/kernel/main.cc index 68c0974..6a7970c 100644 --- a/src/kernel/main.cc +++ b/src/kernel/main.cc @@ -42,7 +42,7 @@ extern "C" void kernel_main() fdt_init(g_dtb_addr); Drivers::uart_init(); - Drivers::uart_puts("\n[Modern DOS Kernel] Booted in S-Mode.\n"); + Drivers::uart_puts("\n[Lume OS Kernel] Booted in S-Mode.\n"); Drivers::uart_puts("2025 Richard Qin\n"); Drivers::uart_puts("\n"); Drivers::uart_puts("\n[Boot] Kernel started.\n"); |
