0% found this document useful (0 votes)
7 views19 pages

Module 1

The document provides an overview of operating systems, defining them as intermediaries between users and hardware while detailing their characteristics, advantages, and disadvantages. It discusses various types of operating systems, including Windows, macOS, Linux, and Unix, as well as the evolution of operating systems through different generations. Additionally, it explains different operating system types such as batch, multiprogramming, multitasking, and multiprocessing, highlighting their functionalities and use cases.

Uploaded by

ashneetkaur527
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)
7 views19 pages

Module 1

The document provides an overview of operating systems, defining them as intermediaries between users and hardware while detailing their characteristics, advantages, and disadvantages. It discusses various types of operating systems, including Windows, macOS, Linux, and Unix, as well as the evolution of operating systems through different generations. Additionally, it explains different operating system types such as batch, multiprogramming, multitasking, and multiprocessing, highlighting their functionalities and use cases.

Uploaded by

ashneetkaur527
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

Module 1: Introduction

 Concept of Operating systems:


An operating system is an intermediary between a computer user and hardware. In short, it's an interface
between computer hardware and the user.

 The purpose of an operating system is to provide an environment in which a user can execute
programs conveniently and efficiently.

 An operating system is software that manages computer hardware and software. The hardware must
provide appropriate mechanisms to ensure the computer system's correct operation and prevent
user programs from interfering with the system's proper operation.

 Operating system is a program running at all times on the computer (usually called the kernel), with
all else being application programs.

 Concerned with assigning resources among programs, e.g., memory, processors, and input/output
devices.

 Various tasks handled by OS are file management, task management, garbage management, memory
management, process management, disk management, I/O management, peripherals management,
etc.

Characteristics of Operating Systems

Let us now discuss some of the important characteristic features of operating systems:

 Device Management: The operating system keeps track of all the devices. So, it is also called the
input/output controller, which decides which process gets the device, when, and for how long.

 File Management: It allocates and de-allocates the resources and decides who gets them.

 Job Accounting: It keeps track of time and resources used by various jobs or users.

 Error-detecting Aids: These contain methods that include the production of dump, error messages,
and other debugging and error-detecting methods.

 Memory Management: It is responsible for managing the primary memory of a computer, including
what parts of it are in use by whom. It also checks how much is free or used and allocates the
process.

 Processor Management: It allocates the processor to a process and then de-allocates it when it is no
longer required or the job is done.

 Control on System Performance: It records the delays between the request for a service and the
system.

 Security: Using passwords or some protection technique prevents unauthorized access to programs
and data.

 Convenience: An OS makes a computer more convenient to use.

 Efficiency: An OS allows the computer system resources to be used efficiently.


 Ability to Evolve: An OS should be constructed in such a way as to permit the effective development,
testing, and introduction of new system functions at the same time without interfering with service.

 Throughput: An OS should be constructed to give maximum throughput (Number of tasks per unit
time).

List of standard Operating Systems

There are multiple types of operating systems, each having its unique features:

1. Windows OS: Easy to use for most users, Broad support from third-party applications, Frequent
updates and support.

 Developer: Microsoft

 Key Features: User-friendly interface, software compatibility, hardware support, Strong gaming
support.

 Typical Use Cases: Personal computing, Business environment, Gaming.

2. macOS: Optimized for Apple hardware, Seamless experience across the Apple ecosystem, Superior
graphics and multimedia capabilities.

 Developer: Apple.

 Key Features: Sleek, intuitive user interface, strong integration with other Apple products, robust
security features, and high performance.

 Typical Use Cases: Creative industries (design, video editing, music production), Personal computing,
and Professional environments.

3. Linux: Free to use and distribute, Strong community support, Suitable for servers and development
environments

 Developer: Community-driven (various distributions).

 Key Features: Open-source and highly customizable, robust security and stability, lightweight and can
run on older hardware, and a large selection of distributions (e.g., Ubuntu, Fedora, Debian).

 Typical Use Cases: Servers and data centres, Development and programming, Personal computing for
tech enthusiasts.

4. Unix

 Developer: Originally AT&T Bell Labs, various commercial and open-source versions available

 Key Features: Multiuser and multitasking capabilities, Strong security and stability, Powerful
command-line interface, Portability across different hardware platforms

 Advantages: Reliable and robust performance, Suitable for high-performance computing and servers,
Extensive support for networking

 Typical Use Cases: Servers and workstations, Development environments, Research and academic
settings.

Conceptual view of computer system:

The process operating system as User Interface:


1. User

2. System and application programs

3. Operating system

4. Hardware

Every general-purpose computer consists of hardware, an operating system(s), system programs, and
application programs. The hardware consists of memory, CPU, ALU, I/O devices, peripheral devices, and
storage devices. The system program consists of compilers, loaders, editors, OS, etc.

Every computer must have an operating system to run other programs. The operating system coordinates
the use of the hardware among the various system programs and application programs for various users.
It simply provides an environment within which other programs can do useful work.

An OS is a package of some programs that runs on a computer machine, allowing it to perform efficiently.
It manages the simple tasks of recognizing input from the keyboard, managing files and directories on
disk, displaying output on the screen, and controlling peripheral devices.

Advantages of Operating System

 It helps manage the data present in the device, i.e., Memory Management.

 It helps in making the best use of computer hardware.

 It helps in maintaining the security of the device.

 It helps different applications in running them efficiently.

Disadvantages of Operating System

 Operating Systems can be complex for someone to use.

 Some OS are expensive, and they require heavy maintenance.

 Operating Systems can come under threat if used by hackers.

 Generations of Operating systems


Operating systems (OS) have evolved through several generations, each reflecting advancements in computer
technology and user needs. Below are the key generations of operating systems:

1st Generation (1940s–Early 1950s): No Operating System


 Computing Environment: Vacuum tube-based computers, batch processing.

 User Interaction: Direct interaction with hardware using plugboards or switches.

 Key Features: No OS; programs were manually loaded and executed.

 Examples: ENIAC, UNIVAC.

2nd Generation (1950s–Early 1960s): Batch Processing Systems

 Computing Environment: Transistor-based computers.

 User Interaction: Batch processing; jobs were submitted on punch cards or magnetic tape.

 Key Features:

o Simple monitoring programs (e.g., Resident Monitor) to manage job execution.

o No direct interaction with users during execution.

 Examples: IBM 1401, IBM 7090.

3rd Generation (1960s–Early 1970s): Multiprogramming and Timesharing Systems

 Computing Environment: Mainframe computers, introduction of integrated circuits.

 User Interaction: Time-sharing allowed multiple users to interact with the system simultaneously.

 Key Features:

o Multiprogramming: Multiple programs could run concurrently.

o Time-sharing: Shared system resources between multiple users.

o Introduced spooling (simultaneous peripheral operations like printing).

 Examples: IBM System/360, MULTICS.

4th Generation (1970s–1980s): Personal Computers and Distributed Systems

 Computing Environment: Microprocessor-based personal computers.

 User Interaction: Interactive user interfaces with command-line or graphical interfaces (GUI).

 Key Features:

o Support for single-user systems (e.g., personal computers).

o Networking and distributed computing began emerging.

 Examples: UNIX, MS-DOS, Apple Macintosh.

5th Generation (1990s–2000s): Networked and Mobile Operating Systems

 Computing Environment: PCs, servers, mobile devices, and the Internet.

 User Interaction: GUIs became standard; multi-touch interfaces were introduced.

 Key Features:

o Support for networking and the Internet.


o Mobile operating systems emerged (e.g., Palm OS, Symbian).

o Virtualization and advanced multitasking capabilities.

 Examples: Windows 95/XP, Linux, macOS, Android.

6th Generation (2010s–Present): Cloud, Mobile, and AI-Integrated Systems

 Computing Environment: Cloud computing, smartphones, IoT devices.

 User Interaction: Voice commands, touch gestures, and AI-driven interfaces.

 Key Features:

o Cloud-based OS platforms (e.g., Google Chrome OS).

o Seamless integration of mobile and desktop systems.

o AI and machine learning are incorporated into the OS for better user experiences.

o Advanced security features for connected devices.

 Examples: iOS, Android, Windows 10/11, Linux distributions, Chrome OS.

 Types of Operating Systems


Operating systems can be categorized according to different criteria, such as whether an operating system is
for mobile devices (examples Android and iOS) or desktop (examples Windows and Linux).

1. Batch Operating System

This operating system processes jobs in batches without user interaction during execution. 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 many jobs efficiently by processing them in groups. Jobs are submitted in bulk, queued, and
executed sequentially. Applications or examples: Payroll processing, banking transactions, and large-scale
data jobs.

Advantages of Batch Operating System: 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

 CPU is not used efficiently. When the current process is doing IO, the CPU is free and could be utilized
by other processes waiting.
 The other jobs will have to wait for an unknown time if any job fails.

 In batch operating system, average response time increases as all processes are processed one by
one.

 Large Jobs Cause Delays: If a batch contains a large job, then problems may occur because the
processing of all the subsequent jobs is delayed. This, therefore, slows down the overall system
performance.

 Starvation: Batch processing suffers from starvation.

There are five jobs J1, J2, J3, J4, and J5, present in the batch. If the execution time of J1 is very high, then the
other four jobs will never be executed, or they will have to wait for a very long time. Hence the other
processes get starved.

2. Multi-Programming Operating System


A multiprogramming operating system allows multiple programs (processes) to run concurrently on a single
CPU. Multiprogramming is an extension of batch processing where the CPU is always busy. Each process
needs two types of system time: CPU time and IO time. In a multiprogramming environment, the CPU can
start executing other processes when a process does its I/O. Therefore, multiprogramming improves the
efficiency of the system. Examples: UNIX, IBM OS/360, Windows NT and Linux.

How Multiprogramming Works


1. Job Pooling: Multiple jobs (programs) are loaded into the system's memory.

2. CPU Scheduling: The CPU switches between these jobs based on priority or availability of resources.

3. Resource Management: While one job waits for I/O operations (e.g., reading from a disk), the CPU
executes another job.

4. Concurrency: The operating system handles context switching, enabling multiple jobs to "progress"
simultaneously.

Advantages of Multiprogramming OS

o Throughout the system, it increased as the CPU always had one program to execute.

o Response time can also be reduced.

o Multiprogramming maximizes the utilization of resources like memory, I/O devices, and processing
power since more than one program can be kept alive at any time.

o Since several jobs are being processed in parallel, significantly more tasks could be completed within
a certain amount of time, thus enhancing the system's overall throughput.

o During times when a program is waiting for I/O operations, the processor does not go idle since it
jumps on to another task to continue processing.

o The system can support both short and long tasks to be executed in parallel, which makes for a more
dynamic and productive processing environment.

Disadvantages of Multiprogramming OS

o Multiprogramming systems provide an environment in which various systems resources are used
efficiently, but they do not provide any user interaction with the computer system.

o Multiple programs increase system complexity, as the operating system needs to manage multiple
processes, memory management, and scheduling.

o It requires more memory than less sophisticated operating systems because multiple programs run
simultaneously in memory.

o The operating system has to switch between the running processes continuously, and this leads to
scheduling overhead and reduces performance.

o As several concurrent operations access shared resources simultaneously, the system is likely to
experience deadlocks: two or more processes waiting for each other for further actions.

o Resource contention due to competition for scarce resources could degrade performance.

3. Multitasking/Time-sharing Operating System

Multiprogramming extended the concept of multitasking operating systems, which enabled various programs
to run simultaneously. It allowed a user to do more than one task on the same system at a given time by
sharing various system resources like CPU time among different processes. This assures efficient CPU use
because it shifts between tasks quickly; hence, they seem to run parallel. Examples: Windows 10/11, Linux,
macOS, UNIX, Android/iOS.

