aboutsummaryrefslogtreecommitdiff
path: root/kernel/main.dats
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/main.dats')
-rw-r--r--kernel/main.dats29
1 files changed, 14 insertions, 15 deletions
diff --git a/kernel/main.dats b/kernel/main.dats
index 96cfdda..bbac122 100644
--- a/kernel/main.dats
+++ b/kernel/main.dats
@@ -2,7 +2,7 @@
staload "kernel/interrupts/idt.sats"
staload BOOT = "kernel/bootinfo/multiboot.sats"
-staload "kernel/memory/frame.sats"
+staload FRAME = "kernel/memory/frame.sats"
staload "lib/SATS/writer.sats"
%{^
@@ -25,11 +25,11 @@ in
i2sz(0)
end
-(* fn test(allocptr : !allocptr, bootptr : !bootptr) : void = let *)
-(* fun loop(i : int) : void = if (i < 160) then( let val _ = allocate_frame(allocptr.0, bootptr.0 | allocptr.2, bootptr.2) in end; loop(succ(i))) *)
-(* in *)
-(* loop(0) *)
-(* end *)
+fn test() : void = let
+ fun loop(i : int) : void = if (i < 160) then( let val _ = $FRAME.allocate_frame() in end; loop(succ(i)))
+in
+ loop(0)
+end
extern fun breakpoint() :void = "mac#"
@@ -39,21 +39,20 @@ extern fun entry(p : Ptr1) : void = "ext#"
implement entry(p) = let
val () = $BOOT.init(p);
val (kernel_start,kernel_end) = $BOOT.get_kernel_ranges()
- (* val (multiboot_start,multiboot_end) = get_multiboot_ranges(bootptr) *)
- (* val allocptr = frame_allocator_init(kernel_start,kernel_end,multiboot_start,multiboot_end,bootptr) *)
+ val (multiboot_start,multiboot_end) = $BOOT.get_multiboot_ranges()
+ val () = $FRAME.init(kernel_start,kernel_end,multiboot_start,multiboot_end);
in
- // Initialize boot info struct
$BOOT.print_memory_mappings();
$BOOT.print_elf_headers();
println!("Kernel Size: ", kernel_size(kernel_start,kernel_end));
- (* test(allocptr,bootptr); *)
- (* let *)
- (* val frame = allocate_frame(allocptr.0, bootptr.0 | allocptr.2, bootptr.2) *)
- (* in *)
- (* println!(frame.num) *)
- (* end; *)
+ test();
+ let
+ val frame = $FRAME.allocate_frame()
+ in
+ println!(frame.num)
+ end;
// Initialize interrupt table
idt_init();