Envsys

Short description: Hardware monitoring sensors framework

Environmental Systems framework (version 2)Original author(s)| Juan Romero Pardines (2007)

|

Developer(s)| The NetBSD Foundation, Inc.
Initial release| 1 July 2007; 18 years ago (2007-07-01)
Repository| /sys/sys/envsys.h
Written in| C
Operating system| NetBSD since 5.0
Type| system monitoring
Licence| BSD licence#4-clause
Website| envsys(4)
Environmental Systems APIOriginal author(s)| Tim Rightnour and Bill Squier (2000)

|

Developer(s)| The NetBSD Foundation, Inc.
Initial release| 15 December 1999; 26 years ago (1999-12-15)
Final release|

NetBSD 4.0.1 / 14 October 2008; 17 years ago (2008-10-14)

Repository| /sys/sys/envsys.h
Written in| C
Operating system| NetBSD 1.5 to 4.0.1
Type| system monitoring
Licence| BSD licence#4-clause
Website| envsys(4) in NetBSD 4.0

The envsys framework is a kernel-level hardware monitoring sensors framework in NetBSD. As of 4 March 2019[update], the framework is used by close to 85 device drivers to export various environmental monitoring sensors, as evidenced by references of the `sysmon_envsys_register`[1] symbol within the `sys` path of NetBSD; with temperature sensors, `ENVSYS_STEMP`,[2] being the most likely type to be exported by any given driver.[3]: 32 Sensors are registered with the kernel through `sysmon_envsys(9)` API.[4] Consumption and monitoring of sensors from the userland is performed with the help of `envstat` utility through `proplib(3)` through `ioctl(2)` against the `/dev/sysmon` pseudo-device file,[5] the `powerd` power management daemon that responds to kernel events by running scripts from `/etc/powerd/scripts/`,[6][7] as well as third-party tools like `symon` and GKrellM from pkgsrc.

## Contents

* 1 Features
* 2 History
* 3 See also
* 4 References
* 5 External links

## Features

The framework allows the user to amend the monitoring limits specified by the driver, and for the driver to perform monitoring of the sensors in kernel space, or even to programme a hardware chip to do the monitoring for the system automatically.[3]: §7.1 Two levels of limits are defined: critical and warning, both of which additionally extend to an over and an under categorisation.[3]: §7.1 If limit thresholds are crossed, a kernel event may be generated, which can be caught in the userland by `powerd` to execute a pre-defined user script.[6][7] By comparison, in OpenBSD's hw.sensors, the monitoring of user-defined values is performed in userspace by `sensorsd`.

