You are on page 1of 6

BSCLMR148923

St. Paul’s University


Cat1
Principles Of Operating Systems
BCS 3104
1. Explain the essential properties of the following types of Operating
System. Multiprogramming systems and real time systems
In multiprogramming many programs run on a single processor computer. If
one program must wait for an input/output transfer, then other programs are
ready to use the CPU. Its goal is to manage the entire system resources.
In time sharing multiple users with different programs interact nearly
simultaneously with the CPU. it allocates time to a particular task and
switches between tasks frequently. There is no chance of software
duplication.

2. Explain the following:


i) Real time Systems
Real-time systems are special-purpose operating system used in computers that are
designed to process and respond to events or inputs within strict time constraints for
any job. These systems are commonly used in applications where timely and
predictable responses are crucial, such as controlling industrial processes, managing
telecommunications networks, or operating embedded systems.
ii) Distributed Systems
Distributed systems refer to a collection of many central processors which serve
multiple real-time applications and users by communicating and collaborating with each
other to achieve a common goal. Unlike traditional centralized systems, where all
processing occurs on a single machine, distributed systems distribute tasks across
multiple interconnected nodes.

3. Explain the Hardware Protections of an Operating system?


a) CPU protection.
CPU protection ensures that a process does not hold the CPU, as it would prevent
other processes from being executed. Each process should have a limited time, so
that every process gets time to execute its instructions. For that purpose, a timer is
used to limit the amount of time which a process can occupy from the CPU. After the
timer expires, a signal is sent to the process to leave CPU. Hence one process cannot
hold the CPU forever. 
b) Memory protection
There may be multiple processes in the memory so it is possible that one process may
try to access other process memory. To prevent these, we use base register which
stores the starting address of the program and limit register which stores the size of the
process.
c) Input output protection
Input/output is protected by making all input/output instructions privileged. While running
in user mode, the CPU cannot execute them; thus, user code, which runs in user mode,
cannot execute them. User code requests I/O by making appropriate system calls.

4. Explain the services provide by the Operating system in detail?


i) Input/output operation
It comprises of i/o devices and their required driver software. The os plays
the communication part between the user and the device driver which
hides all the complex controlling the hardware from the user.
ii) Security
The os provides security features to protect hardware resources and
data of computer. These features protect data from worms, threats,
viruses, malfunctions, and authorized access by providing antivirus
software and firewalls.
iii) File system management
It deals with all operations regarding file management like reading, deleting
writing and modifying a file. The os controls permission to access a file,
differentiates between types of files and provides an interface to perform all
operations on files.
iv) Resource management
The os supports multi-programming or multi-tasking. Multi-tasking is
responsible in scheduling algorithms for selecting the desired job and in
management of all resources using schedulers.
v) User interface
The os provides user interfaces which helps the user to interact with
system easily. They may include graphical user interface and command-
line interface which acts like a bridge between the user and the system.
vi) Error handling
The os provides error handling mechanisms to detect and recover errors
and exception. It constantly check for possible errors and takes appropriate
action to ensure correct and consistent computing.
vii)Communication
The os manages communications between all processes which
communicates with one another through communication lines in the
network. The os implements communication using either Shared Memory
or by Message passing methods.
5. Define System Calls? Explain the various System Calls.
System calls are methods for a computer program to request services
from the os. The various system calls includes;
i) Process control
It is a system call that is used to direct the processes. It creates a
new process by duplicating the existing process, loads and executes
new programs and terminates the current process
ii) Device management
It deals with devices. It opens a device driver and returns a device
descriptor. It also closes an opened device descriptor, reads data,
writes data, and sends control commands to a device.
iii) File management
It is used to handle files. It creates files, deletes files, opens and
closes, reads and writes files.
iv) Communication system calls
It is used for communication. It creates a communication endpoint,
accepts incoming connection requests, listens to incoming
connection requests, sends, and receives data over a socket.
v) Information maintenance
It is used to maintain information. It gets system data, sets time and
date, and sets system data.

6. Explain the various System programs.


i) File management
It is a collection of specific information saved in a computer systems
memory. It provides utilities for creating, copying, renaming and deleting
files. It is also responsible for the removal of temporary files and
unnecessary system files.
ii) Communication
Programs that are used to maintain a connection between two or more
users. This is possible through the help of the internet and other electronics
sharing systems. Users browse websites, communicates messages to
other users either by emails or transferring files with one another.

iii) Programming language supporters


These are used by programmers which allow programming languages
such as java, C, C++, and other programming languages. These programs
include the compilers, assemblers, debuggers, interpreters, linkers,
loaders, etc.
iv) Program loading and execution.
These are set of programs that are required for the execution of programs.
A loader, a component of os is responsible for loading programs into the
main memory.
v) File modification
These programs are used to work with the files on hard drives or other
storage devices. They include text editors that are used to create or modify
the file. They can also used to search for content within the file.
vi) Status information
These are information about date, time, disk space or memory space.
These programs can either copy information to a file or in a graphical user
interface, displaying it on the screen or printed.

7. What is a process? Explain the process control block and the various
process states.
o A Process is anything that is currently being executed i.e., any active
program.
o Process control block is a data structure containing information of the
process related to it.
Process states include.
 New state
The first state of a process where the process is created
 Ready state
In this state the process is ready for execution by the CPU but it is waiting
for its turn to be executed
 Ready suspended state
Here is where processes from ready state are placed if the memory is full
due to memory constraint.
 Running state
Here a process from the ready state is chosen using CPU scheduling
algorithm and it is executed.
 Waiting or blocked state
During execution of the process, if the process requires some input/output
operations, then the running process will go into this state as other process
come for execution.
 Waiting suspended state
If the waiting queue is full then some processes will be sent here.
 Terminated state.
When a process has been fully executed, it comes to this state where it is
terminated, and the information related to it is deleted.
8. Explain the various CPU scheduling algorithms?
i) First come first serve scheduling algorithm. (FCFS)
FCFS states that the process that requests the CPU first is allocated to the
CPU first and is implemented using FIFO queue.
ii) Shortest job next CPU scheduling algorithm (SJN)
It selects the waiting process with the smallest execution time to execute
next. It aims to minimize the average waiting time providing optimal results.
iii) Longest job first (LJF)
This process is the opposite of SJF. It is based upon the fact that the
process with the largest time is processed first.
iv) Priority CPU scheduling
The function is set to be important by the editor where the most important
process must be done first.
v) Round robin
Here each process is cyclically assigned a fixed time slot. If a process slot
expires, it is preempted and moved to the back of the ready queue.
vi) Multiple-level queues scheduling
They make use of another existing algorithm. Here processes are divided
into multiple priority queues, and each queue may have a different
scheduling algorithm.
vii)Shortest remaining time
It is pre-emptive version of the SJN. The processor is allocated to the job
closest to completion.

9. Explain the various Page Replacement Algorithms


i) First in, first out (FIFO)
It assigns pages sequentially according to the order in which they were
accessed most recently. The page which has been in the memory longest
is selected for replacement.
ii) Least recently used
It assigns pages sequentially according to the order in which they were
accessed least recently. The algorithm first looks for the least recently used
page and then assigns the next page to that location.
iii) Optimal page replacement
It selects the page that would not be referenced for the longest time in the
future for replacement. It requires future knowledge of page reference.
iv) Last in, last out (LIFO)
It replaces the latest page that was the last one to come in the memory. It
uses stacks to monitor every page.

You might also like