2 ms·
> but if you are virtualising macOS-on-macOS, there is little reason to. Not needing to run a kext just to retrieve a known hardcoded string seems like a very
by yjftsjthsd-h 5y ago
> but if you are virtualising macOS-on-macOS, there is little reason to.
Not needing to run a kext just to retrieve a known hardcoded string seems like a very good reason.
- skissane 5y agoYou don't need to use a kext. You can instead use IOKit to talk to the AppleSMC driver over a Mach port. Works even without root: https://gist.github.com/vagelim/dd5be2802ecb097b81cf07711f6a5fea https://gist.github.com/vagelim/dd5be2802ecb097b81cf07711f6a... VirtualBox has code to do the above. But it also has code in one of its kexts to do it by talking directly to the hardware, in case (for whatever reason) this API doesn't work; it tries IOKit first and then calls the kext as a fallback. And, the kext doesn't solely exist to talk to the SMC, it does a bunch of other things too. I'm not sure whether VirtualBox works without its kexts, but if it doesn't, it isn't because of this reason. (When I wrote my original comment above, I didn't know you could do this through the IOKit API, although I've since edited that comment to mention it.)