X-Git-Url: http://git.dujemihanovic.xyz/projects?a=blobdiff_plain;f=boot%2Fx86%2Fstage3%2Floader.s;h=b67d33894099660760e7c63fc4d471c8090f3507;hb=4ea950eb2243c099968ae328ecad99f94fca8a5b;hp=bd703bacde4700755c287e4bed7663ec0432a391;hpb=750b9e3f093f34310a05ffbac7f6b1317ef786e7;p=nameless-os.git diff --git a/boot/x86/stage3/loader.s b/boot/x86/stage3/loader.s index bd703ba..b67d338 100644 --- a/boot/x86/stage3/loader.s +++ b/boot/x86/stage3/loader.s @@ -1,6 +1,6 @@ bits 16 cpu 686 -org 0x8000 +org 0x1800 %include "../fat32/fat32-structs.s" @@ -14,15 +14,13 @@ org 0x8000 _start: mov [BOOT_DRIVE], dl call enable_unreal - print string call check_a20 jc .a20_enabled call enable_a20 jnc .a20_enable_fail .a20_enabled: - print a20_enabled call get_1st_data_sec - mov ax, 0x2000 + mov ax, 0x1000 mov es, ax mov eax, BPB_RootClus xor di, di @@ -54,11 +52,9 @@ _start: .kernel_found: pop si pop cx - print kernel_found mov ax, [es:di+dir_entry.firstclushi] shl eax, 16 mov ax, [es:di+(dir_entry.firstcluslo)] - call print_dword mov edi, 0x100000 call read_clus_chain_unreal ; load kernel @@ -88,7 +84,7 @@ read_clus_chain_unreal: push es push ax xor di, di - mov ax, 0x100 + mov ax, 0x1000 mov es, ax pop ax call read_cluster @@ -99,7 +95,7 @@ read_clus_chain_unreal: push eax push ebx push ecx - mov esi, 0x1000 + mov esi, 0x10000 xor ebx, ebx movzx eax, word BPB_BytsPerSec movzx bx, byte BPB_SecPerClus @@ -163,11 +159,8 @@ bits 32 jmp $-1 kernel_name: db "KERNEL BIN" -string: db "Hello from LOADER.BIN!", 0xd, 0xa, 0 -a20_enabled: db "A20 is enabled", 0xd, 0xa, 0 a20_fail: db "Failed to enable A20, giving up!", 0xd, 0xa, 0 crit_err: db "A critical error occurred, dumping registers now: ", 0xd, 0xa, 0 -kernel_found: db "Found kernel at cluster ", 0 missing_kernel: db "Could not find KERNEL.BIN", 0xd, 0xa, 0 eax_s: db "EAX: ", 0 ebx_s: db "EBX: ", 0