ECET 360 Week 2 iLab

Published on January 2018 | Categories: Books - Non-fiction | Downloads: 107 | Comments: 0 | Views: 1169
of 1
Download PDF   Embed   Report

Accessing Your Lab To access your labs after you've logged in, apply the following steps: Click the Professional Development tab located on the top of the page. Select "Development Paths". You will see the course that you are taking listed on this page. Click the course to see the labs. Starting Your Lab There are two ways to start a lab activity: Schedule It. (Recommended) Because you have access to live equipment, there is only a defined number of students who can use any one lab at any given time. It is recommended to schedule your labs to make sure the lab is available to you at your convenience. If you try to log into a lab and the access is denied, the system will let you schedule the lab at a later date. Start it right away. L A B O V E R V I E W Scenario/Summary Process Management Simulation (Part 2 of 3) The objective of this three section lab is to simulate four process management functions: process creation, replacing the current process image with a new process image, process state transition, process scheduling. This lab will be due over the first three weeks of this course. The commander process program is due in week 1. This program will introduce the student to system calls and other basic operating system functions. The process manager functions: process creation, replacing the current process image with a new process image andprocess state transition, are due in week 2. The scheduling section of the process manager is due in week 3. You will use Linux system calls such as fork( ), exec(), wait( ), pipe( ), and sleep( ). Read man pages of these system calls for details. This simulation exercise consists of three processes running on a Linux environment: commander, process manager, andreporter. There is one commander process (this is the process that starts your simulation), one process manager process that is created by the commander process, and a number of reporter processes that get created by the process manager, as needed. 1. Commander Process: The commander process first creates a pipe and then the process manager process. It then repeatedly reads commands from the standard input and passes them to the process manager process via the pipe. The commander process accepts four commands: 1. Q: End of one unit of time. 2. U: Unblock the first simulated process in blocked queue. 3. P: Print the current state of the system. 4. T: Print the average turnaround time, and terminate the system. Command T can only be executed once. 1.1 Simulated Process: Process management simulation manages the execution of simulated processes. Each simulated process is comprised of a program that manipulates the value of a single integer variable. Thus the state of a simulated process at any instant is comprised of the value of its integer variable and the value of its program counter. A simulated process™ program consists of a sequence of instructions. There are seven types of instructions as follows: 1. S n: Set the value of the integer variable to n, where n is an integer. 2. A n: Add n to the value of the integer variable, where n is an integer. 3. D n: Subtract n from the value of the integer variable, where n is an integer. 4. B: Block this simulated process. 5. E: Terminate this simulated process. 6. F n: Create a new simulated process. The new (simulated) process is an exact copy of the parent (simulated) process. The new (simulated) process executes from the instruction immediately after this (F) instruction, while the parent (simulated) process continues its execution n instructions after the next instruction. 7. R filename: Replace the program of the simulated process with the program in the file filename, and set program counter to the first instruction of this new program. An example of a program for a simulated process is as follows:

Comments

Content

Accessing Your Lab To access your labs after you've logged in, apply the following steps: Click the Professional Development tab located on the top of the page. Select "Development Paths". You will see the course that you are taking listed on this page. Click the course to see the labs. Starting Your Lab There are two ways to start a lab activity: Schedule It. (Recommended) Because you have access to live equipment, there is only a defined number of students who can use any one lab at any given time. It is recommended to schedule your labs to make sure the lab is available to you at your convenience. If you try to log into a lab and the access is denied, the system will let you schedule the lab at a later date. Start it right away. L A B O V E R V I E W Scenario/Summary Process Management Simulation (Part 2 of 3) The objective of this three section lab is to simulate four process management functions: process creation, replacing the current process image with a new process image, process state transition, process scheduling. This lab will be due over the first three weeks of this course. The commander process program is due in week 1. This program will introduce the student to system calls and other basic operating system functions. The process manager functions: process creation, replacing the current process image with a new process image andprocess state transition, are due in week 2. The scheduling section of the process manager is due in week 3. You will use Linux system calls such as fork( ), exec(), wait( ), pipe( ), and sleep( ). Read man pages of these system calls for details. This simulation exercise consists of three processes running on a Linux environment: commander, process manager, andreporter. There is one commander process (this is the process that starts your simulation), one process manager process that is created by the commander process, and a number of reporter processes that get created by the process manager, as needed. 1. Commander Process: The commander process first creates a pipe and then the process manager process. It then repeatedly reads commands from the standard input and passes them to the process manager process via the pipe. The commander process accepts four commands: 1. Q: End of one unit of time. 2. U: Unblock the first simulated process in blocked queue. 3. P: Print the current state of the system. 4. T: Print the average turnaround time, and terminate the system. Command T can only be executed once. 1.1 Simulated Process: Process management simulation manages the execution of simulated processes. Each simulated process is comprised of a program that manipulates the value of a single integer variable. Thus the state of a simulated process at any instant is comprised of the value of its integer variable and the value of its program counter. A simulated process™ program consists of a sequence of instructions. There are seven types of instructions as follows: 1. S n: Set the value of the integer variable to n, where n is an integer. 2. A n: Add n to the value of the integer variable, where n is an integer. 3. D n: Subtract n from the value of the integer variable, where n is an integer. 4. B: Block this simulated process. 5. E: Terminate this simulated process. 6. F n: Create a new simulated process. The new (simulated) process is an exact copy of the parent (simulated) process. The new (simulated) process executes from the instruction immediately after this (F) instruction, while the parent (simulated) process continues its execution n instructions after the next instruction. 7. R filename: Replace the program of the simulated process with the program in the file filename, and set program counter to the first instruction of this new program. An example of a program for a simulated process is as follows:

Sponsor Documents

Or use your account on DocShare.tips

Hide

Forgot your password?

Or register your new account on DocShare.tips

Hide

Lost your password? Please enter your email address. You will receive a link to create a new password.

Back to log-in

Close