Skip to content

refacto: reorganize command structure and implement command functions - #133

Merged
NymiiTechTips merged 1 commit into
Auri-OS:developfrom
NymiiTechTips:refacto/reworking-file-tree
Aug 30, 2026
Merged

NymiiTechTips merged 1 commit into
Auri-OS:developfrom
NymiiTechTips:refacto/reworking-file-tree

Conversation

@NymiiTechTips

Copy link
Copy Markdown
Member

This pull request refactors the shell command handling in the kernel by moving the implementation of built-in commands from shell.c into dedicated source files under src/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

  • Extracted the logic for built-in shell commands (such as help, fetch, crash, reboot, poweroff, mia, memtest, uptime, echo, memdump, peek, and poke) from src/kernel/shell.c into individual source files under src/commands/, improving code organization and maintainability. The shell now calls these functions via the new commands.h interface. [1] [2]
  • Added src/include/commands.h to declare all shell command functions and a utility function, ensuring consistent usage throughout the codebase. [1] [2]

New and Improved Command Implementations

  • Improved or re-implemented command logic in their new files, including argument parsing, help messages, and output formatting for commands like echo, uptime, memdump, peek, and poke. [1] [2] [3] [4] [5]
  • Added or updated commands such as crash, fetch, help, memtest, mia, reboot, and poweroff with clearer separation of concerns and better encapsulation. [1] [2] [3] [4] [5] [6] [7]

Build System Update

  • Updated the Makefile to include the new src/commands/*.c source 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.

@NymiiTechTips NymiiTechTips self-assigned this Aug 30, 2026
@NymiiTechTips
NymiiTechTips merged commit f52abf1 into Auri-OS:develop Aug 30, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

1 participant