Phoenix Shell (psh)

Phoenix Shell is a compact program that enables you to control the Phoenix-RTOS from the command line.

psh presents itself with a commandline where user can enter commands to control the Phoenix-RTOS system, manage files and processes.

Overview

Usage

If psh is in control of the commandline each new line starts with (psh)% prompt. User can then enter desired command. See Applets for list of available commands.

If 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
  • 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
  • perf - track kernel performance events
  • ping - ICMP ECHO requests
  • ps - prints processes and threads
  • pshapp - delivers psh interpreter, exit, pshlogin and history commands
  • pshlogin - launches psh with user authentication
  • reboot - restarts the machine
  • sync - synchronizes device
  • sysexec - launch program from syspage using given map
  • top - top utility
  • touch - changes file timestamp
  • uptime - prints how long the system has been running
  • / - executes a file

Executing

When executing psh from a name "psh" it is only possible to enter interactive mode or executa a script with -i.

If psh is launched with different name that corresponds to an available applet then the new psh executes only that applet and then close. Executing psh with different name can be achieved using symbolic links.

Restrictions

Only one interactive session of psh can be run in a scope of a psh process. For now running psh does not spawn new process, so in order to invoke a second, independent shell user must execute a psh binary file. See exec or / for examples.