0% found this document useful (0 votes)
12 views

Unit1 Introduction and Operating System Structures

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Unit1 Introduction and Operating System Structures

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 41

Unit 1: Introduction and Operating system structures:

 Definition:

Operating System (OS) is an interface between computer user and computer


hardware. An operating system is 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.

Operating System can be defined as an interface between user and


hardware. It is responsible for the execution of all the processes, Resource
Allocation, CPU management, File Management and many other task

Operating system is software that enables applications to interact with a


computer's hardware. The software that contains the core components of the
operating system is called the kernel.

The primary purposes of an Operating System are to enable applications


(software) to interact with a computer's hardware and to manage a system's
hardware and software resources.

Operating Systems include Linux Operating System, Windows Operating


System, VMS, OS/400, AIX, z/OS, etc.

 Types of Operating Systems

There are several types of Operating Systems which are mentioned below.

1. Batch Operating System


2. Multi-Programming System
3. Multi-Processing System
4. Multi-Tasking Operating System
5. Time-Sharing Operating System
6. Distributed Operating System
7. Network Operating System
8. 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 requirements
and groups them into batches. It is the responsibility of the operator to sort
jobs with similar needs. Batch Operating System is designed to manage and
execute a large number of jobs efficiently by processing them in groups.

In batch operating system the processing time for jobs is commonly difficult
to accurately predict while they are in the queue.

Batch Operating System

Advantages of Batch Operating System

1. Multiple users can share the batch systems.


2. The idle time for the batch system is very less.
3. It is easy to manage large work repeatedly in batch systems.
Disadvantages of Batch Operating System

1. Batch systems are hard to debug.


2. It is sometimes costly.
3. 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.

2. 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 utilization of resources.

MultiProgramming

Advantages of Multi-Programming Operating System

1. Multi Programming increases the Throughput of the System.


2. It helps in reducing the response time.

Disadvantages of Multi-Programming Operating System

1. There is not any facility for user interaction of system resources with
the system.

3. Multi-Processing Operating System

Multi-Processing Operating System 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.

Multiprocessing Operating System

Advantages of Multi-Processing Operating System

1. It increases the throughput of the system.


2. As it has several processors, so, if one processor fails, we can proceed
with another processor.

Disadvantages of Multi-Processing Operating System

1. Due to the multiple CPU, it can be more complex and somehow difficult
to understand.

4. Multi-Tasking Operating System


Multitasking Operating System is simply a multiprogramming Operating
System with having facility of a Round-Robin Scheduling Algorithm. It can run
multiple programs simultaneously.

There are two types of Multi-Tasking Systems which are listed


below.

1. Preemptive Multi-Tasking
2. Cooperative Multi-Tasking

Advantages of Multi-Tasking Operating System

1. Multiple Programs can be executed simultaneously in Multi-Tasking


Operating System.
2. It comes with proper memory management.

Disadvantages of Multi-Tasking Operating System

1. The system gets heated in case of heavy programs multiple times.


5. Time-Sharing Operating Systems

Each task is given some time to execute so that all the tasks work smoothly.
Each user gets the time of the 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.

Advantages of Time-Sharing OS

1. Each task gets an equal opportunity.


2. Fewer chances of duplication of software.
3. CPU idle time can be reduced.
4. Resource Sharing: Time-sharing systems allow multiple users to share
hardware resources such as the CPU, memory, and peripherals,
reducing the cost of hardware and increasing efficiency.
5. Improved Productivity: Time-sharing allows users to work concurrently,
thereby reducing the waiting time for their turn to use the computer.
This increased productivity translates to more work getting done in less
time.
6. Improved User Experience: Time-sharing provides an interactive
environment that allows users to communicate with the computer in
real time, providing a better user experience than batch processing.

Disadvantages of Time-Sharing OS

1. Reliability problem.
2. One must have to take care of the security and integrity of user
programs and data.
3. Data communication problem.
4. High Overhead: Time-sharing systems have a higher overhead than
other operating systems due to the need for scheduling, context
switching, and other overheads that come with supporting multiple
users.

 6.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

Hard Real-Time Systems: 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.

Soft Real-Time Systems: These OSs are for applications where time-
constraint is less strict.

Difference Between Hard Real Time and Soft Real Time System
Hard Real Time System Soft Real Time System

In hard real time system, the size In soft real time system, the size of data
of data file is small or medium. file is large.

In this system response time is in


In this system response time are higher.
millisecond.

Peak load performance should be In soft real time system, peak load can
predictable. be tolerated.

In this system safety is critical. In this system safety is not critical.

A hard real time system is very A Soft real time system is less
restrictive. restrictive.

In case of an error in a hard real In case of an soft real time system,


time system, the computation is computation is rolled back to previously
rolled back. established a checkpoint.

Satellite launch, Railway DVD player, telephone switches,


signaling system etc. electronic games etc.

Guarantees response within a Does not guarantee response within a


specific deadline. specific deadline.

Catastrophic or severe
Minor consequences (e.g., degraded
consequences (e.g., loss of life or
performance or reduced quality).
property damage).

Focused on processing critical Focused on processing tasks with lower


tasks with high priority. priority.
Advantages of RTOS

1. Maximum Consumption: Maximum utilization of devices and


systems, thus more output from all the resources.
2. Task Shifting: The time assigned for shifting tasks in these systems is
very less. For example, in older systems, it takes about 10
microseconds in shifting from one task to another, and in the latest
systems, it takes 3 microseconds.
3. Focus on Application: Focus on running applications and less
importance on applications that are in the queue.
4. Real-time operating system in the embedded system: Since the
size of programs is small, RTOS can also be used in embedded systems
like in transport and others.
5. Error Free: These types of systems are error-free.
6. Memory Allocation: Memory allocation is best managed in these
types of systems.

Disadvantages of RTOS

1. Limited Tasks: Very few tasks run at the same time and their
concentration is very less on a few applications to avoid errors.
2. Use heavy system resources: Sometimes the system resources are
not so good and they are expensive as well.
3. Complex Algorithms: The algorithms are very complex and difficult
for the designer to write on.
4. Device driver and interrupt signals: It needs specific device drivers
and interrupts signal to respond earliest to interrupts.
5. Thread Priority: It is not good to set thread priority as these systems
are very less prone to switching tasks.
6. Examples of Real-Time Operating Systems are Scientific
experiments, medical imaging systems, industrial control systems,
weapon systems, robots, air traffic control systems, etc.

 Components of Operating System

There are the following components of an operating system, such as:

1. Process Management
2. File Management
3. Network Management
4. Main Memory Management
5. Secondary Storage Management
6. I/O Device Management
7. Security Management
8. Command Interpreter System

1.Process Management

The process management component is a procedure for managing many


processes running simultaneously on the operating system. Every running
software application program has one or more processes associated with
them.

For example, when you use a search engine like Chrome, there is a process
running for that browser program.

Functions of process management

1. Process creation and deletion.


2. Suspension and resumption.
3. Synchronization process
4. Communication process

2.File Management

A file is a set of related information defined by its creator. It commonly


represents programs (both source and object forms) and data. Data files can
be alphabetic, numeric, or alphanumeric.

Function of file management

1. File and directory creation and deletion.


2. For manipulating files and directories.
3. Mapping files onto secondary storage.
4. Backup files on stable storage media.

3.Network Management

Network management is the process of administering and managing


computer networks. It includes performance management, provisioning of
networks, fault analysis, and maintaining the quality of service.
Functions of Network management

1. Network management provides the following functions, such as:


2. Distributed systems help you to various computing resources in size
and function. They may involve minicomputers, microprocessors, and
many general-purpose computer systems.
3. A distributed system also offers the user access to the various
resources the network shares.
4. It helps to access shared resources that help computation to speed up
or offers data availability and reliability.

4.Main Memory management

Main memory is a large array of storage or bytes, which has an address. The
memory management process is conducted by using a sequence of reads or
writes of specific memory addresses.

It should be mapped to absolute addresses and loaded inside the memory to


execute a program. The selection of a memory management method
depends on several factors.
Functions of Memory management

1. An Operating System performs the following functions for Memory


Management in the operating system:
2. It helps you to keep track of primary memory.
3. Determine what part of it are in use by whom, what part is not in use.
4. In a multiprogramming system, the OS decides which process will get
memory and how much.
5. Allocates the memory when a process requests.
6. It also de-allocates the memory when a process no longer requires or
has been terminated.

5.Secondary-Storage Management

The most important task of a computer system is to execute programs. These


programs help you to access the data from the main memory during
execution. This memory of the computer is very small to store all data and
programs permanently. The computer system offers secondary storage to
back up the main memory.

Functions of Secondary storage management

1. Storage allocation
2. Free space management
3. Disk scheduling

6.I/O Device Management

One of the important use of an operating system that helps to hide the
variations of specific hardware devices from the user.
Functions of I/O management

1. It offers a buffer caching system


2. It provides general device driver code
3. It provides drivers for particular hardware devices.
4. I/O helps you to know the individualities of a specific device.

7.Security Management

The various processes in an operating system need to be secured from other


activities. Therefore, various mechanisms can ensure those processes that
want to operate files, memory CPU, and other hardware resources should
have proper authorization from the operating system.

Security refers to a mechanism for controlling the access of programs,


processes, or users to the resources defined by computer controls to be
imposed, together with some means of enforcement.

8.Command Interpreter System

One of the most important components of an operating system is its


command interpreter. The command interpreter is the primary interface
between the user and the rest of the system.

Many commands are given to the operating system by control statements. A


program that reads and interprets control statements is automatically
executed when a new job is started in a batch system or a user logs in to a
time-shared system. This program is variously called.

1. The control card interpreter,


2. The command-line interpreter,
3. The shell (in UNIX), and so on.

Its function is quite simple, get the next command statement, and
execute it. The command statements deal with process management,
I/O handling, secondary storage management, main memory
management, file system access, protection, and networking.

 System Services:

The operating system provides the programming environment in which a


programmer works on a computer system. The user program requests
various resources through the operating system. The operating system gives
several services to utility programmers and users. Applications access these
services through application programming interfaces or system calls.

services provided by an operating system –

1. Program execution
2. Control Input/output devices
3. Program creation
4. Error Detection and Response
5. Accounting
6. Security and Protection
7. File Management
8. Communication

1.Program execution

To execute a program, several tasks need to be performed. Both the


instructions and data must be loaded into the main memory. In addition,
input-output devices and files should be initialized, and other resources must
be prepared. The Operating structures handle these kinds of tasks. The user
now no longer should fear the reminiscence allocation or multitasking or
anything.

2.Control Input/output devices


As there are numerous types of I/O devices within the computer system, and
each I/O device calls for its own precise set of instructions for the operation.
The Operating System hides that info with the aid of presenting a uniform
interface. Thus, it is convenient for programmers to access such devices
easily.

3. Program Creation

The Operating system offers the structures and tools, including editors and
debuggers, to help the programmer create, modify, and debugging programs.

4. Error Detection and Response

An Error in a device may also cause malfunctioning of the entire device.


These include hardware and software errors such as device failure, memory
error, division by zero, attempts to access forbidden memory locations, etc.
To avoid error, the operating system monitors the system for detecting errors
and takes suitable action with at least impact on running applications.

While working with computers, errors may occur quite often. Errors may
occur in the:

1. Input/ Output devices: For example, connection failure in the network,


lack of paper in the printer, etc.
2. User program: For example: attempt to access illegal memory
locations, divide by zero, use too much CPU time, etc.
3. Memory hardware: For example, Memory error, the memory becomes
full, etc.

To handle these errors and other types of possible errors, the operating
system takes appropriate action and generates messages to ensure correct
and consistent computing.

5. Accounting

An Operating device collects utilization records for numerous assets and


tracks the overall performance parameters and responsive time to enhance
overall performance. These personal records are beneficial for additional
upgrades and tuning the device to enhance overall performance.
6.Security and Protection

Operating device affords safety to the statistics and packages of a person


and protects any interference from unauthorized users. The safety feature
counters threats, which are published via way of individuals out of doors the
manage of the running device.

7. File management

Computers keep data and information on secondary storage devices like


magnetic tape, magnetic disk, optical disk, etc. Each storage media has its
capabilities like speed, capacity, data transfer rate, and data access
methods.

8. Communication

The operating system manages the exchange of data and programs among
different computers connected over a network. This communication is
accomplished using message passing and shared memory.

 Systems Calls
A system call is a way for a user program to interface with the operating
system. The program requests several services, and the OS responds by
invoking a series of system calls to satisfy the request.

A system call can be written in assembly language or a high-level language


like C or Pascal.

What is a System Call?

A system call is a method for a computer program to request a service from


the kernel of the operating system on which it is running.

A system call is a method of interacting with the operating system via


programs. A system call is a request from computer software to an operating
system's kernel.

How are system calls made?


When a computer software needs to access the operating system's kernel, it
makes a system call. The system call uses an API to expose the operating
system's services to user programs. It is the only method to access the kernel
system. All programs or processes that require resources for execution must
use system calls, as they serve as an interface between the operating system
and user programs.

Types of System Calls

1. Process Control
2. File Management
3. Device Management
4. Information Maintenance
5. Communication

1. Process Control

Process control is the system call that is used to direct the processes. Some
process control examples include creating, load, abort, end, execute,
process, terminate the process, etc.

how it all works out:

1. Process Creation: Every time you start a new application, an


operating system calls into life and assigns it a process. It then assigns
it a unique process ID and gives it all the required resources, such as
memory, that will enable it to begin its start-up.
2. Scheduling of Processes: The operating system needs to decide
which process gets its turn with the CPU. It achieves this with
scheduling algorithms—kind of like making sure every person in line
gets their turn at the checkout. This keeps things moving without
waiting, whether it is a first-come-first-served approach or prioritizing
specific tasks.
3. Process Execution: After a process is born, it's time to run the
program. OS swaps between processes, ensuring that your computer is
multitasking. Imagine jugglers tossing balls: every time one goes to the
floor, another snatched off the return in mid-air. That is how the CPU
manages all sorts of processes!
4. Suspension and Resumption: At other times, processes are
suspended to free up resources or let other more important processes
run. The system saves its state so it can pick up right where it left off
when resumed, just like hitting the pause button in a video game.
5. Process Termination: Every process eventually needs to terminate-it
either finishes its work or an error occurs. In the case of an OS, it
simply deallocates that resource from memory and gets rid of it,
making everything neat and clean.
6. Inter-process Communication (IPC): Processes sometimes need to
communicate with other processes. To achieve this, the OS has
facilities like message passing or shared memory. Think of two friends
texting each other; that's the way processes communicate.
7. Synchronization: Sometimes, processes desire to share resources -
files or memory, for example. However, if they all wish to access a
resource simultaneously, things may become somewhat unravelled.
So, in order to prevent this kind of chaos, the OS uses tools such as
semaphores and mutexes, which are in charge of orchestrating
everything smoothly so that no such conflict might arise.
8. Deadlock Handling: Deadlock is where the processes are
deadlocked, waiting for each other's resources, people holding doors
open for one another, and neither can get through. The OS has
strategies to avoid or resolve these situations, ensuring that no process
is deadlocked for an indefinite amount of time.

2. File Management

File Management basically refers to how your computer handles the


organization and manipulation of files. It is rather like storing your physical
documents in a drawer: each file has to be created, opened, edited, and
perhaps sometimes even trashed. The OS takes care of everything behind
the scenes.

1. Creating Files: Each time you save a new document or program, your
computer creates a file. It gives it a location on the hard drive or other
storage - much the way you might put a paper file into a folder.
2. Opening Files: To look at or edit a file, you open it. The operating
system will retrieve it so that you can view it or work on it.
3. Reading Files: Once the file is opened, one can read what is inside.
Be it a text file, an image, or anything else, the OS will call from
storage to be viewed and worked with.
4. Writing to Files: Every time you make a change—either by typing
into a document or touching up a picture—the operating system writes
those changes to the file.
5. Closing Files: When you are finished with it, closing the file saves
everything and marks it as not in use. It is like putting the document
back in its folder when you are finished reading or modifying it.
6. File Deletion: You just delete files whenever you think they should not
be in your system again. The operating system would then delete them
from your storage, creating more space for other things.
7. Controlling Permissions: You might sometimes need to control who
can access and edit some of the files. The OS allows you to set
permissions for each file so that you may choose whether someone
else can run, alter, or open it.

3. Device Management

Device management is a system call that is used to deal with devices. Some
examples of device management include read, device, write, get device
attributes, release device, etc.What device management does;

1. Reading from Devices: Whenever the computer wants to read data


from the device, be it reading a file off of your hard drive or input from
the keyboard, the operating system handles that request. It makes
sure the data is read right and then forwarded to the right place.
2. Writing to Devices: whenever you need to export data to a device,
such as saving the file of your report to the USB stick or just printing it,
the OS takes care of it and makes sure that all the data gets written to
the device in the right way.
3. Getting Device Attributes: The OS can get such information about a
device, say, its status or settings. For example, it can check what is
available on disk or the level of the battery of a wireless mouse.
4. Allocation of Resources: OS decides how many of the system
resources like memory or processing power a device gets, so no device
gets more than its share, and the whole thing runs without problems.
5. Release Devices: The OS releases a device, that is, frees system
resources allocated for that device once it has completed all its work.
Essentially, it is as safe as pulling a USB drive out of the computer after
you are done with it.
6. Handling Interrupts: Devices often send signals to the CPU, termed
as interrupts, claiming its attention. The OS handles these interruptions
so that it will come to know whenever a device needs attention and
deal with them in the right sequence.

4. Information Maintenance

1. Information maintenance is a system call that is used to maintain


information. There are some examples of information maintenance,
including getting system data, set time or date, get time or date, set
system data, etc.. The usual information maintenance in everyday life
activities are;
2. Get System Data: It fetches information about the system that it
actually is, such as CPU or memory usage, network status, etc. It keeps
records of all the resources in use.
3. Set System Data: The OS can, whenever needed, change some of the
configurations associated with the systems, such as changing system
behaviour, updating configurations, setting user preferences, etc.
4. Retrievability of Time or Date: OS can retrieve the time and date of
the system, which is used in many applications such as file timestamp,
logging and scheduling.
5. Setting Time or Date: The system may update the current time and
date when necessary; thus, accurate times and dates can be appended
to files or processes or synchronized with an external time clock.
6. System logs and audits: The operating system maintains an event
log and activity record of errors, system performance, or user actions.
It is primarily used for debugging and monitoring the system.

5. Communication

Communication is a system call that is used for communication. There are


some examples of communication, including create, delete communication
connections, send, receive messages, etc.Key activities involved in
communication are as follows:

1. Setting Up Communication Links: OS connects two processes or


