
Lead Image © psdesign1, Fotolia.com
Kernel and driver development for the Linux kernel
Core Technology
In keeping with the central Unix philosophy that everything is a file, Linux systems publish system information through the virtual filesystems /proc
and /sys
(see the "Proc Filesystem" box). This brilliant mechanism gives the user read and write access to system internals with the read()
and write()
functions.
Proc Filesystem
The /proc
virtual filesystem folders and files are not stored on a hard disk; rather, the kernel creates them dynamically on access. The term "proc" derives from "processes"; thus, it is clear that the /proc
filesystem primarily provides information about computing processes (Figure 1).
For each computational process, the kernel creates a new directory with the process identification number as its name. Below the directory, you find extensive information about the job, including the call parameters (cmdline
), shared file descriptors (fd
) and environment variables (environ
), and process statistics.
In addition to information about computing processes, the kernel uses the virtual filesystem to share information with the user system and receive configurations. All data for the current CPU is in /proc/cpuinfo
, interrupt sources and the frequency of their occurrence is under /proc/interrupts
, and info for activated device drivers with their device numbers is under /proc/devices
. Writing 1
to /proc/sys/net/ipv4/ip_forward
enables routing in the Linux kernel and configures the watchdog feature when written to /proc/sys/kernel/watchdog
. KL:Navigating the /proc
filesystem is both useful and instructive. A proc file name reveals how important a file in
Buy this article as PDF
(incl. VAT)
Buy ADMIN Magazine
Subscribe to our ADMIN Newsletters
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Most Popular
Support Our Work
ADMIN content is made possible with support from readers like you. Please consider contributing when you've found an article to be beneficial.
