Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The user-level program below shows the way to create a new process with fork(). pid_t cpid; cpid fork (); if (cpid != 0) {
The user-level program below shows the way to create a new process with fork(). pid_t cpid; cpid fork (); if (cpid != 0) { (ii) // parent's code } else { } // child's code (a) What are system calls? Apart from fork(), give an example of system call for process control and for file manipulation respectively in the Linux OS. (5 marks) (b) Describe the meaning of "dual mode operation" in an OS, and explain how it allows the OS to protect itself and other system components. (5 marks) (c) When fork() is invoked (i.e., called), "process switch" happens. (i) What kind of process switching mechanism is the above? State the cause and the use of such process switching mechanism. (3 marks) Describe the operations done by the OS during the process switch above. (4 marks) (d) Suggest a scenario that causes the child process created to become a zombie process, and propose the action to be done by the parent process to avoid such. (4 marks) (e) Suggest a scenario that causes the child process created to become an orphan process, and propose the action to be done by the parent process to avoid such. (4 marks)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started