INIT content: What is init: init is an indispensable program in Linux system operations. The so-called init process, it is a user-level process that is started by the kernel. The kernel starts self-launch (already loaded into memory, start running, and has initialized all device drivers and data structures, etc.), the boot process is completed by launching a user-level programin init. So, init is always the first process (its process number is always 1). The kernel severages several places that INIT have used in the past, and its correct position (for Linux systems) is / sbin / init. If the kernel can't find init, it will try to run / bin / sh. If the operation fails, the system starts will fail.
SHM content
Excerpt from:
Http://www-900.ibm.com/developerWorks/cn/linux/l-ipc/part5/index1.shtml
Shared memory can be said to be the most useful process communication method, and the fastest IPC form. The two different processes A, B shared memory means that the same physical memory is mapped to process A, B respective process address space. Process A can immediately see the update of data in the shared memory, and vice versa. Since multiple processes share the same memory area, you must need some synchronous mechanism, mutex, and signal quantities.
An obvious advantage of using shared memory communication is efficiency, because the process can directly read and write memory without having to copy any data. For communication methods such as pipelines and message queues, you need to make four data copies in the kernel and user space, and shared memory only copies two data [1]: once from the input file to the shared memory area, another from the sharing The memory area to the output file. In fact, when the process is shared between the processes, the mapping is not always read and written, and when new communication is released, the shared memory area is re-established. Instead, keep the shared area until the communication is completed, so that the data content has been saved in the shared memory and does not write back the file. The content in shared memory is often written back to the file when the mapping is released. Therefore, the efficiency of communication mode using shared memory is very high.
Linux's 2.2.x kernel supports multiple shared memory methods, such as MMAP () system calls, POSIX shared memory, and system V shared memory. Linux distribution versions such as Redhat 8.0 support MMAP () system calls and system v shared memory, but has not implemented POSIX shared memory, this article will mainly introduce the principle and application of MMAP () system calls and system V shared memory APIs.