Nyanix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | LICENSE

commit 78cd37b8bb2ba987041ddcf22bc46ce38ed6c4f4
parent b3ebd7ccbf59309b313a5c1f34cf109cc9856e0b
Author: Dani Frisk <dani@silverskin.fi>
Date:   Mon,  5 Nov 2018 13:40:21 +0200

Support for 64 Megabytes large kernels

Diffstat:
src/main/main_loader.s | 26+++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/src/main/main_loader.s b/src/main/main_loader.s @@ -21,8 +21,8 @@ kernel_entry_address equ 0x1000 -sectors_remaining db 1 ; the amount of sectors to load -kernel_sectors_loaded db 0 +sectors_remaining dw 1 ; the amount of sectors to load +kernel_sectors_loaded dw 0 main_loader: push ebp @@ -37,28 +37,28 @@ main_loader: .load_disk_loop: ; check if there is more than 15KB left to load - cmp byte [sectors_remaining], 15 + cmp word [sectors_remaining], 15 jle .final_iteration ; adjust the entry-address for load mov eax, kernel_entry_address xor ebx, ebx - mov bl, byte [kernel_sectors_loaded] + mov bx, word [kernel_sectors_loaded] imul ebx, 1024 add eax, ebx ; load next 15 Kb from disk. - mov bl, byte [boot_device_db] + mov bx, word [boot_device_db] mov cl, 15 call load_sectors - mov bl, byte [kernel_sectors_loaded] - add bl, 15 - mov byte [kernel_sectors_loaded], bl + mov bx, word [kernel_sectors_loaded] + add bx, 15 + mov word [kernel_sectors_loaded], bx - mov bl, byte [sectors_remaining] - sub bl, 15 - mov byte [sectors_remaining], bl + mov bx, word [sectors_remaining] + sub bx, 15 + mov word [sectors_remaining], bx jmp .load_disk_loop @@ -66,7 +66,7 @@ main_loader: .final_iteration: mov eax, kernel_entry_address xor ebx, ebx - mov bl, byte [kernel_sectors_loaded] + mov bx, word [kernel_sectors_loaded] imul ebx, 1024 add eax, ebx @@ -78,7 +78,7 @@ main_loader: mov esi, kernel_entry_address mov edi, 0x20000 xor ecx, ecx - mov cl, byte [kernel_sectors_loaded] + mov cx, word [kernel_sectors_loaded] imul ecx, 1024 .relocate_loop: