From 84b2a489aa2b3f6100c0a2947c472625832a6b38 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Fri, 9 Nov 2007 21:39:43 +0000 Subject: 2007-11-09 Joel Sherrill * init.c: Test improved. --- telnetd/ChangeLog | 4 ++++ 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 + + * init.c: Test improved. + 2007-09-25 Joel Sherrill * .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 #include #include @@ -65,6 +69,11 @@ rtems_task Init( #include #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 + +#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"); -- cgit v1.2.3