aboutsummaryrefslogtreecommitdiff
path: root/kernel/main.dats
diff options
context:
space:
mode:
authorXander <xander@biltopia.org>2023-07-15 00:31:51 +0200
committerXander <xander@biltopia.org>2023-07-15 00:31:51 +0200
commitab383485291164f7bc78b88787271dd1b85c0d73 (patch)
tree2c94f258cda82214bf1834a56571d3b8487f652c /kernel/main.dats
parent5ad68a0c087d21fa1d0f82bea1550169f1e4c1aa (diff)
downloadats-os-ab383485291164f7bc78b88787271dd1b85c0d73.tar.xz
ats-os-ab383485291164f7bc78b88787271dd1b85c0d73.zip
Boot info memory mapping implementation
Diffstat (limited to 'kernel/main.dats')
-rw-r--r--kernel/main.dats25
1 files changed, 11 insertions, 14 deletions
diff --git a/kernel/main.dats b/kernel/main.dats
index b35387f..7e6bfe7 100644
--- a/kernel/main.dats
+++ b/kernel/main.dats
@@ -3,10 +3,14 @@
#define ATS_DYNLOADFLAG 0
staload "kernel/interrupts/idt.sats"
+staload "kernel/multiboot.sats"
staload "lib/SATS/writer.sats"
staload UN = "prelude/SATS/unsafe.sats"
+extern praxi c (p : ptr) : [l : agz] strptr l
+extern prfun eat(p : strptr) : void
+
%{^
void breakpoint(){
__asm__("int3");
@@ -17,25 +21,18 @@ extern castfn char_arr2string {n:nat} (arr : &(@[char][n])) : string n
extern fun breakpoint() :void = "mac#"
-extern fun main(p : ptr) : void = "ext#"
+extern fun main(p : Ptr1) : 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 boot info struct
+ let
+ val bootptr = boot_info_init(p)
+ prval () = bootptr.1(bootptr.0)
+ in end;
// Initialize interrupt table
idt_init();