summaryrefslogtreecommitdiffstats
path: root/hello
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-08-06 20:25:58 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-08-06 20:25:58 +0000
commit3083373e471be76b1624e0583c5a3f2f455d41c1 (patch)
treee7d15e5fdeb23587043f57d57fb0de6f399dbbbc /hello
downloadrtems-examples-3083373e471be76b1624e0583c5a3f2f455d41c1.tar.bz2
Initial import of reorganized examples.initialbase
Diffstat (limited to 'hello')
-rw-r--r--hello/Makefile14
-rw-r--r--hello/both_hello/.cvsignore1
-rw-r--r--hello/both_hello/Makefile27
-rw-r--r--hello/both_hello/test.c42
-rw-r--r--hello/hello_world_c/.cvsignore1
-rw-r--r--hello/hello_world_c/Makefile27
-rw-r--r--hello/hello_world_c/test.c35
-rw-r--r--hello/posix_hello_world/.cvsignore1
-rw-r--r--hello/posix_hello_world/Makefile27
-rw-r--r--hello/posix_hello_world/test.c34
10 files changed, 209 insertions, 0 deletions
diff --git a/hello/Makefile b/hello/Makefile
new file mode 100644
index 0000000..9f3b0c3
--- /dev/null
+++ b/hello/Makefile
@@ -0,0 +1,14 @@
+#
+# $Id$
+#
+
+include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
+include $(RTEMS_CUSTOM)
+include $(RTEMS_ROOT)/make/directory.cfg
+
+SUBDIRS=hello_world_c
+
+# If the POSIX API isn't enabled, we can't build these
+ifeq ($(RTEMS_HAS_POSIX_API),yes)
+SUBDIRS += posix_hello_world both_hello
+endif
diff --git a/hello/both_hello/.cvsignore b/hello/both_hello/.cvsignore
new file mode 100644
index 0000000..fecf58a
--- /dev/null
+++ b/hello/both_hello/.cvsignore
@@ -0,0 +1 @@
+o-optimize
diff --git a/hello/both_hello/Makefile b/hello/both_hello/Makefile
new file mode 100644
index 0000000..e9d3ea2
--- /dev/null
+++ b/hello/both_hello/Makefile
@@ -0,0 +1,27 @@
+#
+# $Id$
+#
+
+#
+# RTEMS_MAKEFILE_PATH is typically set in an environment variable
+#
+
+PGM=${ARCH}/both_hello.exe
+
+# optional managers required
+MANAGERS=all
+
+# C source names
+CSRCS = test.c
+COBJS = $(CSRCS:%.c=${ARCH}/%.o)
+
+include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
+include $(RTEMS_CUSTOM)
+include $(PROJECT_ROOT)/make/leaf.cfg
+
+OBJS= $(COBJS) $(CXXOBJS) $(ASOBJS)
+
+all: ${ARCH} $(PGM)
+
+$(PGM): $(OBJS)
+ $(make-exe)
diff --git a/hello/both_hello/test.c b/hello/both_hello/test.c
new file mode 100644
index 0000000..f8947b9
--- /dev/null
+++ b/hello/both_hello/test.c
@@ -0,0 +1,42 @@
+/*
+ * Simple test program -- simplified version of sample test hello.
+ */
+
+#include <bsp.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+
+rtems_task Init(
+ rtems_task_argument ignored
+)
+{
+ printf( "Classic -- Hello World\n" );
+ rtems_task_delete( RTEMS_SELF );
+}
+
+void *POSIX_Init(
+ void *argument
+)
+{
+ printf( "POSIX -- Hello World\n" );
+ sleep( 1 );
+ exit( 0 );
+}
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#define CONFIGURE_MAXIMUM_TASKS 1
+#define CONFIGURE_MAXIMUM_POSIX_THREADS 1
+
+#define CONFIGURE_INIT
+
+#include <rtems/confdefs.h>
+
+/* end of file */
diff --git a/hello/hello_world_c/.cvsignore b/hello/hello_world_c/.cvsignore
new file mode 100644
index 0000000..fecf58a
--- /dev/null
+++ b/hello/hello_world_c/.cvsignore
@@ -0,0 +1 @@
+o-optimize
diff --git a/hello/hello_world_c/Makefile b/hello/hello_world_c/Makefile
new file mode 100644
index 0000000..9fe9919
--- /dev/null
+++ b/hello/hello_world_c/Makefile
@@ -0,0 +1,27 @@
+#
+# $Id$
+#
+
+#
+# RTEMS_MAKEFILE_PATH is typically set in an environment variable
+#
+
+PGM=${ARCH}/hello.exe
+
+# optional managers required
+MANAGERS=all
+
+# C source names
+CSRCS = test.c
+COBJS = $(CSRCS:%.c=${ARCH}/%.o)
+
+include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
+include $(RTEMS_CUSTOM)
+include $(PROJECT_ROOT)/make/leaf.cfg
+
+OBJS= $(COBJS) $(CXXOBJS) $(ASOBJS)
+
+all: ${ARCH} $(PGM)
+
+$(PGM): $(OBJS)
+ $(make-exe)
diff --git a/hello/hello_world_c/test.c b/hello/hello_world_c/test.c
new file mode 100644
index 0000000..d9354f7
--- /dev/null
+++ b/hello/hello_world_c/test.c
@@ -0,0 +1,35 @@
+/*
+ * Simple test program -- simplified version of sample test hello.
+ *
+ * $Id$
+ */
+
+#include <bsp.h>
+
+#include <stdlib.h>
+#include <stdio.h>
+
+rtems_task Init(
+ rtems_task_argument ignored
+)
+{
+ printf( "\n\n*** HELLO WORLD TEST ***\n" );
+ printf( "Hello World\n" );
+ printf( "*** END OF HELLO WORLD TEST ***\n" );
+ exit( 0 );
+}
+
+/* configuration information */
+
+/* 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
+#define CONFIGURE_MAXIMUM_TASKS 1
+
+#define CONFIGURE_INIT
+
+#include <rtems/confdefs.h>
+
+/* end of file */
diff --git a/hello/posix_hello_world/.cvsignore b/hello/posix_hello_world/.cvsignore
new file mode 100644
index 0000000..fecf58a
--- /dev/null
+++ b/hello/posix_hello_world/.cvsignore
@@ -0,0 +1 @@
+o-optimize
diff --git a/hello/posix_hello_world/Makefile b/hello/posix_hello_world/Makefile
new file mode 100644
index 0000000..bc6693f
--- /dev/null
+++ b/hello/posix_hello_world/Makefile
@@ -0,0 +1,27 @@
+#
+# $Id$
+#
+
+#
+# RTEMS_MAKEFILE_PATH is typically set in an environment variable
+#
+
+PGM=${ARCH}/posix_hello.exe
+
+# optional managers required
+MANAGERS=all
+
+# C source names
+CSRCS = test.c
+COBJS = $(CSRCS:%.c=${ARCH}/%.o)
+
+include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
+include $(RTEMS_CUSTOM)
+include $(PROJECT_ROOT)/make/leaf.cfg
+
+OBJS= $(COBJS) $(CXXOBJS) $(ASOBJS)
+
+all: ${ARCH} $(PGM)
+
+$(PGM): $(OBJS)
+ $(make-exe)
diff --git a/hello/posix_hello_world/test.c b/hello/posix_hello_world/test.c
new file mode 100644
index 0000000..0386b5b
--- /dev/null
+++ b/hello/posix_hello_world/test.c
@@ -0,0 +1,34 @@
+/*
+ * Simple test program -- simplified version of sample test hello.
+ */
+
+#include <bsp.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+
+void *POSIX_Init(
+ void *argument
+)
+{
+ printf( "\n\n*** HELLO WORLD TEST ***\n" );
+ printf( "Hello World\n" );
+ printf( "*** END OF HELLO WORLD TEST ***\n" );
+ exit( 0 );
+}
+
+/* configuration information */
+
+/* NOTICE: the clock driver is explicitly disabled */
+#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+
+#define CONFIGURE_MAXIMUM_POSIX_THREADS 1
+
+#define CONFIGURE_INIT
+
+#include <rtems/confdefs.h>
+
+/* end of file */