有没有办法读取所有CPU的系列号,是否每个CPU都有系列号

解决方案 »

  1.   

    http://www.csdn.net/develop/Article/14/14271.shtm
      

  2.   

    #include <stdio.h>
    #include <conio.h>
    int main(int argc,char **argv)
    {
      unsigned long s1,s2;
      unsigned char vendor_id[]="------------";
      char sel;
      printf("Select the function:\n1-------Read CPU id.\n2-------Disable CPU id.\n");
      sel=getch();
      switch(sel)
      {
        case '1':
          __asm{
            xor eax,eax
            cpuid
            mov dword ptr vendor_id,ebx
            mov dword ptr vendor_id[+4],edx
            mov dword ptr vendor_id[+8],ecx
          }
          printf("%s-",vendor_id);
          __asm{
            mov eax,01h
            xor edx,edx
            cpuid
            mov s1,edx
            mov s2,eax
          }
          printf("%08X\n%08X-",s1,s2);
          __asm{
            mov eax,03h
            xor ecx,ecx
            xor edx,edx
            cpuid
            mov s1,edx
            mov s2,ecx
          }
          printf("%08X-%08X\n",s1,s2);
          break;
        case '2':
          {
          __asm{
            mov ecx,119h
            rdmsr
            or eax,00200000h
            wrmsr
          }
          }
          printf("CPU id is disabled.\n");
          break;
        }
      return 0;
    }
      

  3.   

    这个没有试过。不过可以用GETCPULASS来试一下,
      

  4.   

    to wistaria(听风听雨):
        这个程序对于非X86CPU能不能用呢。