From 4038ec5662a5b1ebe652e9170069e3f2f79c7e71 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Sat, 24 Aug 2024 00:05:47 +0200 Subject: Bootstrap the project MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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à --- include/fbos/compiler.h | 9 +++++++++ include/fbos/init.h | 8 ++++++++ include/fbos/mm.h | 16 ++++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 include/fbos/compiler.h create mode 100644 include/fbos/init.h create mode 100644 include/fbos/mm.h (limited to 'include') 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 + +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 */ -- cgit v1.2.3