
The figure shows a rectangular block that is divided into two layers. The first layer consists of three circles labeled sh, sh, and Is, they are again labeled P I D equals 501, P I D equals 748, and P I D equals 748. The second layer consists of two rectangular blocks labeled fork code and exec code. An arrow labeled New process is pointed to the second circle. Another arrow labeled the Same process is pointed to the second and third circles. An arrow is pointed to the fork code block and labeled Allocate childs task structure Fill childs task structure from parent Allocate childs stack and user area Fill childs user area from parent Allocate PID for child Set up a child to share parents text Copy page tables for data and stack Set up sharing of open files Copy parents registers to the child. Another arrow is pointed to the exec code block and labeled Find the executable program Verify the execute permission Read and verify the header Copy arguments, environ to kernel Free the old address space Allocate new address space Copy arguments, environ to stack Reset signals Initialize registers. The steps are given as follows: 1. An arrow labeled Fork calls from the first circle to the fork code. 2. An arrow labeled New sh created from the fork code to the second circle. 3. An arrow labeled exec call from the second circle to the exec code. 4. An arrow labeled sh overlaid with Is from the exec code to the third circle.
Back