You are on page 1of 14

18CS654 INTRODUCTION TO OPERATING SYSTEM

QUESTION BANK WITH SOLUTIONS


1. DEFINE OPERAING SYSTEM. EXPLAIN OS ORGANIZATION
Ans: A program that acts as an intermediary between a user of a computer and the
computer hardware Operating system goals: Execute user programs and make solving
user problems easier Make the computer system convenient to use Use the computer
hardware in an efficient manner
Operating System Organization
Computer System Structure Computer system can be divided into four components.
Hardware – provides basic computing resources CPU, memory, I/O devices
Operating system -Controls and coordinates use of hardware among various
applications and users.
Application programs – define the ways in which the system resources are used to
solve the computing problems of the users Word processors, compilers, web
browsers, database systems, video games.
Users -People, machines, other computers.

Computer-System Operation
 I/O devices and the CPU can execute concurrently
 Each device controller is in charge of a particular device type
 Each device controller has a local buffer
 CPU moves data from/to main memory to/from local buffers
 I/O is from the device to local buffer of controller
 Device controller informs CPU that it has finished its operation by causing An
interrupt
Q2. WITH A NEAT DIAGRAM EXPLAIN STORAGE DEVICE HEIRARCHY OR
MEMORY HEIRARCHY

Storage Structure
 Main memory – only large storage media that the CPU can access
directly
 Secondary storage – extension of main memory that
provides large nonvolatile storage capacity Magnetic disks –
rigid metal or glass platters covered with magnetic recording
material
 Disk surface is logically divided into tracks, which are subdivided into
sectors
 The disk controller determines the logical interaction between the
device and the computer

Storage Hierarchy
Memory is depenadant on the following dimensions
Speed
Cost
Volatality

Caching – copying information into faster storage system; main memory can be
viewed as a last cache for secondary storage
Q3.WRITE A NOTE ON THE FOLLOWING
i. Single processor systems (Uni Processor)
 The name itself is saying that the single processor system contains
only one processor for processing.
 There is a use of a coprocessor in single processors because it uses
multiple Controllers which are designed to handle special tasks and
that can execute limited instruction sets.
 For example − DMA Controller. Single processor systems cost is
more because here every processor requires separate resources
 It is Easy to design Single Processor Systems. Single processor
system is less reliable because failure in one processor will result in
failure of the entire system.

ii. Multiprocessor Systems


 For this also the name itself indicates that the multiprocessor system
contains two or more processors for processing. Multiprocessor uses
two types of approaches −
In Symmetric Multiprocessing every processor performs all the tasks
within the operating system.
In Asymmetric Multiprocessing one Processor will acts as a Master
and Second Processor act as Slave.
 Multiprocessor systems cost less than equivalent multiple single
processor systems because they use the same resources on a sharing
basis.
 Multiprocessor system is more reliable because failure of one
processor does not halt the entire system but only speed will be
slowed down.

iii. Clustered Systems

 Like multiprocessor systems, but multiple systems working together


Usually sharing storage via a storage-area network
 Provides a high-availability service which survives failures
 Some clusters are for high-performance computing (HPC)
 Applications must be written to use parallelization
 Asymmetric clustering has one machine in hot-standby mode
 Symmetric clustering has multiple nodes running applications,
monitoring each other
Q4.LIST AND EXPLAIN THE SERVICES OR FUNCTIONALITIES OF
OS
Services of OS are as follows
1. Security –
The operating system uses password protection to protect user data and similar
other techniques. it also prevents unauthorized access to programs and user
data.

2. Control over system performance –


Monitors overall system health to help improve performance. records the
response time between service requests and system response to having a
complete view of the system health. This can help improve performance by
providing important information needed to troubleshoot problems.

3. Job accounting –
Operating system Keeps track of time and resources used by various tasks and
users, this information can be used to track resource usage for a particular user
or group of users.

4. Error detecting aids –


The operating system constantly monitors the system to detect errors and avoid
the malfunctioning of a computer system.

5. Coordination between other software and users –


Operating systems also coordinate and assign interpreters, compilers,
assemblers, and other software to the various users of the computer systems.

6. Memory Management –
The operating system manages the Primary Memory or Main Memory. Main
memory is made up of a large array of bytes or words where each byte or word
is assigned a certain address. Main memory is fast storage and it can be accessed
directly by the CPU. For a program to be executed, it should be first loaded in
the main memory. An Operating System performs the following activities for
memory management:
It keeps track of primary memory, i.e., which bytes of memory are used by
which user program. The memory addresses that have already been allocated
and the memory addresses of the memory that has not yet been used. In
multiprogramming, the OS decides the order in which processes are granted
access to memory, and for how long. It Allocates the memory to a process when
the process requests it and deallocates the memory when the process has
terminated or is performing an I/O operation.

7. Processor Management –
In a multi-programming environment, the OS decides the order in which
processes have access to the processor, and how much processing time each
process has. This function of OS is called process scheduling. An Operating
System performs the following activities for processor management.
Keeps track of the status of processes. The program which performs this task is
known as a traffic controller.

8. Device Management –
An OS manages device communication via their respective drivers. It performs
the following activities for device management. Keeps track of all devices
connected to the system. designates a program responsible for every device
known as the Input/Output controller. Decides which process gets access to a
certain device and for how long. Allocates devices in an effective and efficient
way. Deallocates devices when they are no longer required.

9. File Management –
A file system is organized into directories for efficient or easy navigation and
usage. These directories may contain other directories and other files. An
Operating System carries out the following file management activities. It keeps
track of where information is stored, user access settings and status of every file,
and more… These facilities are collectively known as the file system.

The Operating System provides certain services to the users which can be listed in
the following manner:
1. Program Execution: The Operating System is responsible for the execution of all
types of programs whether it be user programs or system programs. The Operating
System utilizes various resources available for the efficient running of all types of
functionalities.
2. Handling Input/Output Operations: The Operating System is responsible for
handling all sorts of inputs, i.e, from the keyboard, mouse, desktop, etc. The
Operating System does all interfacing in the most appropriate manner regarding all
kinds of Inputs and Outputs.
For example, there is a difference in the nature of all types of peripheral devices
such as mice or keyboards, the Operating System is responsible for handling data
between them.
3. Manipulation of File System: The Operating System is responsible for making
decisions regarding the storage of all types of data or files, i.e, floppy disk/hard
disk/pen drive, etc. The Operating System decides how the data should be
manipulated and stored.
4. Error Detection and Handling: The Operating System is responsible for the
detection of any type of error or bugs that can occur while any task. Resource
Allocation: The Operating System ensures the proper use of all the resources
available by deciding which resource to be used by whom for how much time. All
the decisions are taken by the Operating System.
5. Accounting: The Operating System tracks an account of all the functionalities
taking place in the computer system at a time. All the details such as the types of
errors that occurred are recorded by the Operating System.
6. Information and Resource Protection: The Operating System is responsible for
using all the information and resources available on the machine in the most
protected way. The Operating System must foil an attempt from any external
resource to hamper any sort of data or information.
Q5.WITH A NEAT DIAGRAM EXPLAIN DUEL MODE OPERATION AND
TRANSITION OF OS FROM USER TO KERNEL MODE.

An error in one program can adversely affect many processes, it might modify data
of another program, or also can affect the operating system. For example, if a
process stuck in the infinite loop then this infinite loop could affect the correct
operation of other processes. So to ensure the proper execution of the operating
system, there are two modes of operation:
User mode –
When the computer system is run by user applications like creating a text document
or using any application program, then the system is in user mode. When the user
application requests for a service from the operating system or an interrupt occurs
or system call, then there will be a transition from user to kernel mode to fulfill the
requests.
Note: To switch from kernel mode to user mode, the mode bit should be 1.
Given below image describes what happen when an interrupt occurs:

Kernel Mode –
When the system boots, hardware starts in kernel mode and when the operating
system is loaded, it starts user application in user mode. To provide protection to the
hardware, we have privileged instructions which execute only in kernel mode. If the
user attempts to run privileged instruction in user mode then it will treat instruction
as illegal and traps to OS. Some of the privileged instructions are:

1. Handling Interrupts
2. To switch from user mode to kernel mode.
3. Input-Output management.
Note: To switch from user mode to kernel mode bit should be 0.

Transition Of Os From User To Kernel Mode


Q6.LIST AND EXPLAIN VARIOUS COMPUTING ENVIRNMENTS w.r.t OS
A computer system uses many devices, arranged in different ways to solve many problems.
This constitutes a computing environment where many computers are used to process and
exchange information to handle multiple issues.
The different types of Computing Environments are −
Personal Computing Environment
In the personal computing environment, there is a single computer system. All the system
processes are available on the computer and executed there. The different devices that
constitute a personal computing environment are laptops, mobiles, printers, computer
systems, scanners etc.
Time Sharing Computing Environment
The time sharing computing environment allows multiple users to share the system
simultaneously. Each user is provided a time slice and the processor switches rapidly among
the users according to it. Because of this, each user believes that they are the only ones using
the system.
Client Server Computing Environment
In client server computing, the client requests a resource and the server provides that
resource. A server may serve multiple clients at the same time while a client is in contact with
only one server. Both the client and server usually communicate via a computer network but
sometimes they may reside in the same system.
Distributed Computing Environment
A distributed computing environment contains multiple nodes that are physically separate but
linked together using the network. All the nodes in this system communicate with each other
and handle processes in tandem. Each of these nodes contains a small part of the distributed
operating system software.
Cloud Computing Environment
The computing is moved away from individual computer systems to a cloud of computers in
cloud computing environment. The cloud users only see the service being provided and not
the internal details of how the service is provided. This is done by pooling all the computer
resources and then managing them using a software.
Cluster Computing Environment
The clustered computing environment is similar to parallel computing environment as they
both have multiple CPUs. However a major difference is that clustered systems are created
by two or more individual computer systems merged together which then work parallel to
each other.
Peer-to-Peer Computing
The peer to peer computing architecture contains nodes that are equal participants in data
sharing. All the tasks are equally divided between all the nodes. The nodes interact with each
other as required as share resources.
Peer to peer networks are usually formed by groups of a dozen or less computers. These
computers all store their data using individual security but also share data with all the other
nodes.

