Initialization

Before the proc filesystem can be used, it must be mounted with mount, and the kernel must set up and initialize several data structures to describe the filesystem structure in kernel memory. Unfortunately, the appearance and contents of /proc differ substantially from platform to platform and from architecture to architecture, and the code is crammed with #ifdef pre-processor statements that select code sections according to the particular situation. Although this practice is frowned upon, it simply cannot be avoided.

Because initialization differences relate primarily to creation of the subdirectories that subsequently appear in /proc, they are not evident in Figure 10-2, which shows a code flow diagram of proc_root_initin fs/proc/root.c.

proc_root_init proc_init_inodecache

register_filesystem

kern_mount_data

proc_misc_init

proc_net_init|

—> Create directories with proc_mkdir

Continue reading here: Figure 102 Code flow diagram for procrootinit

Was this article helpful?

0 0