[CLUE-Tech] lm_sensors

Dave Anselmi anselmi at americanisp.net
Fri Mar 15 12:38:52 MST 2002


This post doesn't really help your sensors problem much, but I'll explain
what your perl script is complaining about.

If you can read and understand error messages like sensors-detect gave you,
you can usually figure out an easy way to get around them (e.g., not finding
modprobe because it isn't in your path).

Mike Staver wrote:

> This is the function in question:
>
> # This function returns a list of hashes. Each hash has some PCI
> information
> # (more than we will ever need, probably). The most important
> # fields are 'bus', 'slot', 'func' (they uniquely identify a PCI device in
>
> # a computer) and 'vendid','devid' (they uniquely identify a type of
> device).
> # /proc/bus/pci/devices is only available on late 2.1 and 2.2 kernels.
> sub read_proc_dev_pci
> {
>   my ($dfn,$vend, at pci_list);
>   open INPUTFILE, "/proc/bus/pci/devices" or return;
>   while (<INPUTFILE>) {
>     my $record = {};

I'm not a perl hacker, but this loop reads lines out of
/proc/bus/pci/devices into a variable called $_.

> ($dfn,$vend,$record->{irq},$record->{base_addr0},$record->{base_addr1},
> $record->{base_addr2},$record->{base_addr3},$record->{base_addr4},
>           $record->{base_addr5},$record->{rom_base_addr}) =
>           map { oct "0x$_" } split;

This is a long, single statement.  The 'map { oct "0x$_" } split' part is
the right side of an assignment that breaks the line we read into pieces and
assigns the pieces to the long list of variables in the preceding three
lines.  The pieces of the line are strings representing hex values that are
being converted into numbers.

So the error you were getting about this line are due to having non-hex
strings in the line you're processing from /proc/bus/pci/devices.  Maybe
that file format changed from kernel 2.2 to 2.4, but you can look at it to
see what it is.  It's supposed to contain irqs and base addresses and such.

Dave





More information about the clue-tech mailing list