【发布时间】:2014-01-04 22:13:35
【问题描述】:
我有带保护模式开关和 Vesa 初始化的 VBR。但是我在另一种情况下看到了这个问题。当内核有3个扇区时,将其加载到内存中并跳转到0x7E00是没有问题的。但是当内核有 4 个或更多扇区时,它的代码停止工作......当我删除了长内核的一些功能以将内核的长度截断为 3 个扇区时 - 代码开始工作。
mov dl, 0x80 ; 80 - FF => HardDisk
mov ah, 0x42
mov si, .kernelStruct
int 0x13
...
.kernelStruct:
dw 16 ; byte of structure length + empty byte
dw sectorsForLoad ; sectors for load count
dd Kernel ; out address
dq 1 ; start sector
...
times 510-($-$$) db 0
dw 0xAA55
; kernel code from 0x7E00
times 512 - (($-$$) % 512) db 0
sectorsForLoad equ ($-$$-512) / 512
为什么以及我能做什么?谢谢。
【问题讨论】: