Apart from the directories associated with the
different processes, /proc
also contains a myriad of
information on the hardware present in your machine. A list of files from
the /proc
directory shows the following:
$ ls -d [a-z]* acpi/ diskstats iomem locks pci sysvipc/ asound/ dma ioports mdstat scsi/ tty/ buddyinfo driver/ irq/ meminfo self@ uptime bus/ execdomains kallsyms misc slabinfo version cmdline fb kcore modules splash vmstat config.gz filesystems keys mounts@ stat cpuinfo fs/ key-users mtrr swaps crypto ide/ kmsg net/ sys/ devices interrupts loadavg partitions sysrq-trigger $
For example, if we look
at the contents of /proc/interrupts
, we can
see that it contains the list of interrupts currently used by the
system, along with the peripheral which uses them. Similarly,
ioports
contains the list of input/output
address ranges currently busy, and lastly dma
does the same for DMA channels. Therefore, in order to track
down a conflict, look at the contents of these three files:
$ cat interrupts CPU0 0: 543488 XT-PIC timer 2: 0 XT-PIC cascade 5: 109 XT-PIC ohci_hcd:usb2, eth1 7: 1 XT-PIC parport0 8: 0 XT-PIC rtc 9: 3432 XT-PIC acpi, NVidia CK8 10: 52855 XT-PIC ehci_hcd:usb3, eth0 11: 7538 XT-PIC libata, ohci_hcd:usb1 12: 1386 XT-PIC i8042 14: 20 XT-PIC ide0 15: 5908 XT-PIC ide1 NMI: 0 LOC: 0 ERR: 0 MIS: 0 $ cat ioports 0000-001f : dma1 0020-0021 : pic1 0040-0043 : timer0 0050-0053 : timer1 0060-006f : keyboard 0070-0077 : rtc 0080-008f : dma page reg 00a0-00a1 : pic2 00c0-00df : dma2 00f0-00ff : fpu 0170-0177 : ide1 01f0-01f7 : ide0 0376-0376 : ide1 0378-037a : parport0 037b-037f : parport0 03c0-03df : vesafb 03f6-03f6 : ide0 03f8-03ff : serial 0778-077a : parport0 0970-0977 : 0000:00:0b.0 0970-0977 : sata_nv 09f0-09f7 : 0000:00:0b.0 09f0-09f7 : sata_nv 0b70-0b73 : 0000:00:0b.0 0b70-0b73 : sata_nv 0bf0-0bf3 : 0000:00:0b.0 0bf0-0bf3 : sata_nv 0cf8-0cff : PCI conf1 4000-407f : motherboard 4000-4003 : PM1a_EVT_BLK 4004-4005 : PM1a_CNT_BLK 4008-400b : PM_TMR 4020-4027 : GPE0_BLK 4080-40ff : motherboard 4080-40ff : pnp 00:00 4200-427f : motherboard 4200-427f : pnp 00:00 4280-42ff : motherboard 4280-42ff : pnp 00:00 4400-447f : motherboard 4400-447f : pnp 00:00 4480-44ff : motherboard 44a0-44af : GPE1_BLK 5000-503f : motherboard 5000-503f : pnp 00:01 5100-513f : motherboard 5100-513f : pnp 00:01 9000-9fff : PCI Bus #02 9000-907f : 0000:02:07.0 9000-907f : 0000:02:07.0 ac00-ac0f : 0000:00:0b.0 ac00-ac0f : sata_nv b000-b07f : 0000:00:0b.0 b000-b07f : sata_nv b800-b8ff : 0000:00:06.0 b800-b8ff : NVidia CK8 bc00-bc7f : 0000:00:06.0 bc00-bc7f : NVidia CK8 c000-c007 : 0000:00:04.0 c000-c007 : forcedeth c400-c41f : 0000:00:01.1 f000-f00f : 0000:00:09.0 f000-f007 : ide0 f008-f00f : ide1 $cat dma 3: parport0 4: cascade $
Or, more simply, use the lsdev command, which gathers information from these files and sorts them by peripheral, which is undoubtedly more convenient.[8]:
$ lsdev Device DMA IRQ I/O Ports ------------------------------------------------ 0000:00:01.1 c400-c41f 0000:00:04.0 c000-c007 0000:00:06.0 b800-b8ff bc00-bc7f 0000:00:09.0 f000-f00f 0000:00:0b.0 0970-0977 09f0-09f7 0b70-0b73 0bf0-0bf3 ac00-ac0f b000-b07f 0000:02:07.0 9000-907f 9000-907f cascade 4 2 CK8 9 dma 0080-008f dma1 0000-001f dma2 00c0-00df eth0 10 eth1 5 forcedeth c000-c007 fpu 00f0-00ff GPE0_BLK 4020-4027 GPE1_BLK 44a0-44af i8042 12 ide0 14 01f0-01f7 03f6-03f6 f000-f007 ide1 15 0170-0177 0376-0376 f008-f00f keyboard 0060-006f motherboard 4000-407f 4080-40ff 4200-427f 4280-42ff 4400-447f 4480-44ff 5000-503f 5100-513f NVidia b800-b8ff bc00-bc7f ohci_hcd:usb1 11 parport0 3 7 0378-037a 037b-037f 0778-077a PCI 0cf8-0cff 9000-9fff pic1 0020-0021 pic2 00a0-00a1 PM1a_CNT_BLK 4004-4005 PM1a_EVT_BLK 4000-4003 PM_TMR 4008-400b pnp 4080-40ff 4200-427f 4280-42ff 4400-447f 5000-503f 5100-513f rtc 8 0070-0077 sata_nv 0970-0977 09f0-09f7 0b70-0b73 0bf0-0bf3 ac00-ac0f b000-b07f serial 03f8-03ff timer 0 timer0 0040-0043 timer1 0050-0053 vesafb 03c0-03df $
An exhaustive listing of files would take too long, but here's the description of some of them:
cpuinfo
: this file
contains, as its name says, information on the processor(s) present in
your machine.
modules
: this file
contains the list of modules currently used by the kernel,
along with the usage count for each one. In fact, this is
the information used by the lsmod command which
displays it in a more readable form.
meminfo
: this file
contains information on memory usage at the time you print its
contents. The free command will display the same
information in a easier-to-read format.
apm
: if you
have a laptop, displaying the contents of this file allows you
to see the state of your battery. You can see whether the AC
is plugged in, the charge level of your battery, and if the
APM BIOS of your laptop supports it (unfortunately
this is not the case for all laptops), the remaining battery
life in minutes, etc. The file isn't very readable by itself,
therefore you want to use the apm command
instead, which gives the same information in a human readable
format.
Note that modern computers now provide ACPI support instead of APM. See below.
bus
: this
subdirectory contains information on all peripherals found on
different buses in your machine. The information is usually not
readable, and for the most part it is reformatted with external
utilities: lspcidrake, lspnp, etc.
acpi
: several of the files
and directories provided in this directory are interesting
especially for laptops, where you can select several
power-saving options. Note that it is easier to modify those
options using a higher level application, such as the ones
included in the acpid
kapacity
packages.
The most interesting entries are:
battery
Shows how many batteries are in the laptop, and related information as current remaining life, maximum capacity, etc.
button
Allows you to control actions associated to “special” buttons such as power, sleep, lid, etc.
fan
Displays the state of the fans on your computer, whether they are running or not, and enables you to start/stop them according to certain criteria. The amount of control of the fans in your machine depends on the motherboard.
processor
There is one subdirectory for each of the CPUs in your machine. Control options vary from one processor to another. Mobile processors have more features enabled, including:
Note that there are several processors that do not offer these possibilities.
thermal_zone