-
Notifications
You must be signed in to change notification settings - Fork 1
Summary of the Book The Linux Programming Interface
Linux kernel is a central software layer that manages and allocates computer resources (i.e., the CPU, RAM, and devices). Linux kernel executable resides at the pathname /boot/vmlinuz, e.g. vmlinuz-4.15.0-88-generic
Linux is a preemptive multitasking(抢占式多任务) operating system, Multitasking means that multiple processes (i.e., running programs) can simultaneously reside in memory and each may receive use of the CPU(s). Preemptive means that the rules governing which processes receive use of the CPU and for how long are determined by the kernel process scheduler.
- Processes are isolated from one another and from the kernel.
- Only part of a process needs to be kept in memory.
Processes can request the kernel to perform various tasks using kernel entry points known as system calls
Areas of virtual memory can be marked as being part of user space or kernel space.
Difference between Process and kernel:a process can request that the kernel create another process. a Process can not create another process and can not finish itself. Kernel controlls everything about processes.
A symbolic link provides an alternative name for a file. Symbolic link is a specially marked file containing the name of another file.
- read permission allows the contents of (i.e., the filenames in) the directory to be listed;
- write permission allows the contents of the directory to be changed (i.e., filenames can be added, removed, and changed);
- execute (sometimes called search) permission allows access to files within the directory (subject to the permissions on the files themselves).
- A filter is the name often applied to a program that reads its input from stdin, performs some transformation of that input, and writes the transformed data to stdout.
- Examples of filters include cat, grep, tr, sort, wc, sed, and awk.
- A process is an instance of an executing program. When a program is executed, the kernel loads the code of the program into virtual memory, allocates space for program variables, and sets up kernel bookkeeping(簿记) data structures to record various information (such as process ID, termination status, user IDs, and group IDs) about the process.
- processes are the entities among which the kernel must share the various resources of the computer
A Process has the following segments(parts):
- Text: the instructions of the program.
- Data: the static variables used by the program.
- Heap: an area from which programs can dynamically allocate extra memory.
- Stack: a piece of memory that grows and shrinks(缩小) as functions are called and return and that is used to allocate storage for local variables and function call linkage information.
A daemon is a process, that is long-lived and run in the background and has no controlling terminal.
certain daemons are run as kernel threads
the following processes sind daemons: cron, sshd, httpd and inetd