Professional Documents
Culture Documents
Instructions: University of Sargodha
Instructions: University of Sargodha
Instructions
1. Don’t copy data from internet, you may take concept and then type in your own words.
2. Don’t copy from your class fellow because plagiarism will be checked and you will get NO
CREDIT if data is copied.
3. Viva will be conducted on the completion of the paper, so be prepared conceptually about
what you type here in your paper.
4. Write your answers in the given space of this paper sheet, for question 1 you may add
more rows to add more terms.
Question 1: Watch all video lectures on OS (three lectures per day, my suggestion) and discuss the
topic covered in the lecture in your own words, no practical examples are needed,
only cover the theoretical portion. Don’t copy from the internet or from your class
fellow. Viva will be also conducted for this question. [MARKS: 10+6 = 16]
Link to OS Playlist:
https://www.youtube.com/playlist?list=PLuBM8LkREOp97J-DYarKohCaJbpKaMQOJ
Lecture Description
Lecture 1 1) Operating System 2) Booting
Operating System:
Operating system is a collection of program which is used to run hardware. It
responsible for taking care of all the hardware and managing the applications
access to the hardware. It acts as a manager of all the hardware in the system.
Booting:
Booting is the procedure of loading the operating system when the computer is
turned on. It has five steps.
Lecture 5 1) Scheduler:
3 types of schedulers:
a) Short term scheduler:
It is responsible for scheduling one of the process from ready state to
running state.
b) Medium term scheduler:
It is responsible of suspending and resuming the processes. It is also
swapper.
c) Long term scheduler (Job scheduler):
Long term scheduler is responsible for creating new processes and bringing
them into the system.
Lecture 6
Lecture 7
Lecture 8 1) CPU Scheduling 2) Criteria to check Best Algorithm.
CPU Scheduling:
Picking the process from ready state and give it to CPU with the help of CPU
scheduler is known as CPU scheduling.
There are several CPU scheduling algorithms:
FCSS, SJF, SRTF, Priority Scheduling, round robin,multilevel queue, Multilevel
feedback queue.
Criteria to check Best Algorithm:
CPU Utilization: Keep the CPU busy. It must be high.
Throughput: How many process completed in a unit time. It must be high.
Waiting Time: waiting for some i/o device. Turnaround time – burst time =
waiting time. It must be low.
Response Time: After arrival of process, the first time that process gets the CPU.
It must be low.
Turnaround Time: The Time from the start of the process to its completion. It
must be low.
Lecture 9 1) First Come First Serve 2) Convoy Effect
First Come First Serve:
Assign CPU to process which comes first as the name
suggest first come first serve.
There are two types of CPU scheduling: Pre-emptive & non-pre-emptive.
Pre-emptive: if the process is running in the CPU then that process can be
forcefully remove from the CPU and CPU can be allocated to another process.
Non-pre-emptive: Once a CPU is allocated to one process then that process
cannot removed from CPU until termination.
Lecture 10 1) First Come First Serve
Lecture 16
Lecture 17
Lecture 18 1) Multilevel queue scheduling
In multilevel queue scheduling algorithm, There are multilevel of queues and
each has its own scheduling algorithm. These queues has also following fixed
priority scheduling algorithm in which one has Top priority and other has
medium and lower priority. If a process assigned to a particular queue during its
execution till its termination, that process cannot change its queue or cannot
migrate to another queue. In other words we can say when a process came, it is
permanently assigned to particular queue.
The problem in this algorithm is STARVATION in which the processes from last
queues should wait for long or for infinite time.
Lecture 19 1) Multilevel Feedback queue scheduling
In multilevel feedback queue scheduling, The queue from lower priority can be
promoted to a queue having higher priority. Also higher priority queue can be
demoted to the processes to the queue having lower priority.
Lecture 20 1) Process Synchronization:
In process synchronization, Processes must be synchronized. Processes can be
executed one by one which means when one process executing, no other
process can executed until first one termination. i.e ATM. Process
synchronization cooperative processes k darmeyan mn hoti ha.
Race condition: The scenario or condition in which multiple processes can use a
shared resource.
Critical Section: The resourse which is shared.
Lecture 21 1) Solution of the critical problem:
a) Software Based Solution b) Hardware Solution c) OS System Based System
Every Solution have four parts: Entry Section, Critical Section, Exit Section and
Remainder Section.
Entry Section: it checks the process who should go and who should not to
critical section. It also sure that there is no already existing process in critical
section.
Critical Section: The resourse or variable which shared among all processes.
Exit Section: it tells that it finishes task from critical section.
Lecture 22
Lecture 23
Lecture 24
Lecture 25
Input: This program should get the number of processes, arrival time and
burst time from the user.
Output: This program should provide the Gantt Chart, Average Arrival Time
and Average Turnaround Time.