Reading an arbitrary MSR

Out of curiosity is there some sort of API (or other method) if a driver
requires to access an MSR? On linux one can easily read/write the
relevant file from /dev. Msdn/google search didn’t show anything relevant.

Regards

__readmsr does it

Don Burn
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

“lorddoskias” wrote in message
news:xxxxx@ntdev:

> Out of curiosity is there some sort of API (or other method) if a driver
> requires to access an MSR? On linux one can easily read/write the
> relevant file from /dev. Msdn/google search didn’t show anything relevant.
>
> Regards

“Don Burn” wrote in message news:xxxxx@ntdev…
> __readmsr does it

In kernel mode only, as MSRs are privileged registers.
Windows is not Linux.
– pa

> “lorddoskias” wrote in message news:xxxxx@ntdev:
>
>> Out of curiosity is there some sort of API (or other method) if a driver
>> requires to access an MSR? On linux one can easily read/write the
>> relevant file from /dev. Msdn/google search didn’t show anything
>> relevant.
>>
>> Regards
>
>

C:\>kd -kl -c “RDMSR 176;q” | grep -A2 -i lkd
lkd> kd: Reading initial command ‘RDMSR 176;q’
msr[176] = 00000000`8053d560
quit:

C:\>kd -kl -c “RDMSR 178;q” | grep -A2 -i lkd
lkd> kd: Reading initial command ‘RDMSR 178;q’
no such msr
quit:

C:\>kd -kl -c “RDMSR 248;q” | grep -A2 -i lkd
lkd> kd: Reading initial command ‘RDMSR 248;q’
no such msr
quit:

C:\>kd -kl -c “RDMSR 174;q” | grep -A2 -i lkd
lkd> kd: Reading initial command ‘RDMSR 174;q’
msr[174] = 00000000`00000008
quit:

C:\>

On 7/8/12, Pavel A. wrote:
> “Don Burn” wrote in message news:xxxxx@ntdev…
>> __readmsr does it
>
> In kernel mode only, as MSRs are privileged registers.
> Windows is not Linux.
> – pa
>
>> “lorddoskias” wrote in message news:xxxxx@ntdev:
>>
>>> Out of curiosity is there some sort of API (or other method) if a driver
>>> requires to access an MSR? On linux one can easily read/write the
>>> relevant file from /dev. Msdn/google search didn’t show anything
>>> relevant.
>>>
>>> Regards
>>
>>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>