summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md94
-rwxr-xr-xbuild/kernel.elfbin20704 -> 20704 bytes
-rw-r--r--build/src/kernel/main.obin7976 -> 7976 bytes
-rw-r--r--src/kernel/main.cc2
4 files changed, 95 insertions, 1 deletions
diff --git a/README.md b/README.md
index e69de29..f87a864 100644
--- a/README.md
+++ b/README.md
@@ -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
index 56cd68a..d498d4f 100755
--- a/build/kernel.elf
+++ b/build/kernel.elf
Binary files differ
diff --git a/build/src/kernel/main.o b/build/src/kernel/main.o
index 44d666e..f6bd81b 100644
--- a/build/src/kernel/main.o
+++ b/build/src/kernel/main.o
Binary files differ
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");