devices through a communication channel. The connection may be
performed using sockets, pipes, or shared memory; thus, it facilitates
easy communication between these two processes or devices.
2. Closing Communication Links: OS dismantles or deletes a link if its
communication process is complete; resources are released, and the
system is not affected.
3. The OS ensures that a message or data sent by one process or system
reaches the target recipient, either locally or on a network.
4. Receiving Messages: The receiving process gets the data sent by
another process. The OS manages the incoming messages and makes
sure that it is delivered to the correct target.
5. Manages the protocols of communication: The OS manages rules
as well as communications protocols, which enable data to be both
sent and received in appropriate formats and sequences.

 System programs

In an operating system a user is able to use different types of system programs and the system
program is responsible for all the application software performance of the computer.

The system programs are responsible for the development and execution of a program and they
can be used by the help of system calls because system calls define different types of system
programs for different tasks.

 File management − These programs create, delete, copy, rename, print, exit and generally
manipulate the files and directory.
 Status information − It is the information regarding input, output process, storage and the CPU
utilization time how the process will be calculated in how much memory required to perform a task
is known by status information.
 Programming language supports − compiler, assembler, interrupt are programming language
support used in the operating system for a particular purpose in the computer.
 Programming Loading and execution − The needs to enter the program and after the loading
of a program it needs to execute the output of the programs and this task is also performed by
system calls by the help of system programs.
 Communication − These services are provided by the user because by using this number of
devices communicates with each other by the help of device or wireless and communication is
necessary for the operating system.
 Background services − There are different types of services available on the operating system
for communication and background service is used to change the background of your window and
it also works for scanning and detecting viruses in the computer.

Purpose of using system program

System programs communicate and coordinate the activities and functions of hardware and
software of a system and also controls the operations of the hardware. An operating system is one
of the examples of system software. Operating system controls the computer hardware and acts
like an interface between the application software’s.

Types of System programs

The types of system programs are as follows −

Utility program

It manages, maintains and controls various computer resources. Utility programs are
comparatively technical and are targeted for the users with solid technical knowledge.

Few examples of utility programs are: antivirus software, backup software and disk tools.

Device drivers

It controls the particular device connected to a computer system. Device drivers basically act as a
translator between the operating system and device connected to the system.

Example − printer driver, scanner driver, storage device driver etc.

Directory reporting tools

These tools are required in an operation system to have some software to facilitate the navigation
through the computer system.

Example − dir, ls, Windows Explorer etc.

 Operating System Structure


operating system is a design that enables user application programs to
communicate with the hardware of the machine. The operating system
should be built with the utmost care because it is such a complicated
structure and should be simple to use and modify. Partially developing the
operating system is a simple approach to accomplish this. Each of these
components needs to have distinct inputs, outputs, and functionalities.

This article discusses many sorts of structures that implement operating


systems, as listed below, as well as how and why they work. It also defines
the operating system structure.

1. Simple Structure
2. Monolithic Structure
3. Layered Approach Structure
4. Micro-Kernel Structure
5. Exo-Kernel Structure
6. Virtual Machines

What is an operating System Structure?

Operating systems consist of many interacting parts, and the definition of the
structural relationships among these parts is called OS structure. Such a
structure ensures that it will be easy to develop, maintain, and customize the
OS for particular applications.

The OS structure provides an idea of how different components are


connected and integrated within the kernel, which is the central part of the
OS. The kernel carries out sensitive tasks such as memory management,
process scheduling, and interaction with hardware.

1. Simple Structure

It is the most straightforward operating system structure, but it lacks


definition and is only appropriate for usage with tiny and restricted
systems. Since the interfaces and degrees of functionality in this structure
are clearly defined, programs are able to access I/O routines, which may
result in unauthorized access to I/O procedures.

This organizational structure is used by the MS-DOS operating


system:

There are four layers that make up the MS-DOS operating system, and each
has its own set of features.

These layers include ROM BIOS device drivers, MS-DOS device drivers,
application programs, and system programs.

The MS-DOS operating system benefits from layering because each level can
be defined independently and, when necessary, can interact with one
another.
If the system is built in layers, it will be simpler to design, manage, and
update. Because of this, simple structures can be used to build constrained
systems that are less complex.

When a user program fails, the operating system as whole crashes.

Because MS-DOS systems have a low level of abstraction, programs and I/O
procedures are visible to end users, giving them the potential for unwanted
access.

Advantages of Simple Structure:

1. It is easy to develop as it contains only a few interfaces and levels.


2. It executes faster because there are fewer layers between the
hardware and applications.
3. Direct access to hardware provides faster operations.
4. Minimal consumption of system resources as the structure is very
simple.
5. Light in weight hence suitable for small or even embedded systems.

Disadvantages of Simple Structure:

1. As these components are not distinctly separated, making any change


