Page 1 of 1

Write to Register to Receive Interrupts for APIC

Posted: Sun Oct 30, 2022 8:55 pm
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.

Re: Write to Register to Receive Interrupts for APIC

Posted: Sun Oct 30, 2022 9:33 pm
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.