OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 2:05 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Remapping and masking all IRQs instead of just disabling PIC
PostPosted: Mon Mar 09, 2015 10:15 am 
Offline
Member
Member
User avatar

Joined: Thu Mar 27, 2014 3:57 am
Posts: 568
Location: Moscow, Russia
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?

_________________
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
- Alan Kay


Top
 Profile  
 
 Post subject: Re: Remapping and masking all IRQs instead of just disabling
PostPosted: Mon Mar 09, 2015 4:50 pm 
Offline
Member
Member
User avatar

Joined: Sat Nov 06, 2010 10:42 am
Posts: 52
Location: Antwerp (Belgium)
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.


Top
 Profile  
 
 Post subject: Re: Remapping and masking all IRQs instead of just disabling
PostPosted: Tue Mar 10, 2015 12:23 am 
Offline
Member
Member
User avatar

Joined: Thu Mar 27, 2014 3:57 am
Posts: 568
Location: Moscow, Russia
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.

_________________
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
- Alan Kay


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 19 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group