Как создать IDT с помощью LIDT Я работаю на Intel-Atom 32bit (Assembly AT & T).Я использую MocroC OSII в качестве ОС, я сделал это, но он не работает:
Load_IDT:
push %ebp //save the context to swith back
mov %esp,%ebp
movw $256*8, -6(%esp) //256 ISR possible
movl $IDT, -4(%esp) //IDT is a table of 256*8bytes
lidt -6(%esp)
pop %ebp //Return to the calling function
ret
static void fill_interrupt(unsigned char num, unsigned int base, unsigned short sel, unsigned char flags)
{
unsigned short *Interrupt_Address;
/*address = idt_ptr.base + num * 8 byte*/
Interrupt_Address = (unsigned short *)(idt_ptr.base + num*8);
*(Interrupt_Address) = base&0xFFFF;
*(Interrupt_Address+1) = sel;
*(Interrupt_Address+1) = (flags>>4)&0xFF00;
*(Interrupt_Address+1) = (base>>16)&0xFFFF;
}
/*Change the address of idt_entries table */
fill_interrupt(ISR_Nbr,(unsigned int) isr33, 0x08, 0x8E);