aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorAlex Auvolat <alex.auvolat@ens.fr>2015-02-13 20:28:54 +0100
committerAlex Auvolat <alex.auvolat@ens.fr>2015-02-13 20:28:54 +0100
commitcf0b8a52287ee7c747b1d5a7d77abdef1fb46f94 (patch)
treed06ada519003a0794d3107fea1e882b737b5a00c /src/lib
parente484c92ff08e54e7cbfdb815a5b254507dade003 (diff)
downloadkogata-cf0b8a52287ee7c747b1d5a7d77abdef1fb46f94.tar.gz
kogata-cf0b8a52287ee7c747b1d5a7d77abdef1fb46f94.zip
Reorganize code in preparation for user apps.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/include/syscall.h12
-rw-r--r--src/lib/libkogata/Makefile11
-rw-r--r--src/lib/libkogata/debug.c13
-rw-r--r--src/lib/libkogata/malloc.c11
-rw-r--r--src/lib/libkogata/start.c9
-rw-r--r--src/lib/libkogata/syscall.c10
6 files changed, 66 insertions, 0 deletions
diff --git a/src/lib/include/syscall.h b/src/lib/include/syscall.h
new file mode 100644
index 0000000..d6df4ec
--- /dev/null
+++ b/src/lib/include/syscall.h
@@ -0,0 +1,12 @@
+#pragma once
+
+#include <stddef.h>
+#include <stdint.h>
+#include <stdbool.h>
+
+#include <fs.h>
+#include <debug.h>
+
+void dbg_print(const char* str);
+void yield();
+
diff --git a/src/lib/libkogata/Makefile b/src/lib/libkogata/Makefile
new file mode 100644
index 0000000..2649e25
--- /dev/null
+++ b/src/lib/libkogata/Makefile
@@ -0,0 +1,11 @@
+OBJ = start.o malloc.o debug.o syscall.o
+
+LIB = ../../common/libkogata/libkogata.lib
+
+CFLAGS = -I ../include -I ../../common/include
+
+LDFLAGS =
+
+OUT = libkogata.lib
+
+include ../../rules.make
diff --git a/src/lib/libkogata/debug.c b/src/lib/libkogata/debug.c
new file mode 100644
index 0000000..27c9e28
--- /dev/null
+++ b/src/lib/libkogata/debug.c
@@ -0,0 +1,13 @@
+#include <stdbool.h>
+
+#include <debug.h>
+
+void panic(const char* msg, const char* file, int line) {
+ // TODO
+ while(true);
+}
+
+void panic_assert(const char* assert, const char* file, int line) {
+ // TODO
+ while(true);
+}
diff --git a/src/lib/libkogata/malloc.c b/src/lib/libkogata/malloc.c
new file mode 100644
index 0000000..c776cdf
--- /dev/null
+++ b/src/lib/libkogata/malloc.c
@@ -0,0 +1,11 @@
+#include <malloc.h>
+
+void* malloc(size_t size) {
+ // TODO
+ return 0;
+}
+
+void free(void* ptr) {
+ // TODO
+}
+
diff --git a/src/lib/libkogata/start.c b/src/lib/libkogata/start.c
new file mode 100644
index 0000000..88a4eb3
--- /dev/null
+++ b/src/lib/libkogata/start.c
@@ -0,0 +1,9 @@
+#include <stddef.h>
+#include <stdint.h>
+#include <stdbool.h>
+
+void __libkogata_start() {
+ // TODO
+ while(true);
+}
+
diff --git a/src/lib/libkogata/syscall.c b/src/lib/libkogata/syscall.c
new file mode 100644
index 0000000..234b9ff
--- /dev/null
+++ b/src/lib/libkogata/syscall.c
@@ -0,0 +1,10 @@
+#include <debug.h>
+#include <syscall.h>
+
+void dbg_print(const char* str) {
+ // TODO
+}
+
+void yield() {
+ // TODO
+}