There are multitasking systems in almost all personal computers where, for example, a user might run a web
browser, a music player, and a document editor simultaneously.
How Multitasking Works

1. Time-Slicing: The CPU allocates a small time slice to each task in a cyclic order.

2. Context Switching: When a task's allocated time expires, the system saves its state and switches to
another task.

3. Concurrency: Multiple tasks progress simultaneously, as the CPU rapidly switches between them.

4. Resource Sharing: System resources (e.g., memory, CPU) are shared among all running tasks

Advantages of Time-Sharing OS

 Each task gets an equal opportunity.

 CPU idle time can be reduced.

 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.

 Improved Productivity: Time-sharing allows users to work concurrently, reducing the waiting time for
their turn to use the computer. This increased productivity translates to more work getting done in
less time.

 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 Multitasking Operating System:

o The multitasking environment makes several processors busier simultaneously; that is, the CPU
generates more heat.

o Managing different tasks altogether requires a more sophisticated algorithm, which becomes
complex to administer.

o Running too many applications simultaneously can stress the system to a point where performance
degrades.

o In this scenario, multiple tasks will compete for the same resources, thereby delaying them.
o Multitasking systems usually require more powerful hardware, especially memory and processing
power, to run without a hitch.

4. Multiprocessing Operating System

In Multiprocessing, Parallel computing is achieved. There is more than one processor in the system, which
can execute more than one process simultaneously. This will increase the system's throughput.

o In multiprocessing, several processors execute procedures in collaboration. You can even split a
procedure into parts that run in parallel.

o Since several processors work concurrently, more tasks are completed faster.

o Multiprocessing enhances the speed at which the system executes since tasks scatter the processors,
minimizing the procedure waiting period.

o If one processor is faulty, the others will continue running, enhancing system reliability.

Such an operating system is suited for highly computationally intensive environments needing high
processing power, such as scientific simulations, real-time data processing, and server environments.
Examples: Linux, Windows Server, macOS, Unix.

Working

In a Multiprocessing OS, concurrent execution of processes by multiple processors is done. The processes are
divided and allotted to different processors for parallel computing. Thus, system performance is enhanced
due to high throughput, good resource allocation, smooth distribution of workload on the processors, and
fault tolerance. If one of its processors fails, then the system can continue and reallocate its tasks to other
processors, and thus, the operation can be done smoothly.

Types of Multiprocessing Systems

1. Symmetric Multiprocessing (SMP):

o All CPUs share a single operating system and memory.

o Each CPU is treated equally and performs tasks independently.

o Example: Most modern operating systems like Linux, Windows, and macOS support SMP.

2. Asymmetric Multiprocessing (AMP):


o One primary CPU controls the system, while others execute specific tasks the primary CPU
assigns.

o Often used in embedded systems.

o Example: Some older versions of UNIX.

3. Massively Parallel Processing (MPP):

o Thousands of processors work on separate tasks simultaneously.

o Processors have their own memory and communicate via a high-speed interconnect.

o Example: Supercomputers like IBM Blue Gene.

Advantages of Multiprocessing Operating System:

o Increased Reliability: Because multiple processors are present, if one fails, others may take over it,
thus stabilizing the system.

o Increased Throughput: More jobs can be processed at the same time by these multiple processors
than by a single processor, thereby increasing the speed of execution.

o Efficient Resource Utilization: It acts more productively upon the utilization of resources like CPU,
memory, and I/O devices.

o Parallelism: Many processes can run parallel, which increases the speed of execution to a large
extent.

o Scalability: As the workload increases, more processors can be added to enhance performance.

Disadvantages of Multiprocessing Operating System:

o Complexity: There is a rise in the system's complexity while dealing with several processors and
proper distribution of tasks.
o Increased Cost: Hardware equipment added in multiprocessing systems increases their cost
o Communication Overhead: Generally, communication among processors results in overhead and
provides a slight reduction in efficiency.
o Software Compatibility Problems: Most software is not designed to operate properly with
multiprocessing systems.
[Link] Time Operating System

A Real-Time Operating System is conceived as a design for tasks that need to be completed under very strict
time constraints. In such systems, each task has a clear deadline; failing to achieve completion by that
deadline can, in turn, bring about significant consequences. Completion by the deadline may result in either
a critical failure or something no longer of relevance. It is commonly used in applications where timing and
precision are critical, such as embedded systems, robotics, and medical devices.
Types of Real-Time Operating Systems

1. Hard Real-Time Systems:


o Guarantees that critical tasks are completed within strict deadlines.
o Failure to meet deadlines can result in catastrophic consequences.
o Examples: Airbag systems, pacemakers, and industrial control systems.
2. Soft Real-Time Systems:
o Tasks have deadlines, but occasional delays are acceptable.
o Focuses on optimizing performance rather than strict deadline adherence.
o Examples: Multimedia streaming, online gaming, and mobile communications.
3. Firm Real-Time Systems:
o Missing deadlines does not cause system failure, but the task loses its value.
o A balance between hard and soft real-time requirements.
o Examples: Banking systems and e-commerce platforms.

Advantages of RTOS

1. Predictability: Ensures tasks meet deadlines, crucial for time-sensitive applications.


2. High Reliability: Designed for stable and consistent performance under strict constraints.
3. Efficient Resource Utilization: Manages system resources to maximize performance.
4. Concurrency Support: Handles multiple tasks simultaneously without compromising timing.

Disadvantages of RTOS

1. Complexity: Designing and maintaining an RTOS is more challenging compared to general-purpose


operating systems.
2. Limited Features: Focuses on specific functionality, often sacrificing versatility for performance.
3. Cost: Implementation can be expensive for large-scale systems.
4. High Development Time: Requires meticulous planning and testing to ensure deterministic behavior.

Applications of RTOS

1. Embedded Systems: Automotive control systems, home appliances, and IoT devices.
2. Medical Devices: Heart rate monitors, ventilators, and surgical robots.
3. Industrial Automation: Robotics, assembly lines, and process control systems.
4. Telecommunications: Call switching systems and base stations.
5. Aerospace and Defense: Missile systems, flight control, and satellite systems.

[Link] Operating System


Various autonomous, interconnected computers communicate using a shared communication network.
Independent systems possess their own memory unit and CPU. These systems’ processors differ in size and
function. The major benefit of working with these types of operating systems is that it is always possible for
one user to access the files or software that are not present on his system. Still, some other systems
connected within this network, i.e., remote access, are enabled within the devices connected in that
network. These systems allow resource sharing, task distribution, and inter-process communication across
multiple interconnected computers, often called nodes.
Advantages of Distributed Operating Systems

1. Resource Sharing: Users can access resources like storage, processors, and peripherals across nodes.
2. Scalability: Easily add more nodes to increase computing power or storage.
3. Reliability: Redundancy and fault tolerance minimize the risk of downtime.
4. Performance: Parallel processing reduces task execution time.
5. Flexibility: Resources and tasks can be reallocated dynamically based on load.

Disadvantages of Distributed Operating Systems

1. Complexity: Requires sophisticated algorithms for scheduling, synchronization, and communication.


2. Security: Distributed systems are more susceptible to cyberattacks due to network dependencies.
3. Latency: Communication between nodes can introduce delays.
4. Cost: High initial setup and maintenance costs, including networking and infrastructure.
5. Troubleshooting: Debugging and diagnosing issues in distributed systems are more challenging.

Examples of Distributed Operating Systems:

 Google File System (GFS): Used in Google’s data centers for large-scale data storage.
 Apache Hadoop: Framework for distributed storage and processing of big data.
 Distributed versions of UNIX: Amoeba, Plan 9.
 Microsoft Azure OS: Underpins Microsoft’s cloud platform.

Applications of Distributed Operating Systems

1. Cloud Computing:
o Services like AWS, Microsoft Azure, and Google Cloud rely on distributed systems.
2. Scientific Computing:
o Large-scale simulations, weather forecasting, and genome sequencing.
3. Big Data Processing:
o Frameworks like Hadoop and Spark for data analytics.

 Operating System Services

Operating systems provide a wide range of services to ensure smooth interaction between the user,
hardware, and software applications. These services are essential for managing system resources, running
applications, and ensuring user convenience and system efficiency.

Categories of Operating System Services

1. User Services: Directly assist users in interacting with the computer system.
2. System Services: Manage system resources and support the execution of user applications.

Key Operating System Services

1. Program Execution

 Loads a program into memory, executes it, and ensures proper termination.
 Handles errors during execution and allocates resources.

2. I/O Operations
 Provides mechanisms for input/output operations, abstracting hardware details.
 Allows interaction with devices like keyboards, mice, printers, and disk drives.

3. File Management

 Services for creating, reading, writing, and deleting files.


 Manages file organization, access permissions, and storage allocation.

4. Memory Management

 Allocates memory to processes and deallocates it after usage.


 Handles swapping between main memory and secondary storage to optimize performance.

5. Process Management

 Manages processes by creating, scheduling, and terminating them.


 Ensures proper synchronization and communication between processes.

6. Security and Access Control

 Protects data and system resources from unauthorized access.


 Implements authentication mechanisms (e.g., passwords, biometrics).
 Enforces access control policies for users and applications.

7. Communication Services

 Enables inter-process communication (IPC) within the same or across different systems.
 Provides mechanisms like message passing, shared memory, and networking.

8. Error Detection and Handling

 Monitors the system for potential errors in hardware, software, or processes.


 Takes corrective action to ensure system reliability.

9. Resource Allocation

 Allocates system resources (CPU, memory, I/O devices) efficiently to multiple users and tasks.
 Ensures fair and optimal usage of resources.

10. User Interface

 Provides a user interface, such as:


o Command-Line Interface (CLI): Text-based interaction.
o Graphical User Interface (GUI): Visual interaction using windows, icons, and menus.
 Simplifies interaction between the user and system.

 System calls

A system call is a programmatic way in which a computer program requests a service from the kernel of the
operating system on which it is executed. A system call allows programs to interact with the operating
system. A computer program makes a system call when it requests the operating system’s kernel. The kernel
is a core component of an operating system and serves as the primary interface between the computer's
physical hardware and the processes running on it. The kernel enables multiple applications to share
hardware resources by providing access to CPU, memory, disk I/O, and networking. System call provides the
operating system's services to the user programs via the Application Program Interface (API). System calls
are the only entry points into the kernel system and are executed in kernel mode.

 A user program can interact with the operating system using a system call. Many services are
requested by the program, and the OS responds by launching several systems calls to fulfill the
request.

 A system call can be written in high-level languages like C or Pascal or in assembly language. If a
high-level language is used, the operating system may directly invoke system calls, predefined
functions.

 A system call is initiated by the program executing a specific instruction, which triggers a switch to
kernel mode, allowing the program to request a service from the OS. The OS then handles the
request, performs the necessary operations, and returns the result back to the program.

 System calls are essential for properly functioning an operating system, as they provide a
standardized way for programs to access system resources. Without system calls, each program
must implement its methods for accessing hardware and system services, leading to inconsistent
and error-prone behavior.

Services Provided by System Calls

 Process Creation and Management


 Main Memory Management
 File Access, Directory, and File System Management
 Device Handling(I/O)
 Protection
 Networking, etc.
o Process Control: end, abort, create, terminate, allocate, and free memory.

o File Management: create, open, close, delete, read files, etc.

o Device Management

o Information Maintenance
o Communication

Features of System Calls

 Interface: System calls provide a well-defined interface between user programs and the operating
