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 directory
  • cat - concatenate file(s) to standard output
  • cd- change working directory
  • cp- copy file
  • date - print/set the system date
  • df - prints filesystem statistics
  • echo - display a line of text
  • edit - text editor
  • exec - replace shell with the given command
  • exit - exits shell
  • help - prints this help message
  • history - prints commands history
  • kill - terminates process
  • ls- lists files in the namespace
  • mem - prints memory map
  • mkdir- creates directory
  • mount- mounts a filesystem
  • nc- TCP and UDP connections and listens
  • nslookup- queries domain name servers
  • ntpclient- set the system's date from a remote host
  • perf - track kernel performance events
  • ping - ICMP ECHO requests
  • pm- monitors processes
  • ps- prints processes and threads
  • pshapp - delivers psh interpreter, exit, pshlogin and history commands
  • pshlogin - launches psh with user authentication
  • pwd- prints the name of current working directory
  • reboot - restarts the machine
  • sync - synchronizes device
  • sysexec - launch program from syspage using given map
  • top - top utility
  • touch- changes file timestamp
  • umount - unmount a filesystem
  • uptime - 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.

See also

  1. Utilities
  2. Table of Contents