Quickly understand the proc directory under Linux system


/Proc / devices file
This file lists the master device numbers of character and block devices, as well as the device names assigned to those device numbers.

The common command is # cat / proc / devices (this is still useful when debugging the driver. You can check whether the driver module is loaded through lsmod)



Each line of this file has a reserved interrupt. The fields in each line are: interrupt number, the number of interrupts in this line, and the fields with a plus sign (SA)_ Interrupt flag setting), and the name of the driver that registers the interrupt. Before installing the new hardware, you can manually view the file in hand with the cat command just like / proc / DMA and / proc / ioports. These files list the resources currently in use (but not those used by hardware that does not have drivers loaded).

The common command is cat / proc / interrupts


/Proc / ioports file
This file lists many I / O port ranges registered by various device drivers such as disk drives, Ethernet cards, and sound cards.

The common command is cat / proc / ioports


/Proc / kmsg file
This file is used to retrieve kernel messages generated with printk. Only one process with super user privilege can read this file at any time. You can also retrieve these messages by calling syslog. These messages are usually retrieved using the tool dmesg or the daemon klogd.


/Proc / ksyms file
This file lists registered kernel symbols; these symbols give the addresses of variables or functions. Each line gives the address of a symbol, the name of the symbol, and the module that registers the symbol. The programs ksyms, insmod and kmod use this file. It also lists the number of running tasks, the total number of tasks and the last PID assigned.