ASMC(4)

πŸ“¦
version 15.1 Β· 2 versions
, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

🌸 ASMC(4) β€” Apple SMC driver 🌸

Okay so this is ASMC(4) from the Kernel Interfaces Manual, and it's lowkey iconic: we're talking about the device driver for the Apple System Management Controller. Bestie, buckle up πŸ’–.

✨ NAME ✨

asmc β€” device driver for the Apple System Management Controller (SMC). That's the whole name vibe.

πŸŽ€ SYNOPSIS πŸŽ€

To compile this driver into the kernel, place the following line in your kernel configuration file:

device asmc

Alternatively, to load the driver as a module at boot time, place the following line in loader.conf(5):

asmc_load="YES"

πŸ¦‹ DESCRIPTION πŸ¦‹

The asmc driver controls the Apple System Management Controller (SMC for short) found on Intel Apple systems. Periodt.

The SMC is known to be found on the following systems:

  • MacBook
  • MacBook Pro
  • Intel MacMini
  • Mac Pro
  • MacBook Air
  • Intel iMac

With this driver, you can configure your keyboard backlight brightness, check temperatures of several sensors, check the speed of the internal fans and check the status of the Sudden Motion Sensor. It's giving "tiny system spy but make it useful" ✨.

Variables related to the SMC control and inspection are exported via sysctl(3) under the device tree dev.asmc. Keep that path in your notes, bestie.

πŸ’‘ KEYBOARD BACKLIGHT πŸ’‘

On MacBook Pro systems, you can control the keyboard brightness by writing a value to the dev.asmc.%d.light.control sysctl MIB.

The sysctl MIBs that hold the raw value returned by the left and right light sensors are dev.asmc.%d.light.left or dev.asmc.%d.light.right. Light sensor lore, honestly 🌈.

🌑️ TEMPERATURES 🌑️

The number of temperature sensors and their description varies among systems. You can inspect the temperature sensors on your system by traversing the dev.asmc.temp sysctl MIB. Go off, little sysctl tree 🌈.

All values are in degrees celsius.

πŸŒ€ SYSTEM FANS πŸŒ€

The dev.asmc.fan.%d sysctl tree contains the leaf nodes speed, safespeed, minspeed, maxspeed and targetspeed. Each of these leaf nodes represent the current fan speed, the safest minimum fan speed, the minimum speed and the maximum speed respectively. That's a lot of speed, but okay πŸ’….

All values are in RPM.

🚨 SUDDEN MOTION SENSOR 🚨

The Sudden Motion Sensor (SMS for short) is a device that detects laptop movement and notifies the operating system via an interrupt. The sysctl MIBs present under dev.asmc.sms all relate to the SMS.

The most interesting usage of this device is to park the disk heads when the laptop is moved harshly. First, you need to install ataidle(8) (ports/sysutils/ataidle) and then configure devd(8) the following way:

notify 0 {
        match "system"          "ACPI";
        match "subsystem"       "asmc";
        action                  "/usr/local/sbin/ataidle -s X Y";
};

Do not forget to change the X and Y values in the command above.

⚠️ Also, please note that parking the disk heads too many times can dramatically reduce your hard drive's life span. Do not rely solely on the SMS to protect your hard drive: good care and common sense can increase your hard drive's life. No cap, be nice to your hard drive 🫢.

πŸ”— SEE ALSO πŸ”—

πŸ“œ HISTORY πŸ“œ

The asmc driver first appeared in FreeBSD 8.0. Throwback ✨.

πŸ‘‘ AUTHORS πŸ‘‘

Rui Paulo <rpaulo@FreeBSD.org> (Google Summer of Code project). Iconic.

πŸ’€ BUGS πŸ’€

Support for the latest models was never tested and is most likely not fully working. Not me warning you, but like... warning you πŸ™ˆ.


Source/version/date sign-off: Debian, April 2, 2019, page ASMC(4) β€” mwah, bestie πŸ’‹.

πŸ“¦ where this page comes from