OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 3:13 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Read/Write x86 Registers
PostPosted: Sat Oct 29, 2022 1:24 pm 
Offline
Member
Member

Joined: Tue Sep 13, 2022 9:29 pm
Posts: 61
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.


Top
 Profile  
 
 Post subject: Re: Read/Write x86 Registers
PostPosted: Sat Oct 29, 2022 1:57 pm 
Offline
Member
Member

Joined: Fri Feb 11, 2022 4:55 am
Posts: 435
Location: behind the keyboard
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.


Top
 Profile  
 
 Post subject: Re: Read/Write x86 Registers
PostPosted: Sat Oct 29, 2022 2:00 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5099
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.

Which registers are you talking about? There are a lot of those!

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.


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 73 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