system. Programs make requests by calling specific functions, and the operating system responds by
executing the requested service and returning a result.

 Protection: System calls are used to access privileged operations that are not available to normal
user programs. The operating system uses this privilege to protect the system from malicious or
unauthorized access.

 Kernel Mode: When a system call is made, the program is temporarily switched from user mode
to kernel mode. In kernel mode, the program has access to all system resources, including hardware,
memory, and other processes.

 Context Switching: A system call requires a context switch, which involves saving the state of the
current process and switching to the kernel mode to execute the requested service. This can
introduce overhead, which can impact system performance.

 Error Handling: System calls can return error codes to indicate problems with the requested service.
Programs must check for these errors and handle them appropriately.

How does System Call Work?

Here is a detailed explanation step by step how system calls work:

 Users need special resources: Sometimes programs need to do some special things that can’t be
done without the permission of the OS like reading from a file, writing to a file, getting any
information from the hardware, or requesting a space in memory.

 The program makes a system call request: There are special predefined instructions to make a
request to the operating system. These instructions are nothing but just a “system call”. The
program uses these system calls in its code when needed.

 Operating system sees the system call: When the OS sees the system call then it recognizes that the
program needs help at this time, so it temporarily stops the program execution and gives all the
control to a special part of itself called ‘Kernel’. Now ‘Kernel’ solves the need of the program.

 The operating system performs the operations: Now the operating system performs the operation
that is requested by the program. Example: reading content from a file etc.

 Operating system gives control back to the program: After performing the special operation, OS
gives power back to the program for further execution.

Why do you need system calls in the Operating System?


There are various situations where the system calls are required in the operating system. Following of the
situations are as follows:
 It is required when a file system wants to create or delete a file.
 Network connections require the system to send and receive data packets.
 You must make system calls to read or write a file.
 You need a system call if you want to access hardware devices, including a printer or scanner.
 System calls are used to create and manage new processes.
 They allow system programs to exercise control over hardware devices-for example, to set
parameters or to read status.
 They enforce access controls and permissions to protect system resources.
 Used for inter-process communication and coordination.
 System calls provide mechanisms for accessing status information and configuration data about the
system.

Types of System Calls


 Services provided by an OS are typically related to any kind of operation that a user program can
perform, such as creation, termination, forking, moving, communication, etc. Similar types of
operations are grouped into one single system call category. System calls are classified into the
following categories:

 Open(): Accessing a file on a file system is possible with the open() system call. It gives the file
resources it needs and a handle the process can use. A file can be opened by multiple processes
simultaneously or just one process. Everything is based on the structure and file system.
 Read(): Data from a file on the file system is retrieved using it.
 Wait(): In some systems, a process might need to hold off until another process has finished
running before continuing. When a parent process creates a child process, the execution of the
parent process is halted until the child process is complete. The parent process is stopped using the
wait() system call. The parent process regains control once the child process has finished running.
 Write(): Data from a user buffer is written using it to a device like a file. A program can produce
data in one way by using this system call.
 Fork(): The fork() system call is used by processes to create copies of themselves. It is one of the
most frequently used methods in operating systems to create processes. When a parent process
creates a child process, the parent process’s execution is suspended until the child process is
finished. The parent process regains control once the child process has finished running.
 Exit(): A system call called exit() is used to terminate a program. In environments with multiple
threads, this call indicates that the thread execution is finished. The operating system recovers the
process's resources after using the exit() system function.

 Structure of an Operating system


A system structure for an operating system is like the blueprint of how an OS is organized and how its
different parts interact with each other. Because operating systems have complex structures, we want a
structure that is easy to understand so that we can adapt an operating system to meet our specific needs.
Similar to how we break down larger problems into smaller, more manageable subproblems, building an
operating system in pieces is simpler. The operating system is a component of every segment. The strategy
for integrating different operating system components within the kernel can be thought of as an operating
system structure.
Types of Operating Systems Structures
 Monolithic Structure
