0% found this document useful (0 votes)
11 views18 pages

Operating System Unit 4

The document outlines the objectives and functions of operating systems, including process, memory, file system, device management, security, and user interface functions. It also discusses performance measurement metrics such as throughput, turnaround time, and response time, and describes various operating system types including batch processing, multiprogramming, multitasking, multiprocessing, and time-sharing. Each type is defined, explained, and evaluated for its advantages and disadvantages.

Uploaded by

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

Operating System Unit 4

The document outlines the objectives and functions of operating systems, including process, memory, file system, device management, security, and user interface functions. It also discusses performance measurement metrics such as throughput, turnaround time, and response time, and describes various operating system types including batch processing, multiprogramming, multitasking, multiprocessing, and time-sharing. Each type is defined, explained, and evaluated for its advantages and disadvantages.

Uploaded by

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

Operating System Unit 4 :

Operating System:

Q1. Objectives & Functions :-


The main objectives of an operating system are:
• Convenience: An OS makes a computer more convenient to use.
• Efficiency: An OS allows the computer system resources to be used in
an efficient
manner.
• 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
without interfering with service.
Here are the key functions of an OS:

1. Process Management Functions


These involve handling all tasks related to processes (programs in
execution).
Key Functions:
Process Creation and Termination – Starts and stops processes as
needed.
Process Scheduling – Decides which process gets the CPU next.
Context Switching – Saves the state of a running process and loads the
state of the next one.
Deadlock Handling – Detects and resolves situations where processes are
stuck waiting for each other.
Synchronization – Coordinates processes that share data or resources.

2. Memory Management Functions


These deal with how memory (RAM) is allocated and managed.
key Functions:
Memory Allocation – Assigns memory to programs when needed.
Memory Deallocation – Frees up memory when it's no longer in use.
Virtual Memory Management – Uses disk space to simulate additional
RAM.
Segmentation and Paging – Divides memory into manageable units for
better efficiency and protection.

3. File System Management Functions


Responsible for organizing and managing data on storage devices.
Key Functions:
File Creation/Deletion – Enables users and programs to create or delete
files.
Directory Management – Organizes files into folders/directories.
Access Control – Manages permissions (read, write, execute).
File Backup and Recovery – Ensures data safety and restoration.

4. Device Management Functions (I/O Management)


Handles all interactions between the computer and its hardware devices.
Key Functions:
Device Drivers – Acts as translators between the OS and hardware.
I/O Scheduling – Determines the order in which devices are accessed.
Buffering and Caching – Temporarily stores data to speed up device
interactions.
Error Detection – Detects issues in device communication.

5. Security and Protection Functions


Protects data and system resources from unauthorized use or damage.
Key Functions:
User Authentication – Verifies user identity (password, fingerprint).
Access Control – Grants or denies access to system resources.
Encryption and Firewalls – Protects data from hackers or malware.
Audit and Monitoring – Tracks system usage and detects unusual
behavior.
6. User Interface Functions
Facilitates interaction between the user and the system.
Types of Interfaces:
CLI (Command-Line Interface) – Text-based input/output (e.g., DOS, Linux
terminal).
GUI (Graphical User Interface) – Visual interaction using windows, icons,
and menus (e.g., Windows, macOS).
Key Functions:
Display Management – Manages output on screen (text, graphics).
Input Handling – Accepts and processes keyboard, mouse, and touch
inputs.
Accessibility Features – Helps users with disabilities interact with the
system.

Q2. Measuring System Performance:-


The efficiency of an operating system and the overall performance of a
computer system are usually
measured in terms of the following aspects:

Throughput: Throughput is the amount of work that the system is


able to do per unit time. It
is measured as the number of processes that are completed by the
system per unit time. For example, if n processes are completed in an
interval of t seconds, the throughput is taken as n/t
processes per second during that interval. Throughput is normally
measured in processes/hour.
Here, it is noteworthy that the value of throughput does not depend only
on the capability of
a system, but also on the nature of jobs being processed by the system.
For long processes,
throughput may be one process/hour; and for short processes,
throughput may be 100
processes/hour.

