我正在建立一个小型操作系统作为我自己的一个挑战。我在网上阅读了很多文章,说要覆盖中断向量表,您需要更改0000的物理地址:中断号* 4和0000:(中断号* 4)+2。 我写下了一段完全相同的代码,但试图在虚拟机上运行它时,没有任何反应。你们中的任何一个人可以分享他们的知识,并告诉我错在哪里?这是我的代码:重写中断向量表8086没有任何反应
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虚拟框。
'×69×4 = 0x1a4'禁用。 – Jester
注意到这是我得到之前的代码,我之前修复过它并没有帮助 –
确保您的'org'设置正确。发布完整[mcve]。 – Jester