如何使用VB6.0读取BIOS中CPU的核心温度
总所周知,个人计算机会在CPU温度过高时自动断电保护,要实现这一功能首先就是要是取得CPU的核心温度。在主板的BIOS中有一项可以查看CPU核心的温度。我想通过VB6.0编写程序读取它。我尝试过网上提供的一些方法,比如:
Public Function GetCPUTemp() As Double Dim i As Integer Dim mCPU As Variant Dim u As Variant Dim s As String Set mCPU = GetObject("WINMGMTS:{impersonationLevel=impersonate}!root\wmi").ExecQuery("SELECT CurrentTemperature From MSAcpi_ThermalZoneTemperature") For Each u In mCPU s = s & u.CurrentTemperature Next Set mCPU = Nothing GetCPUTemp = (s - 2732) / 10 End Function
4--7 型号 (model)
8--11 家族 (family)
EDX=特征标志字
bit 内容 缩写
0 FPU On-chip FPU
1 Virtual Mode Extension VME
2 Debugging Extension DE
3 Page Size Extension PSE
4 Time Stamp Counter TSC
5 RDMSR/WRMSR Instructions
6 Physical Address Extension PAE
7 Machine Check Exception MCE
8 CMPXCHG8B Instruction
9 On-chip APIC HardWare
10 Undefined
11 SYSENTER/SYSEXIT Instructions
12 Memory Type Range Registers
13 Page Global Enable PGE
14 Machine Check Architecture MCA
15 Conditional Move Instruction CMI
16 Page Attribute Table PAT
17--22 Undefined
23 MMX Instructions MMX
24 internet Streaming SIMD Extensions SSE
25--31 Undefined
(2)扩展指令
1.第80000000号功能(EAX=80000000h)
调用寄存器:
EAX=80000000h
返回寄存器:
EBX,ECX,EDX=保留
EAX=最大功能号
2.第80000001号功能
调用寄存器:
EAX=80000001h
返回寄存器:
EAX=CPU说明(见第1号功能)
EDX=扩展特征标志字
EDX[0] <- FPU: FPU on Chip
EDX[1] <- VME: Virtual Mode Extention present
EDX[2] <- DE: Debbuging Extentions
EDX[3] <- PSE: CPU support 4MB size pages
EDX[4] <- TSC: TSC present (See RDTSC command)
EDX[5] <- MSR: CPU have K5 Compatible MSRs
EDX[6] <- 0 (Reserved)
EDX[7] <- MCE: Machine Check exception
EDX[8] <- CX8: Support CMPXCHG8B instruction
EDX[9] <- Reserved
EDX[10]<- Support SYSCALL and SYSRET instruction (!!!)
EDX[11,12]<- reserved
EDX[13]<- PGE: Page Global Feature support
EDX[14]<- reserved
EDX[15]<- CMOV: CPU support CMOV instruction
EDX[16]<- FCMOV: CPU support FP. FCMOV (!!!)
EDX[22..16] <- Reserved
EDX[23] <- MMX: CPU support IA MMX
EDX[24] <- (Cyrix) Cyrix Extended MMX
EDX[30..24] <- Reserved
EDX[31] <- AMD 3DNow!
1. Cyrix
厂商识别串: "CyrixInstead"
CPU名称 家族 型号
MediaGX 4 4
6x86 5 2 (特征标志字=0x1)
6x86L 5 2 (特征标志字=0x105)
GXm 5 4
6x86MX 6 0
2. NexGen
厂商识别串: "NexGenDriven"
CPU名称 家族 型号
Nx586 5
3. UMC
厂商识别串: "UMC UMC UMC "
CPU名称 家族 型号
U5D 4 1
U5S 4 2
4. AMD
厂商识别串: "AuthenticAMD"
CPU名称 家族 型号
486DX2WT 4 3
486DX2WB 4 7
486DX4WT 4 8
486DX4WB 4 9
5x86WT 4 0x0e
5x86WB 4 0x0f
486 4 Others
K5/SS 5 0
K5 5 1,2,3
K6 5 6,7
K6-2 5 8
K6-III 5 9
K5/K6 5 Others
K7工程样本 6 0
K7 6 Others
5. IDT
厂商识别串: "CentaurHauls"
CPU名称 家族 型号
WinChip C6 5 4
WinChip 2 5 8
6 Rise
厂商识别串: "RiseRiseRise"
CPU名称 家族 型号
mP6 5 0