Read/Write x86 Registers
-
- Member
- Posts: 61
- Joined: Tue Sep 13, 2022 9:29 pm
- Libera.chat IRC: FunnyGuy9796
Read/Write x86 Registers
I am currently implementing APIC but have come across a minor issue where I cannot quite figure out how to read or write to registers. I know this is a basic question but I just can't figure it out.
Re: Read/Write x86 Registers
this is how you setup the apic : https://wiki.osdev.org/APIC
after that, you will have the physical lapic address that you can just read/write to like normal RAM.
after that, you will have the physical lapic address that you can just read/write to like normal RAM.
-
- Member
- Posts: 5563
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Read/Write x86 Registers
Which registers are you talking about? There are a lot of those!FunnyGuy9796 wrote:I am currently implementing APIC but have come across a minor issue where I cannot quite figure out how to read or write to registers.
If you mean the APIC registers, by default they're ordinary MMIO. The ACPI MADT will tell you the address. If you enable x2APIC mode, they're MSRs instead, and you can access them using RDMSR and WRMSR.