OS/2, eCS & ArcaOS - Technical > Programming

An XWorkplace CPU Temperature Widget for AMD CPUs

<< < (3/7) > >>

Dariusz Piatkowski:
Hey Lars!


--- Quote from: Lars on March 04, 2025, 09:08:38 am ---my ACPI is crippled, it's very old and does not support many of the new ACPI objects. And then, I don't know if with our ACPI.PSD there is a way to overload ACPI tables on the fly.

--- End quote ---

Not sure the age of your hardware, but the early years of ACPI were plagued by buggy BIOS firmware, etc., so this may not be all that surprising.


--- Quote from: Lars on March 04, 2025, 09:08:38 am ---Then I found the AMD BIOS Writer's Guide:
https://www.amd.com/content/dam/amd/en/documents/archived-tech-docs/programmer-references/42301_15h_Mod_00h-0Fh_BKDG.pdf

The register to read is the "Reported Temperature Control" PCI config space register Device 18h Function 3 Byte Offset A4h  (so yes, in principle, the ACPI tables could be extended by AML code that just reads that specific PCI config space register but I am far from an expert on ACPI).

--- End quote ---

Yeah, spot on. I was thinking to myself that if ACPI is not workable then querrying up the right register might still get you to the right spot. That PDF is the bible for the FX CPUs. Keep the following in mind: there really are TWO CPU temperatures: core and package. The core stuff does not store/output an actual temperature, rather it is an offset from what AMD considers the MAX safe temp for this particular CPU. Which means you need to do a little bit of a calculation to try to either get it back to a F/C-degree scale, or you can simply call this value out as "xx Deg. away from MAX Temp". The ACPI logic (as well as the processor itself) use this information to determine when a critical thermal shutdown needs to be initiated. The PDF describes this as well.


--- Quote from: Lars on March 04, 2025, 09:08:38 am ---And then I have to find out exactly what AMD CPUs support that PCI config space register. Don't want to crash anyone's system ...

--- End quote ---

LOL, I know the feeling...I trapped my box yesterday as I ran the acpistat command from that 3.18 ACPI release against my current installed ACPI base...oops...you'd think it would perhaps fail a bit more gracefuly!

Lars:
Hi Dariusz,

by now I have hacked together a proof of concept. Since you have a FX 8380 CPU (I think), would you be willing to test ? Beware, the test prog has no strict error checking but I can provide the source code to you ...

You will also need to install:
https://hobbesarchive.com/Home/Download?path=/Hobbes/pub/os2/system/drivers/misc/SysCall_3-0.wpi

which is my driver + DLL to execute code in Ring 0 (necessary for the test program to read MSRs, also used to map physical to linear address).

Dariusz Piatkowski:
Lars!


--- Quote from: Lars on March 05, 2025, 01:40:31 am ---..by now I have hacked together a proof of concept. Since you have a FX 8380 CPU (I think), would you be willing to test ? Beware, the test prog has no strict error checking but I can provide the source code to you ...

You will also need to install:
https://hobbesarchive.com/Home/Download?path=/Hobbes/pub/os2/system/drivers/misc/SysCall_3-0.wpi

which is my driver + DLL to execute code in Ring 0 (necessary for the test program to read MSRs, also used to map physical to linear address).

--- End quote ---

OK, so the install of that SysCall WPI is done...but everything in that source tree is dated Dec-2020 and earliert, so I'm guessing this does not contain any of the stuff you were working on...or am I missing something?

In other words: happy to test, I just don't know what it is that I should be trying to test???

Lars:
Correct, the test proggie I will still need to attach here. Will do so.

Lars:
Find attached.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version