Write to Register to Receive Interrupts for APIC

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
FunnyGuy9796
Member
Member
Posts: 61
Joined: Tue Sep 13, 2022 9:29 pm
Libera.chat IRC: FunnyGuy9796

Write to Register to Receive Interrupts for APIC

Post by FunnyGuy9796 »

Code: Select all

write_reg(0xF0, ReadRegister(0xF0) | 0x100);
I am a little confused on what this line is doing. It seems as though it writes the value 0x100 to the register 0xF0. I am also wondering how I would perform a task such as writing to this register as well as read from it.
Octocontrabass
Member
Member
Posts: 5563
Joined: Mon Mar 25, 2013 7:01 pm

Re: Write to Register to Receive Interrupts for APIC

Post by Octocontrabass »

FunnyGuy9796 wrote:It seems as though it writes the value 0x100 to the register 0xF0.
It sets bit 8 without modifying the other bits.
FunnyGuy9796 wrote:I am also wondering how I would perform a task such as writing to this register as well as read from it.
If you're using xAPIC or one of the ancient APICs, you access it the same as any other MMIO, and the ACPI MADT will tell you the base address. If you're using x2APIC, you access it using RDMSR/WRMSR, and the base address is 0x800.
Post Reply