Changeset 4872

2007-09-24 13:31:37 (8 years ago)

Strip for version 3. Ultimately the contents of this file should be
folded into README.

1 modified


  • lm-sensors/branches/lm-sensors-3.0.0/BACKGROUND

    r4473 r4872  
    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. 
    61When you want to communicate with a piece of hardware, you need a kernel 
    72driver (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. We support both 
    10 approaches. 
    12 We have chooses for a very modular (no pun intended) setup. There are a 
    13 few general-purpose base kernel modules, which you always need. In  
    14 addition, there is one kernel module for each piece of hardware - whether 
    15 this is an I2C bus adapter, an SMBus adapter or a sensors chip. 
     3way to do it safely). 
    175The kernel modules communicate their information through the /sys inter- 
    18 face. To keep things uncomplicated, the sensor chips always advert their 
    19 measurements 'as is'. This means that the values they report are not 
    20 immediately relevant to you - they must first be scaled and translated 
    21 to correspond to the real world. 
    23 It is also possible to communicate directly with chips on an I2C bus 
    24 or SMBus. This is done through /dev files. This is useful if you  
    25 quickly want to test how a certain chip behaves, without having to 
    26 write a kernel driver. 
    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! 
    32 Applications could (and can) directly read the sensor values through the  
    33 /sys interface. This is harder than 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. 
     6face. Because every motherboard is different, the sensor chips always 
     7advert the measurements at their pins. This means that the values they 
     8report are not always immediately relevant to you. They have to be 
     9labelled properly, and sometimes they must be scaled to correspond to 
     10the real world. 
    3812libsensors 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. 
    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. 
     13offers a simple-to-use interface for applications to access the sensor 
     14chip readings, to set new limits, and all other commonly needed things. 
     15It has a configuration file where you can put all the 
     16motherboard-specific labels and conversion rules. That way, all 
     17applications do not need to duplicate the effort and can simply link 
     18with libsensors and work out of the box. 
    5720This package does not contain a nice graphical monitor. Look at the file 
    6124for more intricate programs. 
    63 There are many, many kernel modules in this package, and there are lots 
     26The Linux 2.6 kernel has many, many sensor drivers, and there are lots 
    6427of different sensor chips supported. Sometimes, it can be hard to  
    6528determine what chips and adapters you have, and which modules correspond 
    6629to 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. 
     30that should tell you exactly what is available, and what you need to do.