* feat: Add Native AOT compilation support for LibreHardwareMonitorLib
- Replace non-generic Marshal.GetDelegateForFunctionPointer with generic versions
(NvApi.cs, NvidiaML.cs, OpCode.cs)
- Replace non-generic Marshal.PtrToStructure/SizeOf with generic versions
(AtiAdlxx.cs, AmdGpu.cs, Ipmi.cs)
- Replace reflection-based Mono.Posix calls with direct Syscall for non-NETFRAMEWORK
(OpCode.cs)
- Add DynamicallyAccessedMembers annotations for trim-safe generic marshaling
(MsiCoreLiquidController.cs, WireViewPro2.cs)
- Add IsAotCompatible, IsTrimmable, and AOT/trim analyzers to csproj for net8.0+
- All changes maintain full backward compatibility with net472/netstandard2.0
Tested: dotnet publish with PublishAot=true on net10.0 win-x64 succeeds.
AOT binary correctly enumerates all hardware and sensors without errors.
* feat: Add conditional compilation for .NET 5.0 or greater in various classes
* feat: Add AOT test project and update workflows for AOT compilation
* Drop test project
* NET5_0_OR_GREATER > NET
---------
Co-authored-by: PhyxionNL <7643972+PhyxionNL@users.noreply.github.com>
* Add NCT6687DR fan control support with bit mapping and configuration phase handling
* NCT6687DR: emulate CC_Engine SetManualFAN protocol
- System fans (index > 8): skip manual mode bit (0xA00), use flat SmartFAN curve instead
- Change commit value from 0x40 to 0xC0 (REQ|DONE) matching CC_Engine
- Write 7-point temp curve (all 0x20/32C) alongside duty curve for system fans
- Add Sleep(10ms) after request (0x80) and commit (0xC0) per CC_Engine timing
- Restore: only clear manual mode bit for CPU/Pump/Chipset/EZ-Connect fans
* NCT6687DR: add INVALID bit check with retry after EC commit
- FinishFanCfgUpdate now returns bool: false if EC sets INVALID (0xCF8 & 0x10)
- SetControl and RestoreDefaultFanControl retry up to 3 times on INVALID
- Matches CC_Engine's post-commit validation behavior
* fix(NCT6687DR): bypass SmartFAN engine for system fans — use direct PWM
System fans (SYSFAN1-7) now use the same direct PWM mechanism as
CPU/Pump/Chipset fans, completely bypassing the SmartFAN curve engine
and its inherent ~2%/sec PWM smoothing.
Key changes:
- FAN_PWM_COMMAND_REG: system fans now point to direct PWM registers
(SYSFAN7: 08:E9, SYSFAN1-6: 02:65..02:60) instead of SmartFAN
curve base addresses (0xBE0..0xC70)
- FAN_CONTROL_MODE_REG: system fans use 08:0F (not 0xA00) for their
manual-mode enable bits
- FAN_CONTROL_MODE_BIT: corrected per-channel bit positions derived
from BIOS unk_104C0 table (sub_2F50 / sub_2BDC analysis)
- Set6687DRControl: simplified to single WriteByte for all fans
(no more 7-point flat curve + step/rate writes)
- SetControl: unified path — all fans set manual-mode bit + direct PWM
- RestoreDefaultFanControl: clear manual-mode bit to return to SmartFAN
Register mapping discovered via IDA analysis of BIOS firmware:
- Extended unk_101E0 table at 0x103AC contains channels 10-15
- sub_2BDC configures 5 register operations per channel before curve write
- Entry[1] in unk_104C0 = manual-mode enable register + bit position
* review: Stopwatch, engineSts rename, CompleteFanConfigUpdate
* refactor: PreciseWait via SpinWait, DateTime to Stopwatch in ReadByte/WriteByte
* review: remove regions, revert PreciseWait to Thread.Sleep
* Add support for MSI MAG B850 Tomahawk Wifi (non-max) using NCT6687DR Controller
* Handle MSI NCT6687DR SIO Controller declaration more elegantly
This is a more powerful yet elegant way of handling MSI motherboards with the MSI flavored Nuvoton NCT6687D (aka NCT6687D-R). While it still requires that support be manually added for each motherboard so it be properly identified, this reduces the amount of work to add support and also reduces the amount of clutter in LpcIO.cs.
* Add support for MSI MEG X870E ACE MAX
* Foundational support for ALL MSI B840/B850, X870(E), and Z890 Motherboards!
Assigns all MSI B840, B850, X870, X870E and Z890 motherboards the NCT6687D-R SIO Controller
* Remove MSI B850 GAMING PLUS WIFI6E NCT6687D handling
* Used more stringent comparison criteria for MSI 800 series NCT6687DR identification
* Support for 10 new MSI motherboards with NCT6687D-R SIO controller
* Support for newly established fan and control register structure
WILL ABSOLUTELY BREAK FAN CONTROL CONFIGS FOR NCT6687DR USERS. This introduces Support for 16 System Fans and Controls, including EZ-Connect, Pump Fan 2, and System Fan 7. Also improved the logic for nct6687dr control.
* Add support for X870E Tomahawk WIFI, fix B850 Gaming Plus WIFI PZ identification
Additionally sync with upstream
* Add support for B850M Gaming Plus WIFI and Z890 Unify-X
Also removes duplicate model identification case for B850M GAMING PLUS WIFI6E
* Rename temperature sensor to proper name for X870E Carbon Wifi and GODLIKE motherboards
* Add support for MSI PRO B850M-A Project Zero (MS-7E78)
* Rename 'T_Sensor' to 'Temperature Sensor' for clarity
* T Sensor > Temperature Sensor
* Rename Temperature Sensors to Thermistor Sensors
---------
Co-authored-by: PhyxionNL <7643972+PhyxionNL@users.noreply.github.com>
* Fix ASUS Z170 EC temperature read returning zero values
Adjust EC read logic so temperature registers (PCH, T_SENSOR, VRM)
return valid values on ASUS Z170 boards in user-mode.
Verified with RWEverything and HWiNFO.
* merge back to inter100,
Use IBF clearing fallback when OBF unsupported
* Fix formatting of CrOS enum entry
* Update WindowsEmbeddedControllerIO.cs
---------
Co-authored-by: PhyxionNL <7643972+PhyxionNL@users.noreply.github.com>
* Support for 10 new MSI motherboards with NCT6687D-R SIO controller
* Support for newly established fan and control register structure
WILL ABSOLUTELY BREAK FAN CONTROL CONFIGS FOR NCT6687DR USERS. This introduces Support for 16 System Fans and Controls, including EZ-Connect, Pump Fan 2, and System Fan 7. Also improved the logic for nct6687dr control.
* Add support for X870E Tomahawk WIFI, fix B850 Gaming Plus WIFI PZ identification
Additionally sync with upstream
* Add support for B850M Gaming Plus WIFI and Z890 Unify-X
Also removes duplicate model identification case for B850M GAMING PLUS WIFI6E
* Support for 10 new MSI motherboards with NCT6687D-R SIO controller
* Support for newly established fan and control register structure
WILL ABSOLUTELY BREAK FAN CONTROL CONFIGS FOR NCT6687DR USERS. This introduces Support for 16 System Fans and Controls, including EZ-Connect, Pump Fan 2, and System Fan 7. Also improved the logic for nct6687dr control.
* Try and migrate the old GigabyteController stuff with PawnIO
* Bring back WinRing0 era GigabyteController stuff
* ISABridge use the PawnIO module with its built-in logic
* Ecio uses LpcIO directly (not sure about the initialization logic in TryCreate() to make this work)
* Code-review
* Fix inverted logic
* Remove IsaBridgeEc field init
* Format document
* Combine logic
* Gigabyte Implementation best attempt
* Update IsaBridgeGigabyteController.cs
* Cleanup and fix enablind logic for Isa version
* Add debug logs
* Update IsaBridgeGigabyteController.cs
* Code review
* Unmap + restore the mmio state is done through the closing of the module.
* Fix boolean logic
* Restore the fan control byte instead
* Fallback to ECIO if FanControl enable byte is 0xFF
+ add logs to ECIO
* Port back to validation logic
* Allow for one or the other MMIO to be 0
* Wrap enter/exit mmio logic + enter/exit each time
* Keep state of EcioPort enable
* Missing dispose + close order fix
* Update IsaBridgeGigabyteController.cs
* Remove empty line before TryCreate method
* Code review
* Remove try/finally for SW
* Cleanup debug log methods
* Add DEBUG_LOG define conditional
* Misc
* Misc
---------
Co-authored-by: PhyxionNL <7643972+PhyxionNL@users.noreply.github.com>
* Begin CrOS implementation for Framework Laptops
* CrOS: Talk directly to the EC, instead of through ACPI
* Add a few Framework models
* Remove early Framework models
These have a different EC, and don't currently work
* Migrate CrOS ECs to PawnIO
* Implement EcCommand and read sensor names
* Add more Framework models
* Add some error handling
* Misc
---------
Co-authored-by: PhyxionNL <7643972+PhyxionNL@users.noreply.github.com>
* Make the Debug,WriteLine opt in with a symbol define
Having all these Debug,WriteLine made the update method painfully slow and the running process laggy during a debug session.
* Update Nct677X.cs
* Update Nct677X.cs
* Update Nct677X.cs
---------
Co-authored-by: PhyxionNL <7643972+PhyxionNL@users.noreply.github.com>
* Add support for MSI MEG Z790 GODLIKE MAX.
* Update LibreHardwareMonitorLib/Hardware/Motherboard/SuperIOHardware.cs
* Rename M2_1 to M2 #1 in temperature readings
---------
Co-authored-by: PhyxionNL <7643972+PhyxionNL@users.noreply.github.com>
* Replace Storage implementation with CrystalDiskInfo based implementation.
* Formatting.
* Code review.
* Code review.
* Increase space for attribute name in report.
* Implement dynamic disk handling for usage sensor.
Disable unused warnings.
* Further cleanup in NativeMethods.txt and referenced.
* Add ASRock X870E Nova WiFi Support
- Added support for Nuvoton NCT5585D chip
- Added support for Nuvoton NCT6796D-S chip
- Added motherboard-specific switch to select the correct chip due to duplicate chip ID/Revision (see #2005)
- Added chips to disable monitor i/o space lock block
- Added business logic to include chips in _superIOs.Add for the Nct677X() logic.
- Added chips to business logic to properly assign indices for fans, controls, temperatures and voltages.
- Added TSENSOR to the enum for SourceNct67Xxd to display the 3rd thermistor sensor.
- Added Naming and Identification for the X870E Nova WiFi
- Supressed warnings and added documentation
* Corrections
These changes reflect scraping the datasheet for the correct registers, half-registers, halfBits, sourceRegisters and alternateRegisters
- Replaced TSENSOR with AUXTIN5 as it is named in the datasheet
- Corrected Register values
- Reworked indexes and temperature naming
* Requested Changes
- Linked to PR instead of Datasheet which may change.
- Changed descriptions to be more understandable rather than using Datasheet labels
* Removed duplicate TSENSOR in enum
* Add Info for Gigabyte GA-MA790X-DS4 and some Typo corrections
* Fix casing of 'VBAT' to 'VBat' in SuperIOHardware
---------
Co-authored-by: PhyxionNL <7643972+PhyxionNL@users.noreply.github.com>
added identifier string to Identification.cs
added new model enum entry B850S_PRO_WIFI6E
added B850S_PRO_WIFI6E to the list of models that get the NCT6687DR instead of NCT6687D
Co-authored-by: Stephan Koster <skoster@enclustra.com>