Turnaround time: From the point of view of an individual user, an


important criterion is
‘how long it takes the system to complete a job submitted by him/her’.
Turnaround time is the
interval from the time of submission of a job to the system for processing
to the time of
completion of the job. Although higher throughput is desirable from the
point of view of
overall system performance, but individual users are more interested in
better turnaround time
for their jobs.

Response time: Turnaround time is usually not a suitable measure for


interactive systems,
because in an interactive system, a process can produce some output
fairly early during its
execution and can continue executing while previous results are being
output to the user. Thus,
another measure used in case of interactive systems is response time,
which is the interval
from the time of submission of a job to the system for processing to the
time the first response
for the job is produced by the system.

In any computer system, it is desirable to maximize throughput and


to minimize turnaround
time and response time

Q3. Batch Processing:-

Definition:
Batch Processing is a type of operating system where similar jobs are
grouped (batched) together and executed one after another without user
interaction during execution.
Jobs are collected, grouped, and processed in batches.
Users submit jobs to an operator, who loads them onto a storage device.
The OS then processes these jobs automatically in the order they were
received.

How It Works:
Users submit their jobs using punch cards, magnetic tapes, or files.
Jobs are grouped into a batch.
The system processes all jobs in the batch one by one.
Output is collected and given back to the user later.

Key Features:
No direct user interaction during execution.
Jobs are executed sequentially.
Uses job control language (JCL) to instruct the OS on job execution.
Efficient for repetitive and large-scale tasks.

Advantages:
Efficient for large volumes of similar tasks (e.g., payroll, bank statements).
Reduces idle CPU time.
Simple and predictable job execution.

Disadvantages:
No real-time interaction – users can't interfere during execution.
Debugging is hard – errors are found only after the batch finishes.
Longer wait times for jobs, especially if the batch is large.

Examples of Batch Processing:


Payroll systems in companies.
Bank statement generation.
Report generation for large datasets.
Old IBM mainframes using systems like IBM OS/360.

Q4. Multi-Programming :-

Definition:
A Multiprogramming Operating System allows multiple programs to
reside in memory at the same time and execute concurrently by sharing
CPU time. While one program waits (e.g., for I/O), another can use the
CPU, increasing efficiency.

How It Works:
Multiple programs are loaded into memory.
The CPU executes one program at a time.
When a program waits for I/O (e.g., reading from disk), the CPU switches
to another program.
This continues in a cycle, so the CPU is never idle.

Key Concept:
The CPU is always busy — it switches between programs to maximize
resource use and reduce idle time.
Key Features:
Increased CPU utilization
Simultaneous execution (not at the same exact time, but switching
quickly between tasks)
Uses job scheduling algorithms (like FCFS, SJF, Round Robin)
Requires memory management and process management

Advantages:
Better CPU and resource utilization
Faster job completion compared to batch systems
Reduced idle time for CPU and other components

Disadvantages:
Requires more memory and complex OS design
Can cause issues like deadlocks or priority conflicts
Slower response compared to real-time or time-sharing systems

Example Use Cases:


Desktop OS like Windows, Linux, and macOS Systems running multiple
applications at once (e.g., browser, music player, and word processor)
Q5. Multi-Tasking:-

Definition:
A Multitasking Operating System allows a user to perform multiple tasks
(programs) simultaneously. The CPU switches rapidly between tasks,
giving the illusion that they are running at the same time.

Example: You are listening to music while browsing the web and
writing a document — all at once.

How It Works:
The CPU allocates a small time slice to each task.
After each slice, the OS quickly switches to the next task (this is called
context switching).
Because this switching happens quickly, all tasks seem to run
concurrently.

