0% found this document useful (0 votes)
5 views17 pages

OPERATING SYSTEM CHAPTER 01

An Operating System (OS) is software that manages hardware and software resources, acting as an interface between users and the computer. It performs key functions such as process management, memory allocation, and file management, and comes in various types including batch, multiprogramming, and real-time systems. The OS consists of components like the kernel, which manages system resources, and system calls that facilitate interactions between user programs and the OS.

Uploaded by

tagev50063
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)
5 views17 pages

OPERATING SYSTEM CHAPTER 01

An Operating System (OS) is software that manages hardware and software resources, acting as an interface between users and the computer. It performs key functions such as process management, memory allocation, and file management, and comes in various types including batch, multiprogramming, and real-time systems. The OS consists of components like the kernel, which manages system resources, and system calls that facilitate interactions between user programs and the OS.

Uploaded by

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

OPERATING SYSTEM

An Operating System (OS) is a software that manages and handles hardware


and software resources of a computing device.
 Responsible for managing and controlling all the activities and sharing of
computer resources among different running applications.
 A software that acts as an interface between the users and hardware of
the computer system
 A software that provides a working environment for the users’
applications
 A resource manager that manages the resources needed for all the
applications in the background
 Examples are Linux, Unix, Windows 11, MS DOS, Android, macOS and
iOS.
Resource Manager (Operating System)
The Operating System (OS) manages and allocates system resources efficiently.
It is responsible for handling multiple processes, memory allocation, file
management, and communication between processes.
Key Functions:
✔ Process Management – Creates, deletes, and manages running programs.
✔ Memory Management – Allocates available memory to processes.
✔ File Management – Organizes and stores user files.
✔ I/O Management – Controls access to hardware like printers and storage
devices.
✔ Interprocess Communication – Ensures smooth communication between
running tasks.

Control Program:

 Manages all components of a computer system in an integrated manner.

 Controls the execution of user programs and I/O devices to prevent


errors and improper use of computer resources.

 Looks over and protects the computer


Command Executer:
 Interfaces between the users and machine.
 Supplies services/utilities to users.
 Provides the users with a convenient CLI (Command Language Interface),
also called a Shell (in UNIX), for entering the user commands.

Virtual Machine Manager (Operating System)


The Operating System (OS) acts as a Virtual Machine Manager, creating a
simplified view of hardware for users and programmers. Instead of
interacting directly with complex hardware, users work with a virtual
system that makes tasks easier.
How the OS Creates a Virtual Machine:
1. Virtual Processors – Runs multiple processes to simulate multiple CPUs.
2. Virtual Memory – Divides physical memory into separate spaces for
different processes.
3. Virtual Storage – Manages disk space through file systems.
4. Virtual Devices – Provides an easy-to-use interface for hardware like
printers and keyboards.

Type Of Operating System


1. Batch-Processing Operating System:-
In batch operating system the jobs were performed in batches. This means
Jobs having similar requirements are grouped and executed as a group to
speed up processing. Users using batch operating systems do not interact with
the computer directly. Each user prepares their job using an offline device for
example a punch card and submits it to the computer operator. It is a real time
operating system.
A batch processing operating system (BPOS) is designed to handle and process
large volumes of data in batches, making it ideal for organizations that require
efficient and rapid data processing. Unlike interactive systems, batch processing
systems operate by executing a series of jobs without manual intervention,
which enhances their speed and efficiency.
Batch OS contains a library for scheduling tasks. This library permits tasks to be
scheduled in a ranked manner, which makes it easy to manage and schedule
tasks across a network of computers. The user interface permits users to view
and manage tasks in a graphical manner.

Advantages of Batch Operating System


 Resource Efficiency: These systems improve the use of computation
resources by processing jobs in groups and scheduling them during
stages of resource accessibility.
 High Throughput: Batch processing systems can handle and complete a
large number of tasks quickly, confirming quick turnaround times and
high throughput.
 Error Reduction: Since these systems work without requiring user
interference, they minimize the risk of faults that can occur with manual
processing.
 Cost Efficiency: By producing well-organized use of resources and
reducing processing time and errors, batch processing systems can be a
cost-effective option.

Disadvantages of Batch Operating System


 Limited functionality: A batch operating system can solve only simple
tasks not solve more complex tasks
 Security issues: Batch operating systems are not more secure because
they are not typically used for day-to-day tasks.
 Interruptions Batch systems can be interrupted frequently, which
