The MyOS Shell provides a command-line interface for interacting with the operating system. It offers a familiar environment similar to CMD or PowerShell for Windows users.
The shell automatically starts when the system boots up, presenting you with a window titled "MyOS Shell". The shell prompt looks like this:
MyOS>
Commands in MyOS Shell follow this general syntax:
command [arguments]
For example:
copy source.txt destination.txt
- Use the Up and Down arrow keys to navigate through previously entered commands
- Press Enter to execute a command
- Use Backspace to delete characters
| Command | Description | Usage |
|---|---|---|
cd |
Change directory | cd [directory] |
dir |
List directory contents | dir [directory] |
type |
Display file contents | type <file> |
copy |
Copy files | copy <source> <destination> |
del |
Delete files | del <file> |
mkdir |
Create directory | mkdir <directory> |
rmdir |
Remove directory | rmdir <directory> |
| Command | Description | Usage |
|---|---|---|
cls |
Clear screen | cls |
echo |
Display messages | echo [message] |
help |
Show available commands | help |
ver |
Show OS version | ver |
date |
Show/set date | date [MM-DD-YYYY] |
time |
Show/set time | time [HH:MM:SS] |
-
Creating and navigating directories:
mkdir documents cd documents dir -
File operations:
echo Hello World > test.txt type test.txt copy test.txt backup.txt del test.txt -
System information:
ver date time
The shell runs in a window that can be:
- Moved by dragging the title bar
- Resized by dragging the window edges
- Minimized/maximized using window controls
- Insert Mode: Default mode for typing
- Cursor Movement: Left/Right arrow keys to move within the command
- Line Clearing: Ctrl+C to clear current line
The shell provides clear error messages when:
- A command is not found
- Invalid arguments are provided
- Operations fail due to permissions or other issues
Example error messages:
Unknown command. Type 'help' for list of commands.
Usage: copy <source> <destination>
Error: File not found
The shell behavior can be customized through:
- Environment variables (coming soon)
- Shell configuration file (coming soon)
Common issues and solutions:
-
Command Not Found
- Check command spelling
- Use
helpto see available commands - Ensure proper case sensitivity
-
File Operation Failures
- Verify file paths
- Check file permissions
- Ensure sufficient disk space
-
Window Issues
- Try closing and reopening the shell
- Check for sufficient memory
- Verify display driver status
Planned features for future releases:
- Tab completion
- Command aliases
- Script execution
- Pipe and redirection operators
- Background process management
- Custom prompt configuration
- Command history persistence
The shell is implemented in:
src/apps/shell.c: Main shell implementationsrc/apps/shell.h: Shell interface definitionssrc/kernel/command.c: Command system implementationsrc/kernel/command.h: Command system interface
Key components:
- Command Parser
- History Manager
- Window Manager Integration
- File System Interface
- Input/Output Handler