The CrisOS v2 shell (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/CRISTOP-bot/cris-os-v2/llms.txt
Use this file to discover all available pages before exploring further.
shell_run()) provides 28 built-in commands. All commands are typed at the > prompt. Type help to see the full command list inline. This page documents every command with its syntax, arguments, and behavior, grouped by category.
Every character typed at the prompt is pre-processed before parsing: the
=
character is globally replaced with +. This means calc 2=3 is silently
treated as calc 2+3, and echo foo=bar becomes echo foo+bar. Design
arithmetic input accordingly.Quick Reference
| Command | Description |
|---|---|
help | List all available commands |
clear | Clear the console screen |
ls [path] | List directory contents |
pwd | Print current working directory |
cd <path> | Change current directory |
mkdir <path> | Create a new directory |
rmdir <path> | Remove an empty directory |
rm <path> | Remove a file |
touch <path> | Create an empty file |
cp <src> <dst> | Copy a file |
mv <src> <dst> | Move or rename a file |
cat <file> | Print file contents |
grep <pattern> <file> | Search for a pattern in a file |
echo <text> [> file] | Print text or write to a file |
stat <file> | Show file path and size |
df | Show disk usage summary |
uname | Print OS identifier |
whoami | Print current user |
mouse | Show current mouse state |
kblayout [us|es|de] | Show or change keyboard layout |
reboot | Hardware reset the machine |
panic [message] | Trigger a kernel panic |
lcp <args> | Invoke the in-kernel package manager |
systemctl <args> | Invoke the service manager |
bootctl <args> | Invoke the boot manager |
gui | Launch the VGA text-mode GUI overlay |
asm <op> <a> <b> | Assembly arithmetic (add/sub/mul/div) |
calc <expression> | Evaluate an arithmetic expression |
File System Commands
ls
path. If no path is given, lists the current working directory. Calls vfs_list() internally. Prints Invalid path if the path does not exist or is not accessible.
Optional. The VFS path to list. Defaults to the current directory when
omitted.
pwd
vfs_pwd(). Takes no arguments.
Example:
cd
/) and relative paths. Prints Directory not found if the target does not exist or is not a directory.
Destination directory path. Must resolve to an existing directory in the VFS.
mkdir
path. Prints Cannot create directory if the parent directory does not exist, the path already exists, or the VFS node table is full.
Path of the directory to create. The parent directory must already exist.
rmdir
path. The directory must be empty. Prints Cannot remove directory if the path is not found, is not a directory, or the directory still contains entries.
Path of the directory to remove. Must be empty.
rm
Cannot remove file if the path does not exist, the path points to a directory (use rmdir for that), or the VFS rejects the operation.
Path of the file to delete. Must be a regular file, not a directory.
touch
path. Prints Cannot touch file if the parent directory does not exist or the VFS is full. Does not update timestamps on existing files — it is a creation-only primitive.
Path where the new empty file will be created.
cp
src to dst. Both arguments are required. Prints Copy failed if src does not exist, dst’s parent does not exist, or the VFS cannot accommodate the copy.
Path of the source file.
Destination path for the copy.
mv
src to dst. Both arguments are required. Prints Move failed if the operation cannot be completed.
Current path of the file.
New path for the file.
cat
file from the VFS and prints its raw content to the console. Prints File not found or is a directory if the path does not resolve to a readable regular file.
Path of the file to print. Must be a regular file.
grep
pattern in the lines of file. Prints each matching line prefixed with its 1-based line number. The match is case-sensitive and substring-based. Prints Pattern search failed if the file cannot be read or is empty.
The literal substring to search for. Case-sensitive.
Path of the file to search.
echo
text to the console followed by a newline.
In the second form, writes text to file in the VFS using vfs_write(). The file is created if it does not exist, or overwritten if it does. This uses a single > — append (>>) is not supported.
The text to output or write. Everything before the
> separator is taken as
content.Optional VFS destination path. When present, output is written to the file
instead of the console.
Because the shell replaces
= with + before parsing, writing something
like echo x=1 > file.txt will store x+1 in the file.stat
No such file or directory if the path cannot be found in the VFS.
Path of the file to inspect.
df
rootfs filesystem. Takes no arguments. The values shown are fixed at compile time and reflect the design capacity of the in-memory VFS.
Example output:
System Information Commands
uname
CrisOS i386. Takes no arguments.
Example:
whoami
cris in CrisOS v2. Takes no arguments.
Example:
mouse
mouse_get_state() and prints the x position, y position, and button bitmask. Takes no arguments.
Example output:
kblayout
One of
us (English), es (Spanish), or de (German). Required when
switching layouts.System Control Commands
help
clear
console_clear(). Takes no arguments. The prompt is re-drawn on the next iteration.
reboot
Rebooting... and immediately triggers a hardware CPU reset via I/O port 0x64. The machine restarts without saving any state.
panic
kernel_panic(). The screen turns red, the message is displayed, and the CPU is halted. If no message is given, the default string Kernel panic triggered from shell. is used.
Optional human-readable panic description. The entire remainder of the
command line is passed as the message.
Subsystem Commands
lcp
list, info, install, remove, search, files, depends, verify, update, and upgrade.
Examples:
systemctl
systemd_handle_command(). Manages kernel services and daemons.
bootctl
boot_handle_command(). Manages boot configuration and entries.
gui
gui_show(). Takes no arguments. The GUI runs over the existing text-mode console.
asm
Arithmetic operation. One of
add, sub, mul, or div.First operand. Supports an optional leading
- sign.Second operand. Supports an optional leading
- sign.calc
expression to calc_app(), which evaluates an arithmetic expression supporting integers, +, -, *, /, and parentheses, then prints = <result>.
Arithmetic expression string. Supports
+, -, *, /, and
parentheses. Spaces are allowed.Because the shell replaces
= with + globally before parsing, the
expression 2=3 arrives at calc_app as 2+3. Use + directly in all
expressions to avoid ambiguity.