Add AppleSMC module: Apple SMC fan/sensor access#70
Open
JdovGamester wants to merge 1 commit into
Open
Conversation
…/0x304 Scoped to only these two fixed ports (unlike LpcIO's BAR-discovered range) - this module cannot be used to poke arbitrary I/O, only the well-documented Apple SMC protocol used by every Intel Mac (see e.g. Linux's applesmc.c for an independent implementation of the same hardware interface). Exposes ioctl_smc_read/ioctl_smc_write for reading/writing arbitrary SMC keys (fan RPM, min/max, target, mode bitmask, temperature sensors, etc). Built and tested against PawnIOLib on a MacBookPro15,1 running Windows 10 via Boot Camp; module structure validated via PawnIOUtil (fails cleanly on the expected signature check since it isn't signed with the trusted key).
Owner
|
Was this fully tested with the unrestricted driver? Note that the 2.2.0 installer is bugged, you'll need 2.1.0 or build the unrestricted version yourself. Additionally, is it possible to restrict it more in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AppleSMC.p, a module for reading/writing Apple SMC keys (fan RPM, min/max, target, mode bitmask, temperature sensors, etc.) on Intel Macs running Windows via Boot Camp.0x300, command port0x304) — the same interface documented and independently implemented by e.g. Linux'sdrivers/hwmon/applesmc.c.LpcIO.p's BAR-discovered range) — this module can't be used to poke arbitrary I/O, only the well-known Apple SMC handshake.ioctl_smc_read(key, len) -> dataandioctl_smc_write(key, len, data).Motivation
Built for a personal Boot Camp power/thermal management project. Wanted real fan-speed control without WinRing0 (blocklisted, CVE-2020-14979) — PawnIO's signed, scoped-module model is exactly the right fit, but there's currently no Apple SMC module in this repo.
Test plan
pawncc -C64against this repo'sinclude/(only pre-existing "tag mismatch" style warnings, same category as other modules comparingNTSTATUS:return values).PawnIOUtil testagainst the signed driver: module load correctly fails at the signature-trust step (expected, since it isn't signed by the maintainer key) — confirms the module and PawnIOLib integration are structurally sound up to that boundary.FS!mode bitmask) is implemented per the well-documented protocol but untestable end-to-end until signed, since I don't have a way to load it through the trusted driver myself.Happy to adjust naming/style/scope to match repo conventions — first contribution here.