Hello all,
I have assigned the interrupt handler to the IDT and i'm unable to call the interrupt. I've written an interrupt that displays the character 'A' in the screen. But, i'm unable to call the interrupt. I use Bochs for windows simulater and I receive the error message, " getHostMemAddr vetoed direct read, pAddr=0xa0000". I've given the coding to install the interrupt, the idt and the protected mode coding. Please, help me out of this problem.
----------------------------------------
installs the interrupt handler address:
mov eax, demo_int
mov [offset0_15], ax
shr eax, 16
mov [offset16_31], ax
lidt [idt_descriptor]
----------------------------------
gdt:
null_descriptor:
dw 0
dw 0
db 0
db 0
db 0
db 0
code_descriptor:
dw 0xFFFF
dw 0
db 0
db 0x9A
db 0xCF
db 0
data_descriptor:
dw 0xFFFF
dw 0
db 0
db 0x92
db 0xCF
db 0
video_descriptor:
dw 0x00EF
dw 0xB800
db 0
db 0x92
db 0xCF
db 0
gdt_end:
gdt_descriptor:
dw gdt_end - gdt - 1
dd gdt
----------------------------------------
idt:
offset0_15 dw 0
selector0_15 dw 08h
zero_byte db 0
iflags db 8eh
offset16_31 dw 0
idt_end:
idt_descriptor:
dw idt_end - idt - 1
dd idt
----------------------------------------
demo_int:
push ds
mov ax, 10h
mov ds, ax
mov byte [0xb8000], 'A'
mov byte [0xb8001], 1Bh
pop ds
iretd
----------------------------------------
start32:
sti
int 0h
hlt
Thank you.
An Interesting Error
RE:An Interesting Error
Since there is no backards jump after the HLT, when the interrupt comes the processor will handle it, leave the halt, and execute zeros until the instruction pointer hits 0xA0000, the start of the VGA's area. Since the vga says "Everything is between 0xB8000 and 0xC0000 (default textmode values), so no, cpu, you CANT have the byte at 0xA0000" the Bochs CPU complains loudly. Add a "jmp $-1" insn at the end to fix this (jumps to 1 byte before start of jump == start of halt).