OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 12:35 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Writing to a Register in C
PostPosted: Tue Jan 10, 2023 11:06 am 
Offline
Member
Member

Joined: Tue Sep 13, 2022 9:29 pm
Posts: 61
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:
write_reg(0xF0, ReadRegister(0xF0) | 0x100);


Help would be much appreciated!


Top
 Profile  
 
 Post subject: Re: Writing to a Register in C
PostPosted: Tue Jan 10, 2023 11:20 am 
Offline
Member
Member

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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], Sa41848 and 98 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