覆盖中断向量 table 8086 没有任何反应

overriding the interrupt vector table 8086 nothing happens

我正在构建一个小型 os 作为对自己的挑战。网上看了很多文章说要override中断向量table需要改物理地址0000:interrupt number*4和0000:(interrupt number*4)+2。 我写下了一段完全可以做到这一点的代码,但是当试图在虚拟机上 运行 它时,没有任何反应。你们中的任何人都可以分享他们的知识并告诉我我错在哪里吗?这是我的代码:

mov ax,0
mov es,ax
mov ax,cs ;; set ax to the current segment
mov [es:01a6h], ax ;; change 0000:(interrupt number*4)+2
mov ax,interrupt1 ;; set ax to the offset of the interrupt  
mov [es:01a4h], ax ;; change 0000:(interrupt number*4)
int 69h
jmp $

这是中断:

interrupt1: MOV ah,09h mov al,'c' ;;; its function is to write down the letter c in red mov bx,0004 MOV cx,1 int 10h iret

我正在使用 nasm 和 Oracle Virtual box。

显然要在中断内部使用中断,您需要使用 sti 打开中断标志,因为它会自动禁用