diff options
author | Anas Nashif <anas.nashif@intel.com> | 2016-12-23 14:06:46 -0500 |
---|---|---|
committer | Anas Nashif <nashif@linux.intel.com> | 2016-12-25 19:35:11 +0000 |
commit | 7297f5db887c81d4acdca6d3691a6739084c104d (patch) | |
tree | 702c64c84e89b0f24607a082d91bae44bbd55c71 /doc | |
parent | 46fa5384aae3fa5389b3900559c3979dd54a8328 (diff) |
shell: move shell to its own subsystem
This moves the shell component into its own subsys and groups all
related files and options into a single place.
Additionally, one Kconfig option will now be required to enable the
shell:
CONFIG_CONSOLE_SHELL=y
The header files was also moved to include/shell/shell.h and can be now
referenced with
#include <shell/shell.h>
instead of
#include <misc/shell.h>
Updated documentation as well.
Change-Id: Iffbba4acfa05408055e9fd28dffa213451351f94
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/subsystems/shell.rst | 49 |
1 files changed, 24 insertions, 25 deletions
diff --git a/doc/subsystems/shell.rst b/doc/subsystems/shell.rst index 17eb7c1db..8d2b6d669 100644 --- a/doc/subsystems/shell.rst +++ b/doc/subsystems/shell.rst @@ -6,11 +6,11 @@ Shell Overview ******** -Zephyr OS Shell enables multiple Zephyr OS modules to use and expose their -shell interface simultaneously. +The Shell enables multiple subsystem to use and expose their shell interface +simultaneously. -Each module can support shell functionality dynamically by its Kconfig file, -which enables or disables the shell usage for the module. +Each subbsystem can support shell functionality dynamically by its Kconfig file, +which enables or disables the shell usage for the subsystem. Using shell commands ******************** @@ -19,14 +19,19 @@ Use one of the following formats: Specific module's commands ========================== + +A shell interface exposing subsystem features is a shell module, multiple +modules can be available at the same time. + `MODULE_NAME COMMAND` One of the available modules is “KERNEL”, for the Kernel module. More information can be found in :c:macro:`SHELL_REGISTER`. Help commands ============= + `help` - Prints the available modules. + Prints the list of available modules. `help MODULE_NAME` Prints the names of the available commands for the module. @@ -37,6 +42,7 @@ Help commands Select module commands ====================== + `set_module MODULE_NAME` Use this command when using the shell only for one module. After entering this command, you will not need to enter module name in further commands. If @@ -54,40 +60,33 @@ There are two levels of configuration: Infrastructure level and Module level. Infrastructure level ==================== -The default value for ENABLE_SHELL flag should be considered per product. -This flag enables shell services. +The option :option:`CONFIG_CONSOLE_SHELL` enables the shell subsystem and enable the +default features of the shell subsystem. -If it is enabled, kernel shell commands are also available for use. -See the :option:`CONFIG_ENABLE_SHELL` Kconfig options for more information. - -Module level -============ -Each module using shell service should add a unique flag in its Kconfig file. +Module/Subsystem level +====================== +Each subsystem using the shell service should add a unique flag in its Kconfig file. Example: -CONFIG_SAMPLE_MODULE_USE_SHELL=y - -In the module’s code, the shell usage depends on this config parameter. -This module-specific flag should also depend on ENABLE_SHELL flag. +CONFIG_NET_SHELL=y -Therefore, there is one global flag, in addition to a unique flag per each -module. -The default value for ENABLE_SHELL flag should be considered per product. +In the subsystem’s code, the shell usage depends on this config parameter. +This subsystem specific flag should also depend on :option:`CONFIG_CONSOLE_SHELL` flag. Configuration steps to add shell functionality to a module ========================================================== - #. Check that ENABLE_SHELL is set to yes. - #. Add the module unique flag to its Kconfig file. + #. Check that :option:`CONFIG_CONSOLE_SHELL` is set to yes. + #. Add the subsystem unique flag to its Kconfig file. Writing a shell module ********************** -In order to support shell in your module, the application must do the following: +In order to support shell in your subsystem, the application must do the following: -#. Module configuration flag: Declare a new flag in your module Kconfig file. - It should depend on `ENABLE_SHELL` flag. +#. Module configuration flag: Declare a new flag in your subsystem Kconfig file. + It should depend on `:option:`CONFIG_CONSOLE_SHELL`` flag. #. Module registration to shell: Add your shell identifier and register its callback functions in the shell database using :c:macro:`SHELL_REGISTER`. |