[go: up one dir, main page]

0% found this document useful (0 votes)
22 views42 pages

Os Record Print

Ynsysb

Uploaded by

Renjini Xavier
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views42 pages

Os Record Print

Ynsysb

Uploaded by

Renjini Xavier
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 42

Date:

//FCFS CPU SCHEDULING


/* OUTPUT

Enter the number of processes: 5


Enter process ID, arrival time, and burst time for each process:
Process 1:
PID: 0
Arrival time: 5
Burst time: 10
Process 2:
PID: 1
Arrival time: 2
Burst time: 3
Process 3:
PID: 2
Arrival time: 1
Burst time: 12
Process 4:
PID: 3
Arrival time: 4
Burst time: 3
Process 5:
PID: 4
Arrival time: 11
Burst time: 20
Process BT AT WT CT TAT
2 12 1 0 13 12
1 3 2 11 16 14
3 3 4 12 19 15
0 10 5 14 29 24
4 20 11 18 49 38
Average Waiting Time: 11.00
Average Turnaround Time: 12.00

*/

RESULT
Date:
//SJF CPU SCHEDULING
/* OUTPUT

Enter the number of process : 4


Enter arrival time :2
3
4
1
Enter the burst time12
2
10
3
process BT AT WT TAT CT
p1 12 2 14 26 28
p2 2 3 1 3 6
p3 10 4 2 12 16
p4 3 1 0 3 4

Average waiting time :4.250000

Average turnaround time:11.000000

*/

RESULT
Date:

PROGRAM NO: 3
SHORTEST REMAINING TIME FIRST CPU SCHEDULING

AIM: To write a C program to show how Shortest Remaining Time First CPU
Scheduling works.
ALGORTIHM
RESULT
Date:
// PRIORITY CPU SCHEDULING
/* OUTPUT

Enter the number of processes: 5


Enter process ID, arrival time, and burst time for each process:
Process 1:
PID: 0
Arrival time: 1
Burst time: 10
Priority: 3
Process 2:
PID: 1
Arrival time: 2
Burst time: 22
Priority: 4
Process 3:
PID: 2
Arrival time: 3
Burst time: 12
Priority: 2
Process 4:
PID: 3
Arrival time: 4
Burst time: 3
Priority: 4
Process 5:
PID: 4
Arrival time: 6
Burst time: 11
Priority: 1
Process BT AT Priority WT CT TAT
4 11 6 1 0 17 11
2 12 3 2 14 29 26
0 10 1 3 28 39 38
1 22 2 4 37 61 59
3 3 4 4 57 64 60
Average Waiting Time: 27.20
Average Turnaround Time: 13.00

*/

RESULT
Date:
//ROUND ROBIN CPU SCHEDULING
/* OUTPUT

Enter the total number of processes5


Enter the arrival and burst time of the process[1]
Arrival time: 1
Burst time: 2
Enter the arrival and burst time of the process[2]
Arrival time: 2
Burst time: 21
Enter the arrival and burst time of the process[3]
Arrival time:
3
Burst time: 11
Enter the arrival and burst time of the process[4]
Arrival time: 4
Burst time: 12
Enter the arrival and burst time of the process[5]
Arrival time: 5
Burst time: 10
Enter the time quantum for the process5

Process no burst time TAT waiting time


Proces no[1] 2 1 -1
Proces no[5] 10 37 27
Proces no[3] 11 45 34
Proces no[4] 12 46 34
Proces no[2] 21 54 33
Average turn around time : 25.400000
Average waiting time: 36.599998%

*/

RESULT
Date:
//BANKER’S ALGORITHM
/* OUTPUT

Enter the number of processes4


Enter the number of resources3
Enter the maximum resources1
2
3
4
5
6
7
8
9
5
6
7
Enter the allocated resources8
9
4
5
6
3
2
1
6
5
4
7
Enter the available resources now1
2
3
Maximum resources
123
456
789
567
Allocated resources
894
563
216
547
needed resources
-7 -7 -1
-1 -1 3
573
020
process 0 allocate its resources and completes its operation..
new available resources are9 11 7
process 1 allocate its resources and completes its operation..
new available resources are14 17 10
process 2 allocate its resources and completes its operation..
new available resources are16 18 16
process 3 allocate its resources and completes its operation..
new available resources are21 22 23
*/

RESULT
Date:
//FCFS DISK SCHEDULING

/* OUTPUT

Total number of seek operations: 510


Seek Sequence is
176
79
34
60
92
11
41
114
*/

RESULT
Date:
//FIFO PAGE REPLACEMENT
/* OUTPUT

Enter the number of page frames: 3


Enter the page reference string (space-separated): 1 2 3 4 5 6 7 8 9 10 9 1 2 2 5 4 7 6 8 7

Page Reference String:


1 2 3 4 5 6 7 8 9 10 9 1 2 2 5 4 7 6 8 7

Frames: -1 -1 -1
Page Reference: 1 1 -1 -1
Page Reference: 2 1 2 -1
Page Reference: 3 123
Page Reference: 4 123
Page Reference: 5 123
Page Reference: 6 123
Page Reference: 7 123
Page Reference: 8 123
Page Reference: 9 123
Page Reference: 10 123
Page Reference: 9 923
Page Reference: 1 913
Page Reference: 2 912
Page Reference: 2 912
Page Reference: 5 512
Page Reference: 4 542
Page Reference: 7 547
Page Reference: 6 647
Page Reference: 8 687
Page Reference: 7 687

Total Page Faults: 18

*/

RESULT
Date:
//LRU ALGORITHM
/* OUTPUT

Enter the number of page frames: 3


Enter the page reference string (space-separated): 1 2 3 4 5 6 7 8 9 10 3 2 2 6 7 4 6 8 1 5

Page Reference String:


1 2 3 4 5 6 7 8 9 10 3 2 2 6 7 4 6 8 1 5

Frames: -1 -1 -1
Page Reference: 1 1 -1 -1
Page Reference: 2 1 2 -1
Page Reference: 3 123
Page Reference: 4 423
Page Reference: 5 453
Page Reference: 6 456
Page Reference: 7 756
Page Reference: 8 786
Page Reference: 9 789
Page Reference: 10 10 8 9
Page Reference: 3 10 3 9
Page Reference: 2 10 3 2
Page Reference: 2 10 3 2
Page Reference: 6 632
Page Reference: 7 672
Page Reference: 4 674
Page Reference: 6 674
Page Reference: 8 684
Page Reference: 1 681
Page Reference: 5 581

Total Page Faults: 18

*/

RESULT

You might also like