assembly - CPU jumping in garbage after interrupt - Stack Overflow

I am trying to make an IDT, but when i trigger an interrupt it goes to a location i don't know. I

I am trying to make an IDT, but when i trigger an interrupt it goes to a location i don't know. I am in 32-bit protected mode using and i am using QEMU.

I have created only one entry for the moment, the entry #0 (Divide Error) and i am trying to trigger it with int 0x0

main.s

_start:
    lidt [idt_descriptor]
    sti
    int 0x0
    hlt

Interrupt Descriptor Table

idt_descriptor:
    dw idt_end - idt_start - 1
    dd idt_start

idt_start:
    dw isr_0
    dw 1 ; The code segment is 1
    db 0
    db 10001111b
    dw 0
idt_end:

Interrupt Service Routine for Interrupt #0

isr_0:
    mov eax, string
    call kprint
    iret
string: db "Inside ISR", 0

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745592505a4634918.html

相关推荐

  • assembly - CPU jumping in garbage after interrupt - Stack Overflow

    I am trying to make an IDT, but when i trigger an interrupt it goes to a location i don't know. I

    15小时前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信