mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-01 15:13:41 +08:00
* ChangeLog, preinstall.am, libmisc/Makefile.am, libmisc/shell/cmds.c, libmisc/shell/shell.c, libmisc/shell/shell.h: Split shell commands into multiple files and add initial stages of command configuration. This seems to work but the monitor commands need to be integrated this way and the ability to configure user commands needs to be tested. * libmisc/shell/cat_file.c, libmisc/shell/cmd_alias.c, libmisc/shell/cmd_cat.c, libmisc/shell/cmd_cd.c, libmisc/shell/cmd_chdir.c, libmisc/shell/cmd_chmod.c, libmisc/shell/cmd_chroot.c, libmisc/shell/cmd_date.c, libmisc/shell/cmd_dir.c, libmisc/shell/cmd_exit.c, libmisc/shell/cmd_help.c, libmisc/shell/cmd_id.c, libmisc/shell/cmd_logoff.c, libmisc/shell/cmd_ls.c, libmisc/shell/cmd_mallocdump.c, libmisc/shell/cmd_mdump.c, libmisc/shell/cmd_medit.c, libmisc/shell/cmd_mfill.c, libmisc/shell/cmd_mkdir.c, libmisc/shell/cmd_mmove.c, libmisc/shell/cmd_mwdump.c, libmisc/shell/cmd_pwd.c, libmisc/shell/cmd_rm.c, libmisc/shell/cmd_rmdir.c, libmisc/shell/cmd_tty.c, libmisc/shell/cmd_umask.c, libmisc/shell/cmd_whoami.c, libmisc/shell/internal.h, libmisc/shell/shellconfig.c, libmisc/shell/shellconfig.h, libmisc/shell/str2int.c: New files.
60 lines
1.6 KiB
C
60 lines
1.6 KiB
C
/*
|
|
* Author: Fernando RUIZ CASAS
|
|
* Work: fernando.ruiz@ctv.es
|
|
* Home: correo@fernando-ruiz.com
|
|
*
|
|
* The license and distribution terms for this file may be
|
|
* found in the file LICENSE in this distribution or at
|
|
* http://www.rtems.com/license/LICENSE.
|
|
*
|
|
* $Id$
|
|
*/
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
#include "config.h"
|
|
#endif
|
|
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
|
|
#include <rtems.h>
|
|
#include <rtems/monitor.h>
|
|
#include <rtems/shell.h>
|
|
#include "internal.h"
|
|
|
|
/*-----------------------------------------------------------*
|
|
* with this you can call at all the rtems monitor commands.
|
|
* Not all work fine but you can show the rtems status and more.
|
|
*-----------------------------------------------------------*/
|
|
int main_monitor(int argc,char * argv[]) {
|
|
rtems_monitor_command_entry_t *command;
|
|
|
|
rtems_task_ident(RTEMS_SELF,0,&rtems_monitor_task_id);
|
|
|
|
rtems_monitor_node = rtems_get_node(rtems_monitor_task_id);
|
|
|
|
rtems_monitor_default_node = rtems_monitor_node;
|
|
|
|
if ((command=rtems_monitor_command_lookup(rtems_monitor_commands,argc,argv)))
|
|
command->command_function(argc, argv, &command->command_arg, 0);
|
|
|
|
return 0;
|
|
}
|
|
|
|
/*-----------------------------------------------------------*/
|
|
void register_cmds(void) {
|
|
rtems_monitor_command_entry_t *command;
|
|
/* monitor topic */
|
|
command=rtems_monitor_commands;
|
|
while (command) {
|
|
if (strcmp("exit",command->command)) /* Exclude EXIT (alias quit)*/
|
|
shell_add_cmd(command->command,"monitor",
|
|
command->usage ,main_monitor);
|
|
command=command->next;
|
|
}
|
|
|
|
|
|
|
|
}
|
|
/*-----------------------------------------------------------*/
|