Operating System lab

                                                           Operating System Lab 


     Exp-1 to exp-7 and 12 :  download now

8.Simulate Bankers Algorithm for Dead Lock Avoidance :DOWNLOAD NOW   
9) Simulate Bankers Algorithm for Dead Lock Prevention.  :  DOWNLOAD NOW 
 10) Simulate the following page replacement algorithms:
a) FIFO b) LRU c) LFU     DOWNLOAD NOW
11) Simulate the following File allocation strategies:
(a) Sequenced (b) Indexed (c) Linked  DOWNLOAD NOW
13) Write a C program to simulate producer and consumer problem using semaphores  DOWNLOAD NOW

OUTPUT:
11A.)Enter the starting block & length of file 4 104->1 5->1 6->1 7->1 8->1 9->1 10->1 11->1 12->1 13->1 The file is allocated to disk

11B)
OUTPUT: enter index block 9 Enter no of files on index 3 12 3 Allocated File indexed9->1:1 9->2;1 9->3:1 enter 1 to enter more files and 0 to exit

11C)
OUTPUT: Enter how many blocks that are already allocated 3 Enter the blocks no.s that are already allocated 4 7 Enter the starting index block & length 3 7 9 3->1 4->1 file is already allocated 5->1 6->1 7->1 file is already allocated 8->1 9->1file is already allocated 10->1 11->1 12->1

13)
OUTPUT 1. Produce 2. Consume 3. Exit Enter your choice: 2 Buffer is Empty 1. Produce 2. Consume 3. Exit Enter your choice: 1 Enter the value: 100 1. Produce 2. Consume 3. Exit Enter your choice: 2 The consumed value is 100 1. Produce 2. Consume 3. Exit Enter your choice: 3

7B)
OUTPUT: Enter the total memory available (in Bytes) – 1000 OPERATING SYSTEMS LAB DATE: Enter memory required for process 1 (in Bytes) – 400 Memory is allocated for Process 1 Do you want to continue(y/n) – y Enter memory required for process 2 (in Bytes) -- 275Memory is allocated for Process 2 Do you want to continue(y/n) – y Enter memory required for process 3 (in Bytes) – 550 Memory is Full Total Memory Available – 1000 PROCESS MEMORY ALLOCATED 1 400 2 275 Total Memory Allocated is 675 Total External Fragmentation is 325


8.
OUTPUT: Enter the no. of processes and resources: 4 3 Enter the claim matrix: 3 2 2 6 1 3 3 1 4 4 2 2 Enter the allocation matrix: 1 0 0 6 1 2 2 1 1 0 0 2 
Resource vector:9 3 6 
All the resources can be allocated to Process 2
 Available resources are: 6 2 3
 Process 2 executed?y All the resources can be allocated to Process 3 Available resources are: 8 3 4 Process 3 executed?:y All the resources can be allocated to Process 4 Available resourcesare: 8 3 6 Process 4 executed?:y All the resources can be allocated to Process 1 Available resources are: 9 3 6 Process 1 executed?:y System is in safe mode The given state is safe state


9.
OUTPUT: Enter no of jobs:4 Enter name and time: A 1 Enter name and time: B 4Enter name and time: C 2 Enter name and time: D 3 Enter the available resources: 20 Safe sequence is: A 1, C 2, D 3, B 4.

10 A)
OUTPUT: 2 -1 -1 2 3 -1 2 3 -1 2 3 1 5 3 1 5 2 1 5 2 4 5 2 4 3 2 4 3 2 4 3 5 4 3 5 2 Number of page faults: 9

10B)
OUTPUT: 2 -1 -1 2 3 -1 2 3 -1 2 3 1 2 5 1 2 5 1 2 5 4 2 5 4 3 5 4 3 5 2 3 5 2 3 5 2 No of page faults: 7


10C)
OUTPUT : Enter length of the reference string: 12 Enter the reference string: 1 2 3 4 1 2 5 1 2 3 4 5Enter no of frames: 3 1 -1 -1 1 2 -1 1 2 3 1 2 4 1 2 4 1 2 4 1 2 5 1 2 5 1 2 5 3 2 5 4 2 5 4 2 5 Number of page faults : 7 Page fault rate = 58.333332





            For latest updates from our website follow us on telegram  : Follow us

Previous Post Next Post