As of 2019[update], the framework itself does not facilitate computer fan control, although the drivers could still implement interfacing with the fan-controlling capabilities of their chips through other means, for example, through a driver-specific sysctl interface, which is the approach taken by the `dbcool(4)` driver.[8] However, the drivers for the most popular Super I/O chips like `lm(4)` and `itesio(4)` do not implement any fan control at all (in fact, historically, in all of OpenBSD, NetBSD and DragonFly, these drivers don't even report the duty cycle of the fans — only the actual RPM values are reported).[9][10]

## History

The framework undergone two major revisions: the first version of `envsys.h` was committed on 15 December 1999; 26 years ago (1999-12-15); with `envsys.4` man page following on 27 February 2000; 26 years ago (2000-02-27). Between 2000 and 2007, the manual page for envsys(4) in NetBSD stated that the "API is experimental", and that the "entire API should be replaced by a sysctl(8)", "should one be developed";[11][12] it can be noted that in 2003 this was the exact approach taken by OpenBSD with sysctl hw.sensors when some of the envsys(4) drivers were ported to OpenBSD.[3]: §6.1

The second revision came about on 1 July 2007; 18 years ago (2007-07-01). The serialisation with userland was reimplemented using property lists with the help of NetBSD's new proplib(3) library (the underlying transport layer between the kernel and userland still being done through ioctl).[13][3]

The envsys framework was the precursor to OpenBSD's sysctl hw.sensors framework in 2003, and many drivers, as well as some sensor types, have been ported back and forth between NetBSD and OpenBSD. Support for sensors of `drive` type has been added to NetBSD on 2007, similar to `drive` type in OpenBSD, which was at the same time when bio(4) and bioctl were ported from OpenBSD to NetBSD.[3]: §7.1

## See also

* bioctl
* hw.sensors
* lm sensors
* SpeedFan

## References

1. ↑ "`sysmon_envsys_register()`". NetBSD. http://bxr.su/n/sys/dev/sysmon/sysmon_envsys.c#sysmon_envsys_register.
2. ↑ "`ENVSYS_STEMP`". NetBSD. http://bxr.su/n/sys/sys/envsys.h#ENVSYS_STEMP.
3. ↑ 3.0 3.1 3.2 3.3 3.4 3.5 Constantine A. Murenin (2010-05-21). "7.1. NetBSD envsys / sysmon". OpenBSD Hardware Sensors — Environmental Monitoring and Fan Control (MMath thesis). University of Waterloo: UWSpace. hdl:10012/5234. Document ID: ab71498b6b1a60ff817b29d56997a418.
4. ↑ "sysmon_envsys(9) — kernel part of the envsys 2 framework". NetBSD. 2007–2008. http://bxr.su/n/share/man/man9/sysmon_envsys.9.
5. ↑ "_PATH_SYSMON in paths.h". NetBSD. http://bxr.su/n/include/paths.h#_PATH_SYSMON. "`#define _PATH_SYSMON "/dev/sysmon"`"
6. ↑ 6.0 6.1 Wasabi Systems, Inc. (2003). "powerd(8) — power management daemon for sysmon". NetBSD. http://bxr.su/n/usr.sbin/powerd/.
7. ↑ 7.0 7.1 "/etc/powerd/scripts/". NetBSD. http://bxr.su/n/etc/powerd/scripts/.
8. ↑ "dbcool(4): dev/i2c/dbcool.c". NetBSD. 2008. http://bxr.su/n/sys/dev/i2c/dbcool.c.
9. ↑ "lm(4): dev/ic/nslm7x.c". NetBSD. http://bxr.su/n/sys/dev/ic/nslm7x.c.
10. ↑ "itesio(4): dev/isa/itesio_isa.c". NetBSD. http://bxr.su/n/sys/dev/isa/itesio_isa.c.
11. ↑ "envsys -- Environmental Systems API". 2007-12-19. http://mdoc.su/n40/envsys.4. "This API is experimental and may be deprecated at any time ... This entire API should be replaced by a sysctl(8) interface or a kernel events mechanism, should one be developed."
12. ↑ Constantine A. Murenin (2007-04-17). "Generalised Interfacing with Microprocessor System Hardware Monitors". Proceedings of 2007 IEEE International Conference on Networking, Sensing and Control, 15–17 April 2007.. London, United Kingdom: IEEE. pp. 901–906. doi:10.1109/ICNSC.2007.372901. IEEE ICNSC 2007, pp. 901—906.. ISBN 978-1-4244-1076-7. http://sensors.cnst.su/IEEE_ICNSC_2007.
13. ↑ Hubert Feyrer (2007-06-21). "envsys2". http://www.feyrer.de/NetBSD/bx/blosxom.cgi/nb_20070621_1638.html.

## External links

* /sys/sys/envsys.h

* v
* t
* e

The NetBSD Project

Operating system|

* NetBSD

Related projects|

* pkgsrc
* ATF
* netpgp
* pcc
* tnftp
* tcsh

Notable subsystems|

* Veriexec
* busdma
* DTrace
* envsys
* LKM
* Rump kernel

File systems and storage|

* bioctl
* CHFS
* disklabel
* fdisk
* LVM2
* PUFFS
* tmpfs
* UFS
* WAPBL
* ZFS

Firewalls and networking|

* 802.11 drivers
* ALTQ
* Bluetooth
* BPF
* IPFilter
* NPF
* PF
* CARP
* pfsync

0.00

(0 votes)

Original source: https://en.wikipedia.org/wiki/Envsys. Read more

|

Retrieved from "https://handwiki.org/wiki/index.php?title=Software:Envsys&oldid=709550"
*[v]: View this template
*[t]: Discuss this template
*[e]: Edit this template