Module 1 Questionbank Operating Systems Basics Introduction
Module 1 Questionbank Operating Systems Basics Introduction
OPERATING SYSTEMS
MODULE 1
INTRODUCTION
Syllabus:
1.1. Introduction to Operating System
1.2. Operating System operations, functions, service
1.3. System calls, Types
1.4. Operating System Structure: Simple, Layered, Microkernel, Modules
1.5. System Boot Process
4. Under what circumstances would a user be better off using a time-sharing system
than a PC or a single user workstation?
Each task is given some time to execute so that all the tasks work smoothly.
Each user gets the time of CPU as they use a single system.
These systems are also known as Multitasking Systems.
The task can be from a single user or different users also.
The time that each task gets to execute is called quantum. After this time
interval is over OS switches over to the next task.
Examples of Time-Sharing OSs are: Multics, Unix, etc.
○ If there are multiple processes that share data, it is better to schedule them
on multiprocessor systems with shared data than have different computer
systems with multiple copies of the data.
Disadvantages of Multiprocessor Systems
● Increased Expense
○ Even though multiprocessor systems are cheaper in the long run than using
multiple computer systems, still they are quite expensive.
○ It is much cheaper to buy a simple single processor system than a
multiprocessor system.
● Complicated Operating System Required
○ There are multiple processors in a multiprocessor system that share
peripherals, memory etc.
○ So, it is much more complicated to schedule processes and impart
resources to processes.than in single processor systems. Hence, a more
complex and complicated operating system is required in multiprocessor
systems.
● Large Main Memory Required
○ All the processors in the multiprocessor system share the memory. So a
much larger pool of memory is required as compared to single processor
systems
8. How does hardware find the Operating System kernel after system switch-on?
● The CPU initializes itself after the power in the computer is first turned on.
● This is done by triggering a series of clock ticks that are generated by the system
clock.
● After this, the CPU looks for the system’s ROM BIOS to obtain the first instruction
in the start-up program.
● This first instruction is stored in the ROM BIOS and it instructs the system to run
POST (Power On Self Test) in a memory address that is predetermined.
● POST first checks the BIOS chip and then the CMOS RAM.
● If there is no battery failure detected by POST, then it continues to initialize the
CPU.
● POST also checks the hardware devices, secondary storage devices such as hard
drives, ports etc. And other hardware devices such as the mouse and keyboard.
● This is done to make sure they are working properly.
● After POST makes sure that all the components are working properly, then the
BIOS finds an operating system to load.
● In most computer system’s, the operating system loads from the C drive onto the
hard drive.
● The CMOS chip typically tells the BIOS where the operating system is found.
● The order of the different drives that CMOS looks at while finding the operating
system is known as the boot sequence.
● This sequence can be changed by changing the CMOS setup.
● After finding the appropriate boot drive, the BIOS first finds the boot record which
tells it to find the beginning of the operating system.
● After the initialization of the operating system, the BIOS copies the files into the
memory. Then the operating system controls the boot process.
● In the end, the operating system does a final inventory of the system memory and
loads the device drivers needed to control the peripheral devices.
● The users can access the system applications to perform various tasks.
○ 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.
Step 1) The processes executed in the user mode till the time a system call interrupts it.
Step 2) After that, the system call is executed in the kernel-mode on a priority basis.
Step 3) Once system call execution is over, control returns to the user mode.,
Step 4) The execution of user processes resumed in Kernel mode.
○ The kernel provides various services such as memory management, file management,
process scheduling etc. using function calls.
○ This makes the execution of the operating system quite fast as the services are
implemented under the same address space.
■ To add any new service, the entire operating system needs to be modified by the user.
○ 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.
■ Records the response time between service requests and system response to have
a complete view of the system health.
○ 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.
■ Operating system constantly monitors the system to detect errors and avoid the
malfunctioning of the computer system.
○ Memory Management
■ It keeps track of primary memory, i.e., which bytes of memory are used by which
user program.
○ Processor Management
○ Device Management
■ Decides which process gets access to a certain device and for how long. Allocates
devices in an effective and efficient way.
○ File Management
■ A file system is organized into directories for efficient or easy navigation and
usage.
■ OS keeps track of where information is stored, user access settings and status of
every file and more…
○ Program Execution:
■ The Operating System is responsible for execution of all types of programs
whether it be user programs or system programs.
■ The Operating System utilises various resources available for the efficient running
of all types of functionalities.
○ Handling Input/Output Operations:
■ The Operating System is responsible for handling all sorts of inputs, i.e, from
keyboard, mouse, desktop, etc.
■ The Operating System does all interfacing in the most appropriate manner
regarding all kinds of Inputs and Outputs.
○ 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.
○ Error Detection and Handling:
■ The Operating System is responsible for detection of any types of error or bugs
that can occur while any task.
■ The well secured OS sometimes also acts as countermeasure for preventing any
sort of breach to the Computer System from any external source and probably
handling them.
○ 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.
○ 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 occurred are recorded by the Operating
System.
■ 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.
16. Explain types of system calls?
○ Process Control
■ This system calls perform the task of process creation, process termination, etc.
■ Functions:
● End and Abort
● Load and Execute
● Create Process and Terminate Process
● Wait and Signed Event
● Allocate and free memory
○ File Management
■ File management system calls handle file manipulation jobs like creating a file,
reading, and writing, etc.
■ Functions:
● Create a file
● Delete file
○ Device Management
■ Device management does the job of device manipulation like reading from device
buffers, writing into device buffers, etc.
10
■ Functions:
○ Information Maintenance
■ It handles information and its transfer between the OS and the user program.
■ Functions:
○ Communications
■ These types of system calls are specially used for interprocess communications.
■ Functions:
17. Explain the simple structure operating system. Also list out the advantages and
disadvantages of simple structure OS.
● Simple structure:
○ Such operating systems do not have well defined structure and are small, simple
and limited systems.
○ The interfaces and levels of functionality are not well separated.
○ MS-DOS is an example of such an operating system.
○ In MS-DOS application programs are able to access the basic I/O routines.
○ These types of operating systems cause the entire system to crash if one of the
user programs fails.
○ Diagram of the structure of MS-DOS is shown below.
11
■ It delivers better application performance because of the few interfaces between the
application program and the hardware.
18. What is Layered structure OS and also give the advantages and disadvantages of Layered
structure.
○ An OS can be broken into pieces and retain much more control on the system.
○ In this structure the OS is broken into a number of layers (levels).
○ The bottom layer (layer 0) is the hardware and the topmost layer (layer N) is the user
interface.
○ These layers are so designed that each layer uses the functions of the lower level layers
only.
○ This simplifies the debugging process as if lower level layers are debugged and an error
occurs during debugging then the error must be on that layer only as the lower level layers
have already been debugged.
○ The main disadvantage of this structure is that at each layer, the data needs to be
modified and passed on which adds overhead to the system.
○ Moreover careful planning of the layers is necessary as a layer can use only lower level
layers.
○ UNIX is an example of this structure.
12
■ Layering makes it easier to enhance the operating system as implementation of a layer can
be changed easily without affecting the other layers.
■ It is very easy to perform debugging and system verification.
○ Disadvantages of Layered structure:
○ This structure designs the operating system by removing all non-essential components
from the kernel and implementing them as system and user programs.
○ This results in a smaller kernel called the micro-kernel.
○ Advantages of this structure are that all new services need to be added to user space and
does not require the kernel to be modified.
○ Thus it is more secure and reliable as if a service fails then the rest of the operating system
remains untouched.
○ Mac OS is an example of this type of OS.
○ Microkernel architecture is small and isolated therefore it can function better.
○ Providing services in a microkernel system are expensive compared to the normal
monolithic system
13
14
15
● Each task is given some time to execute so that all the tasks work smoothly.
● Each user gets the time of CPU as they use a single system.
● These systems are also known as Multitasking Systems.
● The task can be from a single user or different users also.
● The time that each task gets to execute is called quantum. After this time interval is
over OS switches over to the next task.
● Examples of Time-Sharing OSs are: Multics, Unix, etc.
16
● These types of operating systems are a recent advancement in the world of computer
technology and are being widely accepted all over the world and, that too, with a great
pace.
● Various autonomous interconnected computers communicate with each other using a
shared communication network.
● Independent systems possess their own memory unit and CPU.
● These are referred to as loosely coupled systems or distributed systems.
● These system’s processors differ in size and function.
● The major benefit of working with these types of the operating system is that it is
always possible that one user can access the files or software which are not actually
present on his system but some other system connected within this network i.e., remote
access is enabled within the devices connected in that network.
● Examples of Distributed Operating Systems are- LOCUS, etc.
17
● These systems run on a server and provide the capability to manage data, users,
groups, security, applications, and other networking functions.
● These types of operating systems allow shared access of files, printers, security,
applications, and other networking functions over a small private network.
● One more important aspect of Network Operating Systems is that all the users are well
aware of the underlying configuration, of all other users within the network, their
individual connections, etc. and that’s why these computers are popularly known as
tightly coupled systems.
● Examples of Network Operating System are: Microsoft Windows Server 2003,
Microsoft Windows Server 2008, UNIX, Linux, Mac OS X, Novell NetWare, and BSD, etc.
● The time interval required to process and respond to inputs is very small.
● Real-time systems are used when there are time requirements that are very strict like
missile systems, air traffic control systems, robots, etc.
18
■ These OSs are meant for applications where time constraints are very strict
and even the shortest possible delay is not acceptable.
■ These systems are built for saving life like automatic parachutes or airbags
which are required to be readily available in case of any accident.
19
o Device driver and interrupt signals: It needs specific device drivers and interrupts
signals to respond earliest to interrupts.
o Thread Priority: It is not good to set thread priority as these systems are very less
prone to switching tasks.
20