can lead to missed deadlines or mistakes.
 Inefficiency: Batch systems are often slow and difficult to
use, which can lead to inefficiency in the workplace.
2. Multiprogramming System: -
A Multiprogramming Operating System allows multiple programs to be in
memory at the same time, with one running at any moment. This improves
resource use and efficiency.
Advantages of Multi-Programming Operating System
 CPU is better utilized and overall performance of the system improves.
 It helps in reducing the response time.
Disadvantage of Multi-Programming Operating System
 Complex
 Memory management problem
Throughput = Number of jobs completed per unit time
Throughput is increased if degree of multi-programming is increased. Degree of
multi-program ming is the number of programs in main memory. increase the
degree of multi-programming, throughput also increases. However, this
increase in throughput depends on two factors.
i. how much memory for storing programs is available.
ii. The type of program: - If the programs under multiprogrammed
execution are either CPU bound or I/O bound, the throughput will be
low. If there is a proper mix of these two types of programs, only then
the throughput will be improved.
3. Multi-Tasking/Time-sharing Operating systems
A Multitasking OS is a type of Multiprogramming OS where tasks run in a
round-robin manner. Each task gets a fixed time (called quantum) to execute
before switching to the next. This ensures smooth operation and allows
multiple users or programs to share the CPU efficiently.
Advantages of Time-Sharing OS
 Each task gets an equal opportunity.
 Fewer chances of duplication of software.
 CPU idle time can be reduced.
Disadvantages of Time-Sharing OS
 Complexity: Time-sharing systems are complex and require advanced
software to manage multiple users simultaneously. This complexity
increases the chance of errors.
 Security Risks: With multiple users sharing resources, the risk of
security breaches increases.

Example is windows terminal

4. Distributed Operating System (Jaise team viewer)


A Distributed Operating System connects multiple independent computers
through a shared network. Each system has its own CPU and memory
(loosely coupled system). These systems can differ in size and function. A
major advantage is remote access, allowing users to access files or software
from other connected systems.
Advantages of Distributed Operating System
 Failure of one will not affect the other network communication, as all
systems are independent of each other.
 Electronic mail increases the data exchange speed.
 Since resources are being shared, computation is highly fast and durable.
 Load on host computer reduces.

Disadvantages of Distributed Operating System


 Failure of the main network will stop the entire communication.
 To establish distributed systems the language is used not well-defined
yet.
 These types of systems are not readily available as they are very
expensive.

5. Network Operating System (NOS)

A Network Operating System (NOS) runs on a server and manages data,


users, security, and network resources. It allows shared access to files,
printers, and applications within a private network. In these tightly coupled
systems, users are aware of other users and their connections within the
network.
Advantages of Network Operating System
 Highly stable centralized servers.
 Security concerns are handled through servers.
 Server access is possible remotely from different locations and types of
systems.
Disadvantages of Network Operating System
 Servers are costly.
 User has to depend on a central location for most operations.
 Maintenance and updates are required regularly.

6. Real-Time Operating System (RTOS)

A Real-Time Operating System (RTOS) is designed to process tasks quickly


and within a fixed time. It is used in systems where immediate response is
critical, such as medical devices, industrial automation, and embedded
systems.
Types of RTOS:
1. Hard RTOS – Strict timing rules; missing a deadline can cause failure
(e.g., pacemakers, aircraft control).
2. Soft RTOS – Timing is important but not critical; delays are acceptable
(e.g., video streaming, online transactions).
Advantages:
✔ Fast and predictable response time
✔ Efficient task scheduling
✔ High reliability and stability

Disadvantages of RTOS
 Limited Tasks
 Use heavy system resources
 Complex Algorithms

7. Embedded Operating System


An Embedded Operating System is designed for specialized devices with
specific functions, such as smart appliances, ATMs, and medical equipment.
It is optimized for efficiency, reliability, and low power consumption.
Key Features:
✔ Lightweight & Fast – Uses minimal resources
✔ Task-Specific – Runs a dedicated function (e.g., washing machine
software)
✔ Real-Time Capabilities – Often includes RTOS features for instant
response

Operating System’s Generic Components


The Operating System (OS) acts as a bridge between users, applications, and
hardware. Users cannot directly access hardware, so the OS manages all
interactions.

Main Components of an OS:


 Shell (User Interface) – Receives user commands and translates them
