CPU scheduling simulation for scheduling algorithms FCFS,RR,SRTF using C program. How to compile and execute it using proj2 program.
Examples proj2 input.1 ECES proj2 input.1 RR 2 - tar the files: FCTS scheduling with the data file "input.1 Simulate RR scheduling with time quantum 2 milliscconds (4d parameter is reuired venquantum 1 millen with the data file "input.1" Simulate SRTF scheduling with the data file" inpu. 1" Verify the files have been placed in a tar file: ta--tvf ECS username >-a5qmt2.tar - Compress the liles using grip: qzip
-asqmt 2. tar.FZ proj2 input.1 SRTE 2.3 Sample Inputs and Outputs Sample input files and expected outputs are shown in Appendix. You can use it to verify your results 3 Requirements The project requires to simulate Ri S RR, and SRTI. scheduling for given tasks and to compute the average waiting timc, response time, tumaround time and overall CPU usage. You can find their detinitions in texthook 1. Implement scheduling algorithm for FCFS, RR. and SRTF. The program should schedule tasks and print progress of task every unit time (millisecond) as shown in sample outputs. 2. Print statistical information. As soon as all tasks are completed, the program should compute and print 1 average wailing me 2) average response lime, 3) average lurnaround me and 4) overall CPU usage Note: if you use static array to implement ready queue siructure, you can assume the maximum queue length is 20. 4 Suggested Methodology 1. Implement one scheduling algorithm at each step 2. You can use circular linked list as a queue structure 3. You can use a data siructure similar to PCBach lask, though il will be much simpler 5 Deliverables Make sure your code can be compiled and work on Athena server correctly. Upload to Canvas the following: All source codes/liles thal you have aakled/modilied and the demonstralive resulls, A README.TXT file that briefly describes cach file, ow to compile the file(s). and how to run the file. These files should be placed in a directory called cECS username asgmt2. Use ar command lo place a he liles i a single lile called -asgmt2.tar Assuming you are in the directory -asgmt 2 do the following: - Gio the parent directory: ad. Appendix: about input file and output information by CPU scheduling simulato for FCFS, RR, and SRTF more input 3 16 6 09 ro Usage: proj2 input_file FCFS IRR ISRJF Iquantum] % proj2 input .1 FCFS Schdeuling algorithm: FCFS Total 6 tasks are read from "input.1". press 'enter' to start... process1 is running 1 is running 1 is running 1 is running 1 is running 1 is running time 1> process 2> process 3> process 4> process 5> process process 1 is running process 8> process 9> process 1 is running 1 is running 1 is running process process process process process process process process process system time18> process process process process process process 3 is running process process process process process process process process process5 is running process process process5 is running process5 is running system time34> process process process process process 6 is running process process process system time 41> process system time41> All processes finish 2 is running 2 is running 2 is running 2 is running 2 is running 2 is running 2 is running 2 is running 2 is running 2 is finished... 3 is running 3 is running 3 is running 3 is running 4 is running 4 is running 4 is running is running 5 is running 5 is running 5 is finished...._.. 6 is running 6 is running 6 is running 6 is running 6 is running 6 is running 6 is finished. . .-..... 100.00 Avarage waiting tin : 14.17 Avarag respons" t ine 14, 17 Avar age turnazound tin: 21.00 eyetem timeocess2 15 running proj2 input RR Scldeuling algozitha: RR Tot1 6 t5sk5 are read tron "1npot. 1". pre55 "enter, to tart. eyetem tie10 pcocess1s running cayatatina I> process 1 is running syaten Eime3 proceas 2 ia running systen tine rocess 1s running syaten Eine5 proceas ia running syaten tie proce 3 ia running Cayate 12 peoces 2 is unning eyeten tie1pcocess 2 1s running Cayate 14> peoces 2 is unning Cayate 15> peoces 2 is unning eyetem tie1 pcocess 2 1s running Cayate 1 peoces 2 is unning syaten Eimeproceas 2 ia running systen tine rocess2 1s running ayaten Eie 10x proceas ia running systen tine 11 process 1s running systen tine 12s procas4 ia running syaten tine 13> proceas4 la running systen tine 14s pro 3i running syaten Eie 15s procea 3 ia running systen tine 1b rocess ayaten Eine 17s procea S ia running systen tine rocess1s running systen tine 19s proca running systen tine 2Urocess 2 1s running systen tine 21s proc 2 ia running systen tine 22rocess 1s running systen tine 23rocess 1s running systen tine 24s procas4 i running systen tine 2process1s running Proce88 4 is finished. systen tine 25 rocess 1s running Prot:88 3 is finished systen tine 2rocess1s running Cayate 18> peoces system tine 192 proce 5 caya terti. 20) procesa iuning 5 i5 running 5 is running Cayat Cayate 22> proces5 i run ing 23> peoces iuning caya terti. 24> peace sa 6 is running yeten tine 2pcocess1s running Cayat 26> peoces is runn ing system tine 2.pcoce 5 is running Cayat t 28 pros is runn ing yten tine 29pocess1s running yeten tine 30pcocess1s running systen tie3cocess 1 1s running Cayat 32 pros is runn ing system tiecocess 1 1s running systent cocess 1 1s running systen tine 29rocess 1s running systen tine ans pros unning systen tine 3ls pro 2 i running systen tine 32rocess 2 1s running Prot:88 l is running systen tine rocess 1s running systent 3cocess 1 1s running systenticocess 1 1s running cgys ten, tine L> ALI process 5 finish. ysten tine 35rocess1s running systen ine 36s proS unning Prnrn88 5 is finished. oysten tine process1s running systen tine 3Rs pros unning ysten tine rocess 2 1s running va-ag waiting tine: 10.50 vaage response ti9.0U ysten tine process 1s running A1 processes finish Avaraqe esponse tine.00 Avarage turnaround tine: 29.33 s pro12 input.2 SRTE sehdnulingignrittin: SRTT Tatal 6 tkxar" rnsd from "input. .. pres enter. tnatart Examples proj2 input.1 ECES proj2 input.1 RR 2 - tar the files: FCTS scheduling with the data file "input.1 Simulate RR scheduling with time quantum 2 milliscconds (4d parameter is reuired venquantum 1 millen with the data file "input.1" Simulate SRTF scheduling with the data file" inpu. 1" Verify the files have been placed in a tar file: ta--tvf ECS username >-a5qmt2.tar - Compress the liles using grip: qzip -asqmt 2. tar.FZ proj2 input.1 SRTE 2.3 Sample Inputs and Outputs Sample input files and expected outputs are shown in Appendix. You can use it to verify your results 3 Requirements The project requires to simulate Ri S RR, and SRTI. scheduling for given tasks and to compute the average waiting timc, response time, tumaround time and overall CPU usage. You can find their detinitions in texthook 1. Implement scheduling algorithm for FCFS, RR. and SRTF. The program should schedule tasks and print progress of task every unit time (millisecond) as shown in sample outputs. 2. Print statistical information. As soon as all tasks are completed, the program should compute and print 1 average wailing me 2) average response lime, 3) average lurnaround me and 4) overall CPU usage Note: if you use static array to implement ready queue siructure, you can assume the maximum queue length is 20. 4 Suggested Methodology 1. Implement one scheduling algorithm at each step 2. You can use circular linked list as a queue structure 3. You can use a data siructure similar to PCBach lask, though il will be much simpler 5 Deliverables Make sure your code can be compiled and work on Athena server correctly. Upload to Canvas the following: All source codes/liles thal you have aakled/modilied and the demonstralive resulls, A README.TXT file that briefly describes cach file, ow to compile the file(s). and how to run the file. These files should be placed in a directory called cECS username asgmt2. Use ar command lo place a he liles i a single lile called -asgmt2.tar Assuming you are in the directory -asgmt 2 do the following: - Gio the parent directory: ad. Appendix: about input file and output information by CPU scheduling simulato for FCFS, RR, and SRTF more input 3 16 6 09 ro Usage: proj2 input_file FCFS IRR ISRJF Iquantum] % proj2 input .1 FCFS Schdeuling algorithm: FCFS Total 6 tasks are read from "input.1". press 'enter' to start... process1 is running 1 is running 1 is running 1 is running 1 is running 1 is running time 1> process 2> process 3> process 4> process 5> process process 1 is running process 8> process 9> process 1 is running 1 is running 1 is running process process process process process process process process process system time18> process process process process process process 3 is running process process process process process process process process process5 is running process process process5 is running process5 is running system time34> process process process process process 6 is running process process process system time 41> process system time41> All processes finish 2 is running 2 is running 2 is running 2 is running 2 is running 2 is running 2 is running 2 is running 2 is running 2 is finished... 3 is running 3 is running 3 is running 3 is running 4 is running 4 is running 4 is running is running 5 is running 5 is running 5 is finished...._.. 6 is running 6 is running 6 is running 6 is running 6 is running 6 is running 6 is finished. . .-..... 100.00 Avarage waiting tin : 14.17 Avarag respons" t ine 14, 17 Avar age turnazound tin: 21.00 eyetem timeocess2 15 running proj2 input RR Scldeuling algozitha: RR Tot1 6 t5sk5 are read tron "1npot. 1". pre55 "enter, to tart. eyetem tie10 pcocess1s running cayatatina I> process 1 is running syaten Eime3 proceas 2 ia running systen tine rocess 1s running syaten Eine5 proceas ia running syaten tie proce 3 ia running Cayate 12 peoces 2 is unning eyeten tie1pcocess 2 1s running Cayate 14> peoces 2 is unning Cayate 15> peoces 2 is unning eyetem tie1 pcocess 2 1s running Cayate 1 peoces 2 is unning syaten Eimeproceas 2 ia running systen tine rocess2 1s running ayaten Eie 10x proceas ia running systen tine 11 process 1s running systen tine 12s procas4 ia running syaten tine 13> proceas4 la running systen tine 14s pro 3i running syaten Eie 15s procea 3 ia running systen tine 1b rocess ayaten Eine 17s procea S ia running systen tine rocess1s running systen tine 19s proca running systen tine 2Urocess 2 1s running systen tine 21s proc 2 ia running systen tine 22rocess 1s running systen tine 23rocess 1s running systen tine 24s procas4 i running systen tine 2process1s running Proce88 4 is finished. systen tine 25 rocess 1s running Prot:88 3 is finished systen tine 2rocess1s running Cayate 18> peoces system tine 192 proce 5 caya terti. 20) procesa iuning 5 i5 running 5 is running Cayat Cayate 22> proces5 i run ing 23> peoces iuning caya terti. 24> peace sa 6 is running yeten tine 2pcocess1s running Cayat 26> peoces is runn ing system tine 2.pcoce 5 is running Cayat t 28 pros is runn ing yten tine 29pocess1s running yeten tine 30pcocess1s running systen tie3cocess 1 1s running Cayat 32 pros is runn ing system tiecocess 1 1s running systent cocess 1 1s running systen tine 29rocess 1s running systen tine ans pros unning systen tine 3ls pro 2 i running systen tine 32rocess 2 1s running Prot:88 l is running systen tine rocess 1s running systent 3cocess 1 1s running systenticocess 1 1s running cgys ten, tine L> ALI process 5 finish. ysten tine 35rocess1s running systen ine 36s proS unning Prnrn88 5 is finished. oysten tine process1s running systen tine 3Rs pros unning ysten tine rocess 2 1s running va-ag waiting tine: 10.50 vaage response ti9.0U ysten tine process 1s running A1 processes finish Avaraqe esponse tine.00 Avarage turnaround tine: 29.33 s pro12 input.2 SRTE sehdnulingignrittin: SRTT Tatal 6 tkxar" rnsd from "input. .. pres enter. tnatart