0% found this document useful (0 votes)
25 views27 pages

Os Unit1 Sol

Uploaded by

ammujasty
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views27 pages

Os Unit1 Sol

Uploaded by

ammujasty
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 27

OPERATING SYSTEM

UNIT-1

1.What is an Operating System and its types? What are its objectives? [7M] [SET-2,4, Jan2023][Remember]

An Operating System (OS) is an interface between a computer user and computer hardware. An operating
system is a software which performs all the basic tasks like file management, memory management, process
management, handling input and output, and controlling peripheral devices such as disk drives and printers.

 An operating system is a program that acts as an interface between the user and the computer hardware and
controls the execution of all kinds of program
 An operating system (OS) is system software that manages computer hardware, software resources, and
provides common services for computer programs.

The purpose of an operating system is to provide an environment in which a user can execute programs in
convenient and efficient manner.
Examples of operating system: Windows, Linux, Mac OS, etc.

Architecture of operating system

:
Structure of a Computer System

A Computer System consists of:

Users (people who are using the computer)

Application Programs:Application software is a type of software which runs as per user request (word
processors, Databases, Games, Video player, Browsers, etc.):

System Programs: system software is used for operating computer hardware(Shells, Editors, Compilers, etc.)

Operating System (A special program which acts as an interface between user and hardware

Hardware (CPU, Disks, Memory, etc)

Types of operating systems

There are several types of Operating Systems

 Batch operating system


 Multi-Processing System
 Multi-Tasking Operating System
 Time sharing operating system
 Distributed Operating System
 Network operating system
 Real time operating system

1. Batch Operating System


This type of operating system does not interact with the computer directly. There is an operator which takes
similar jobs having the same requirement and groups them into batches. It is the responsibility of the
operator to sort jobs with similar need
Advantages of Batch Operating System
 It is very difficult to guess or know the time required for any job to complete. Processors of the batch
systems know how long the job would be when it is in the queue.
 Multiple users can share the batch systems.
 The idle time for the batch system is very less.
 It is easy to manage large work repeatedly in batch systems.
Disadvantages of Batch Operating System
 The computer operators should be well known with batch systems.
 Batch systems are hard to debug.
 It is sometimes costly.
 The other jobs will have to wait for an unknown time if any job fails.
Examples of Batch Operating Systems: Payroll Systems, Bank Statements, etc.

Multi-Programming Operating System

Multiprogramming operating systems:can be simply illustrated as more than one program is present in the main
memory and any one of them can be kept in execution. This is basically used for better execution of resources.

An OS does the following activities related to multiprogramming.

 The operating system keeps several jobs in memory at a time.


 This set of jobs is a subset of the jobs kept in the job pool.
 The operating system picks and begins to execute one of the jobs in the memory.
Advantages of Multi-Programming Operating System
 Multi Programming increases the Throughput of the System.
 It helps in reducing the response time .
Disadvantages of Multi-Programming Operating System
 There is not any facility for user interaction of system resources with the system
Multi-Processing Operating System
Multi processing operating sytem is a type of Operating System in which more than one CPU is used for the execution
of resources. It betters the throughput of the System.

Advantages of Multi-Processing Operating System

 It increases the throughput of the system.


 As it has several processors, so, if one processor fails, we can proceed with another processor.
Disadvantages of Multi-Processing Operating System
 Due to the multiple CPU, it can be more complex and somehow difficult to understand
Multi tasking Operating system

The multitasking operating system is a logical extension of a multiprogramming system that


enables multiple programs simultaneously. It allows a user to perform more than one computer task at the
same time.
Advantages of Multi-Tasking Operating System
 Multiple Programs can be executed simultaneously in Multi-Tasking Operating System.
 It comes with proper memory management.
Disadvantages of Multi-Tasking Operating System
 The system gets heated in case of heavy programs multiple times.
Time sharing Operating systems
In the Time Sharing operating system, computer resources are allocated in a time-dependent fashion to several
programs simultaneously. Thus it helps to provide a large number of user's direct access to the main computer.
It is a logical extension of multiprogramming. In time-sharing, the CPU is switched among multiple programs
given by different users on a scheduled basis.

A time-sharing operating system allows many users to be served simultaneously, so sophisticated CPU
scheduling schemes and Input/output management are required.

Time-sharing operating systems are very difficult and expensive to build

Advantages of Time Sharing Operating System

 The time-sharing operating system provides effective utilization and sharing of resources.

 This system reduces CPU idle and response time.

Disadvantages of Time Sharing Operating System


o Data transmission rates are very high in comparison to other methods.
o Security and integrity of user programs loaded in memory and data need to be maintained as many
users access the system at the same time.
Distributed Operating System

These are referred to as loosely coupled systems or distributed systems. These systems’ 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.

Advantages of Distributed Operating System

 Failure of one will not affect the other network communication, as all systems are independent of each
other.
 Electronic mail increases the data exchange speed.
 Since resources are being shared, computation is highly fast and durable.
 Load on host computer reduces.
 These systems are easily scalable as many systems can be easily added to the network.
 Delay in data processing reduces.
Disadvantages of Distributed Operating System
 Failure of the main network will stop the entire communication.
 To establish distributed systems the language is used not well-defined yet.
 These types of systems are not readily available as they are very expensive. Not only that the underlying
software is highly complex and not understood well yet.

Network Operating System


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 to files,
printers, security, applications, and other networking functions over a small private network. these computers
are popularly known as tightly coupled systems.
Advantages of Network Operating System
 Highly stable centralized servers.
 Security concerns are handled through servers.
 New technologies and hardware up-gradation are easily integrated into the system.
 Server access is possible remotely from different locations and types of systems.
Disadvantages of Network Operating System
 Servers are costly.
 User has to depend on a central location for most operations.
 Maintenance and updates are required regularly.
Examples of Network Operating Systems are Microsoft Windows Server 2003, Microsoft Windows Server 2008,
UNIX, Linux, Mac OS X, Novell NetWare, BSD, etc.

Real-Time Operating System


These types of OSs serve real-time systems. The time interval required to process and respond to inputs is
very small. This time interval is called response time.
Real-time systems are used when there are time requirements that are very strict like missile systems, air
traffic control systems, robots, etc.
Types of Real-Time Operating Systems
 HardReal-TimeSystems:
Hard Real-Time 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 an accident. Virtual memory is rarely
found in these systems.
 SoftReal-TimeSystems:
These OSs are for applications where time-constraint is less strict.
Functions of Operating System:

2. What are the functionalities of Operating Systems? Explain in detail. [7M] [SET-1,4 Jan2023,July2022][Remember]

Process Management

A process is a program in execution. A process needs certain resources, including CPU time, memory,files,
and I/O devices, to accomplish its task.The operating system is responsible for the following activities in
connection with process management.
✦ Process creation and deletion.
✦ Process suspension and resumption.
✦ Provision of mechanisms for:
 Process Synchronization
 Process Communication
Main-Memory Management
Memory is a large array of words or bytes, each with its own address. It is a repository of quickly accessible
data shared by the CPU and I/O devices.Main memory is a volatile storage device. It loses its contents in the
case of system failure.
The operating system is responsible for the following activities in connections with memory
management:
 Keep track of which parts of memory are currently being used and by whom.
 Decide which processes to load when memory space becomes available.
 Allocate and de-allocate memory space as needed.

File Management
A file is a collection of related information defined by its creator. Commonly,files represent
programs(both source and object forms) and data.The operating system is responsible for the following
activities in connections with file management:
✦ File creation and deletion.
✦ Directory creation and deletion.
✦ Support of primitives for manipulating files and directories.
✦ Mapping files onto secondary storage.
✦ File backup on stable (nonvolatile) storage media.
I/O System Management
The I/O system consists of:
✦ A buffer-caching system
✦ A general device-driver interface
✦ Drivers for specific hardware devices
Secondary-Storage Management
Since main memory (primary storage) is volatile and too small to accommodate all data and
programspermanently, the computer system must provide secondary storage to back up main memory.
Most modern computer systems use disks as the principle on-line storage medium, for both programs and
data.The operating system is responsible for the following activities in connection with disk management:
✦ Free space management
✦ Storage allocation
✦ Disk scheduling
Networking (Distributed Systems)
 A distributed system is a collection of processors that do not share memory or a clock. Each
processor has its own local memory.
 The processors in the system are connected through a communication network.
 Communication takes place using a protocol.
 A distributed system provides user access to various system resources.
 Access to a shared resource allows:
✦ Computation speed-up
✦ Increased data availability
✦ Enhanced reliability
Protection System
 Protection refers to a mechanism for controlling access by programs, processes, or users
to bothsystem and user resources.
 The protection mechanism must:
✦ distinguish between authorized and unauthorized usage.
✦ specify the controls to be imposed.
✦ provide a means of enforcement.
Command-Interpreter System
Many commands are given to the operating system by control statements which deal with:
✦ process creation and management
✦ I/O handling
✦ secondary-storage management
✦ main-memory management
✦ file-system access
✦ protection
✦ networking:The program that reads and interprets control statements is called
variously:
✦ command-line interpreter
✦ shell (in UNIX)
Its function is to get and execute the next command statement

Components of OS: OS has two parts. (1)Kernel.(2)Shell.


1.Kernel is an active part of an OS i.e., it is the part of OS running at all times. It is a programs whichcan
interact with the hardware. Ex: Device driver, dll files, system files etc.
2.Shell is called as the command interpreter. It is a set of programs used to interact with the application
programs. It is responsible for execution of instructions given to OS (called commands).
Operating systems can be explored from two viewpoints: the user and the system.

User View: From the user’s point view, the OS is designed for one user to monopolize its resources, to
maximize the work that the user is performing and for ease of use.
System View: From the computer's point of view, an operating system is a control program that
manages the execution of user programs to prevent errors and improper use of the computer. It is
concerned with the operation and control of I/O devices.

Different Approaches or Structures of Operating Systems


3. Explain the types of Operating System structures. [7M] [SET-2 Jan2023] [Knowledge]

The operating system can be implemented with the help of various structures. The structure of the OS depends mainly
on how the various standard components of the operating system are interconnected and melded into the kernel.
structures in the operating system:

Simple structure

Such operating systems do not have well-defined structures and are small, simple, and limited. 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. .

Advantages of Simple structure


 It delivers better application performance because of the few interfaces between the application program
and the hardware.
 It is easy for kernel developers to develop such an operating system .
Disadvantages of Simple structure
 The structure is very complicated, as no clear boundaries exist between modules.
 It does not enforce data hiding in the operating system.
Layered structure
An OS can be broken into pieces and retain much more control over 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. This simplifies the debugging process, 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 .

Advantages of Layered structure


 Layering makes it easier to enhance the operating system, as the 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
 In this structure, the application’s performance is degraded as compared to simple structure.
 It requires careful planning for designing the layers, as the higher layers use the functionalities of only the
lower layers.
Micro-kernel
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 fails, 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 rest of the
operating system remains untouched. Mac OS is an example of this type of OS.
Advantages of Micro-kernel structure
1. It makes the operating system portable to various platforms.
2. As microkernels are small so these can be tested effectively .
Disadvantages of Micro-kernel structure
1. Increased level of inter module communication degrades system performance

Modular structure or approach


It is considered as the best approach for an OS. It involves designing of a modular kernel. The kernel has only a set of
core components and other services are added as dynamically loadable modules to the kernel either during runtime or
boot time. It resembles layered structure due to the fact that each kernel has defined and protected interfaces, but it is
more flexible than a layered structure as a module can call any other module. For example Solaris OS is organized as
shown in the figure.

Operating System Operations


4. Explain different operations performed by the operating system. [7M] [SET-1 July2022] [Knowledge]

An operating system is a construct that allows the user application programs to interact with the system
hardware. Operating system by itself does not provide any function but it provides an atmosphere in
which different applications and programs can do useful work.
The major operations of the operating system are process management, memory management, device
management and file management. These are given in detail as follows:
An operating system is a program that acts as an interface between the user and the computer
hardware and controls the execution of all kinds of programs.
Memory Management
• Processor Management
• Device Management
• File Management
• Security
• Control over system performance
• Job accounting
• Error detecting aids
• Coordination between other software and users
Memory Management
Memory management refers to management of Primary Memory or Main Memory. Main
memory is a large array of words or bytes where each word or byte has its own address.

Main memory provides a fast storage that can be accessed directly by the CPU. For a program to be
executed, it must in the main memory. An Operating System does the following activities for memory
management −
• Keeps tracks of primary memory, i.e., what part of it are in use by whom, what part are not
in use.
• In multiprogramming, the OS decides which process will get memory when and how
much.
• Allocates the memory when a process requests it to do so.
• De-allocates the memory when a process no longer needs it or has been terminated.
Processor Management
In multiprogramming environment, the OS decides which process gets the processor when and for
how much time. This function is called process scheduling. An Operating System does the following
activities for processor management −
• Keeps tracks of processor and status of process. The program responsible for this task is
known as traffic controller.
• Allocates the processor (CPU) to a process.
• De-allocates processor when a process is no longer required.
Device Management
An Operating System manages device communication via their respective drivers. It does the
following activities for device management −
• Keeps tracks of all devices. Program responsible for this task is known as the
I/Ocontroller.
• Decides which process gets the device when and for how much time.
• Allocates the device in the efficient way.
• De-allocates devices.
File Management
A file system is normally organized into directories for easy navigation and usage. These
directories may contain files and other directions.
An Operating System does the following activities for file management −
• Keeps track of information, location, uses, status etc. The collective facilities are
often known as file system.
• Decides who gets the resources.
• Allocates the resources.
• De-allocates the resources.
Other Important Activities
Following are some of the important activities that an Operating System performs −
• Security − By means of password and similar other techniques, it prevents
unauthorized accessto programs and data.
• Control over system performance − Recording delays between request for a service and
responsefrom the system.
• Job accounting − Keeping track of time and resources used by various jobs and users.
• Error detecting aids − Production of dumps, traces, error messages, and other
debugging and errordetecting aids.
• Coordination between other softwares and users − Coordination and assignment of
compilers, interpreters, assemblers and other software to the various users of the
computer systems.
• A computer system uses many devices, arranged in different ways to solve many
problems. This constitutes a computing environment where many computers are used
toprocess and exchange information to handle multiple issues.

Computing Environments:
5.Explain how operating systems are used in a variety of computing environments? [7M] [SET-1 July2022]
[ Knowledge]

When a problem is solved by the computer, during that computer uses many devices, arranged in different
ways and which work together to solve problems. This constitutes a computing environment where various
number of computer devices arranged in different ways to solve different types of problems in different ways.
In different computing environments computer devices are arranged in different ways and they exchange
information in between them to process and solve problem. One computing environment consists of many
computers other computational devices, software and networks that to support processing and sharing
information and solving task. Based on the organization of different computer devices and communication
processes there exists multiple types of computing environments.

Types of Computing Environments: There are the various types of computing environments. They are

1.Personal Computing Environment: In personal computing environment there is a stand- alone machine.
Complete program resides on computer and executed there. Different stand- alone machines that
constitute a personal computing environment are laptops, mobiles, printers, computer systems, scanners
etc. That we use at our homes and offices

2.Time-Sharing Computing Environment: In Time Sharing Computing Environment multiple users share
system simultaneously. Different users (different processes) are allotted different time slice and processor
switches rapidly among users according to it. For example, student listening to music while coding
something in an IDE. Windows 95 and later versions, Unix, IOS, Linux operating systems are the examples
of this time sharing computing environment.

3.Client Server Computing Environment: In client server computing environment two machines are
involved i.e., client machine and server machine, sometime same machine also serve as client and server. In
this computing environment client requests resource/service and server provides that respective
resource/service. A server can provide service to multiple clients at a time and here mainly communication
happens through computer network.
4.Distributed Computing Environment: In a distributed computing environment multiple nodes are
connected together using network but physically they are separated. A single task is performed by different
functional units of different nodes of distributed unit. Here different programs of an application run
simultaneously on different nodes, and communication happens in between different nodes of this system
over network to solve task.
5.Grid Computing Environment: In grid computing environment, multiple computers from different
locations works on single problem. In this system set of computer nodes running in cluster jointly perform a
given task by applying resources of multiple computers/nodes. It is network of computing environment
where several scattered resources provide running environment for single task.
6.Cloud Computing Environment: In cloud computing environment on demand availability of computer
system resources like processing and storage are availed. Here computing is not done in individual
technology or computer rather it is computed in cloud of computers where all required resources are
provided by cloud vendor. This environment primarily comprised of three services i.e. software-as-a-service
(SaaS), infrastructure-as-a-service (IaaS), and platform-as-a-service (PaaS).

7.Cluster Computing Environment: In cluster computing environment cluster performs task where cluster is a
set of loosely or tightly connected computers that work together. It is viewed as single system and performs
task parallelly that’s why also it is similar to parallel computing environment. Cluster aware applications are
especially used in cluster computing environment

Open-Source Operating Systems


6.What is Open-source software? Discuss its advantages and disadvantages. List out some Open-Source
operating systems.[7M] [SET-1 Jan 2023] [Remember]

The term "open source" refers to computer software or applications where the owners or copyright holders
enable the users or third parties to use, see, and edit the product's source code. The source code of an open-
source OS is publicly visible and editable. The usually operating systems such as Apple's iOS, Microsoft's
Windows, and Apple's Mac OS are closed operating systems. Open-Source Software is licensed in such a way
that it is permissible to produce as many copies as you want and to use them wherever you like. It generally
uses fewer resources than its commercial counterpart because it lacks any code for licensing, promoting other
products, authentication, attaching advertisements, etc.

The open-source operating system allows the use of code that is freely distributed and available to
anyone and for commercial purposes. Being an open-source application or program, the program source
code of an open-source OS is available. The user may modify or change those codes and develop new
applications according to the user requirement. Some basic examples of the open-source operating systems
are Linux, Open Solaris, Free RTOS, Open BDS, Free BSD, Minix, etc.

In 1997, the first Open-Source software was released. Despite the industry, there are now Open- Source
alternatives for every Software program.

Open-source operating system works similarly to a closed operating system, except that the user may modify
the source code of the program or application. There may be a difference in function even if there is no
difference in performance.

While the licensed operating system is secure and hassle-free, and the open source operating system requires
some technical knowledge, you may customize these and increase performance. There is no specific way or
framework for working on the open-source OS, but it may be customized on the user requirement

Advantages

1.Reliable and efficient


The open-source operating systems are most reliable and efficient. Thousands of eyes monitor these because
the source code is public. As a result, if there are any bugs or errors, they are fixed by the best developers
worldwide.
2.Cost-efficient

Most of the open-source operating systems are free. And some of them are far less expensive than
commercially closed products.

3.Flexibility

The great advantage is you may customize it as per your requirement. And there is creative freedom.

Disadvantages

1. Complicated
It is not as user-friendly as the ones that are closed. To use this software, you must have a basic
understanding of technology.
2. Security risk
Despite the defects having been detected, there is a risk of assaults because the attackers have access to the
source code.
3.No support
If you run across an issue, there is no customer support available to assist you.

Operating System Services

7.List various services of Operating System. [7M] [SET-1 Feb/March 2022] [Knowledge]

An Operating System provides services to both the users and to the programs.

 It provides programs an environment to execute.


 It provides users the services to execute the programs in an convenient manner. The following are a
few common services provided by an operating system −
 Program execution
 I/O operations
 File System manipulation
 Communication
 Error Detection
 Resource Allocation
 Protection

Program execution
Operating systems handle many kinds of activities from user programs to system programs like
printer spooler, name servers, file server, etc. Each of these activities is encapsulated as a process.
A process includes the complete execution context (code to execute, data to manipulate, registers,
OS resources in use). Following are the major activities of an operating system with respect to program
management –
 Loads a program into memory.
 Executes the program.
 Handles program's execution.
 Provides a mechanism for process synchronization.
 Provides a mechanism for process communication.
 provides a mechanism for deadlock handling
I/O Operation

An I/O subsystem comprises of I/O devices and their corresponding driver software. Drivers hide the
peculiarities of specific hardware devices from the users.
An Operating System manages the communication between user and device drivers.

 I/O operation means read or write operation with any file or any specific I/O device.
 Operating system provides the access to the required I/O device when required.
File system manipulation
A file represents a collection of related information. Computers can store files on the disk (secondary
storage), for long-term storage purpose. Examples of storage media include magnetic tape, magnetic disk
and optical disk drives like CD, DVD. Each of these media has its own properties like speed, capacity, data
transfer rate and data access methods.
A file system is normally organized into directories for easy navigation and usage. These
directories may contain files and other directions. Following are the major activities of an operating system
with respect to file management −

 Program needs to read a file or write a file.


 The operating system gives the permission to the program for operation on file.
 Permission varies from read-only, read-write, denied and so on.
 Operating System provides an interface to the user to create/delete files.
 Operating System provides an interface to the user to create/delete directories.
 Operating System provides an interface to create the backup of file system.
Communication
In case of distributed systems which are a collection of processors that do not share memory,
peripheral devices, or a clock, the operating system manages communications between all the processes.
Multiple processes communicate with one another through communication lines in the network.
The OS handles routing and connection strategies, and the problems of contention and security.
Following are the major activities of an operating system with respect to communication −

 Two processes often require data to be transferred between them


 Both the processes can be on one computer or on different computers, but are connected
through a computer network.
 Communication may be implemented by two methods, either by Shared Memory or by
Message Passing.
Error handling
Errors can occur anytime and anywhere. An error may occur in CPU, in I/O devices or in the
memory hardware. Following are the major activities of an operating system with respect to error
handling −

 The OS constantly checks for possible errors.


 The OS takes an appropriate action to ensure correct and consistent computing.
Resource Management
In case of multi-user or multi-tasking environment, resources such as main memory, CPU cycles and
files storage are to be allocated to each user or job. Following are the major activities of an operating system
with respect to resource management −

 The OS manages all kinds of resources using schedulers.


 CPU scheduling algorithms are used for better utilization of CPU.
Protection
Considering a computer system having multiple users and concurrent execution of multiple
processes, the various processes must be protected from each other's activities.
Protection refers to a mechanism or a way to control the access of programs, processes, or users to
the resources defined by a computer system. Following are the major activities of an operating system with
respect to protection −

 The OS ensures that all access to system resources is controlled.


 The OS ensures that external I/O devices are protected from invalid access attempts
 The OS provides authentication features for each user by means of passwords.
User and Operating System Interface
8. What are the primary functions of a command-line interface (CLI) in an operating system, and how does it
differ from a graphical user interface (GUI)? [7M][Remember]
The user and operating system are connected with each other with the help of interface, so interface is
used to connect the user and OS.
In computers there are different types of interface that can be used for connection with computers to
users and their connection is responsible for data transfer.
Also, in computers there are different interfaces. These interfaces are not necessarily used but can be
used in computers whenever it is needed. So, different types of tasks can be performed by the help of
different interfaces.
Command line interface
The command-line interface is an interface whenever the user needs to have different commands
regarding the input and output and then a task is performed so this is called the command-line argument and
it is used to execute the output and create, delete, print, copy, paste, etc.
All these operations are performed with the help of the command-line interface.
The interface is always connected to the OS so that the command given by the user directly works
by the OS and a number of operations can be performed with the help of the command line interface
because multiple commands can be interrupted at same time and execute only one.
The command line interface is necessary because all the basic operations in the computer are
performed with the help of the OS and it is responsible for memory management. By using this we can
divide the memory and we can use the memory.
Command Line Interface advantages −
 Controls OS or application
 faster management
 ability to store scripts which helps in automating regular tasks.
 Troubleshoot network connection issues.

Command Line Interface disadvantages −


 The steeper learning curve is associated with memorizing commands and a complex syntax.
 Different commands are used in different shells.
Graphical user interface
The graphical user interface is used for playing games, watching videos, etc. these are done with the
help of GUI because all these applications require graphics.
The GUI is one of the necessary interfaces because only by using the user can clearly see the picture, play
videos.
So we need GUI for computers and this can be done only with the help of an operating system.
When a task is performed in the computer then the OS checks the task and defines the interface which is
necessary for the task. So, we need GUI in the OS.
The basic components of GUIs are −
 Start menu with program groups
 Taskbar which showing running programs
 Desktop screen
 Different icons and shortcuts.

Choice of interface
The interface that is used with the help of OS for a particular task and that task can be performed
with minimum possible time and the output is shown on the screen in that case we use the choice of
interface.
The choice of interface means the OS checks the task and finds out which interface can be suitable
for a particular task. So that type of interface is called the choice of interface and this can be done with the
help of an OS.
System Calls, Types of System Calls
9.Explain in detail about various types of System Calls handled by Operating System[7M][SET-4 Jan2023]
[Knowledge]

The interface between a process and an operating system is provided by system calls. In general, system calls
are available as assembly language instructions. They are also included in the manuals used by the assembly
level programmers. System calls are usually made when a process in user mode requires access to a resource.
Then it requests the kernel to provide the resource via a system call.
A figure representing the execution of the system call is given as follows –
Types of System Calls
There are mainly five types of system calls.
Process Control
These system calls deal with processes such as process creation, process termination etc.
File Management
These system calls are responsible for file manipulation such as creating a file, reading a file, writing
into a file etc.
Device Management
These system calls are responsible for device manipulation such as reading from device buffers,
writing into device buffers etc.
Information Maintenance
These system calls handle information and its transfer between the operating system and the user
program.
Communication
These system calls are useful for interprocess communication. They also deal with creating and
deleting a communication connection.
Some of the examples of all the above types of system calls in Windows and Unix are given as
follows −
Types of System Calls Windows Linux
CreateProcess() fork()
Process Control ExitProcess() exit()
WaitForSingleObject() wait()
CreateFile() open()
ReadFile() read()
File Management
WriteFile() write()
CloseHandle() close()
SetConsoleMode() ioctl()
Device Management ReadConsole() read()
WriteConsole() write()
GetCurrentProcessID() getpid()
Information Maintenance SetTimer() alarm()
Sleep() sleep()
CreatePipe() pipe()
Communication CreateFileMapping() shmget()
MapViewOfFile() mmap()
open( )
The open() system call is used to provide access to a file in a file system. This system call allocates resources
to the file and provides a handle that the process uses to refer to the file. A file can be opened by multiple
processes at the same time or be restricted to one process. It all depends on the file organization and file
system.
read( )
The read() system call is used to access data from a file that is stored in the file system. The file to read can
be identified by its file descriptor and it should be opened using open() before it can be read. In general, the
read() system calls takes three arguments i.e. the file descriptor, buffer which stores read data and number
of bytes to be read from the file.
write( )
The write() system calls writes the data from a user buffer into a device such as a file. This system call is
one of the ways to output data from a program. In general, the write system calls takes three arguments i.e.
file descriptor, pointer to the buffer where data is stored and number of bytes to write from the buffer.
close( )
The close() system call is used to terminate access to a file system. Using this system call means that
the file is no longer required by the program and so the buffers are flushed, the file metadata is updated and
the file resources are de-allocated.
System Programs
System programs provide an environment where programs can be developed and executed. In the simplest
sense, system programs also provide a bridge between the user interface and system calls. In reality, they are
much more complex. For example, a compiler is a complex system program.
The system program serves as a part of the operating system. It traditionally lies between the user
interface and the system calls. The user view of the system is actually defined by system programs and not
system calls because that is what they interact with and system programs are closer to the user interface.

System programs as well as application programs form a bridge between the user interface and the
system calls. So, from the user view the operating system observed is actually the system programs and not
the system calls.
Types of System Programs
10.Name three types of system programs found in an operating system and briefly explain the purpose of
each. [7M][Remember]
System programs can be divided into seven parts. These are given as follows:
Status Information
The status information system programs provide required data on the current or past status of the
system. This may include the system date, system time, and available memory in system, disk space, logged
in users etc.
Communications
These system programs are needed for system communications such as web browsers. Web
browsers allow systems to communicate and access information from the network as required.
File Manipulation
These system programs are used to manipulate system files. This can be done using various
commands like create, delete, copy, rename, print etc. These commands can create files, delete files, copy
the contents of one file into another, rename files, print them etc.
Application Programs
Application programs can perform a wide range of services as per the needs of the users. These
include programs for database systems, word processors, plotting tools, spreadsheets, games, scientific
applications etc.
Programming Language Support
These system programs provide additional support features for different programming languages.
Some examples of these are compilers, debuggers etc. These compile a program and make sure it is error
free respectively.
Operating System Debugging
11.How does the use of debugging tools and techniques differ when debugging an operating system kernel
compared to debugging user-level applications?[7M][ Remember]

Debugging is the process of finding the problems in a computer system and solving them. There are many
different ways in which operating systems perform debugging. Some of these are –

Log Files
The log files record all the events that occur in an operating system. This is done by writing all the
messages into a log file. There are different types of log files. Some of these are given as follows –
Event Logs
These stores the records of all the events that occur in the execution of a system. This is done so that
the activities of all the events can be understood to diagnose problems.
Transaction Logs
The transaction logs store the changes to the data so that the system can recover from crashes and
other errors. These logs are readable by a human.
Message Logs
These logs store both the public and private messages between the users. They are mostly plain text
files, but in some cases they may be HTML files.
Core Dump Files
The core dump files contain the memory address space of a process that terminates unexpectedly.
The creation of the core dump is triggered in response to program crashes by the kernel. The core dump
files are used by the developers to find the program’s state at the time of its termination so that they can find
out why the termination occurred.
The automatic creation of the core dump files can be disabled by the users. This may be done to
improve performance, clear disk space or increase security.
Crash Dump Files
In the event of a total system failure, the information about the state of the operating system is
captured in crash dump files. There are three types of dump that can be captured when a system crashes.
These are –
Complete Memory Dump
The whole contents of the physical memory at the time of the system crash are captured in the
complete memory dump. This is the default setting on the Windows Server System.
Kernel Memory Dump
Only the kernel mode read and write pages that are present in the main memory at the time of the
system crash are stored in the kernel memory dump.
Small Memory Dump
This memory dump contains the list of device drivers, stop code, process and thread information,
kernel stack etc.
Trace Listings
The trace listing record information about a program execution using logging. This information is
used by programmers for debugging. System administrators and technical personnel can use the trace
listings to find the common problems with software using software monitoring tools.
Profiling
This is a type of program analysis that measures various parameters in a program such as space and
time complexity, frequency and duration of function calls, usage of specific instructions etc. Profiling is
done by monitoring the source code of the required system program using a code profiler.
Booting
Booting is the process of starting a computer. It can be initiated by hardware such as a button press or by a
software command. After it is switched on, a CPU has no software in its main memory, so some processes
must load software into memory before execution. This may be done by hardware or firmware in the CPU or
by a separate processor in the computer system.
Restarting a computer also is called rebooting, which can be "hard", e.g., after electrical power to the
CPU is switched from off to on, or "soft", where the power is not cut. On some systems, a soft boot may
optionally clear RAM to zero. Hard and soft booting can be initiated by hardware such as a button press or a
software command. Booting is complete when the operative runtime system, typically the operating system
and some applications, is attained.
The process of returning a computer from a state of sleep does not involve booting; however, restoring it
from a state of hibernation does. Minimally, some embedded systems do not require a noticeable boot
sequence to begin functioning and, when turned on, may run operational programs that are stored in ROM.
All computer systems are state machines and a reboot may be the only method to return to a designated zero-
state from an unintended, locked state.
In addition to loading an operating system or stand-alone utility, the boot process can also load a storage
dump program for diagnosing problems in an operating system.
Sequencing of Booting
Booting is a start-up sequence that starts the operating system of a computer when it is turned on. A boot
sequence is the initial set of operations that the computer performs when it is switched on. Every computer
has a boot sequence.
1. Boot Loader: Computers powered by the central processing unit can only execute code found in the
system's memory. Modern operating systems and application program code and data are stored on
nonvolatile memories. When a computer is first powered on, it must initially rely only on the code and data
stored in nonvolatile portions of the system's memory. The operating system is not really loaded at boot
time, and the computer's hardware cannot perform many complex systems actions.

The program that starts the chain reaction that ends with the entire operating system being loaded is
the boot loader or bootstrap loader. The boot loader's only job is to load other software for the operating
system to start.

2. Boot Devices: The boot device is the device from which the operating system is loaded. A modern PC
BIOS (Basic Input/Output System) supports booting from various devices. These include the local hard disk
drive, optical drive, floppy drive, a network interface card, and a USB device. The BIOS will allow the user to
configure a boot order. If the boot order is set to:

o CD Drive
o Hard Disk Drive
o Network

The BIOS will try to boot from the CD drive first, and if that fails, then it will try to boot from the hard disk
drive, and if that fails, then it will try to boot from the network, and if that fails, then it won't boot at all.

3. Boot Sequence: There is a standard boot sequence that all personal computers use. First, the CPU runs
an instruction in memory for the BIOS. That instruction contains a jump instruction that transfers to the
BIOS start-up program. This program runs a power-on self-test (POST) to check that devices the computer
will rely on are functioning properly. Then, the BIOS goes through the configured boot sequence until it
finds a bootable device. Once BIOS has found a bootable device, BIOS loads the boot sector and transfers
execution to the boot sector. If the boot device is a hard drive, it will be a master boot record (MBR).

The MBR code checks the partition table for an active partition. If one is found, the MBR code loads
that partition's boot sector and executes it. The boot sector is often operating system specific, and however,
in most operating systems, its main function is to load and execute the operating system kernel, which
continues start-up. Suppose there is no active partition, or the active partition's boot sector is invalid. In that
case, the MBR may load a secondary boot loader which will select a partition and load its boot sector, which
usually loads the corresponding operating system kernel.
Types of Booting

There are two types of booting in an operating system.

1. Cold Booting: When the computer starts for the first time or is in a shut-down state and switch on
the power button to start the system, this type of process to start the computer is called cold
booting. During cold booting, the system will read all the instructions from the ROM (BIOS) and the
Operating System will be automatically get loaded into the system. This booting takes more time
than Hot or Warm Booting.
2. Warm Booting: Warm or Hot Booting process is when computer systems come to no response or
hang state, and then the system is allowed to restart during on condition. It is also referred to as
rebooting. There are many reasons for this state, and the only solution is to reboot the computer.
Rebooting may be required when we install new software or hardware. The system requires a
reboot to set software or hardware configuration changes, or sometimes systems may behave
abnormally or may not respond properly. In such a case, the system has to be a force restart. Most
commonly Ctrl + Alt + Del button is used to reboot the system. Else, in some systems, the external
reset button may be available to reboot the system.
Booting Process in Operating System
When our computer is switched on, it can be started by hardware such as a button press, or by software
command, a computer's central processing unit (CPU) has no software in its main memory, there is some
process which must load software into main memory before it can be executed. Below are the six steps to
describe the boot process in the operating system, such as:

Step 1: Once the computer system is turned on, BIOS (Basic Input /Output System) performs a series of
activities or functionality tests on programs stored in ROM, called on POST (Power-on Self Test) that
checks to see whether peripherals in the system are in perfect order or not.

Step 2: After the BIOS is done with pre-boot activities or functionality test, it read bootable sequence
from CMOS (Common Metal Oxide Semiconductor) and looks for master boot record in the first physical
sector of the bootable disk as per boot device sequence specified in CMOS. For example, if the boot device
sequence is:
o Floppy Disk
o Hard Disk
o CDROM

Step 3: After this, the master boot record will search first in a floppy disk drive. If not
found, then the hard disk drive will search for the master boot record. But if the master
boot record is not even present on the hard disk, then the CDROM drive will search. If the
system cannot read the master boot record from any of these sources, ROM displays "No
Boot device found" and halted the system. On finding the master boot record from a
particular bootable disk drive, the operating system loader, also called Bootstrap loader, is
loaded from the boot sector of that bootable drive· into memory. A bootstrap loader is a
special program that is present in the boot sector of a bootable drive.

Step 4: The bootstrap loader first loads the IO.SYS file. After this, MSDOS.SYS file is
loaded, which is the core file of the DOS operating system.

Step 5: After this, MSDOS.SYS file searches to find Command Interpreter in


CONFIG.SYS file, and when it finds, it loads into memory. If no Command
Interpreter is specified in the CONFIG.SYS file, the COMMAND.COM file is
loaded as the default Command Interpreter of the DOS operating system.

Step 6: The last file is to be loaded and executed is the AUTOEXEC.BAT file that
contains a sequence of DOS commands. After this, the prompt is displayed. We can see the
drive letter of bootable drive displayed on the computer system, which indicates that the
operating system has been successfully on the system from that drive
Dual Booting
12.What is meant by Dual Booting? Explain the Booting process in Operating System
[7M][SET-2 Jan2023][Remember]
When two operating systems are installed on the computer system, then it is called dual
booting. Multiple operating systems can be installed on such a system. But to know which
operating system is to boot, a boot loader that understands multiple file systems and multiple
operating systems can occupy the boot space.
Once loaded, it can boot one of the operating systems available on the disk. The
disk can have multiple partitions, each containing a different type of operating system.
When a computer system turns on, a boot manager program displays a menu, allowing the
user to choose the operating system to use.

You might also like