for the OS.
 Kernel (Core of OS) – Manages essential functions like task scheduling
and memory management. It is always loaded into memory for quick
execution.
 Hardware – The physical
components controlled by the
OS.
Since memory is limited, only
essential OS parts (Kernel) stay in
memory, while other modules (e.g.,
virtual memory) load when needed.

Kernel in Operating
System:-
A kernel is the core part of an
operating system. It acts as a bridge between software applications and the
hardware of a computer.
 The kernel manages system resources, such as the CPU, memory, and
devices, ensuring everything works together smoothly and efficiently.
 It handles tasks like running programs, accessing files, and connecting to
devices like printers and keyboards.
 An Operating System includes the kernel as its core, but also provides a
user interface, file system management, network services, and various
utility applications that allow users to interact with the system
System call
A system call is a way for a program to request services from the operating
system’s kernel. It allows user programs to interact with the OS through the
Application Program Interface (API). System calls are executed in kernel
mode and serve as the only entry points into the kernel.
Programs can request various services, and the OS responds by executing
system calls to fulfill them. These calls can be written in high-level languages
like C or Pascal or in assembly language. When a program executes a system
call, it switches to kernel mode, allowing the OS to handle the request and
return the result.
System calls are essential for accessing system resources efficiently. Without
them, programs would need to manage hardware and system services
independently, leading to inconsistencies and errors.

System Calls (Simplified):-


System calls are essential for understanding how an operating system (OS)
works. The system operates in two modes:
 User Mode: Executes regular user programs.
 System Mode (Kernel Mode): Handles privileged operations.
Since user-mode programs cannot directly access kernel functions, they
must use system calls, which act as a bridge between user programs and
the OS. System calls allow programs to request privileged operations, such
as accessing hardware, files, directories, or communicating with other
processes.
However, a system call does not perform the operation itself. Instead, it
triggers an interrupt, allowing the OS to take control of the CPU. The OS
then determines the type of request and executes the corresponding
operation using an interrupt handler.
System calls also enhance security by preventing user programs from
directly accessing the OS or other users’ data, ensuring the safe use of I/O
devices and system resources.

Types of System Calls:-

System calls are categorized based on the resources they manage, enabling
users to perform various operations through the operating system.
1. Process Control System Calls
These system calls manage processes, allowing users to:
 Create and terminate processes
 Suspend or resume processes
2. File Management System Calls
Files are essential for data storage and retrieval. Key system calls for file
management include:
 Creating and deleting files
 Opening and closing files
 Reading from and writing to files
 Managing directories
3. Device Management System Calls
To access I/O devices safely, system calls provide operations like:
 Requesting and releasing devices
 Performing read and write operations
Files are often treated as virtual devices, so many file system calls are
used for device access as well.
4. Information Maintenance System Calls
These system calls offer valuable system information, such as:
 Process details
 Memory usage
 Device status
 Disk space availability
5. Communication System Calls
Facilitate communication between processes, allowing them to:
 Send and receive messages
 Share data
6.Protection
 Control access to resources
 Get and set permissions
 Allow and deny user access
General Structure of an Operating System (OS)
The OS resides in the main memory, but due to its increasing size, it is
divided into two parts:
1. Resident Part (Kernel) – Always present in memory, containing essential
programs.
2. Transient Part – Loaded only when needed to save memory.

Resident Part Components: -


 Resource Allocation Data Structures – Manage resource allocation to
processes.
 Process Information – Stores process details like ID, priority, and state,
crucial for multitasking.
 System Call Handler – Handles frequent user requests via system calls.
 Event Handlers – Manage essential operations like memory and disk I/O.
 Scheduler – Selects and dispatches jobs from the queue in a multi-
programming environment.
1. Monolithic architecture
• A complex structure of operating system because every module in the
operating
system accessed hardware directly.
•Programming effort was high because of semantic gap—the difference
between user- level operations and low-level
machine instructions. This gap made OS development more challenging, as
high-level tasks like memory allocation and scheduling had to be translated into
machine-level instructions.
2.Layered Architecture
As OSs became more complex, monolithic structures became obsolete(no
longer needed), leading to layered architectures. This design organizes OS
functionalities into separate layers, each with a specific role. The functions
related to a category are grouped together and made a layer of that category.
Key Design Principles:
1. Grouping of Functions – Related functions are grouped into layers. For
example, process creation and management form a process
management layer. The topmost layer interacts with applications, while
the lowest layer interfaces with hardware.
2. Hierarchy of Layers – Each layer communicates only with the layer
directly above or below it, ensuring a structured flow of operations.
Advantages:
 Simplified Architecture – Easier to understand and manage than
