OSDev.org

The Place to Start for Operating System Developers
It is currently Sun Jan 21, 2018 4:51 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: model specific registers's realted questions
PostPosted: Mon Jun 12, 2017 12:32 am 
Offline
User avatar

Joined: Sat May 06, 2017 11:35 am
Posts: 10
1)what happens when tring to modifiing the Time Stamp Counter or the Performance Counter registers using WRMSR ? , does their bits even change ? , does an exeption is raised ? how can I change their values if I wanted to ?

2)What are the 'MCA Extended State Registers' (index 0x180 - 0x197), are they just another way to access the general perpuse registers?

3)Does modifing the 'mpref' register(Index 0xe7) actually modifing the proccessor's frequency?


Sources:
http://sandpile.org/x86/msr.htm
http://wiki.osdev.org/Model_Specific_Registers

_________________
Restart any PC in the easy way around:

mov eax,cr0
xor al,1
mov cr0,eax
lidt [illegal_idtr]
jmp 0:$

; done:)


Top
 Profile  
 
 Post subject: Re: model specific registers's realted questions
PostPosted: Mon Jun 12, 2017 1:00 am 
Offline
Member
Member
User avatar

Joined: Sat Jan 15, 2005 12:00 am
Posts: 8201
Location: At his keyboard!
Hi,

EladAshkcenazi335 wrote:
1)what happens when tring to modifiing the Time Stamp Counter or the Performance Counter registers using WRMSR ? , does their bits even change ? , does an exeption is raised ? how can I change their values if I wanted to ?


You'd change their values by writing to them (using the WRMSR instruction).

EladAshkcenazi335 wrote:
2)What are the 'MCA Extended State Registers' (index 0x180 - 0x197), are they just another way to access the general perpuse registers?


They would contain the values that were in various registers when a machine check exception occurred (e.g. when the last hardware failure occured) and wouldn't contain the values that are currently in those registers.

EladAshkcenazi335 wrote:
3)Does modifing the 'mpref' register(Index 0xe7) actually modifing the proccessor's frequency?


No. For some CPUs (most Intel CPUs?) if you write any value to this MSR the time stamp counter is set to zero (regardless of which value you wrote) and it has no effect on CPU frequency.

Note that all of these are Model Specific Registers, which means that they're model specific, and may not exist and/or may have completely different behaviour on different CPUs.

Also; I'd strongly recommend using Intel's manuals for MSRs on Intel's CPUs and AMD's manuals for MSRs on AMD CPUs; and NOT using recycled information from any other source (sandpile, our wiki) for anything more than a quick introduction.


Cheers,

Brendan

_________________
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.


Top
 Profile  
 
 Post subject: Re: model specific registers's realted questions
PostPosted: Tue Jun 13, 2017 6:19 am 
Offline
User avatar

Joined: Sat May 06, 2017 11:35 am
Posts: 10
Thanks Brendan:)

_________________
Restart any PC in the easy way around:

mov eax,cr0
xor al,1
mov cr0,eax
lidt [illegal_idtr]
jmp 0:$

; done:)


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