diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2007-11-09 21:39:43 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2007-11-09 21:39:43 +0000 |
commit | 84b2a489aa2b3f6100c0a2947c472625832a6b38 (patch) | |
tree | 7cc8e5771218d97a5f51cf7731a69565e1ce9925 | |
parent | 2007-11-06 Joel Sherrill <joel.sherrill@OARcorp.com> (diff) | |
download | network-demos-84b2a489aa2b3f6100c0a2947c472625832a6b38.tar.bz2 |
2007-11-09 Joel Sherrill <joel.sherrill@oarcorp.com>
* init.c: Test improved.
-rw-r--r-- | telnetd/ChangeLog | 4 | ||||
-rw-r--r-- | telnetd/init.c | 47 |
2 files changed, 46 insertions, 5 deletions
diff --git a/telnetd/ChangeLog b/telnetd/ChangeLog index d886edc..e3016f0 100644 --- a/telnetd/ChangeLog +++ b/telnetd/ChangeLog @@ -1,3 +1,7 @@ +2007-11-09 Joel Sherrill <joel.sherrill@oarcorp.com> + + * init.c: Test improved. + 2007-09-25 Joel Sherrill <joel.sherrill@oarcorp.com> * .cvsignore, ChangeLog, Makefile, init.c: New files. diff --git a/telnetd/init.c b/telnetd/init.c index 729573f..f57d565 100644 --- a/telnetd/init.c +++ b/telnetd/init.c @@ -5,11 +5,13 @@ * Don't forget to change the IP addresses */ +#define USE_RTEMS_SHELL + #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER #define CONFIGURE_RTEMS_INIT_TASKS_TABLE #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 20 -#define CONFIGURE_MAXIMUM_PTYS 1 +#define CONFIGURE_MAXIMUM_PTYS 8 #define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM #define CONFIGURE_MEMORY_OVERHEAD 256 @@ -31,6 +33,8 @@ #define CONFIGURE_MAXIMUM_DRIVERS 10 #define CONFIGURE_INIT +#define STACK_CHECKER_ON + #include <stdlib.h> #include <rtems.h> #include <rtems/telnetd.h> @@ -65,6 +69,11 @@ rtems_task Init( #include <sys/socket.h> #include "../networkconfig.h" +#if defined(USE_ECHO_SHELL) + +#define SHELL_HELP_MSG \ + "Starting echoShell via telnetd -- default password is rtems\n" + /* * Number of sessions */ @@ -122,6 +131,31 @@ void echoShell( } } +#define SHELL_ENTRY echoShell + +#endif + +#if defined(USE_RTEMS_SHELL) + +#include <rtems/shell.h> + +#define SHELL_HELP_MSG \ + "Starting rtemsShell via telnetd -- default account is rtems w/no password\n" + +void rtemsShell( + char *pty_name, + void *cmd_arg +) +{ + printk("============== Starting Shell ==============\n"); + shell_shell_loop( NULL ); + printk("============== Exiting Shell ==============\n"); +} + +#define SHELL_ENTRY rtemsShell + +#endif + /* * Init task */ @@ -138,13 +172,16 @@ rtems_task Init( rtems_bsdnet_show_inet_routes (); printf("============== Start Telnetd ==============\n"); - printk( "Starting echoShell via telnetd -- default password is rtems\n" ); + + printk( SHELL_HELP_MSG ); + rtems_telnetd_initialize( - echoShell, /* "shell" function */ + SHELL_ENTRY, /* "shell" function */ NULL, /* no context necessary for echoShell */ FALSE, /* spawn a new thread */ - RTEMS_MINIMUM_STACK_SIZE, /* default stack size please */ - 1 /* priority .. we feel important today */ + RTEMS_MINIMUM_STACK_SIZE * 4, /* default stack size please */ + 1, /* priority .. we feel important today */ + 0 /* do not ask for password */ ); printf("============== Deleting Init Task ==============\n"); |