Wednesday, December 28, 2022

What is The /proc Filesystem

The /proc directory contains virtual files that are windows into the current state of the running Linux kernel. This allows the user to peer into a vast array of information, effectively providing them with the kernel's point-of-view within the system. In addition, the user can use the /proc directory to communicate particular configuration changes to the kernel.


A Virtual Filesystem


In Linux, everything is stored in files. Most users are familiar with the two primary types of files, text and binary. However, the /proc directory contains files that are not part of any filesystem associated with your hard disks, CD-ROM, or any other physical storage device connected to your system (except, arguably, your RAM). Rather, these files are part of a virtual filesystem, enabled or disabled in the Linux kernel when it is compiled.


By default, when a Red Hat Linux system starts up, a line in /etc/fstab is responsible for mounting the /proc filesystem.


none         /proc       proc       defaults       0 0


The best way to understand /proc as a virtual filesystem is to list the files in the directory. The following is only a partial excerpt of such a list:


Viewing Virtual Files

By using cat, more, or less commands in combination with the files within /proc, you can immediately access an enormous amount of information about the system. As an example, if you want to see how the memory registers are currently assigned on your computer:


cat /proc/iomem

00000000-0009fbff : System RAM

0009fc00-0009ffff : reserved

000a0000-000bffff : Video RAM area

000c0000-000c7fff : Video ROM

000f0000-000fffff : System ROM

00100000-03ffcfff : System RAM

  00100000-002557df : Kernel code

  002557e0-0026c80b : Kernel data

03ffd000-03ffefff : ACPI Tables

03fff000-03ffffff : ACPI Non-volatile Storage

dc000000-dfffffff : S3 Inc. ViRGE/DX or /GX

e3000000-e30000ff : Lite-On Communications Inc LNE100TX

  e3000000-e30000ff : eth0

e4000000-e7ffffff : Intel Corporation 440BX/ZX - 82443BX/ZX Host bridge

ffff0000-ffffffff : reserved

[root@bleach /]# 

references:

https://mirror.apps.cam.ac.uk/pub/doc/redhat/ES2.1/rhl-rg-en-7.2/ch-proc.html

No comments:

Post a Comment