Types of Multitasking:
1. Preemptive Multitasking
The OS decides when to switch tasks (forces it after a set time).
Ensures fair CPU sharing.
Examples: Windows, Linux, macOS.

2. Cooperative Multitasking
A task voluntarily gives control to the next task.
Less reliable (a frozen program can block others).
Examples: Older systems like Windows 3.x, Mac OS 9.

Key Functions:
Process scheduling
Context switching
CPU time allocation
Resource sharing

Advantages:
Efficient CPU utilization
Improved productivity — multiple applications can run together.
Better user experience with smooth task switching.

Disadvantages:
Requires more memory and CPU power.
Overhead from frequent context switching.
Risk of system slowdowns if too many processes run at once.

Examples of Multitasking OS:


Windows 10/11
macOS
Linux (Ubuntu, Fedora, etc.)
Android & iOS (for mobile multitasking)

Q6. Multi-Processing :-

**Definition:
A** Multiprocessing Operating System is an OS that supports the use of
two or more CPUs (processors) in a single computer system. These
processors work simultaneously to execute multiple processes at the
same time, significantly boosting performance and reliability.

Example: Modern servers, high-performance computers, and some


desktops/laptops with multi-core CPUs.

How It Works:
Each processor can execute a different process in parallel.
The OS manages task distribution, synchronization, and communication
between processors.
This differs from multitasking, where only one CPU is switching between
tasks.

Key Features:
True parallel processing of tasks.
Shared memory or distributed memory depending on the architecture.
Requires complex scheduling and communication control.
Provides better fault tolerance — one processor can keep working if
another fails.

Types of Multiprocessing:
1. Symmetric Multiprocessing (SMP)
All processors are treated equally.
They share the same memory and I/O.
Common in most modern systems.
Example: Windows, Linux, macOS on multi-core CPUs.

2. Asymmetric Multiprocessing (AMP)


Processors are assigned specific tasks (master-slave approach).
One controls the system, others follow commands.
Used in simpler or specialized systems.

Advantages:
Greatly increases system performance.
Can handle multiple tasks truly in parallel.
Improves system reliability and availability.
Useful for scientific, engineering, and database applications.

Disadvantages:
Expensive hardware (multiple CPUs or cores).
Complex OS design for managing processors and memory.
Software needs to be designed to take full advantage of multiple CPUs.

Examples of Multiprocessing Systems:


Modern operating systems on multi-core processors (Intel i7/i9, AMD
Ryzen).
UNIX/Linux servers
High-performance computing (HPC) systems
Supercomputers

Q7. Time-Sharing :-
Definition:
A Time-Sharing Operating System is a type of OS that allows multiple
users or processes to use the computer system at the same time by
sharing CPU time. Each task or user gets a small, fixed time slot (called a
time slice) to use the CPU.
If there are n users actively requesting service at one time, each user will
only
see on the average 1/n of the effective computer capacity, not counting
OS overhead.

It creates the illusion that all users or tasks are running


simultaneously, even though the CPU is switching between them very
quickly.

How It Works:
The CPU rapidly switches between tasks or users.
Each task is assigned a short time quantum.
After its time is up, the OS moves to the next task, and so on.
If a task finishes before the time expires, the next task starts immediately.

Key Features:
Multi-user support – many users can access the system at once (e.g., on
terminals).
Fast response time – quick switching makes it feel "instant."
Efficient resource utilization – CPU, memory, and I/O devices are shared.
Preemptive scheduling – tasks are forcefully paused if they exceed their
time slot.

Advantages:
Interactive user experience – users feel like they have their own system.
Reduces CPU idle time.
Effective for multi-user environments like servers and mainframes.

Disadvantages:
Overhead due to frequent context switching.
Can become slow if too many users or tasks are active.
Security and data isolation between users are more complex.

Examples of Time-Sharing Systems:


UNIX/Linux systems with multiple users
Mainframes supporting remote terminal access
Early versions of Windows NT Modern cloud-based environments using
virtualization

You might also like