Hi,
I am reading the source code of xv6(
http://pdos.csail.mit.edu/6.828/2011/xv6.html) recently, which can handle multiple processors. Something confuses me.
In its
mpinit function there is a snippet:
Code:
if(mp->imcrp){
// Bochs doesn't support IMCR, so this doesn't run on Bochs.
// But it would on real hardware.
outb(0x22, 0x70); // Select IMCR
outb(0x23, inb(0x23) | 1); // Mask external interrupts.
}
It searches for the MP floating pointer structure(the mp variable) and then find whether there is IMCR. And if there is, which means we are in PIC mode, set the IMCR 0x1. What confuses me is the comment
Mask external interrupts . From MP spec, I learn that setting the IMCR 0x1 is one step jumping from PIC mode to Symmetric I/O mode, making the CPU receiving IRQs from local APIC, not directly from 8259A PIC. Does this have something to do with masking external interrupts? Do I miss something or there is something wrong with the comment?
Hope someone could help me. Thanks in advance.
Addition:
When boot, the local APIC is software disabled, so some IRQs cannot be handled. Maybe the comment refer to this???