hur.st's bl.aagh

BSD, Ruby, Rust, Rambling

k8temp

Command-line AMD K8 CPU thermal diode reader

[c] [bsd]

A foray into lower-level code, bashing PCI registers and using a bit of custom assembler, k8temp offers a command line interface to the thermal sensors on AMD’s old K8 CPUs.

-% sudo k8temp
CPU 0 Core 0 Sensor 0: 35c
CPU 0 Core 1 Sensor 0: 36c
CPU 1 Core 0 Sensor 0: 33c
CPU 1 Core 1 Sensor 0: 32c
-% sudo k8temp -n 0:0:0 1:0:0
35
33
-% sudo k8temp -d
CPUID: Vendor: AuthenticAMD, Id=0x20f12 Model=1 Family=15 Stepping=2
Advanced Power Management=0xf
   Temperature sensor: Yes
 Frequency ID control: Yes
   Voltage ID control: Yes
    THERMTRIP support: Yes
   HW Thermal control: No
   SW Thermal control: No
   100MHz multipliers: No
   HW P-State control: No
        TSC Invariant: No
Thermtrip=0x0d540524 (CurTmp=0x54 (35c) TjOffset=0x0d DiodeOffset=0x05 (6c))
CPU 0 Core 0 Sensor 0: 35c
Thermtrip=0x0d560520 (CurTmp=0x56 (37c) TjOffset=0x0d DiodeOffset=0x05 (6c))
CPU 0 Core 1 Sensor 0: 37c
Thermtrip=0x0f530224 (CurTmp=0x53 (34c) TjOffset=0x0f DiodeOffset=0x02 (9c))
CPU 1 Core 0 Sensor 0: 34c
Thermtrip=0x0f520220 (CurTmp=0x52 (33c) TjOffset=0x0f DiodeOffset=0x02 (9c))
CPU 1 Core 1 Sensor 0: 33c