Bootloader: Fix bootloader on bochs
Bochs int 0x10 seems to scrap full ebp and top bits in some registers. I now save all 32-bit registers on call frame. Also ebp is across all int 0x10 calls.
This commit is contained in:
parent
50ca2ac09e
commit
2a68df81e2
|
@ -57,11 +57,7 @@ vesa_scan_kernel_image:
|
||||||
|
|
||||||
# Find suitable video mode and save it in (vesa_target_mode)
|
# Find suitable video mode and save it in (vesa_target_mode)
|
||||||
vesa_find_video_mode:
|
vesa_find_video_mode:
|
||||||
pushw %ax
|
pushal
|
||||||
pushw %bx
|
|
||||||
pushw %cx
|
|
||||||
pushw %di
|
|
||||||
pushl %esi
|
|
||||||
|
|
||||||
pushl %ebp
|
pushl %ebp
|
||||||
movl %esp, %ebp
|
movl %esp, %ebp
|
||||||
|
@ -87,7 +83,7 @@ vesa_find_video_mode:
|
||||||
# get vesa information
|
# get vesa information
|
||||||
movw $0x4F00, %ax
|
movw $0x4F00, %ax
|
||||||
movw $vesa_info_buffer, %di
|
movw $vesa_info_buffer, %di
|
||||||
int $0x10
|
pushl %ebp; int $0x10; popl %ebp # BOCHS doesn't seem to reserve ebp
|
||||||
cmpb $0x4F, %al; jne .vesa_unsupported
|
cmpb $0x4F, %al; jne .vesa_unsupported
|
||||||
cmpb $0x00, %ah; jne .vesa_error
|
cmpb $0x00, %ah; jne .vesa_error
|
||||||
|
|
||||||
|
@ -109,7 +105,7 @@ vesa_find_video_mode:
|
||||||
movw $0x4F01, %ax
|
movw $0x4F01, %ax
|
||||||
movw (%esi), %cx
|
movw (%esi), %cx
|
||||||
movw $vesa_mode_info_buffer, %di
|
movw $vesa_mode_info_buffer, %di
|
||||||
int $0x10
|
pushl %ebp; int $0x10; popl %ebp # BOCHS doesn't seem to reserve ebp
|
||||||
cmpb $0x4F, %al; jne .vesa_unsupported
|
cmpb $0x4F, %al; jne .vesa_unsupported
|
||||||
cmpb $0x00, %ah; jne .vesa_error
|
cmpb $0x00, %ah; jne .vesa_error
|
||||||
|
|
||||||
|
@ -146,11 +142,7 @@ vesa_find_video_mode:
|
||||||
|
|
||||||
.vesa_find_video_mode_loop_modes_done:
|
.vesa_find_video_mode_loop_modes_done:
|
||||||
leavel
|
leavel
|
||||||
popl %esi
|
popal
|
||||||
popw %di
|
|
||||||
popw %cx
|
|
||||||
popw %bx
|
|
||||||
popw %ax
|
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.vesa_unsupported:
|
.vesa_unsupported:
|
||||||
|
@ -180,14 +172,14 @@ vesa_set_video_mode:
|
||||||
|
|
||||||
movw $0x4F02, %ax
|
movw $0x4F02, %ax
|
||||||
orw $0x4000, %bx
|
orw $0x4000, %bx
|
||||||
int $0x10
|
pushl %ebp; int $0x10; popl %ebp # BOCHS doesn't seem to reserve ebp
|
||||||
|
|
||||||
jmp .set_video_done
|
jmp .set_video_done
|
||||||
|
|
||||||
.vesa_set_target_mode_generic:
|
.vesa_set_target_mode_generic:
|
||||||
movb $0x03, %al
|
movb $0x03, %al
|
||||||
movb $0x00, %ah
|
movb $0x00, %ah
|
||||||
int $0x10
|
pushl %ebp; int $0x10; popl %ebp # BOCHS doesn't seem to reserve ebp
|
||||||
|
|
||||||
.set_video_done:
|
.set_video_done:
|
||||||
popw %bx
|
popw %bx
|
||||||
|
|
Loading…
Reference in New Issue