aboutsummaryrefslogtreecommitdiff
path: root/kernel/main.dats
diff options
context:
space:
mode:
authorXander <xander@biltopia.org>2023-07-14 17:16:54 +0200
committerXander <xander@biltopia.org>2023-07-14 17:16:54 +0200
commit5ad68a0c087d21fa1d0f82bea1550169f1e4c1aa (patch)
treef9d68644254e60926e568071cfbd5fcd2dc1ad5b /kernel/main.dats
parent059b5ba286b3fef4d01c3ced9cd829ace5dd6340 (diff)
downloadats-os-5ad68a0c087d21fa1d0f82bea1550169f1e4c1aa.tar.xz
ats-os-5ad68a0c087d21fa1d0f82bea1550169f1e4c1aa.zip
Preparing for multiboot information
Diffstat (limited to 'kernel/main.dats')
-rw-r--r--kernel/main.dats29
1 files changed, 27 insertions, 2 deletions
diff --git a/kernel/main.dats b/kernel/main.dats
index d6e29f4..b35387f 100644
--- a/kernel/main.dats
+++ b/kernel/main.dats
@@ -1,6 +1,11 @@
#include "./prelude/kernel_prelude.hats"
+#define ATS_DYNLOADFLAG 0
+
staload "kernel/interrupts/idt.sats"
+staload "lib/SATS/writer.sats"
+
+staload UN = "prelude/SATS/unsafe.sats"
%{^
void breakpoint(){
@@ -8,10 +13,29 @@ staload "kernel/interrupts/idt.sats"
}
%}
+extern castfn char_arr2string {n:nat} (arr : &(@[char][n])) : string n
+
extern fun breakpoint() :void = "mac#"
-implement main0 () = (
+extern fun main(p : ptr) : void = "ext#"
+implement main(p) = let
+ prval size = $UN.ptr0_get<strptr>(ptr_add<uint8>(p,
+ 8 +
+ 16 +
+ 16 +
+ 4 + 4
+ (* 16 + *)
+ (* 8 + *)
+ (* 32 + *)
+ (* 16 + 24 + 24 + 24 + 24 + 24 + 48 + // memory map *)
+ (* 792 + // elf *)
+ (* 4 + 4 + 4 *)
+ ))
+in
+
+ clear_screen();
println!("Start");
+ (* println!(size); *)
// Initialize interrupt table
idt_init();
@@ -20,4 +44,5 @@ implement main0 () = (
breakpoint();
println!("End");
-)
+
+end