or upgrade in the system is considerably harder to achieve.
2. All things are connected, and therefore, debugging is quite hectic;
finding the error is very hard.
3. Due to the lack of data abstraction, a security vulnerability is a strong
possibility.
4. It does not scale well to larger, more complex systems. Adding new
features is particularly challenging in this architecture.
5. One failure in one part might bring down the whole system.

2. MONOLITHIC STRUCTURE

The monolithic operating system controls all aspects of the operating


system's operation, including file management, memory management,
device management, and operational operations.

The core of an operating system for computers is called the kernel (OS). All
other System components are provided with fundamental services by the
kernel.

The operating system and the hardware use it as their main interface. When
an operating system is built into a single piece of hardware, such as a
keyboard or mouse, the kernel can directly access all of its resources.

The monolithic operating system is often referred to as the monolithic kernel.


Multiple programming techniques such as batch processing and time-sharing
increase a processor's usability. Working on top of the operating system and
under complete command of all hardware, the monolithic kernel performs the
role of a virtual computer.

This is an old operating system that was used in banks to carry out simple
tasks like batch processing and time-sharing, which allows numerous users at
different terminals to access the Operating System.
1. Advantages of Monolithic Structure:
2. Because everything is packed into one big kernel, there is no need for
multi-layer complexities. Hence, the design and bringing into practice
of such a system is relatively easy.
3. As long as all the components run in the same memory space, there is
no need to have inter-process communication or to perform context
switching between layers; thus, execution is faster.
4. Direct access to hardware and little additional-abstraction overhead
result in high performance.
5. Development can thus be easier as developers have to deal with one
codebase only, and no interactions among various layers or modules
need to be considered.

Disadvantages of Monolithic Structure:

1. Fault in any single component has the potential to bring down the
whole system since there is no isolation between different parts.
2. This can be a hard and unsafe task, as changes in one part of the
system may accidentally filter out into another part.
3. Since the components are more interdependent, debugging is also
more complex and always requires heavy testing and testing-related
activities.
4. This is an issue where scaling up or adjusting to the latest trends in a
system involves significant changes in the kernel.
5. Consequently, it will be cumbersome to update or upgrade the system
because it involves a large codebase in a monolithic form where
changes may have widespread effects.

3. LAYERED STRUCTURE

The OS is separated into layers or levels in this kind of arrangement. Layer 0


(the lowest layer) contains the hardware, and layer 1 (the highest layer)
contains the user interface (layer N).

The model, in this respect, uses the functions' availability through the layer
below it. For example, memory management may have to rely on process
scheduling, while higher layers use it here with respect to user interaction.

This approach also introduces abstraction between layers, whereby the


system is also easier to manage and debug. In case any issue arises, testing
and debugging can be performed at lower layers before going onto higher
layers

The functionalities of each layer are separated in this method, and


abstraction is also an option. Because layered structures are hierarchical,
debugging is simpler, therefore all lower-level layers are debugged before the
upper layer is examined. As a result, the present layer alone has to be
reviewed since all the lower layers have already been examined.

The image below shows how OS is organized into layers:


Advantages of Layered Structure:

1. Development, maintenance, and understanding are much easier, as


every layer is assigned a specific role.
2. It can isolate problems in individual layers because testing and
debugging would be less demanding.
3. Sensitive operations can be confined to specific layers; thus,
unauthorized access can be minimized to such layers because the
concerns have been clearly separated.
4. Modifying or updating one layer will not affect other independent layers
directly; thus, upgrading or fixing could be done more easily.
5. With layers, basic operations can be entrusted to lower layers, and
hence, the layers above need not be concerned with the minute
details, thereby reducing the complexity of the overall management.

1. Disadvantages of Layered Structure:


2. The layered approach adds delays due to the fact that data and
commands must pass through several layers, thus slowing down the
system in general.
3. Designing a properly working layered structure requires forethought
and iron discipline for proper interaction between different layers.
4. Layers are generally dependent on lower layers; thus skipping layers
and directly accessing the lower-level functionalities becomes harder,
hence reducing flexibility in many systems.
5. System performance optimization becomes challenging due to the
extra abstractions introduced by the layers, which harden the tuning of
individual parts of the system to make them run more effectively.
6. Unless the lower-layer design is lousy or inefficient, the whole system
will suffer since the higher layer depends on them for functionality.

MICRO-KERNEL STRUCTURE

The operating system is created using a micro-kernel framework that strips


the kernel of any unnecessary parts. Systems and user applications are used
to implement these optional kernel components. So, Micro-Kernels is the
name given to these systems that have been developed.

The Micro-Kernel Structure minimizes the functions handled by the


kernel, delegating most services to user-level applications. The micro-kernel
itself only handles core functions, such as memory management, process
scheduling, and basic communication between processes.

By stripping away unnecessary services from the kernel, the system becomes
more secure and reliable. If a service crashes, it doesn’t affect the entire
system.

Micro-kernels are common in modern OS architectures like macOS and QNX,


as they allow for easier updates and better system resilience.

The image below shows the Micro-Kernel Operating System Structure:


Advantages of Micro-Kernel Structure:

1. The just necessary services running in the kernel ensure that user
service failures don't crash the whole system.
2. It isolates the services from the kernel, thus minimizing the possibility
of compromising the system since every service operates
independently of the other.
3. Smaller kernels are easier to operate and alter. Hence, updating and
bug fixes are less challenging.
4. Services can be added or removed without affecting the kernel. So, this
gives more flexibility while designing the system.
5. Due to the small size of the micro-kernel, it can be ported on different
hardware platforms with minimal modification.

Disadvantages of Micro-Kernel Structure:

1. The inter-process communication between kernel and user services


introduces additional overhead and hence is slower as compared to the
monolithic approach.
2. In a micro-kernel, the separation of services must be done very
carefully, which may complicate the initial development process.
3. Context switches are more frequent between user space and kernel
space in this approach; hence, performance would be slower in highly
loaded conditions.
4. Due to the complexity and possibly extra performance trade-offs, few
operating systems have been built using the micro-kernel architecture.
5. Modular requires more planning and testing in detail; hence, the
development cycle may be longer.

4. EXOKERNEL

An operating system called Exokernel was created at MIT with the goal of
offering application-level management of hardware resources. The exokernel
architecture's goal is to enable application-specific customization by
separating resource management from protection. Exokernel size tends to be
minimal due to its limited operability.

Exokernel operating systems have a number of features,


including:

1. Enhanced application control support.


2. Splits management and security apart.
3. A secure transfer of abstractions is made to an unreliable library
operating system.
4. Brings up a low-level interface.
5. Operating systems for libraries provide compatibility and portability.

Advantages of Exokernel Structure:

1. Applications directly interface with hardware to realize high power.


2. It provides fine-grained resource allocation and revocation for efficient
usage.
3. Testing and development of new operating systems with low-level
control become easy.
4. Each application can have its memory management; thus, optimization
would be tailored.
5. It removes extra kernel features; thus, it makes the system lean and
faster.
6. Because of its minimalistic approach, it is easily adaptable to different
hardware platforms.

Disadvantages of Exokernel Structure:

1. Developing and maintaining such a complicated interface would be


challenging.
2. The abstractions are not enforced, which might make the different
applications inconsistent with each other.
3. It makes the developers responsible for dealing with resource
management, which enhances the difficulty level of it.
4. Lack of strong abstractions with direct access to hardware may result
in security vulnerabilities.

 VIRTUAL MACHINES (VMs)


The hardware of our personal computer, including the CPU, disc drives, RAM,
and NIC (Network Interface Card), is abstracted by a virtual machine into a
variety of various execution contexts based on our needs, giving us the
impression that each execution environment is a separate computer. A
virtual box is an example of it.

Using CPU scheduling and virtual memory techniques, an operating system


allows us to execute multiple processes simultaneously while giving the
impression that each one is using a separate processor and virtual memory.
System calls and a file system are examples of extra functionalities that a
process can have that the hardware are unable to give. Instead of offering
these extra features, the virtual machine method just offers an interface that
is similar to that of the most fundamental hardware. A virtual duplicate of the
computer system underneath is made available to each process.

We can develop a virtual machine for a variety of reasons, all of which are
fundamentally connected to the capacity to share the same underlying
hardware while concurrently supporting various execution environments, i.e.,
various operating systems.

Disk systems are the fundamental problem with the virtual machine
technique. If the actual machine only has three-disc drives but needs to host
seven virtual machines, let's imagine that. It is obvious that it is impossible to
assign a disc drive to every virtual machine because the program that
creates virtual machines would require a sizable amount of disc space in
order to offer virtual memory and spooling. The provision of virtual discs is
the solution.

The result is that users get their own virtual machines. They can then use any
of the operating systems or software programs that are installed on the
machine below. Virtual machine software is concerned with programming
numerous virtual machines simultaneously into a physical machine; it is not
required to take into account any user-support software. With this
configuration, it may be possible to break the challenge of building an
interactive system for several users into two manageable chunks.

Advantages of Virtual Machines:

1. Each VM is in itself independent, which means any failure or security


consequences that take place will not affect the other virtual machines.
2. One can have a number of operating systems running on one hardware
platform.
3. Cloning, backups, and restoration of virtual machines are pretty easy;
hence, options galore as far as data recovery is concerned.
4. Different operating systems, such as Windows, Linux, etc., can be used
with one machine itself.

Disadvantages of Virtual Machines:

1. Running more than one virtual machine on the same host may decrease
its performance due to the sharing of the resources.
2. VMs are CPU, memory-intensive, and storage-intensive applications;
this will put a high load on host systems.
3. Managing many virtual machines requires further advanced tools and
knowledge.
4. It cannot utilize the hardware as effectively, as would a physical
machine, and hence it affects performance-related applications.

 System Design and Implementation


