我认为BIOS中断8(定时器)应该每秒钟出现18.2次,但在qemu上却没有。请看下面的例子:
$ cat c.asm
init:
.segments:
mov ax, 0x07C0
mov ds, ax
mov ax, 0
mov fs, ax
.interrupt:
mov [fs:0x08*4], word timer
mov [fs:0x08*4+2], ds
main:
hlt
jmp main
timer:
mov ah, 0x0e
mov al, 0x41
int 0x10
iret
times 510-($-$$) db 0
dw 0xaa55
$ nasm -f bin c.asm -o c.bin && qemu-system-x86_64 c.bin
Qemu窗口出现,只显示一个"A",而不是连续出现。
如果我希望不断地收到中断8,那么我的代码有什么问题。
我使用的是nasm 1.14.02、qemu 4.2.1和ubuntu 20.04。