X-Git-Url: http://git.dujemihanovic.xyz/%7B%7B?a=blobdiff_plain;f=boot%2Fx86%2Fstage3%2Floader.s;h=cdecbaac1b45f56740737cb355b28fefb6151863;hb=320a0c820a129a39cc6a8a383ea4e2770f3ee50b;hp=747905d704ef8bc0ae3c50921d996c3bc5ac000e;hpb=1d5cadb08919cd8d40b8303896319687540d9e0d;p=nameless-os.git diff --git a/boot/x86/stage3/loader.s b/boot/x86/stage3/loader.s index 747905d..cdecbaa 100644 --- a/boot/x86/stage3/loader.s +++ b/boot/x86/stage3/loader.s @@ -1,7 +1,7 @@ bits 16 cpu 686 -org 0x1800 +section .text %include "../fat32/fat32-structs.s" %macro print 1 @@ -11,7 +11,11 @@ org 0x1800 pop si %endmacro +extern __STACK_BOTTOM__ + +global _start _start: + mov sp, __STACK_BOTTOM__ mov [BOOT_DRIVE], dl call enable_unreal print begin @@ -147,7 +151,6 @@ memcpy: pop esi ret - %include "unreal.s" %include "a20.s" %include "../fat32/fat32.s" @@ -155,8 +158,9 @@ memcpy: %include "print.s" %include "e820.s" -in_protected: bits 32 +section .text +in_protected: mov ax, 0x10 mov ds, ax mov es, ax @@ -170,6 +174,10 @@ bits 32 jmp 0x8:0xc0000000 nop +%include "paging.s" + +section .rodata + kernel_name: db "KERNEL BIN" begin: db "Nameless Bootloader revision ", GIT_REVISION, 0xd, 0xa, 0 a20_enabled: db "A20 has been enabled", 0xd, 0xa, "Searching for kernel...", 0xd, 0xa, 0 @@ -192,5 +200,3 @@ ss_s: db "SS: ", 0 space: db " ", 0 hex_delm: db "0x", 0 newline: db 0xd, 0xa, 0 - -%include "paging.s"