Repository navigation
refacto: reorganize command structure and implement command functions - #133
Merged
NymiiTechTips merged 1 commit intoAug 30, 2026
Merged
Conversation
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 the shell command handling in the kernel by moving the implementation of built-in commands from
shell.cinto dedicated source files undersrc/commands/, and introducing a new header,commands.h, to declare these commands. The shell now calls these functions instead of containing their logic inline, resulting in a cleaner and more modular codebase. Additionally, new command implementations are added, and the Makefile is updated to include the new source directory.The most important changes are:
Command Refactoring and Modularity
help,fetch,crash,reboot,poweroff,mia,memtest,uptime,echo,memdump,peek, andpoke) fromsrc/kernel/shell.cinto individual source files undersrc/commands/, improving code organization and maintainability. The shell now calls these functions via the newcommands.hinterface. [1] [2]src/include/commands.hto declare all shell command functions and a utility function, ensuring consistent usage throughout the codebase. [1] [2]New and Improved Command Implementations
echo,uptime,memdump,peek, andpoke. [1] [2] [3] [4] [5]crash,fetch,help,memtest,mia,reboot, andpoweroffwith clearer separation of concerns and better encapsulation. [1] [2] [3] [4] [5] [6] [7]Build System Update
src/commands/*.csource files in the build process.These changes make the shell easier to extend and maintain, and lay the groundwork for adding more commands in the future.