Hw.sensors

The hw.sensors framework is a kernel-level hardware sensors framework originating from OpenBSD, which uses the sysctl kernel interface as the transport layer between the kernel and the userland. , the framework is used by over a hundred device drivers in OpenBSD to export various environmental sensors, with temperature sensors being the most common type. Consumption and monitoring of sensors is done in the userland with the help of sysctl, systat, sensorsd, OpenBSD NTP Daemon (OpenNTPD, ntpd), Simple Network Management Protocol (snmpd), ports/sysutils/symon and GKrellM.

Drivers
In OpenBSD, the framework is integrated with Dell's ESM, Intelligent Platform Management Interface (IPMI) and I2C, in addition to several popular Super I/O chips through http://mdoc.su/o/lm.4.

A major difference compared to other solutions like lm_sensors is simplicity and a works-by-default approach in the drivers, which don't need or support any configurability; no installation or configuration actions are required by the system administrator to get the sensors going. This is coupled with a fine-tuned ad-hoc read-only scan procedure on the I2C bus, written by Theo de Raadt in a centralised way with a cache, making it possible to leave it enabled by default at all times, unlike the competing solutions.

RAID sensors
Support for automatic monitoring of RAID drives is also provided through the sensors framework, this concept of sensors of  type has been backported by NetBSD back into envsys in 2007.

OpenNTPD sensors
OpenNTPD uses sensors of type  to synchronise time. These are provided by NMEA and other drivers.

History
The framework was originally devised in 2003 by Alexander Yurchenko, when he was porting several envsys-based drivers from NetBSD. Instead of porting NetBSD's envsys, a simpler sysctl-based mechanism was developed.

Framework use by the device drivers rose sharply with the release of OpenBSD 3.9. Then, in only 6 months, the number of individual drivers using the framework rose from 9 in OpenBSD 3.8 (released 2005-11-01) to 33 in OpenBSD 3.9 (released 2006-05-01).

, the framework was used by 44 devices drivers. At this time, a patchset was committed converting a simple one-level addressing scheme into a more stable multi-layer addressing.

In 2007, the framework was ported to FreeBSD as part of a Google Summer of Code grant. It was adopted by DragonFly BSD later that year. The usability of the http://mdoc.su/o/sensorsd.8, the sensor monitoring daemon, was vastly improved in 2007, partly via the same GSoC grant.

, the total number of drivers stood at 68 in OpenBSD 4.4; growing by 7 drivers in a 6-month release cycle. This rate of growth, of one new driver per month on average, has been common throughout the history of the framework since OpenBSD 3.9.

The values exported by the drivers through the framework are read-only; however, an external patch exists that implements the fan control functions in both the framework, and in one of the drivers for the most popular family of Super I/O chips. This patchset was provided for both OpenBSD and DragonFly BSD.