Os Lab Manual Algorithm
Os Lab Manual Algorithm
Os Lab Manual Algorithm
Aim
To write a program for implement the FCFS scheduling algorithm
Algorithm
1. Start the process.
2. Declare the array size.
3. Get the number of processes to be inserted.
4. Get the value.
5. Start with the first process from it’s initial position let other process to be in
queue.
6. Calculate the total number of burst time.
7. Display the values.
8. Stop the process.
Result
Thus the program for FCFS was implemented and verified.
IMPLEMENTATION OF ROUND ROBIN
EX.NO: 5a
SCHEDULING ALGORITHM
Aim
To write a program for implement the round robin scheduling algorithm
Algorithm
1. Start the process.
2. Declare the array size.
3. Get the number of elements to be inserted.
4. Get the value.
5. Set the time sharing system with preemption.
6. Define quantum is defined from 10 to 100ms.
7. Declare the queue as a circular.
8. Make the CPU scheduler goes around the ready queue allocating CPU to each
process for the time interval specified.
9. Make the CPU scheduler picks the first process and sets time to interrupt after
quantum expired dispatches the process.
10. If the process has burst less than the time quantum than the process releases
the CPU.
11. If the process have bust greater then time quantum then time will go off and
cause interrupt to OS and the process put into the tail of ready queue and the
schedule select next process.
12. Display the results.
13. Stop the process.
Result
The program for round robin scheduling was implemented and hence verified.
EX.NO: 4b
IMPLEMENTATION OF SHORTEST JOB FIST
SCHEDULING ALGORITHM
Aim
To implement the shortest job first scheduling algorithm
Algorithm
1. Start the process.
2. Declare the array size.
3. Get the number of elements to be inserted.
4. Select the process which have shortest burst will execute first.
5. If two process have same burst length then FCFS scheduling algorithm used.
6. Make the average waiting the length of next process.
7. Start with the first process from it’s selection as above and let other process to
be in queue.
8. Calculate the total number of burst time.
9. Display the values.
10. Stop the process.
Result
The program for SJF was implemented and hence verified.
EX.NO:9
Aim
To write a program Implement best fit and worst fit memory management
schemes – II.
Result
The program for best fit and worst fit was implemented and hence verified.
EX.NO:8
Algorithm
1. Start the process.
2. Declare the size.
3. Get the number of processes to be inserted.
4. Allocate the first hole that is big enough searching.
5. Start at the beginning of the set of holes.
6. If not start at the hole that is sharing the pervious first fit search end.
7. If large enough then stop searching in the procedure.
8. Display the values.
9. Stop the process.
Result
The program for first fit was implemented and hence verified.
PROCESS AND DIRECTORIES
EX.NO:1
MANAGEMENTS
Aim
To write programs using the following system calls of UNIX operating
system: fork, exec, getpid, exit, wait, close, stat, opendir, readdir
Result
The program for process and directories managements was implemented and
hence verified.
EX.NO:2 I/O SYSTEM CALLS
Aim
To write programs using the I/O system calls of UNIX operating system
(open, read, write, etc)
Algorithm
1. Start the program.
2. Read the input from user specified file.
3. Write the content of the file to newly created file.
4. Show the file properties (access time, modified time, & etc,.)
5. Stop the program.
Result
Thus the above program using the I/O system calls was verified.
EX.NO:3 SIMULATION OF UNIX COMMAND
Aim
To write C programs to simulate UNIX commands like ls, grep, etc.
Result
Thus the above program to simulate UNIX grep command was executed.
EX.NO:6 INTER PROCESS COMMUNICATION
Aim
To developing Application using Inter Process communication (using shared
memory, pipes or message queues)
Result
Thus the above program to inter-process communication was achieved
through pipes.
EX.NO: 5b IMPLEMENTATION OF PRIORITY
SCHEDULING ALGORITHM
Aim
To write a program for implement the priority scheduling algorithm
Algorithm
1. Start the process.
2. Declare the array size.
3. Get the number of processes to be inserted.
4. Get the priority for each process and value.
5. Start with the higher priority process from it’s initial position let other process
to be in queue.
6. Calculate the total number of burst time.
7. Display the values.
8. Stop the process.
Result
Thus the program for priority scheduling was implemented and verified.
EX.NO:7 PRODUCER CONSUMER PROBLEM USING
SEMAPHORE
Aim
To write a program for Implement the Producer – Consumer problem using
semaphores (using UNIX system calls).
Algorithm
1. Start the process.
2. Initialize buffer size.
3. Consumer enters, before that producer buffer was not empty.
4. Producer enters, before check consumer consumes the buffer.
5. Stop the process.
Result
Thus the program for priority scheduling was implemented and verified.
LIST OF EXPERIMENT: