Page 1 of 1

Writing to a Register in C

Posted: Tue Jan 10, 2023 11:06 am
by FunnyGuy9796
I am trying to set up the APIC and have come across an issue. I am having trouble to set the Spurious Interrupt Vector Register bit 8. I am not sure exactly how the 'write_reg' function works. I know I have asked this question before but I can't seem to figure out how to write to the register.

Code: Select all

write_reg(0xF0, ReadRegister(0xF0) | 0x100);
Help would be much appreciated!

Re: Writing to a Register in C

Posted: Tue Jan 10, 2023 11:20 am
by Octocontrabass
The wiki example code you're blindly copying uses read/write functions that automatically add the APIC base address to the given register offset.

The code in your other thread requires the full virtual address of the register.