SLIDE 1
1
CMPT 300 All three Sections Project 2 Due: April 3, 2002, 430 pm In this project, a group of students (2-3 students per group) are asked to design and implement a simulation of a tiny operating system TOY-OS. The grading will be based on your written answers to questions posed in each of the following tasks, a technical report and a demo. You have 10-15 minutes to showcase your system and answer questions from TA. The marks assigned the project will be distributed as specified within this document. However, software (and personnel !) failures during the demo will result in marks deducted from the overall project. The hand-in of Tasks 1-3 should be clear and brief, while the technical report should be comprehensive. A virtual computer TOY: In virtual computer TOY, the time unit is called tick. There are only three kinds of instructions as follows.
- RUN: keep CPU busy for 1 tick.
- IO: do an I/O operation. It keeps the CPU busy for 1 tick and takes I/O devices 10-20 ticks to
- finish. The duration of an I/O operation is determined by a random number produced when the
I/O operation is started.
- END: the program ends.
Each program of TOY may be between 1M and 32M in size. Please assume that your operating system is stored in a separate space which is not part of the main memory used by user programs. In other words, you do not need to manage the memory of the operating system. Task 1: Simulate the hardware of TOY (20 points): Design and implement classes to simulate TOY and programs of TOY. The behaviors of a program are determined by three parameters as follows.
- Size of the program in megabytes s, 1<=s<=32
- Number of steps n_steps. The program ends after running n_steps ticks on the CPU, excluding
the I/O period.
- CPU workload w (10<=w<=90). In the program, w% of instructions are RUN and (100-w)% are