Refactor and add more doc comments, improve code base with more global static in config file#46
Merged
LuernOutOfOrder merged 5 commits intodevelopfrom Dec 3, 2025
Conversation
… to a specific file instead of the mod file
…c to define max size of static pool for fdt node and props in config file
… static for safety tick duration and add doc comment in kprint
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 refactors and improves the kernel's architecture and device initialization code, with a focus on modularity, clarity, and maintainability. The most significant changes include moving the RISC-V trap frame code into its own module, enhancing documentation and code comments throughout, and improving subsystem initialization and configuration. Additionally, several static initializers and constants have been standardized for consistency.
Architecture and Trap Frame Refactoring
TrapFramestruct and related initialization logic fromsrc/arch/riscv32/mod.rsinto a new dedicated modulesrc/arch/riscv32/traps/trap_frame.rs, improving code organization and modularity. All references toTrapFrameandKERNEL_TRAP_FRAMEhave been updated accordingly. [1] [2] Fabd441dL6, Fabd441dL96)Documentation and Code Comments
Subsystem Initialization and Static Constants
init(e.g.,SerialManager::init,KernelConsole::init), and updated static initializers for serial and console subsystems for consistency. (Fe6cb31aL28, Fe6cb31aL94, F51e092dL29, F51e092dL90)FDT_MAX_STACK,FDT_MAX_PROPS) from local statics to global configuration insrc/config.rs, improving configurability and visibility. (F1ffaf34L17, Fd872ac4L2)Kernel Boot and Main Entry Point
Interrupt and Timer Handling Enhancements
These changes collectively enhance the codebase's maintainability, readability, and modularity, making it easier to extend and support additional architectures and subsystems in the future.