MicroSH is platform independent command line shell for embedded systems, based on my remaster of microRL library by Helius. The library provides complete command interpretator for microRL command line to quickly and efficiently deploy the CLI on the target embedded device.
- Platform independent command shell written in C language (C99)
- Flexible library configuration
- Turn on/off feature for add functional/decrease memory via
microsh_config.handmicrosh_user_config.hconfig files
- Turn on/off feature for add functional/decrease memory via
- No dynamic allocation
- Maximum number of commands is assigned in configuration file
- Console sessions feature (optional)
- Use a shell in multi-user mode with a different set of commands
- Permissive Apache 2.0 license
This repository uses Git Submodules to bring in dependent components.
- Open console and navigate to path in the system to clone repository to. Use command
cd <path_to_lib> - Clone repository
To clone this repository using HTTPS:Using SSH:git clone https://github.com/dimmykar/microsh.git --recurse-submodulesIf you have downloaded repository without using thegit clone [email protected]:dimmykar/microsh.git --recurse-submodules--recurse-submodulesargument, you need to run:git submodule update --init --recursive - Checkout to
masterbranch for latest stable version or stay ondevelopbranch for latest development version
When the library is downloaded successfully, the next step is to add the library to the project, by means of source files to compiler inputs and header files in search path
- Copy
microshfolder to your project, it contains library files - Add
microsh/src/includefolder to include path of your toolchain. This is where C/C++ compiler can find the files during compilation process. Usually using-Iflag - Add source files from
microsh/src/folder to toolchain build. These files are built by C/C++ compiler - Copy
microsh/src/include/microsh/microsh_user_config_template.hto project folder and rename it tomicrosh_user_config.h - Additionally, the microSH library requires the microRL library, whose files follow the same
src/andsrc/includepattern as the microSH library; its install instructions can be found here. Note that you need also to configure microRL library usingmicrorl_user_config.hfile and include it to your project together withmicrosh_user_config.h.
The list of configurations are available in the microsh_config.h file with default values. If any config value needs to be changed, specify values for these configuration values as follows:
- Define in
microsh_user_config.hused by microSH
OR - Pass as compile time preprocessor macros
User configurations file microsh_user_config.h is used to overwrite default configuration values defined in microsh_config.h file without overwrite the file.
If you prefer to avoid using user configurations file, application must define a global symbol MICROSH_IGNORE_USER_CONFIGS and MICRORL_IGNORE_USER_CONFIGS, visible across entire application. This can be achieved with -D compiler option.
See examples in examples folder for minimal library usage.
Author: Dmitry Karasev aka dimmykar ([email protected])
15.01.2022