Phoenix Shell (psh)
The Phoenix Shell is a compact program that enables you to control Phoenix-RTOS from the command line.
psh
presents itself with a command line where user can enter commands to control the Phoenix-RTOS system, manage files
and processes.
Overview
Usage
If the psh
is in control of the command line each new line starts with (psh)%
prompt. The user can then enter the
desired command. See Applets for a list of available commands.
If the psh
command is run with -h
parameter the help message is displayed as follows:
usage: psh [options] [script path] or no args to run shell interactively
-i <script path>: selects psh script to execute
-h: shows this help message
With -i
option psh
can execute a script - fixed set of psh
commands saved in file.
Applets
In psh
, each command or set of commands is a separate applet, here's a list of the available ones:
bind
- binds device to directorycat
- concatenate file(s) to standard outputcd
- change working directorycp
- copy filedate
- print/set the system datedf
- prints filesystem statisticsecho
- display a line of textedit
- text editorexec
- replace shell with the given commandexit
- exits shellhelp
- prints this help messagehistory
- prints commands historykill
- terminates processls
- lists files in the namespacemem
- prints memory mapmkdir
- creates directorymount
- mounts a filesystemnc
- TCP and UDP connections and listensnslookup
- queries domain name serversntpclient
- set the system's date from a remote hostperf
- track kernel performance eventsping
- ICMP ECHO requestspm
- monitors processesps
- prints processes and threadspshapp
- deliverspsh
interpreter,exit
,pshlogin
andhistory
commandspshlogin
- launchespsh
with user authenticationpwd
- prints the name of current working directoryreboot
- restarts the machinesync
- synchronizes devicesysexec
- launch program from syspage using given maptop
- top utilitytouch
- changes file timestampumount
- unmount a filesystemuptime
- prints how long the system has been running/
- executes a file
Executing
When executing the psh
from a name "psh" it is only possible to enter interactive mode or execute a script with -i
.
If the psh
is launched with a different name that corresponds to an available applet then the new psh
executes only
that applet and then close. Executing psh
with a different name can be achieved using symbolic links.
Restrictions
Only one interactive session of the psh
can be run in a scope of a psh
process. For now, running psh
does not
spawn a new process, so in order to invoke a second, independent shell user must execute a psh
binary file.
See exec
or /
for examples.