Find Jobs
Hire Freelancers

OS_software

$10-30 CAD

Closed
Posted over 9 years ago

$10-30 CAD

Paid on delivery
CPU Scheduler is a key component of any multiprogramming operating system (OS) kernel. It is very important to understand all details about the CPU scheduler if you want to know dynamic behaviors of an operating system. In this project, you are asked to write some C programs to simulate the following three CPU scheduling algorithms for a multi-core computing system consisting of four (4) homogeneous CPU’s: (a) FCFS (first-coming-first-serving) scheduling. (b) RR (round robin) scheduling with time quantum q=2 milliseconds, q=12 milliseconds, q=50 milliseconds, respectively. (c) Three-level feedback-queue (FBQ) preemptive scheduling with q1=10 milliseconds and q2=30 milliseconds, as shown in Figure 6.7 in the textbook. Read the corresponding text for details about this scheduling algorithm. Based on a given static CPU workload , your program must calculate and answer all the following questions for each of the above CPU schedulers: What is the average waiting time? What is the average turnaround time? When does the CPU finish all these processes? What is average CPU utilization by this time point? (At any time instance, CPU utilization is 400% if all 4 CPUs are running, 300% if only 3 CPUs are running, 200% for 2 CPUs, 100% for only 1 CPU, 0% if no CPU is running.) How many context switches occur in total during the execution? (How to count context switch for this question: you should count as context switch only for those cases where a process is preempted during its CPU bursts, not for those cases where a process terminates or just finishes its current CPU bursts and goes to I/O.) Which process is the last one to finish? In this project, you need to write three C programs to implement the above CPU schedulers. For FCFS scheduler, your program is called "fcfs.c". For RR scheduler, your program is called "rr.c". For FBQ scheduler, your program is called “fbq.c”. When the programs run, they should print out the answers to all of the above questions to the standard output. In this project, you are provided with some helper functions, which includes C functions to load data from a CPU load file, to sort processes, to do linked-list based scheduling queue implementation. You can download them (sch-helpers.c and sch-helpers.h) and directly use them in your code. Please read closely the hints at the beginning of sch-helpers.c for how to use these helper functions. You are free to make any modifications to these two files to fit your need. Data Format The CPU workload data file can be downloaded from the course Web, which is an ASCII file made in Unix system. Each line represents one process with the following format: (all numbers are in unit of millisecond) pid arrival_time 1st_CPU_burst (1st_IO_burst) 2nd_CPU_burst (2nd_IO_burst) ... e.g. 0 0 4 (100) 12 (67) 2 ... 1 13 7 (210) 20 (23) 67 ... where each I/O burst includes both the time waiting in the device queue and the time spent in actual I/O operations. When you implement each scheduler, if two or more processes are identical in terms of scheduling criterion, you should give priority to a process that has the lowest pid number. What to submit? fcfs.c ssch-helpers.c sch-helpers.h And your code should run like: fcfs < [login to view URL] After the first deadline, a sample code of FCFS scheduler will be posted online for you to debug your code and learn how to write a good C program. Then you will continue to finish the remaining schedulers by the second deadline. Part II submit 3221 project2 rr.c submit 3221 project2 fbq.c submit 3221 project2 sch-helpers.c submit 3221 project2 sch-helpers.h Both rr.c and fbq.c should compile and run in the same way as fcfs.c. gcc –Wall –o rr rr.c sch-helpers.c gcc –Wall –o fbq fbq.c sch-helpers.c And rr and fbq should take a time slice as command-line argument and run as follows: rr 2 < [login to view URL] rr 12 < [login to view URL] rr 50 < [login to view URL] fbq 10 30 < [login to view URL]
Project ID: 7158888

About the project

3 proposals
Remote project
Active 9 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
3 freelancers are bidding on average $60 CAD for this job
User Avatar
Read y!Read y!Read y!Read y!Read y!Read y!Read y!Read y!Read y!Read y!Read y!Read y!Read y!Read y!Read y!Read y!Read y!Read y!Read y!Read y!Read y!Read y!Read y!
$100 CAD in 1 day
5.0 (38 reviews)
5.4
5.4
User Avatar
A proposal has not yet been provided
$25 CAD in 1 day
5.0 (13 reviews)
4.2
4.2
User Avatar
Hi, I could do this for you. maybe we coud chat furthor THX.
$56 CAD in 2 days
5.0 (1 review)
1.0
1.0

About the client

Flag of CANADA
Toronto, Canada
5.0
5
Payment method verified
Member since Jul 7, 2014

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.