Kernel Abstraction
- 0
- Add a Comment
Kernel Abstraction
And you thought filesystems always had to physically reside on a disk … nope. There’s a filesystem in Linux that *doesn’t* really exist anywhere on disk. It’s merely an abstract of kernel functions and variables - a description, in other words, of what each piece of the kernel should do. This vaporous filesystem is called /proc.
Similar to the Registry in Windows 2000, /proc allows system administrators to communicate directly with the kernel. This makes it possible to create small kernel tweaks or read kernel statistics without the need for a full-blown set of kernel tools.
Each entry in the /proc directory (remember - they’re not really files!) corresponds to a particular function or variable in the kernel. For example, the command
more /proc/pci
will return a detailed list of all pci devices installed in your machine. pci, in this case, communicates directly with the kernel to request this information. The kernel generates the report and passes it back to more for display on your screen. The command
cat /proc/cpuinfo
will display a report of all the pertinent information on the cpu in your machine. Again, cpuinfo requests the information directly from the kernel. The kernel, in turn, passes the information back to cat for display.
Here are some of the useful entries in the /proc directory:
| Entry | Function |
| /proc/meminfo | memory usage status |
| /proc/modules | produces the same output as lsmod - listing the loaded modules | /proc/sound | information about currently active sound cards and the sound subsystem |
| /proc/ide/* | information about all the machine’s IDE devices |
| /proc/sys/dev/cdrom/info | information about all the install cdrom drives |
When is a filesystem not really a filesystem? When it’s an abstract of the kernel - the /proc directory in Linux.
