Skip to content
Snippets Groups Projects
Commit b0cdfe51 authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Fixes for bootloader unreal loading

parent 30301ee0
No related branches found
No related tags found
No related merge requests found
...@@ -21,7 +21,7 @@ boot: ; dl comes with disk ...@@ -21,7 +21,7 @@ boot: ; dl comes with disk
mov bh, 0 mov bh, 0
mov bl, [disk] mov bl, [disk]
mov ax, (startup_start - boot) / 512 mov eax, (startup_start - boot) / 512
mov bx, startup_start mov bx, startup_start
mov cx, (startup_end - startup_start) / 512 mov cx, (startup_end - startup_start) / 512
xor dx, dx xor dx, dx
...@@ -58,11 +58,14 @@ load: ...@@ -58,11 +58,14 @@ load:
jmp load jmp load
.good_size: .good_size:
mov [DAPACK.addr], ax mov [DAPACK.addr], eax
mov [DAPACK.buf], bx mov [DAPACK.buf], bx
mov [DAPACK.count], cx mov [DAPACK.count], cx
mov [DAPACK.seg], dx mov [DAPACK.seg], dx
; mov bx, [DAPACK.addr + 2]
; call print_num
;
; mov bx, [DAPACK.addr] ; mov bx, [DAPACK.addr]
; call print_num ; call print_num
; ;
......
...@@ -23,7 +23,7 @@ kernel_base equ 0x100000 ...@@ -23,7 +23,7 @@ kernel_base equ 0x100000
; how often do we need to call load and move memory ; how often do we need to call load and move memory
mov ecx, kernel_file.length_sectors / buffer_size_sectors mov ecx, kernel_file.length_sectors / buffer_size_sectors
mov ax, (kernel_file - boot) / 512 mov eax, (kernel_file - boot) / 512
mov edi, kernel_base mov edi, kernel_base
cld cld
.lp: .lp:
...@@ -35,19 +35,21 @@ kernel_base equ 0x100000 ...@@ -35,19 +35,21 @@ kernel_base equ 0x100000
mov bx, kernel_file mov bx, kernel_file
mov dx, 0x0 mov dx, 0x0
push ax push edi
push eax
call load call load
; moving buffer ; moving buffer
call unreal call unreal
pop ax pop eax
pop edi
mov esi, kernel_file mov esi, kernel_file
mov ecx, buffer_size_bytes / 4 mov ecx, buffer_size_bytes / 4
a32 rep movsd a32 rep movsd
; preparing next iteration ; preparing next iteration
add ax, buffer_size_sectors add eax, buffer_size_sectors
pop cx pop cx
loop .lp loop .lp
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment