For an ultra tiny embedded Linux OS, development on MPLAB using the PIC32 simulator and the Unison RTOS requires the following functionality.
The concept of a bourne or posix shell on Linux or Unix is well understood. This project requires the completion of the development of a posix shell with a tiny footprint as a first step. It is nearly complete but needs upgrades and integration into the Unison environment.
There is a second phase of the project to be posted separately involving upgrades to telnet.
## Deliverables
Tiny POSIX Shell
Ansi C language, current POSIX specifications apply.
It must be extremely small particularly in data space. There can be no large data structures. All data structures which are provided must be dynamically allocated and deallocated using malloc and free. The exception to this can be environment variables which can be static in a parameter controlled array.
It must run as a single thread.
All basic options for commands are required but just basic ones. Variables and variable interpretation are not required. If someone uses variables, return an error.
History is not required.
Special characters will be treated the same as posix for command interface consistency.
Although this looks like something any high school student could do quickly, it requires very high quality and efficient algorithms.
Commands
* pwd
* cd
* ls
* mkdir
* rmdir
* mv
* rm
* rn
* cp
* cat
* chmod
* chown
* setenv (posix version)
* printenv (posix version)
* alias
* unalias
* exit (reclaim all memory resources and kill the shell)
Complete documentation in terms of an html man page is required which details the options on the above listed features.
Starting args are not required. The starting function should be called posh() for POsix SHell
The set of man pages for the POSIX calls which are to be used to support the implementation are available at [login to view URL] one half way down the page on the right side.
The development would be best done under Linux for the first phase and this step is largely complete. Source code is available upon request. It should be completed under mplab version 8.0 or 8.1 with the Unison RTOS and mplab pic32 simulator.
The underlying calls for the system have been examined and are available to support the implementation of the various commands. The non standard posix calls are getdirentries to learn about a directory and get information on it, and dir_register_type, dir_deregister_type, dir_lookup_type. These calls provide access to the registry which is used to register environment variables and shared values.
additional requirement to peek and poke local memory:
peek type address
poke type address value
value and address are in decimal or hex type is one of 8 16 or 32 preceeded by a u if unsigned eg peek u8 0x5512 or peek u8 21778
The idea of environment variables is available via a set of calls. Support is required for PWD, HOME, so that path names can be shorter. (ie ../../filename )
Source code documentation is also required.