联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-23:00
  • 微信:codinghelp

您当前位置:首页 >> C/C++编程C/C++编程

日期:2019-05-23 11:01

48450 Real Time Operating Systems

Assignment 3 (25 marks)

Deadline for submission: 23:59 PM, 22 May 2019

1. Introduction

This assignment will involve the development of some applications with CPU scheduling and

Memory management. You are required to create a program that applies several key concepts

of 48450 (RTOS) subject. A submission will be marked on its merits and may be awarded a

mark that is less than 25 score if it's of modest quality. You are required to include a reflective

self-assessment in the conclusion and submit it by the due date.

All programs are implemented in C language.

This assignment is marked out of 25 points and comprises 25% of the total score for this

course.

2. Assignment details

CPU Scheduling, FIFOs (named Pipe), Memory management and

Signals

The program implementation will involve using the concepts of CPU scheduling, FIFOs and

Signal concepts. Your program is required to include two parts, namely Program_1 and

Program_2:

(1) Program_1 (11 points): You are required to use CPU scheduling and FIFOs (named

Pipe) in the Program_1. It should include two threads, Threads 1 and 2.

Thread 1: In this thread, the Program_1 is to simulate CPU scheduling by applying

Round Robin (RR). In this assignment, the time quantum of RR is 4 milliseconds

and the unit of the burst time is millisecond. Your program is required to measure

the average waiting time and turn-around time in the CPU scheduling. After the CPU

scheduling is completed, your program is required to define a FIFOs and write these

average waiting time and turn-around time to CPU memory through the FIFOs(named

Pipe). The input data involving the CPU scheduling are as follows:

Process ID Arrive time Bust time

1 8 10

2 10 3

3 14 7

4 9 5

5 16 4

6 21 6

7 26 2

Note:

1) You are required to draw a Gantt Chat to illustrate the schedules of process 1

to process 7 in your report.

2) Only the RR scheduling are applied for this Program_1

Thread 2: In this thread, your program is required to read the average waiting time

and turn-around time from the memory through the FIFOs (named Pipe) as defined

in the Thread 1. Then, your program is required to write those read data to a text file

named “output.txt”.

(2) Program_2 (11 points): You are required to use Memory Management and Signal

in the Program_2. Your program is to simulate page-replacement for virtual memory

management by using First-In-First-Out (FIFO) Algorithm. In the Program_2, your

program is required to create 4 frames and the reference string (Please refer to the slide

28 of online lecture) is as follows:

7,0,1,2,0,3,0,4,2,3,0,3,0,3,2,1,2,0,1,7,0,1,7,5

At each point, when a reference string enters into the frames, your program is required

to check whether there is a page fault and output the current frame state including the

page fault number (See the slides 28 of online lecture) on your console (screen). When

the whole reference string entering process is completed, your program is required to

handle a “ctrl+c” Signal. Therefore, when you run your program, the program should

wait for you to press the combined “ctrl+c” keys, your program will then print out the

total number (how many) of fault pages on your console (screen).

(3) Report (3 points): You are required to write a report to summarise your

observation.

Note:

For the command line, it defines “. /assignment3 para1 para2 . . ..”, where para1 and para2

are two input parameters.

For Program_1: the time quantum of RR and the “output.txt” needs to be given from

command line.

For Program_2: the frame number needs to be given from command line (para1 only).

3. Assignment Deadline and Submission

The deadline to submit this assignment is 23:59 PM, 22 May 2019

You are required to submit two formats of the assignment:

1. Upload your full assignment report.

2. Upload your ‘C’ code file

If you use Makefile for compiling your program, you are required to upload the Makefile file

as well


版权所有:留学生编程辅导网 2020 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp