Professional Documents
Culture Documents
1 - UNIT - I - Operating Ssystem Overview and Process
1 - UNIT - I - Operating Ssystem Overview and Process
1 - UNIT - I - Operating Ssystem Overview and Process
(16BT31501)
2
1. Operating systems, Operations, Distributed systems, Special
purpose systems, Operating systems services, Systems calls: An
operating system is system software that manages computer
hardware and software resources and provides common services
for computer programs.
5
Characteristics of Operating System: Here is a list of some
of the most prominent characteristic features of Operating
Systems
1. Memory Management
2. Processor Management
3. Device Management
4. File Management
5. Security
6. Job Accounting
7. Control Over System Performance
1. Multitasking operating system
5. Batch jobs
6. Parallel processing
12
Systems calls: A system call is a way for programs to interact with
the operating system.
A computer program makes a system call when it makes a request to
the operating system's kernel. System call provides the services of
the operating system to the user programs via Application Program
Interface(API).
13
Fig: System Calls 14
2. Operating System Structure: An operating system is a construct
that allows the user application programs to interact with
the system hardware.
An easy way to do this is to create the operating system in parts.
Each of these parts should be well defined with clear inputs,
outputs and functions.
15
16
3) Process Management: Process is a program under execution is
called Process.
20
A Process Scheduler schedules different processes to be assigned to
the CPU based on particular scheduling algorithms.
22
Wait time of each process is as follows
23
2. Shortest Job First (SJF): Shortest job First (SJF), also known
as shortest job Next (SJN) or shortest process next (SPN) and it is It
is a Greedy Algorithm.
Algorithm:
1- Sort all the processes in increasing order according to
burst time.
2- Then simply, apply FCFS.
25
26
27
Given: Table of processes, and their Arrival time, Execution time
31
Wait time of each process is as follows
P0 (0 - 0) + (12 - 3) = 9
P1 (3 - 1) = 2
P3 (9 - 3) + (17 - 12) = 11
32
4) Process Control Block: Process Control Block (PCB, also called
Task Controlling Block, Entry of the Process Table, Task Struct, or
Switchframe) is a data structure in the operating system kernel
containing the information needed to manage the scheduling of a
particular process.
Process Control Block is a data structure that contains information
of the process related to it. The process control block is also known
as a task control block, entry of the process table, etc.
It is very important for process management as the data structuring
for processes is done in terms of the PCB. It also defines the
current state of the operating system.
Structure of the Process Control Block is the process control stores
many data items that are needed for efficient process management.
Some of these data items are explained with the help of the given
diagram:
33
34
The following are the data items:
1. Process State: This specifies the process state i.e. new, ready,
running, waiting or terminated.
2. Process Number: This shows the number of the particular process.
3. Program Counter : This contains the address of the next
35
6. CPU Scheduling Information: The process priority, pointers to
scheduling queues etc. is the CPU scheduling information that is
contained in the PCB. This may also include any other scheduling
parameters.
7. Memory Management Information: The memory management
information includes the page tables or the segment tables
depending on the memory system used. It also contains the value
of the base registers, limit registers etc.
8. I/O Status Information: This information includes the list of I/O
devices used by the process, the list of files etc.
9. Accounting information: The time limits, account numbers,
amount of CPU used, process numbers etc. are all a part of the
PCB accounting information.
10. Location of the Process Control Block: The process control block
is kept in a memory area that is protected from the normal user
access. This is done because it contains important process
information.
36
5) Inter Process Communication (IPC) is a mechanism which
allows processes to communicate each other and synchronize their
actions. The communication between these processes can be seen
as a method of co-operation between them. Processes can
communicate with each other using these two ways: Shared
Memory and Message passing.
The events can vary from user requests to illegal memory access
errors. Some signals, such as the interrupt signal, indicate that a
user has asked the program to do something that is not in the usual
flow of control.
41
SIGNAL
SIGNAL
NUMBER DESCRIPTION
NAME
47
2. Many to Many Model: In this model, we have multiple user
threads multiplex to same or lesser number of kernel level threads.
Number of kernel level threads are specific to the machine,
advantage of this model is if a user thread is blocked we can
schedule others user thread to other kernel thread. Thus, System
doesn’t block if a particular thread is blocked.
48
3. Many to One Model: In this model, we have multiple user threads
mapped to one kernel thread. In this model when a user thread
makes a blocking system call entire process blocks. As we have
only one kernel thread and only one user thread can access kernel at
a time, so multiple threads are not able access multiprocessor at the
same time.
49
Model Questions
1. State and Explain different operating system services. An
operating system is system software that manages computer
hardware, software resources, and provides common services for
computer programs.
50
51
2. Differentiate between sequential and batch processing
52
3. Bootstrap Program: A bootstrap is the program that initializes the operating
system (OS) during startup. The term bootstrap or bootstrapping originated in
the early 1950s. It referred to a bootstrap load button that was used to initiate a
hardwired bootstrap program, or smaller program that executed a
larger program such as the OS.
53
4. What is meant by CPU Scheduling? Explain different
scheduling algorithms with examples: CPU scheduling is a
process which allows one process to use the CPU while the
execution of another process is on hold(in waiting state) due to
unavailability of any resource like I/O etc, thereby making full use
of CPU. The aim of CPU scheduling is to make the system
efficient, fast and fair.
54
5. Illustrate peterson’s solution to critical section problem :
Peterson's Solution is a classical software based solution to
the critical section problem. In Peterson's solution, we have two
shared variables: boolean flag[i] :Initialized to FALSE, initially no
one is interested in entering the critical section. int turn : The
process whose turn is to enter the critical section.
55
6. What is Belady’s Anomaly? Explain with an example:
Bélády's anomaly is the phenomenon in which increasing the
number of page frames results in an increase in the number of page
faults for certain memory access patterns. This phenomenon is
commonly experienced when using the first-in first-out (FIFO)
page replacement algorithm.
56
7. Write about the performance of demand paging: Demand
paging (as opposed to anticipatory paging) is a method of virtual
memory management. ... It follows that a process begins execution
with none of its pages in physical memory, and many page
faults will occur until most of a process's working set of
pages are located in physical memory.
57
8. What are access matrices? Explain its implementation: Access
Matrix is a security model of protection state in computer system.
It is represented as a matrix. Access matrix is used to define the
rights of each process executing in the domain with respect to each
object. The rows of matrix represent domains and columns
represent objects.
58
9. Mention some classical problems of synchronization. Explain
any two of them in detail: The operation or activity of two or
more things at the same time or rate.
59
10. Explain the goals and principles of protection: Protection refers
to a mechanism which controls the access of programs, processes,
or users to the resources defined by a computer system. We can
take protection as a helper to multi programming operating
system, so that many users might safely share a common logical
name space such as directory or files.
60
11. Differentiate between preemptive and non-preemptive
scheduling
61
12. Illustrate the purpose of fork system call with an example:
fork is an operation whereby a process creates a copy of itself. It is
usually a system call, implemented in the kernel. Fork is the
primary (and historically, only) method of process creation on
Unix-like operating systems.
62
13. Explain briefly about Inter Process Communication: IPC is a
mechanism which allows processes to communicate each other
and synchronize their actions. The communication between
these processes can be seen as a method of co-operation between
them. Processes can communicate with each other using these
two ways: Shared Memory. Message passing.
63
14. Discuss how Reader’s Writer’s problem can be solved using
semaphores: Semaphores can be used to restrict access to the
database under certain conditions. In this
example, semaphores are used to prevent any writing processes
from changing information in the database while other processes
are reading from the database.
64
15. What are semaphores? Explain Binary and Counting
semaphores with an example: Semaphores are integer variables
that are used to solve the critical section problem by using two
atomic operations, wait and signal that are used for process
synchronization.
65
66
16. Elucidate the concept of RACE condition? Explain Reader’s-
Writer’s problem with semaphore in detail: A race condition is
an undesirable situation that occurs when a device or system
attempts to perform two or more operations at the same time, but
because of the nature of the device or system, the operations must
be done in the proper sequence to be done correctly.
67
17. Explain the benefit of using role-based access control: here are a
number of benefits to using RBAC to restrict unnecessary
network access based on people's roles within an organization,
including:
1. Improving operational efficiency
2. Enhancing compliance
3. Giving administrators increased visibility
4. Reducing costs
5. Decreasing risk of breaches and data leakage
68