The operating system is needed to design and implement because without
proper design and implementation any system cannot work properly, for
every aspect or for any development a proper design and implementation
should be necessary so that it can work in good manner and we can easily
debug if any failures occur.

There are different types of techniques to design and implement the


operating system.

 Design goals
 Mechanism
 Implementation

1.Design goals

Concurrent Systems

Operating systems must handle multiple devices as well as multiple users


concurrently. It is a must for modern multiple core architectures. Due to
these features the design of the operating system is complex and very
difficult to make.

Security and Privacy

Operating systems must provide security and privacy to a system. It is


important to prevent the malicious user from accessing your system and to
prevent the stealing of the user programs.

Resource Sharing

Operating system ensures that the resources of the system must be shared
in a correct fashion in between multiple user processes. It becomes more
complex when multiple users use the same device.

Changes in Hardware and Software

Operating systems must be flexible in order to accommodate any change to


the hardware and software of the system, It should not be obsolete. It is
necessary as it is costly to change the operating system again and again on
any change to the software or hardware.
Portable Operating Systems

Operating system that is able to work with different hardware and systems is
called a portable operating system and it is a very important design goal.

Backward Compatibility

Any upgrade to the current operating system could not hinder it's
compatibility with the machine i.e. if the previous version of the operating
system is compatible with the system then the newer or upgraded version
should also be compatible with the system this is called backward
compatibility.

2. Mechanism
In an operating system there is a particular mechanism to be followed and
this mechanism is responsible for the entire task performed by the operating
system.

When a task is performed in the operating system then we follow a particular


mechanism for input, store, process, and output and by using this process we
can define memory to the different tasks performed by the computer.

An Operating system provides the services to users and programs. Like I/O
operations, program execution, file system manipulation, Resource
allocation, Protection.

Program Execution

OS handles many activities from user programs to system programs like


printer spooler, name servers, file servers etc. Each of these activities is
encapsulated as a process. A process includes the complete execution
context.

Operating System Activities

The operating system activities are as follows −

 Loads a program into memory


 Execute the program
 Handle's program's execution
 Provides a mechanism for process synchronization
 Provides a mechanism for process communication
 Provides a mechanism for deadlock handling

Implementation
Once the operating system is designed it must be implemented because it is
a collection of many programs written by many people over a long period of
time.

Implementation is a process which is most important for the operating


system.

An operating system needs to be implemented because when it is


implemented then new tasks can be performed and new application software
can also install in your computer and run your computer smoothly for that we
need implementation of operating system.

System Generations.
The First Generation ( 1945 - 1955 ):
Vacuum Tubes and Plugboards
Digital computers were not constructed until the second world war.
Calculating engines with mechanical relays were built at that time. However,
the mechanical relays were very slow and were later replaced with vacuum
tubes. These machines were enormous but were still very slow.

These early computers were designed, built and maintained by a single group
of people. Programming languages were unknown and there were no
operating systems so all the programming was done in machine language. All
the problems were simple numerical calculations.

By the 1950’s punch cards were introduced and this improved the computer
system. Instead of using plugboards, programs were written on cards and
read into the system.
The Second Generation ( 1955 - 1965 ):
Transistors and Batch Systems
Transistors led to the development of the computer systems that could be
manufactured and sold to paying customers. These machines were known as
mainframes and were locked in air-conditioned computer rooms with staff to
operate them.

The Batch System was introduced to reduce the wasted time in the
computer. A tray full of jobs was collected in the input room and read into
the magnetic tape. After that, the tape was rewound and mounted on a tape
drive. Then the batch operating system was loaded in which read the first job
from the tape and ran it. The output was written on the second tape. After
the whole batch was done, the input and output tapes were removed and the
output tape was printed.

The Third Generation ( 1965 - 1980 ): Integrated


Circuits and Multiprogramming
Until the 1960’s, there were two types of computer systems i.e., the scientific
and the commercial computers. These were combined by IBM in the
System/360. This used integrated circuits and provided a major price and
performance advantage over the second generation systems.

The third generation operating systems also introduced multiprogramming.


This meant that the processor was not idle while a job was completing its I/O
operation. Another job was scheduled on the processor so that its time would
not be wasted.

The Fourth Generation ( 1980 - Present ):


Personal Computers
Personal Computers were easy to create with the development of large-scale
integrated circuits. These were chips containing thousands of transistors on a
square centimetre of silicon. Because of these, microcomputers were much
cheaper than minicomputers and that made it possible for a single individual
to own one of them.
The advent of personal computers also led to the growth of networks. This
created network operating systems and distributed operating systems. The
users were aware of a network while using a network operating system and
could log in to remote machines and copy files from one machine to another.

You might also like