From a645637b723971e8af2cfa033bf8a3a96e061668 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 17 Apr 2008 22:46:15 +0000 Subject: 2008-04-17 Joel Sherrill * fileio/init.c, hello/system.h, minimum/init.c, unlimited/system.h: Use CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER where needed. --- testsuites/samples/ChangeLog | 5 ++++ testsuites/samples/fileio/init.c | 49 ++++++++++++++++++++++++++++++++++- testsuites/samples/hello/system.h | 2 ++ testsuites/samples/minimum/init.c | 3 +++ testsuites/samples/unlimited/system.h | 2 ++ 5 files changed, 60 insertions(+), 1 deletion(-) (limited to 'testsuites/samples') diff --git a/testsuites/samples/ChangeLog b/testsuites/samples/ChangeLog index 2070703fcc..01d7b785f1 100644 --- a/testsuites/samples/ChangeLog +++ b/testsuites/samples/ChangeLog @@ -1,3 +1,8 @@ +2008-04-17 Joel Sherrill + + * fileio/init.c, hello/system.h, minimum/init.c, unlimited/system.h: + Use CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER where needed. + 2008-02-28 Joel Sherrill * iostream/init.cc: Add include of stdlib.h for exit(). Needed by gcc diff --git a/testsuites/samples/fileio/init.c b/testsuites/samples/fileio/init.c index b8db7ed1ae..982ac6e9e4 100644 --- a/testsuites/samples/fileio/init.c +++ b/testsuites/samples/fileio/init.c @@ -99,13 +99,60 @@ fstab_t fs_table[] = { #ifdef USE_SHELL #include +void writeScript( + const char *name, + const char *contents +) +{ + int sc; + sc = setuid(0); + if ( sc ) { + printf( "setuid failed: %s:\n", name, strerror(errno) ); + } + + rtems_shell_write_file( name, contents ); + sc = chmod ( name, 0777 ); + if ( sc ) { + printf( "chmod %s: %s:\n", name, strerror(errno) ); + } +} + void fileio_start_shell(void) { + int sc; + sc = mkdir("/scripts", 0777); + if ( sc ) { + printf( "mkdir /scripts: %s:\n", strerror(errno) ); + } + + writeScript( + "/scripts/js", + "#! joel\n" + "\n" + "date\n" + "echo Script successfully ran\n" + "date\n" + "stackuse\n" + ); + + writeScript( + "/scripts/j1", + "#! joel -s 20480 -t JESS\n" + "stackuse\n" + ); + + rtems_shell_write_file( + "/scripts/j2", + "echo j2 TEST FILE\n" + "echo j2 SHOULD BE non-executable AND\n" + "echo j2 DOES NOT have the magic first line\n" + ); + printf(" =========================\n"); printf(" starting shell\n"); printf(" =========================\n"); rtems_shell_init("SHLL",RTEMS_MINIMUM_STACK_SIZE * 4,100,"/dev/console", - 0, 0); + 0, 1); rtems_task_suspend(RTEMS_SELF); } diff --git a/testsuites/samples/hello/system.h b/testsuites/samples/hello/system.h index e738b1a631..a4ac1a5a8b 100644 --- a/testsuites/samples/hello/system.h +++ b/testsuites/samples/hello/system.h @@ -25,6 +25,8 @@ rtems_task Init( #include /* for device driver prototypes */ +/* NOTICE: the clock driver is explicitly disabled */ +#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_MAXIMUM_TASKS 1 diff --git a/testsuites/samples/minimum/init.c b/testsuites/samples/minimum/init.c index 67988fb04c..ea95d8ba1d 100644 --- a/testsuites/samples/minimum/init.c +++ b/testsuites/samples/minimum/init.c @@ -23,6 +23,9 @@ rtems_task Init( #define CONFIGURE_RTEMS_INIT_TASKS_TABLE #define CONFIGURE_MAXIMUM_TASKS 1 +/* NOTICE: the clock driver is explicitly disabled */ +#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER + /* * This is the smallest IO subsystem RTEMS currently supports. */ diff --git a/testsuites/samples/unlimited/system.h b/testsuites/samples/unlimited/system.h index 5925d43202..6412300010 100644 --- a/testsuites/samples/unlimited/system.h +++ b/testsuites/samples/unlimited/system.h @@ -42,6 +42,8 @@ void test3(); #include /* for device driver prototypes */ +/* NOTICE: the clock driver is explicitly disabled */ +#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_RTEMS_INIT_TASKS_TABLE -- cgit v1.2.3