Reading model specific registers (MSRs)

xtknight

Elite Member
Oct 15, 2004
12,974
0
71
It seems like this should be a fairly straightforward operation. So here is the inline x86 asm code I'm trying. I move 10h (IA32_TIME_STAMP_COUNTER) into the ecx register, which is supposed to be TSC (time stamp counter). Yeah, I know, I could just use rdtsc, but eventually I'm going to read another MSR so I wanted to test it with this first.

Why oh why does it crash? The rdtsc function below it is fine. ReadMSR() crashes right after the 'rdmsr' asm operation is called.
 

xtknight

Elite Member
Oct 15, 2004
12,974
0
71
Well, apparently in Windows NT you need to write a kernel-mode driver to access MSRs. In Linux, super-user mode is enough. Does Windows NT expose an API so I can get MSRs?