UTD CS 5348 - Section 3: Process Description and Control

Unformatted text preview:

Section 3: Process Description and Control Question 1 Answers to this question are found in the textbook. 1. Explain the meaning of a process’s instruction trace. 2. Explain the instruction trace presented in Figure 3.4 in the book. How many processes are represented in this figure? What is meant by Time-Out and by I/O Request? 3. Explain the role of the dispatcher service in all of this. How is the dispatcher represented in Figure 3.4? Answer 1. The instruction trace is a list (or trace) of the instruction address that a process executes over some given time range while in the ‘Running’ state. 2. Figure 3.4 illustrates the execution of three processes interleaved with the dispatcher’s execution. The execution of a process divided into slices and every eligible process is to be given a turn executing. The process’s execution can be interrupted for two reasons in this example. Either the process executes a Blocking I/O Request (Blocking SYSCALL) or it executes for the full duration of its time-slice and is preempted by time-out interrupt. 3. The dispatcher is the OS mechanism that selects, installs, and allows to execute a “ready to execute” process from the Read Process Queue. The dispatcher’s execution is represented by the gray shaded traces which execute the same instructions each time. Question 2 1. What is a Process Image? 2. In what two places does a process image reside? 3. What are the five generic steps involved with building a new process image? Answer 1. The process image is the region of memory (disk or main memory) containing the instructions / data / stack of the program being executed. Note that in the model presented in the text, the image also contains the Process Control Block. In this class, the PCB resides in the Kernel for security purposes. 2. The process image resides on the system drive (as a file) and in main memory. The image is initially created on the drive and copied into main memory for execution. 3. The five generic steps are:1. Allocate space for the new image on the system (swap) drive. Copy text and data segments from the executable file to the new image. 2. Create the Process Control Block and other kernel data structures needed by the OS to maintain the process’s execution. 3. Assign a unique process ID (PID) to the new process. 4. Copy the image from the system drive into main memory. 5. Put the new Process in the Ready state and place in the Ready FIFO Queue. Question 3 Using Figure 3.6, describe the process states and conditions that cause a process to transition from one state to another i.e. 1) The transition from New to Ready. 2) Ready to Running 3) Running to Ready 4) Running to Blocked 5) Blocked to Ready 6) Running to Exit. Answer New to Ready: When a new process has been fully installed by the OS i.e. its Process Control Block has been created, its process image has been created, and it is ready to be installed in the ready queue for its turn at execution. Ready to Running: The dispatcher selects a ready process from the Ready Process FIFO. The process’s Processor Context is installed on the processor and the process begins executing its current slice. Running to Ready: The process has completed it slice (time-out). Is processor context is saved and it is moved to the back of the FIFO waiting for its turn to be re-scheduled. Running to Blocked: The process has executed a blocking system call (e.g. I/O request) and its execution is blocked while it waits for the associated event (interrupt) signaling that the request has completed and the process can resume execution. Blocked to Ready: The blocked process’s event has occurred and it is once again eligible for execution. It is moved from the blocked list to the ready queue. Running to Exit: The process has been released by the OS for one of several reasons given in the book and slides. The process control block is release and system resources allocated to the process are also released. Question 4 Describe the difference between the monolithic kernel architecture and the process-based kernel architecture. Include a description about how user processes access kernel services in each model.Answer The monolithic kernel architecture implements the kernel as a single (monolithic) block of executable instructions that is loaded and executed at system boot. The kernel instructions provide the facilities needed to create and maintain processes, device interrupt handlers, and individual syscall instructions (e.g. read(), open(), malloc(), etc.). Also included is the syscall handling mechanism used to transfer control from a process to code residing in the kernel program. The process-based kernel architecture (also known as a Microkernel architecture) implements its services as ‘kernel processes’ (see Slide 39). Kernel Processes are processes separate from the MicroKernel, but run in Kernel Mode as these processes can access individual devices. Both user programs and kernel services are implemented as individual processes. Processes (user and kernel) are interconnected by a relatively simple service layer that provides process management (creation and switching) and a fast Inter-Process Communication. The later allows user processes to make service requests (syscalls) to kernel processes. Question 5 Describe what it means to “Suspend a Process”. Why would the system operator choose to suspend a process? What is the benefit of suspending a process? Answer 1. A suspended process is one that has been set into a ‘suspended’ state and while in the suspended state, will not be scheduled for execution (i.e. made Ready). 2. Suspension is useful if the system finds itself over-capacity. That is, if there is a shortage of physical memory, I/O capacity, or other limited resource such that the system begins thrashing and no progress is being made by any of the executing processes. 3. The benefit of process suspension is that a process can be temporarily halted (i.e. suspended from execution) freeing memory, processor, and other resources (I/O capacity and others) for the remaining executing processes. Because the process is only suspended (and not terminated), a suspended process can later be un-suspended and continue execution. Question 6 1. What are the two system calls used to create and launch a new executable process in the Linux (Unix) operating system. 2. Describe how a parent process uses these two calls to create

View Full Document

UTD CS 5348 - Section 3: Process Description and Control

Download Section 3: Process Description and Control
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...

Join to view Section 3: Process Description and Control and access 3M+ class-specific study document.

We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Section 3: Process Description and Control 2 2 and access 3M+ class-specific study document.


By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?