[PATCH] My first RTEMS application.

Ranjan ranjan42069 at gmail.com
Tue Apr 13 08:28:36 UTC 2021


looking forward to working with RTEMS!! 
Cheers!
---
 .gitmodules |  3 +++
 hello.c     | 14 ++++++++++++++
 init.c      | 15 +++++++++++++++
 rtems_waf   |  1 +
 wscript     | 35 +++++++++++++++++++++++++++++++++++
 5 files changed, 68 insertions(+)
 create mode 100644 .gitmodules
 create mode 100644 hello.c
 create mode 100644 init.c
 create mode 160000 rtems_waf
 create mode 100644 wscript

diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..ae86e49
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "rtems_waf"]
+	path = rtems_waf
+	url = git://git.rtems.org/rtems_waf.git
diff --git a/hello.c b/hello.c
new file mode 100644
index 0000000..72d1dd4
--- /dev/null
+++ b/hello.c
@@ -0,0 +1,14 @@
+/*
+ * Hello world example
+ */
+#include <rtems.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+rtems_task Init(
+  rtems_task_argument ignored
+)
+{
+  printf( "\nHello World\n" );
+  exit( 0 );
+}
diff --git a/init.c b/init.c
new file mode 100644
index 0000000..4be8a7d
--- /dev/null
+++ b/init.c
@@ -0,0 +1,15 @@
+/*
+ * Simple RTEMS configuration
+ */
+
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+
+#define CONFIGURE_UNLIMITED_OBJECTS
+#define CONFIGURE_UNIFIED_WORK_AREAS
+
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#define CONFIGURE_INIT
+
+#include <rtems/confdefs.h>
diff --git a/rtems_waf b/rtems_waf
new file mode 160000
index 0000000..1a118bb
--- /dev/null
+++ b/rtems_waf
@@ -0,0 +1 @@
+Subproject commit 1a118bbcd52138dbdc3236e64bc23fd430a064b1
diff --git a/wscript b/wscript
new file mode 100644
index 0000000..0d6ec47
--- /dev/null
+++ b/wscript
@@ -0,0 +1,35 @@
+#
+# Hello world Waf script
+#
+from __future__ import print_function
+
+rtems_version = "6"
+
+try:
+    import rtems_waf.rtems as rtems
+except:
+    print('error: no rtems_waf git submodule')
+    import sys
+    sys.exit(1)
+
+def init(ctx):
+    rtems.init(ctx, version = rtems_version, long_commands = True)
+
+def bsp_configure(conf, arch_bsp):
+    # Add BSP specific configuration checks
+    pass
+
+def options(opt):
+    rtems.options(opt)
+
+def configure(conf):
+    rtems.configure(conf, bsp_configure = bsp_configure)
+
+def build(bld):
+    rtems.build(bld)
+
+    bld(features = 'c cprogram',
+        target = 'hello.exe',
+        cflags = '-g -O2',
+        source = ['hello.c',
+                  'init.c'])
-- 
2.20.1



More information about the devel mailing list