Experimental process
Clone the corresponding mengning/menu.git on 1.github
2. Test Menuos, test fork Direct execution results
3. Configure debug system, go to gdb Debug, use file Linux-3.18.6/vmlinux and target remote:1234 to configure loading initial debugging environment
4. Set breakpoints in the Linux kernel process to create the points that may be used, respectively, sys_clone,do_fork,dup_task_struct,copy_thread,copy_process and Ret_from_fork.
Summarize:
1. Create the process by calling Do_fork;
2. Copy the parent process PCB--task_struct to create a new process and assign a new kernel stack to the new process ;
3. Modify the copied process data, such as PID, process chain list and so on to execute copy_process and Copy_thread 4, successfully create a new
Wang Xue Cheng
Original works reproduced please indicate the source
"Linux kernel Analysis" MOOC course http://mooc.study.163.com/course/USTC-1000029000
Linux kernel and analysis sixth week analyzing the process of creating a new process for the Linux kernel