]> git.dujemihanovic.xyz Git - nameless-os.git/blobdiff - boot/x86/stage3/loader.s
Get memory map from BIOS E820
[nameless-os.git] / boot / x86 / stage3 / loader.s
index ec08c61bd0f5d00644cf471ebe26274f93153c9e..0ca0ea6012591eaea6b0c573bfb7edb961b65eb1 100644 (file)
@@ -64,6 +64,8 @@ _start:
        call read_clus_chain_unreal ; load kernel
        print kernel_loaded
        
+       call get_e820_map
+
        cli
        lgdt [gdt]
        mov eax, cr0
@@ -151,6 +153,7 @@ memcpy:
 %include "../fat32/fat32.s"
 %include "gdt.s"
 %include "print.s"
+%include "e820.s"
 
 in_protected:
 bits 32
@@ -160,7 +163,11 @@ bits 32
        mov ss, ax
        mov fs, ax
        mov gs, ax
-       call 0x100000
+
+       call load_paging_structs
+       call enable_paging
+
+       call 0xc0000000
        hlt
        jmp $-1
 
@@ -186,3 +193,5 @@ ss_s: db "SS: ", 0
 space: db " ", 0
 hex_delm: db "0x", 0
 newline: db 0xd, 0xa, 0
+
+%include "paging.s"