aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mikisabate@gmail.com>2024-08-24 00:05:47 +0200
committerMiquel Sabaté Solà <mikisabate@gmail.com>2024-08-24 09:13:49 +0200
commit4038ec5662a5b1ebe652e9170069e3f2f79c7e71 (patch)
treec04772eba8e9b0584ccc80bea9a72dfd9f173d86 /include
downloadfbos-4038ec5662a5b1ebe652e9170069e3f2f79c7e71.tar.gz
fbos-4038ec5662a5b1ebe652e9170069e3f2f79c7e71.zip
Bootstrap the project
For now the base layout has been defined and we have a binary that is properly reached through openSBI. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/fbos/compiler.h9
-rw-r--r--include/fbos/init.h8
-rw-r--r--include/fbos/mm.h16
3 files changed, 33 insertions, 0 deletions
diff --git a/include/fbos/compiler.h b/include/fbos/compiler.h
new file mode 100644
index 0000000..edf24d1
--- /dev/null
+++ b/include/fbos/compiler.h
@@ -0,0 +1,9 @@
+#ifndef __FBOS_COMPILER_H
+#define __FBOS_COMPILER_H
+
+#define __noreturn __attribute__((__noreturn__))
+
+#define __section(s) __attribute__((__section__(s)))
+#define __kernel __section(".text.kernel")
+
+#endif /* __FBOS_COMPILER_H */
diff --git a/include/fbos/init.h b/include/fbos/init.h
new file mode 100644
index 0000000..1eeb33a
--- /dev/null
+++ b/include/fbos/init.h
@@ -0,0 +1,8 @@
+#ifndef FBOS_INIT_H
+#define FBOS_INIT_H
+
+#include <fbos/compiler.h>
+
+extern __noreturn __kernel void start_kernel(void);
+
+#endif /* FBOS_INIT_H */
diff --git a/include/fbos/mm.h b/include/fbos/mm.h
new file mode 100644
index 0000000..2b80076
--- /dev/null
+++ b/include/fbos/mm.h
@@ -0,0 +1,16 @@
+#ifndef FBOS_MM_H
+#define FBOS_MM_H
+
+/*
+ * Page = 4KB.
+ */
+#define PAGE_SIZE 0x1000
+
+/*
+ * The code will be linked to start at the first page, which will have a given
+ * offset.
+ */
+#define PAGE_OFFSET 0x80200000
+#define LINK_ADDR PAGE_OFFSET
+
+#endif /* FBOS_MM_H */