Zhang Yu + "Linux kernel analysis" MOOC course http://mooc.study.163.com/course/USTC-1000029000
Process Descriptor TASK_STRUCT Data structure
The process descriptor provides the kernel information that the kernel needs to know. The TASK_STRUCT data structure is very large.
The process state of Linux and the process state described in the operating system principle appear to be different. Essentially the same, ready state, running state, blocking state.
All the process states
Process identifiers
Linked List of processes
It is a doubly linked list that connects all the processes together. A linked list can be operated independently,
Each process has its own independent process address space.
Parent-child Relationship
This is the management of the parent-child relationship in the process
The ptraced is for debugging purposes.
Creation of processes
The fork system call returns one time between the parent and child processes, which becomes two processes. This fork () system call allows you to create a process in the user state.
A normal system call:
When the fork () is called
The parent process returns normally with normal calls, and the child processes generated by the fork are returned inside the kernel.
Fork, Vfork, clone all can create new processes, and all are created by calling Do_fork to implement the process.
Creating a new process is done by replicating the current process.
Linux creates a new process by replicating the parent process, so it provides an ideal framework for us to understand this process:
The system calls the kernel handler functions sys_fork, Sys_vfork, Sys_clone.
The DUP task struct--copies the task struct.
Child process
The child process starts from return_from_fork and then challenges to Syscall_exit, which is returned in the system call.
Description of the process and creation of the process