/usr/bin/lsdev is in procinfo 1:2.0.304-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | #!/usr/bin/perl
#
# lsdev.pl
#
# Created by Sander van Malssen <svm@ava.kozmix.cistron.nl>
#
# Date: 1996-01-22 19:06:22
# Last Change: 1998-05-31 15:26:58
#
# $Id: lsdev.pl,v 1.5 1999/05/15 22:16:03 svm Exp $
#
# MAIN #######################################################################
open (IRQ, "</proc/interrupts") || die "can't open /proc/interrupts";
while (<IRQ>) {
next if /^[ \t]*[A-Z]/;
chop;
if (/PIC/) {
$n = (@line = split());
} else {
$n = (@line = split(' [ +] '));
}
$name = $line[$n-1];
$device{$name} = $name;
@tmp = split(':', $line[0]);
$tmp0 = int($tmp[0]);
$irq{$name} = "$irq{$name} $tmp0";
}
close (IRQ);
open (DMA, "</proc/dma") || die "can't open /proc/dma";
while (<DMA>) {
chop;
@line = split(': ');
@tmp = split (/[ \(]/, $line[1]);
$name = $tmp[0];
$device{$name} = $name;
$dma{$name} = "$dma{$name}$line[0]";
}
close (DMA);
open (IOPORTS, "</proc/ioports") || die "can't open /proc/ioports";
while (<IOPORTS>) {
chop;
@line = split(' : ');
@tmp = split (/[ \(]/, $line[1]);
$name = $tmp[0];
$device{$name} = $name;
$port{$name} = "$port{$name} $line[0]";
}
close (IOPORTS);
printf ("%-16s %4s%6s %s\n------------------------------------------------\n",
"Device", "DMA", "IRQ", " I/O Ports");
foreach $name (sort { uc($a) cmp uc($b) } keys %device) {
printf ("%-16s %4s%6s %s\n",
$name, $dma{$name}, $irq{$name}, $port{$name});
}
# The End ####################################################################
# Local variables:
# rm-trailing-spaces: t
|