summaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
Diffstat (limited to 'init')
-rw-r--r--init/Makefile17
-rw-r--r--init/init.c13
-rw-r--r--init/init.obin0 -> 1672 bytes
3 files changed, 30 insertions, 0 deletions
diff --git a/init/Makefile b/init/Makefile
new file mode 100644
index 0000000..53a64ea
--- /dev/null
+++ b/init/Makefile
@@ -0,0 +1,17 @@
+CC = gcc
+CFLAGS =
+LDFLAGS = --static
+OUTPUT = init.elf
+
+SRC = init.c
+
+build: init.o
+ $(CC) $(CFLAGS) $(SRC) $(LDFLAGS) -o $(OUTPUT)
+
+.PHONY: copy clean
+
+clean:
+ rm -df $(OUTPUT)
+
+copy:
+ objcopy -O binary $(OUTPUT) ../root/init
diff --git a/init/init.c b/init/init.c
new file mode 100644
index 0000000..00836b5
--- /dev/null
+++ b/init/init.c
@@ -0,0 +1,13 @@
+#include <stdio.h>
+#include <unistd.h>
+
+int main(int argc, char* argv[])
+{
+ printf("I'm a kernel!\r\n");
+
+ while(1)
+ {
+ printf("Still running!\r\n");
+ sleep(1);
+ }
+}
diff --git a/init/init.o b/init/init.o
new file mode 100644
index 0000000..6a8fc22
--- /dev/null
+++ b/init/init.o
Binary files differ