root/lm-sensors/tags/V2-3-3/BACKGROUND

Revision 340, 3.8 kB (checked in by frodo, 10 years ago)

New file BACKGROUND

This file offers a small tour around all components of our package.

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