WEB COMPUTING

Web has become ubiquitous

New category of devices to manage web traffic among similar servers:

load balancers Use of operating systems like Windows 95, client-side, have evolved into
Linux and Windows XP,which can be clients and servers
Q7 DEFINE SYSTEM CALLS, EXPLAIN DIFFERENT TYPES OF SYSTEM CALLS
WITH ONE EXAMPLE

A system call is a mechanism that provides the interface between a process and the operating
system. It is a programmatic method in which a computer program requests a service from
the kernel of the OS.

System call offers the services of the operating system to the user programs via API
(Application Programming Interface). System calls are the only entry points for the kernel
system.

Example of System Call


For example if we need to write a program code to read data from one file, copy that data into
another file. The first information that the program requires is the name of the two files, the
input and output files.

In an interactive system, this type of program execution requires some system calls by OS.

 First call is to write a prompting message on the screen


 Second, to read from the keyboard, the characters which define the two files.
Q8 DESCRIBE OS SYSTEM STRUCTURE

A. Simple Structure

It is the simplest Operating System Structure and is not well defined; It can only be used for
small and limited systems. In this structure, the interfaces and levels of functionality are well
separated; hence programs can access I/O routines which can cause unauthorized access to
I/O routines.

Advantages of Simple Structure

 It is easy to develop because of the limited number of interfaces and layers.


 Offers good performance due to lesser layers between hardware and applications.

Disadvantages of Simple Structure

 If one user program fails, the entire operating system crashes.


 Abstraction or data hiding is not present as layers are connected and communicate
with each other.
 Layers can access the processes going in the Operating System, which can lead to
data modification and can cause Operating System to crash.

B. Monolithic Structure

The Monolithic operating System in which the kernel acts as a manager by managing all
things like file management, memory management, device management, and operational
processes of the Operating System.

The kernel is the heart of a computer operating system (OS). Kernel delivers basic services
to all other elements of the System. It serves as the primary interface between the Operating
System and the hardware.

In monolithic systems, kernels can directly access all the resources of the operating System
like physical hardware, exp Keyboard, Mouse etc.
C. Layered Approach

In this type of structure, OS is divided into layers or levels. The hardware is on the bottom
layer (layer 0), while the user interface is on the top layer (layer N). These layers are arranged
in a hierarchical way in which the top-level layers use the functionalities of their lower-level
levels.

In this approach, functionalities of each layer are isolated, and abstraction is also available. In
layered structure, debugging is easier as it is a hierarchical model, so all lower-level layered
is debugged, and then the upper layer is checked. So all the lower layers are already checked,
and the current layer is to be checked only.
Q9. DEFINE VIRTAUL MACHINE. EXPLAIN IN DETAIL

A virtual machine takes the layered approach to its logical


conclusion. It treats hardware and theoperating system kernel as though
they were all hardware
 A virtual machine provides an interface identical to the underlying bare
hardware
 The operating system host creates the illusion that a process has its
own processor and (virtual memory)Each guest provided with a
(virtual) copy of underlying computer

 Fundamentally, multiple execution environments (different


operating systems) can share the samehardware
 Protect from each other
 Some sharing of file can be permitted, controlled
 Commutate with each other,
other physical systems via
networkingUseful for
development, testing
 Consolidation of many low-resource use systems onto fewer busier
systems
 “Open Virtual Machine Format”, standard format of virtual
machines, allows a VM to run within manydifferent virtual machine
(host) platforms
Q10. WRITE A NOTE ON SYSTEM BOOT

 Operating system must be made available to hardware so hardware can start it


 Small piece of code – bootstrap loader, locates the kernel, loads it into
memory, and starts it Sometimes two-step process where boot block at
fixed location loads bootstrap loader
 When power initialized on system, execution starts at a fixed memory location
Firmware used to holdinitial boot code

 Booting the system is done by loading the kernel into main memory, and
starting its execution.
 The CPU is given a reset event, and the instruction register is loaded with
a predefined memory location, where execution starts.
 The initial bootstrap program is found in the BIOS read-only memory.
 This program can run diagnostics, initialize all components of the
system, loads and starts the Operating System loader. (Called boot
strapping)
 The loader program loads and starts the operating system.
 When the Operating system starts, it sets up needed data structures in
memory, sets several registers in the CPU, and then creates and starts the
first user level program. From this point, the operating system only runs
in response to interrupts. See CPU Response to Interrupts.

You might also like