Fixes for bootloader unreal loading
This commit is contained in:
parent
7596648c6b
commit
c27962fd7c
|
@ -21,7 +21,7 @@ boot: ; dl comes with disk
|
|||
mov bh, 0
|
||||
mov bl, [disk]
|
||||
|
||||
mov ax, (startup_start - boot) / 512
|
||||
mov eax, (startup_start - boot) / 512
|
||||
mov bx, startup_start
|
||||
mov cx, (startup_end - startup_start) / 512
|
||||
xor dx, dx
|
||||
|
@ -58,11 +58,14 @@ load:
|
|||
|
||||
jmp load
|
||||
.good_size:
|
||||
mov [DAPACK.addr], ax
|
||||
mov [DAPACK.addr], eax
|
||||
mov [DAPACK.buf], bx
|
||||
mov [DAPACK.count], cx
|
||||
mov [DAPACK.seg], dx
|
||||
|
||||
; mov bx, [DAPACK.addr + 2]
|
||||
; call print_num
|
||||
;
|
||||
; mov bx, [DAPACK.addr]
|
||||
; call print_num
|
||||
;
|
||||
|
|
|
@ -23,7 +23,7 @@ kernel_base equ 0x100000
|
|||
; how often do we need to call load and move memory
|
||||
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
|
||||
cld
|
||||
.lp:
|
||||
|
@ -35,19 +35,21 @@ kernel_base equ 0x100000
|
|||
mov bx, kernel_file
|
||||
mov dx, 0x0
|
||||
|
||||
push ax
|
||||
push edi
|
||||
push eax
|
||||
call load
|
||||
|
||||
; moving buffer
|
||||
call unreal
|
||||
pop ax
|
||||
pop eax
|
||||
pop edi
|
||||
|
||||
mov esi, kernel_file
|
||||
mov ecx, buffer_size_bytes / 4
|
||||
a32 rep movsd
|
||||
|
||||
; preparing next iteration
|
||||
add ax, buffer_size_sectors
|
||||
add eax, buffer_size_sectors
|
||||
|
||||
pop cx
|
||||
loop .lp
|
||||
|
|
Loading…
Reference in a new issue