OSDev.org
https://forum.osdev.org/

Remapping and masking all IRQs instead of just disabling PIC
https://forum.osdev.org/viewtopic.php?f=8&t=29117
Page 1 of 1

Author:  Roman [ Mon Mar 09, 2015 10:15 am ]
Post subject:  Remapping and masking all IRQs instead of just disabling PIC

The APIC wiki page states, that IRQs must be remapped and masked. On the other hand, the PIC wiki page states, that the PIC can be disabled by sending two bytes 0xFF to I/O ports 0xA1 and 0x21. My question is, is it enough to just use the PIC page method or should I also do, what's suggested by the APIC page?

Author:  LegendDairy [ Mon Mar 09, 2015 4:50 pm ]
Post subject:  Re: Remapping and masking all IRQs instead of just disabling

You should first remap the pick and then mask all interrupts, the code on the PIC page, ie sending the two bytes 0xFF to I/O ports 0xA1 and 0x21, is actually just masking all interrupts on both PICs (the master and the slave)(There are actually two pics cascaded, 0x21 is the data port for the master, 0xA1 is the data port for the slave).

You should always first remap the pic so that any IRQ that is fired before that you mask the IRQs won't fire an interrupt , mapped in the 0x08 to 0x0F range, when you enable interrupts , which would cause a double (or tripple if you don't have a valid IDT yet) fault because 0x00->0x1FF are reserved. I used to just mask all the interrupts, but that so;etimes caused random double faults at boot.

Author:  Roman [ Tue Mar 10, 2015 12:23 am ]
Post subject:  Re: Remapping and masking all IRQs instead of just disabling

Thanks for help! I think, I'll edit the PIC page.
Quote:
I used to just mask all the interrupts, but that so;etimes caused random double faults at boot.

That's because it fires spurious interrupts.

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/