aboutsummaryrefslogtreecommitdiffstats
path: root/initrd
diff options
context:
space:
mode:
Diffstat (limited to 'initrd')
-rw-r--r--initrd/Makefile16
-rw-r--r--initrd/hello1
-rwxr-xr-xinitrd/initbin0 -> 12524 bytes
-rw-r--r--initrd/init.c14
-rwxr-xr-xinitrd/testbin37024 -> 0 bytes
-rw-r--r--initrd/test.c16
6 files changed, 25 insertions, 22 deletions
diff --git a/initrd/Makefile b/initrd/Makefile
index 705ac6c..5946eee 100644
--- a/initrd/Makefile
+++ b/initrd/Makefile
@@ -1,6 +1,12 @@
+##
+# A simple Makefile for building executables loadable by stmos.
+#
+
+ARCH = arm-stmos-
+CC = gcc -mcpu=cortex-m4 -mthumb -fsigned-char
+CFLAGS = -Os -fPIE
+
all:
- @arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -fsigned-char -Os \
- -nostdinc -nostdlib \
- -fdata-sections -ffunction-sections -Wl,--gc-sections \
- -I../src/pdclib/include -I../src/pdclib/platform/stmos/include \
- test.c ../src/pdclib/pdclib.a -s -o test
+ @$(ARCH)$(CC) $(CFLAGS) init.c -o init
+ @arm-stmos-strip init
+
diff --git a/initrd/hello b/initrd/hello
deleted file mode 100644
index 5d437a5..0000000
--- a/initrd/hello
+++ /dev/null
@@ -1 +0,0 @@
-Hello, world!!
diff --git a/initrd/init b/initrd/init
new file mode 100755
index 0000000..3bc5fd8
--- /dev/null
+++ b/initrd/init
Binary files differ
diff --git a/initrd/init.c b/initrd/init.c
new file mode 100644
index 0000000..5ff4ae5
--- /dev/null
+++ b/initrd/init.c
@@ -0,0 +1,14 @@
+/**
+ * @file test.c
+ * Basic userland code to be loaded by stmos for program load testing.
+ */
+
+#include <stdio.h>
+
+int main(void)
+{
+ printf("Hello, world!\n");
+ while (1);
+ return 0;
+}
+
diff --git a/initrd/test b/initrd/test
deleted file mode 100755
index 7bf8246..0000000
--- a/initrd/test
+++ /dev/null
Binary files differ
diff --git a/initrd/test.c b/initrd/test.c
deleted file mode 100644
index b79f315..0000000
--- a/initrd/test.c
+++ /dev/null
@@ -1,16 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-
-int main(void);
-
-void _start(void)
-{
- exit(main());
-}
-
-int main(void)
-{
- printf("Hello, world!\n");
- return 0;
-}
-