Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You are to implement the Fork() , Yield) , Exit Exec), Kill, and Join() system calls. The function prototypes of the system calls are listed

image text in transcribedimage text in transcribed

You are to implement the Fork() , Yield) , Exit Exec), Kill, and Join() system calls. The function prototypes of the system calls are listed in syscal1.h and act as follows The Fork (func) system call creates a new user-level (child) process, whose address space starts out as an exact copy of that of the caller (the parent), but immediately the child abandons the program of the parent and starts executing the function supplied by the single argument Fork should return pid of child process (SpaceId). Notice this definition is slightly different from the one in the syscall.h file in Nachos. Also, the semantics is not the same as Unix fork(). After forked function func finishes, the control should go back to the instruction after the initial system call Fork The Yield() call is used by a process executing in user mode to temporarily relinquish the CPU to another process. The return value is undefined. The Exit(int) call takes a single argument, which is an integer status value as in Unix. The currently executing process is terminated. For now, you can just ignore the status value. You need to supply this value to parent process if and when it does a Join() .The Exec(filename) system replaces the current process state with a new process executing program from file. You can think as if the current process stops executing and the new program is loaded in its place. The new program uses the object code from the Nachos object file which You are to implement the Fork() , Yield) , Exit Exec), Kill, and Join() system calls. The function prototypes of the system calls are listed in syscal1.h and act as follows The Fork (func) system call creates a new user-level (child) process, whose address space starts out as an exact copy of that of the caller (the parent), but immediately the child abandons the program of the parent and starts executing the function supplied by the single argument Fork should return pid of child process (SpaceId). Notice this definition is slightly different from the one in the syscall.h file in Nachos. Also, the semantics is not the same as Unix fork(). After forked function func finishes, the control should go back to the instruction after the initial system call Fork The Yield() call is used by a process executing in user mode to temporarily relinquish the CPU to another process. The return value is undefined. The Exit(int) call takes a single argument, which is an integer status value as in Unix. The currently executing process is terminated. For now, you can just ignore the status value. You need to supply this value to parent process if and when it does a Join() .The Exec(filename) system replaces the current process state with a new process executing program from file. You can think as if the current process stops executing and the new program is loaded in its place. The new program uses the object code from the Nachos object file which

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning VB 2008 Databases

Authors: Vidya Vrat Agarwal, James Huddleston

1st Edition

1590599470, 978-1590599471

More Books

Students also viewed these Databases questions