X hits on this document

13 views

0 shares

0 downloads

0 comments

4 / 6

CPSC 410/611: Operating Systems

Projects: Exceptions + Interrupts

+

Initializing the IDT

extern void isr0(); extern void isr1(); /*…*/ extern void isr31();

v o i d i n i t _ e x c e p t i o n _ d i s p a t c h e r ( ) {

/*

Add any new ISRs to the IDT here. */

idt_set_gate( 0, (unsigned) isr0, 0x08, 0x8E); idt_set_gate( 1, (unsigned) isr1, 0x08, 0x8E);

/* … */

idt_set_gate(31, (unsigned)isr31, 0x08, 0x8E);

/* Initialize high-level exception handler */ for(int i = 0; i < EXCEPTION_TABLE_SIZE; i++) {

handler_table[i] = NULL; }

}

For details of “idt_set_gate()” and installation of IDT check out the code (file “idt.c”).

+ Hardware Interrupts: The Programmable

Interrupt Controller (PIC)

! Interrupt control on PC/AT by cascaded (master/slave) pair of 8259 PICs.

! Interrupts (IRQs) are mapped to IDT entries. (Typically inconvenient ones, can be remapped.)

! Interrupt service routine must send EOI (end-of-interrupt) signal to PIC (to both picks if interrupt from slave)

4

Document info
Document views13
Page views13
Page last viewedMon Dec 05 18:54:06 UTC 2016
Pages6
Paragraphs138
Words1665

Comments