aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/x86_64/boot/long_mode_init.asm3
-rw-r--r--kernel/bootinfo/multiboot.sats2
-rw-r--r--kernel/main.dats11
3 files changed, 11 insertions, 5 deletions
diff --git a/arch/x86_64/boot/long_mode_init.asm b/arch/x86_64/boot/long_mode_init.asm
index 22e7fd4..4b0e023 100644
--- a/arch/x86_64/boot/long_mode_init.asm
+++ b/arch/x86_64/boot/long_mode_init.asm
@@ -14,4 +14,7 @@ long_mode_start:
extern main
call main
+ extern entry
+ call entry
+
hlt
diff --git a/kernel/bootinfo/multiboot.sats b/kernel/bootinfo/multiboot.sats
index 0a0dce8..684286b 100644
--- a/kernel/bootinfo/multiboot.sats
+++ b/kernel/bootinfo/multiboot.sats
@@ -52,7 +52,7 @@ fun boot_info_init(p : Ptr1) : bootptr
fn get_memory_mappings_n {l : agz} (pf : !boot_info_t@l | p : ptr l) : [n:nat] size_t n
fn get_memory_mapping {l:agz} (pf : !boot_info_t @ l | p : ptr l, n : size_t) : memory_area_t
-fn print_memory_mappings (p : !bootptr) : void
+fn print_memory_mappings (p : !bootptr) : void // Print all available memory area's
fn get_elf_headers_n (p : !bootptr) : [n:nat] size_t n
fn get_elf_header (p : !bootptr, n : size_t) : elf64_shdr_t
diff --git a/kernel/main.dats b/kernel/main.dats
index ecbbb40..48bff24 100644
--- a/kernel/main.dats
+++ b/kernel/main.dats
@@ -1,7 +1,5 @@
#include "./prelude/kernel_prelude.hats"
-#define ATS_DYNLOADFLAG 0
-
staload "kernel/interrupts/idt.sats"
staload "kernel/bootinfo/multiboot.sats"
staload "kernel/memory/frame.sats"
@@ -36,8 +34,9 @@ end
extern fun breakpoint() :void = "mac#"
-extern fun main(p : Ptr1) : void = "ext#"
-implement main(p) = let
+
+extern fun entry(p : Ptr1) : void = "ext#"
+implement entry(p) = let
val () = clear_screen()
// Initialize boot info struct
@@ -74,3 +73,7 @@ in
end
+
+// Satisfy ats compiler. Should be called once to dynload files
+implement main(argv,argc) = 0
+