Sei sulla pagina 1di 12

EX.

NO: 4a IMPLEMENTATION OF FIRST COME FIRST


SERVE SCHEDULING 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

MEMORY MANAGEMENT BEST FIT


& WORST FIT

Aim
To write a program Implement best fit and worst fit memory management
schemes – II.

Algorithm for best fit


1. Start the program.
2. Declare the size.
3. Get the number of processes to be inserted.
4. Allocate the best hole that is small enough searching.
5. Start at the best of the set of holes.
6. If not start at the hole that is sharing the pervious best fit search end.
7. Compare the hole in the list.
8. If small enough then stop searching in the procedure.
9. Display the values.
10. Stop the program.

Algorithm for worst fit


1. Start the program.
2. Declare the size.
3. Get the number of processes to be inserted.
4. Allocate the first hole that is small enough searching.
5. If small enough then stop searching in the procedure.
6. Display the values.
7. Stop the program.

Result
The program for best fit and worst fit was implemented and hence verified.
EX.NO:8

MEMORY MANAGEMENT - FIRST FIT


Aim
To write a program to implement first fit algorithm for memory management.

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

Algorithm for Process Management


1. Start the program.
2. Read the input from the command line.
3. Use fork() system call to create process, getppid() system call used to get the
parent process ID and getpid() system call used to get the current process ID.
4. execvp() system call used to execute that command given on that command
line argument.
5. execlp() system call used to execute specified command.
6. Stop the program.

Algorithm for Process Management


1. Start the program.
2. Open the directory at specified in command line input.
3. Display the directory contents.
4. Stop the program.

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.

Algorithm for grep command


1. Start the program.
2. Read the input through command line.
3. Open the specified file.
4. Options (c & i) are performed.
5. Stop the program.

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)

Algorithm for PIPES


1. Start the program.
2. Read the input from parent process and perform in child process.
3. Write the date in parent process and read it in child process.
4. Fibonacci Series was performed in child process.
5. Stop the program.

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:

EX.NO NAME OF EXPERIMENTS

EX.NO:1 PROCESS AND DIRECTORIES MANAGEMENTS

EX.NO:2 I/O SYSTEM CALLS

EX.NO:3 SIMULATION OF UNIX COMMAND

EX.NO: 4a IMPLEMENTATION OF FIRST COME FIRST SERVE


SCHEDULING ALGORITHM

EX.NO: 4b IMPLEMENTATION OF SHORTEST JOB FIST


SCHEDULING ALGORITHM

EX.NO: 5a IMPLEMENTATION OF ROUND ROBIN SCHEDULING


ALGORITHM

EX.NO: 5b IMPLEMENTATION OF PRIORITY SCHEDULING


ALGORITHM

EX.NO:6 INTER PROCESS COMMUNICATION

EX.NO:7 PRODUCER CONSUMER PROBLEM USING SEMAPHORE

EX.NO:8 MEMORY MANAGEMENT - FIRST FIT

EX.NO:9 MEMORY MANAGEMENT BEST FIT


& WORST FIT

Potrebbero piacerti anche