Expand description
WhyOS Shell, used for rendering terminal output, running shell commands and executing
programs.
It’s a great tool for exploring WhyOS functionality.
It requires setting up and providing input Queue, as well as output function, typically used with UART.
§What can it do?
Builtin commands:
help|h|? Show this help message
clear|cls Clear the terminal screen
name|n Print OS build name
reboot Reboot the system
uptime Show system uptime in ticks
ps List all tasks
info|i <id> Show detailed task information
suspend|s <id> Suspend a task
resume|r <id> Resume a suspended task
kill|k <id> Kill a task (unsafe)
freq [hz] Get or set system tick frequency
list List available programs
execute|e <name> [num_arg] Execute a program
peek <hex_addr> Read a 32-bit value from memory (might HardFault)
poke <hex_addr> <hex_val> Write a 32-bit value to memory (might HardFault)It also comes in with couple of example programs.
Name | Prio | Stack | Default | Description
────────────────+──────+───────+─────────+──────────────────────────
cnt | 2 | 1024 | 10 | Counts down from N to 0
fib | 2 | 1024 | 10 | Calculates N-th Fibonacci number (up to 186th)
tim | 3 | 1024 | 10000 | Sets a timer for N ticks
panic | 1 | 1024 | 0 | Triggers panic
hard | 1 | 1024 | 0 | Triggers Hard Fault
magic | 3 | 1024 | 0 | Wait for someone to poke memory to stop it
top | 2 | 2048 | 500 | Live task view with N refresh ticks
eater | 3 | 8192 | 90 | Slowly eats its own stack up to ~N% - setting 95 or more will cause HardFault
Re-exports§
pub use embedded_io;
Macros§
- uprint
- Writes formatted text to the shell output.
- uprintln
- Writes formatted text to the shell output and appends a newline.
Structs§
- Program
- Describes a runnable program that can be launched from the shell.
- Shell
- Interactive WhyOS shell loop.
Constants§
- BUFFER_
SIZE - Number of
u8characters that Shell’s buffer can hold.
Type Aliases§
- Output
Fn - Callback invoked by the shell with raw output bytes.