A monolithic structure is a type of operating system architecture where the entire operating system is
implemented as a single large process in kernel mode. Essential operating system services, such as process
management, memory management, file systems, and device drivers, are combined into a single code block.
Examples: Unix, Linux.
Advantages:
 Performance of Monolithic structure is fast as since everything runs in a single block, therefore
communication between components is quick.
 It is easier to build because all parts are in one code block.
Disadvantages:
 It is hard to maintain as a small error can affect entire system.
 There are also some security risks in the Monolithic architecture.
 Layered structure
The OS is divided into layers, each built on top of the other, with each layer performing a specific function.
Each layer communicates only with the layer directly below it. The bottom layer is the hardware, and the
topmost layer interacts with user applications. 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:
 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:
 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 Structure
This structure designs the operating system by removing all non-essential components from the kernel and
implementing them as system and user programs. This results in a smaller kernel called the micro-
kernel. The advantages of this structure are that all new services need to be added to user space and do not
require the kernel to be modified. Thus, it is more secure and reliable as if a service fails, then the rest of
the operating system remains untouched. Mac OS is an example of this type of OS.
Advantages of Micro-kernel Structure
 It makes the operating system portable to various platforms.
 As microkernels are small, they can be tested effectively.
Disadvantages of Micro-kernel Structure
 Increased level of inter-module communication degrades system performance.

 Virtual machine
A virtual machine (VM) is a software-based computer that acts like a physical computer. VMs run on a
physical host machine, but each VM has its operating system. A virtual machine (VM) is a virtual
environment that functions as a virtual computer system with its own CPU, memory, network interface, and
storage created on a physical hardware system.
VMs are isolated from the rest of the system, and multiple VMs can exist on a single piece of hardware,
like a server. That means it is a simulated image of application software and operating system executed on a
host computer or a server. It has its own operating system and software that will facilitate the resources to
virtual computers. In short, a Virtual Machine provides a simulated computing environment that behaves
like a physical computer, allowing multiple OSes and applications to run on a single physical machine. It is
a crucial technology in modern data centers, cloud computing, and development environments.
Characteristics of virtual machines:
 Multiple OS systems use the same hardware and partition resources between virtual computers.
 Separate Security and configuration identity.
 Ability to move the virtual computers between the physical host computers as holistically integrated
files.

Here’s a breakdown of the key concepts:


1. Virtualization:
Creating a virtual version of something, such as a virtual hardware platform, storage device, or operating
system. Virtualization allows multiple virtual machines to share the same physical hardware, efficiently
using resources.
2. Hypervisor:
A hypervisor (a Virtual Machine Monitor or VMM) is the software layer that enables virtualization. It sits
between the physical hardware and the virtual machines, managing to allocate resources (like CPU,
memory, and storage) from physical machine to each VM. Each VM can be configured with different
resources, allowing for flexible management of workloads.
3. Guest OS:
A guest operating system is the OS running inside the virtual machine. It could be Windows, Linux,
macOS, etc. The guest OS interacts with the virtualized hardware as if it were running on physical
hardware.
4. Isolation:
VMs are isolated from each other and the host system. This means that the applications running in one VM
do not affect those running in different VMs or on the host system, providing security and stability.
Advantages of Virtual Machine
 There are no protection problems because each virtual machine is completely isolated from all other
virtual machines.
 Virtual machines can provide an instruction set architecture that differs from real computers.
 Easy maintenance, availability, and convenient recovery.
 Isolation and Security: Since VMs are isolated, the failure of one VM does not affect others or the
host system.
 Flexibility: Different operating systems and applications can be run simultaneously on the same
hardware, which is useful for testing, development, or running legacy software.
 Portability: VMs can be moved, copied, or backed up easily, making them highly portable across
different physical machines.
Disadvantages of Virtual Machine
 When multiple virtual machines are simultaneously running on a host computer, one virtual
machine can be affected by other running virtual machines, depending on the workload.
 Virtual machines are not as efficient as a real one when accessing the hardware.

You might also like