root/lm-sensors/tags/V2-10-6/BACKGROUND

Revision 4932, 3.8 KB (checked in by khali, 5 years ago)

useful_addresses.html is in the wiki now.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1This package consists of many parts. This document offers a small tour
2around the most important pieces. Not all aspects are discussed
3exhaustively, but it should be enough to give you the feeling you
4understand what you are seeing happen.
5
6When you want to communicate with a piece of hardware, you need a kernel
7driver (well, that is not quite true, but it is in most cases the only
8way to do it safely). In the past, this meant you had to patch the kernel
9and recompile it. These days, you can use kernel modules. We support both
10approaches.
11
12We have chooses for a very modular (no pun intended) setup. There are a
13few general-purpose base kernel modules, which you always need. In
14addition, there is one kernel module for each piece of hardware - whether
15this is an I2C bus adapter, an SMBus adapter or a sensors chip.
16
17The kernel modules communicate their information through both the /proc
18and sysctl interfaces (Linux 2.4) or the /sys interface (Linux 2.6). To
19keep things uncomplicated, the sensor chips always advert their
20measurements 'as is'. This means that the values they report are not
21immediately relevant to you - they must first be scaled and translated
22to correspond to the real world.
23
24It is also possible to communicate directly with chips on an I2C bus
25or SMBus. This is done through /dev files. This is useful if you
26quickly want to test how a certain chip behaves, without having to
27write a kernel driver.
28
29Note that all other parts of this package function in so-called user-space.
30This is important, because bugs in kernel-space might crash your
31computer or do other bad things. And kernel memory can not be swapped out!
32
33Applications could (and can) directly read the sensor values through the
34/proc, sysctl or /sys interfaces. This is harder than it sounds; because
35no two chips are the same, the information they communicate may also
36be very unlike. This would mean that every application would have to know
37about every type of chip. But there is a better solution.
38
39libsensors is a (shared or static) library of access functions. It
40knows about every type of chip supported by the kernel modules (or it
41should, if it is up-to-date). It offers a simple-to-use interface for
42applications to access the sensor chip readings, to set new limits,
43and all other commonly needed things. From the application's point of
44view, there is no need to know very much about a specific sensors chip.
45Having some inside information can still be useful, but it is possible to
46write a generic fall-back function that takes care of newer, unknown
47chips, and to display all really important information.
48
49libsensors takes care of one other thing. The kernel modules report
50so-called 'as is' values. They have to be scaled or translated to be
51relevant in the real world. libsensors reads a configuration file
52(usually /etc/sensors.conf) which specifies how this translation should
53be done (with some other things). Again, the application does not have
54to know about it. And because the configuration file is reread each time
55a new application is started, you can change configuration values without
56having to recompile anything.
57
58This package does not contain a nice graphical monitor. See
59http://www.lm-sensors.org/wiki/UsefulLinks for pointers to such programs.
60It does contain an example console program that reports all current sensors
61values. This program is called 'sensors'. You can use it as a reference
62implementation for more intricate programs.
63
64There are many, many kernel modules in this package, and there are lots
65of different sensor chips supported. Sometimes, it can be hard to
66determine what chips and adapters you have, and which modules correspond
67to them. Fortunately, there is a user-space application 'sensors-detect'
68that should tell you exactly what is available, and what you need to
69do. This perl script uses the /dev interface, and you may use it as an
70example how you can do this.
Note: See TracBrowser for help on using the browser.