I'm building a small os as a challenge for myself. I read many articles online saying that to override the interrupt vector table you need to change the physical address of 0000: interrupt number*4 and 0000: (interrupt number*4)+2. I wrote down a piece of code that does exactly that but when trying to run it on a virtual machine, nothing happens. Could any of you guys share their knowledge and tell what am I wrong at? this is my code:
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 $
this is the interrupt:
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
I am using nasm and Oracle Virtual box.