monolithic OSs.
 Modularity – Changes or debugging in one layer do not affect others.
 Protection – Layers are isolated, preventing data corruption and
malicious access.
Disadvantages:
 Performance Overhead – System calls must pass through multiple layers,
slowing execution.
 Complex Layering – Deciding how to group functions into layers can be
challenging.
 Scalability Issues – Too many layers may make the OS complex again.
3.Virtual Machine OS
Different types of jobs require different OS structures—some are batch-
oriented, while others need real-time interaction. A single OS structure
cannot efficiently handle all needs.
Concept of Virtual Machines
 A virtual machine (VM) is an exact copy of the hardware, with its own
processor, memory, and I/O devices.
 Multiple OSs can run on separate VMs on the same physical machine.
 A host OS runs on the actual hardware and manages multiple VMs. It
decides which OS to execute next, similar to job scheduling in a
traditional OS.
 Each guest OS runs independently on a VM, ensuring security and
isolation.

Advantages of Virtual Machine OS:


 Resource Sharing – Multiple OS
environments (e.g., multi-programming,
time-sharing) run on a single machine.
 Isolation & Security – VMs are separate
from each other and from the host OS,
preventing malware or system crashes
from spreading.
Examples of Virtual Machine OSs:
 VM/370, VM/SP, and z/VM – Early
virtual machine-based OSs.
 Hypervisor (VM-CP) – A control program that creates and manages VMs.
 Modern Usage – Pentium architecture allows running MS-DOS alongside
Windows using virtual 8086 mode.

4.Simple Structure OS
Early operating systems had a simple structure with minimal organization.
They were built as a collection of routines with no strict separation
between system components.

Characteristics:
Functions were loosely connected, leading to inefficiencies.
All system services (e.g., process management, I/O, memory management)
were combined into one layer.
Examples: MS-DOS, UNIX (early versions)
Advantages:
 Easy to develop and modify.
 Fast execution due to minimal layering.
Disadvantages:
 Lack of modularity made debugging and maintenance difficult.
 System crashes could affect the entire OS.

5.Microkernel OS Structure
A microkernel OS reduces the kernel size by moving non-essential
functions to user space, making the system more modular and secure.

Key Features:
The kernel handles only core functions like process scheduling and
interprocess communication.
Other services (e.g., file systems, device drivers) run in user mode as
separate processes.
Example: MINIX, QNX, macOS (partially), Windows NT

Advantages:
 Better Security & Stability – A failure in one module does not crash
the whole system.
 Modularity – Easier to update and extend.
 Portability – Can be adapted to different hardware architectures.

Disadvantages:
 Performance Overhead – More context switching and
communication between components can slow down execution.
Privileged and Non-Privileged Instructions in an Operating
System
Privileged Instructions
Privileged instructions can only be executed by the operating system (OS)
kernel or trusted processes. These instructions involve direct access to
hardware or critical system resources and can only run in Kernel Mode.
Characteristics:
 If executed in User Mode, they are blocked and treated as illegal.
 The OS ensures a timer is set before switching to a user program to
maintain control.
 These instructions are crucial for system security and stability.
Examples:
 I/O Operations & Halt Instructions – Controlling hardware devices.
 Turning Off Interrupts – Prevents external disruptions.
 Context Switching – Switching between processes.
 Clearing Memory – Removing a process from memory.
 Modifying Device-Status Table – Managing device access.
OS Role in Managing Privileged Instructions:
1. Access Control – Restricts use to authorized processes.
2. Memory Protection – Prevents unauthorized memory access.

3. Virtualization – Creates a secure environment for executing privileged


instructions.

Non-Privileged Instructions
Non-privileged instructions do not require direct hardware access and can be
executed by any process in User Mode. They perform general computing tasks
and ensure processes remain isolated for system stability.
Examples:
 Reading Processor Status – Checking CPU state.
 Reading System Time – Fetching the current time.
 Generating a Trap Instruction – Requesting OS services.
 Sending a Print Command – Printing output.
To switch from Kernel Mode to User Mode, a non-privileged instruction must
be used, ensuring smooth mode transitions without causing system
interruptions.

You might also like