Use of machine RAM and improve boot flow#60
Merged
LuernOutOfOrder merged 17 commits intodevelopfrom Dec 16, 2025
Merged
Conversation
… and add new mem mod for memory init and handling
…nker stack to real kernel stack from init mem
…play the current platform mode after setting it
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request implements a major refactor and documentation update for the kernel boot flow in LrnRTOS. The changes introduce a clear, phased boot process, modularize early boot logic, add robust memory initialization with dynamic stack switching, and provide detailed developer documentation. The most important changes are grouped below.
Kernel Boot Refactor and Modularization
bootmodule with thekernel_early_bootfunction, which handles the phased initialization of the platform, subsystems, trap frame, interrupts, and memory before jumping to the main kernel loop. The early boot logic was moved frommainto this new function, clarifying responsibilities and improving maintainability. (src/boot.rs[1]src/main.rs[2]src/arch/riscv32/start.rs[3]Documentation/kernel/boot.mdDocumentation/kernel/boot.mdR1-R145)Memory Management and Stack Switching
mem) that initializes RAM based on platform/FDT information, sets up a dynamic kernel stack, and switches the stack pointer at the correct phase in the boot sequence using RISC-V assembly. (src/mem/mod.rs[1]src/mem/kernel.rs[2]src/arch/riscv32/asm/mod.rs[3]src/arch/riscv32/asm/set_kernel_sp.S[4]src/config.rs[5]src/platform/mem.rs[1]src/devices_info.rs[2] [3]src/platform/mod.rs[4] [5]Device Tree and Platform Enhancements
device_type, and fixed a bug in property assignment during FDT parsing. (src/platform/fdt/helpers.rs[1]src/platform/fdt/mod.rs[2] [3] [4] [5]src/platform/mod.rssrc/platform/mod.rsR31-R37)These changes provide a robust, extensible foundation for kernel bring-up, memory management, and platform abstraction, while also improving developer experience and documentation.