You are on page 1of 16

Q1.

Feature Batch Operating System Time-Sharing Operating System

Nature of Processes a set of similar jobs in Allows multiple users to share the
Work bulk. CPU simultaneously.

Minimal user interaction during job


Provides interactive access to multiple
User execution. Users submit jobs, and
users. Users can run programs and
Interaction the system processes them
interact with the system in real-time.
without direct user intervention.

Shorter response time, as the system


Longer response time, as jobs are
Response quickly switches between different
processed one after the other in a
Time user tasks, providing a more
batch.
interactive experience.

Time-sharing scheduler allocates CPU


Jobs are scheduled in batches
time in small, time-sliced intervals to
Scheduling based on priorities, and the entire
multiple users, allowing each user to
batch is processed sequentially.
run their tasks in turns.

Resources allocated to a job are Resources are dynamically allocated


Resource
fixed for the duration of its and deallocated among multiple users
Allocation
execution. based on their current needs.
Q1.2

Feature Buffering Spooling

Temporarily holds data in a memory Simultaneously performs I/O


area (buffer) to reduce the number operations for multiple tasks by using
Purpose
of direct I/O operations between a a spool (simultaneous peripheral
program and I/O device. operations online).

Buffer stores a limited amount of Spool stores larger amounts of data,


Data Storage data and is typically located in the often in a dedicated disk space or
computer's memory. spooling directory.

Primarily used to manage data


Primarily used to manage print jobs
transfer between the main memory
Usage or tasks that involve time-consuming
and I/O devices, smoothing out the
operations, creating a queue of jobs.
rate of data flow.

Spooling allows multiple tasks to be


Buffering is more focused on
processed concurrently, as it creates
Concurrency improving data flow efficiency for a
a queue for multiple jobs or
single task.
operations.

Spooling is frequently used in


Buffering is commonly used in
printing systems, where it queues
streaming media, file I/O
Examples print jobs to allow other tasks to
operations, and network
proceed without waiting for printing to
communication.
finish.
Q1.3

Feature Multitasking Multiprogramming

Allows multiple tasks to run


Involves the concurrent execution of
concurrently on a single processor,
Objective multiple programs for efficient CPU
providing the illusion of parallel
utilization.
execution.

Emphasizes on providing a Primarily focuses on maximizing CPU


seamless user experience by utilization by keeping the processor
Focus
interleaving the execution of tasks busy with continuous execution of
in real-time. multiple programs.

Tasks can be interactive or non-


interactive, and the operating
Programs run independently, and their
Task system must quickly switch
execution is typically managed based
Interaction between them to give the
on priorities and resource availability.
appearance of simultaneous
execution.

Involves dynamic sharing of Resources are allocated to different


Resource resources, such as CPU time, programs based on priorities, and the
Sharing memory, and I/O devices, among focus is on efficient utilization rather
concurrently running tasks. than real-time interaction.

Provides a more responsive and May not provide as seamless an


User interactive user experience, with interactive experience as multitasking
Experience the ability to run multiple but aims to maximize overall system
applications concurrently. throughput and efficiency.
Q1.4

Feature Hard Real-Time OS Soft Real-Time OS

Guarantees a strict and Provides a less strict guarantee on


deterministic response time for response time. Meeting deadlines is
Response Time
critical tasks. Missing deadlines important but occasional misses
Guarantee
is not acceptable, and the may be tolerated, and the system
consequences can be severe. can still be considered useful.

Assigns priorities to tasks, but


Prioritizes tasks based on occasional variations in task
criticality, ensuring that the execution times may be acceptable.
Task Priority
highest priority tasks are Priority levels are usually defined to
executed without delay. handle tasks based on their
importance.

Failure to meet a deadline in a


Occasional deadline misses may not
hard real-time system can have
Consequences of have severe consequences. The
severe consequences, including
Failure system may recover and continue to
system failure or danger to
function without catastrophic failure.
human life.

Applications where timing is


Critical applications where timing
important but occasional delays can
is absolutely crucial, such as in
Use Cases be tolerated, such as multimedia
aerospace, medical devices, and
systems, networked applications,
automotive control systems.
and some industrial control systems.
Typically less flexible, as More flexibility is allowed to
meeting hard deadlines is the top accommodate varying task
Flexibility priority, and the system is execution times. The system can
designed to optimize for adapt to changing conditions without
determinism. risking catastrophic failure.

Q1.5

Feature Job Program Process

A job refers to a single A process is an


A program is a set of
unit of work submitted by instance of a running
instructions written in a
a user or an application program. It includes the
Definition programming language
for execution. It can program code, current
that can be executed by
consist of one or more activity, and a unique
a computer.
programs. process identifier.

A job is initiated by a A program is a static


A process is created
user or an application entity and needs to be
when a program is
Initiation and represents a loaded into memory
loaded into memory for
complete task or a set of and executed to
execution.
related tasks. become a process.

The operating system The operating system The operating system


Interaction manages jobs, and each loads and executes provides resources and
with OS job may consist of one or programs, transforming manages the execution
more programs. them into processes. of processes.
Running a payroll Running multiple
A compiled code written
processing job that instances of a web
in a high-level
Example includes programs for browser, each being a
programming language,
calculating salaries, separate process with
such as a C program.
taxes, etc. its own resources.

Q1.6

Feature System Calls System Programs

Invokes OS services or functions by Collections of utility programs


user programs to perform tasks like provided by the operating system
Purpose
I/O operations, process control, and to perform various system-related
memory allocation. tasks.

Acts as an interface between user-


Executes at user level and
level applications and the kernel. User
Interaction interacts with the operating
programs use system calls to request
system through the system calls.
services from the operating system.

Provides a lower-level interface, Provides a higher-level interface,


Level of exposing the basic functionalities of offering pre-built functionalities
Abstraction the operating system to user and tools for users to manage the
programs. system.

Examples of system programs


Examples of system calls include include command-line utilities like
Examples
open(), read(), write(), and fork(). ls, cp, mv, and system
configuration tools.
Used by end-users and
Used by application developers to
administrators to interact with and
Usage access OS services directly and
manage the system without
perform low-level operations.
having to write low-level code.

Q1.7

Feature Tightly Coupled System Loosely Coupled System

Components are strongly


Components are more independent,
interconnected, and changes in
Definition and changes in one component
one component may directly
have minimal impact on others.
affect others.

Communication between Communication between


components is frequent, direct, components is infrequent, often
Communication
and often involves shared occurring through well-defined
resources. interfaces or message passing.

High interdependence among Lower interdependence;


components; they rely heavily on components can operate more
Dependency
each other's functionality and independently with less reliance on
data. others.

Less flexible in terms of making More flexible, as changes to one


changes or upgrades, as component are less likely to impact
Flexibility
modifications may have a ripple the overall system, allowing for
effect on other components. easier upgrades and modifications.

Mainframes, where processors, Distributed systems, cloud


Examples
memory, and I/O devices are computing environments, where
components can operate
tightly interconnected. independently and communicate
through well-defined interfaces.

Q2.

1. DMA Structure (Direct Memory Access):

DMA (Direct Memory Access) is a feature that allows peripherals to transfer data

to and from memory without involving the CPU directly. It improves the efficiency

of data transfers by reducing the CPU's involvement and increasing overall

system performance.

The DMA structure typically involves the following components:

● DMA Controller: The DMA controller is a specialized hardware component


responsible for managing data transfers between peripherals and memory. It has
registers to store the memory addresses, count of data bytes to be transferred,
and control signals.
● Bus Interface: The DMA controller is connected to the system bus and
communicates with the CPU, memory, and peripherals. It uses the bus interface
to gain control of the system bus during data transfers.
● Memory Buffer: DMA transfers involve the movement of data between
peripherals and memory. A memory buffer is used to temporarily store the data
during these transfers.

Operation:
Initiation: The CPU initializes the DMA controller by providing it with the source and
destination addresses, transfer size, and other control parameters.

Request Phase: The peripheral device requests access to the system bus to initiate
a DMA transfer.

Bus Arbitration: The DMA controller gains control of the system bus through a
process called bus arbitration. It requests control from the CPU and, once
granted, takes over the bus for data transfer.

Data Transfer: The DMA controller transfers data directly between the peripheral
and memory without CPU intervention. It increments memory addresses and
adjusts control signals accordingly.

Completion: Once the transfer is complete, the DMA controller releases control of
the system bus, and it may generate an interrupt to notify the CPU.

2. Interrupt Process:

An interrupt is a mechanism by which a computer's CPU can be interrupted from


its current execution to handle a specific event or request from hardware or
software. The interrupt process involves several steps:

Interrupt Types:

● Hardware Interrupts: Generated by external hardware devices to signal events


such as I/O completion or errors.
● Software Interrupts: Triggered by software, often in response to system calls or
exceptions.

Interrupt Process:
Interrupt Request (IRQ): An external device or software generates an interrupt
request, signaling the CPU to stop its current execution.
Interrupt Acknowledgment: The CPU acknowledges the interrupt request and
temporarily suspends its current task.

Interrupt Vector Table: The CPU uses an interrupt vector table to determine the
address of the interrupt service routine (ISR) associated with the specific
interrupt type.

Save Current State: The CPU saves the current state of the program, including the
program counter and registers, to return to it after handling the interrupt.

Execute ISR: The CPU jumps to the address specified by the interrupt vector table,
executing the ISR that handles the specific interrupt.

Interrupt Service: The ISR performs the necessary actions to handle the interrupt,
such as processing I/O, updating data structures, or responding to software
requests.

Restore State: After completing the ISR, the CPU restores the saved state, allowing
the interrupted program to resume its execution.

Return from Interrupt (RFI): The CPU executes a return from interrupt instruction
to resume the program from the point where it was interrupted.

3. Magnetic Disk:

A magnetic disk is a storage device that uses magnetic patterns to store and

retrieve digital information. It is a non-volatile secondary storage medium widely

used in computers for long-term data storage.

Components:

● Platters: Circular, flat disks coated with a magnetic material where data is
stored.
● Read/Write Heads: Positioned above and below each platter, these heads read
and write data by magnetizing or sensing the magnetic patterns on the platters.
● Spindle: The spindle rotates the platters at a constant speed.
● Actuator Arm: Positioned on the side of the disk, the actuator arm positions the
read/write heads over the desired track.

Operation:

Read Operation: The read/write heads position themselves over the desired track,
and the platter rotates until the data sector is under the heads. The heads sense
the magnetic field, converting it into electrical signals for data retrieval.
Write Operation: To write data, the read/write heads magnetize the surface of the
platter to store binary information.
Access Time: The time taken to position the heads over the desired track (seek
time) and the time for the platter to rotate to the correct sector (rotational latency)
contribute to the access time.
Storage Capacity: Magnetic disks offer high storage capacities and are suitable for
storing large amounts of data, applications, and the operating system.

4. Memory Hierarchy:

Memory hierarchy refers to the organization and arrangement of different types

of computer memory with varying access speeds, capacities, and costs. The

memory hierarchy is designed to provide a balance between speed and cost-

effectiveness.

Levels of Memory:

Registers: Located within the CPU, registers are the fastest and smallest type of
memory. They store data directly accessible by the CPU.
Cache Memory: Cache memory is a small-sized type of volatile computer memory
that provides high-speed data access to the processor and stores frequently
used computer programs, applications, and data.

RAM (Random Access Memory): RAM is volatile memory used by the computer's
operating system, applications, and active data during execution. It provides fast
read and write access.

Virtual Memory: A portion of the computer's hard disk that serves as additional
RAM when the physical RAM is full. It is slower than RAM but expands the
effective memory capacity.

Secondary Storage: Non-volatile memory such as hard drives, SSDs, and optical
drives. It provides long-term storage for the operating system, applications, and
user data.

Principles:

● Temporal Locality: Refers to the tendency of a program to access the same


memory locations repeatedly in a short time.
● Spatial Locality: Refers to the tendency of a program to access memory
locations that are close to each other.
Q3.

CPU Protection:
CPU protection ensures that, a process does not monopolize the CPU indefinetely, as it
would prevent other processes from being executed. Each process should get a limited
time, so that every process gets time to execute it’s instructions. To address this, a
timer is used to limit the amount of time, which a process can occupy from the CPU.
After the timer expires, a signal is sent to the process for relenquishing the CPU. Hence
one process cannot hold the CPU forever.

Memory Protection:
In memory protection, we are talking about that situation when two or more processes
are in memory and one process may access the other process memory. To prevent this
situation we use two registers which are known as: 1. Base register 2. Limit register
So basically Base register store the starting address of program and limit register store
the size of the process. This is done to ensure that whenver a process wants to access
the memory, the OS can check that – Is the memory area which the process wants to
access is previliged to be accessed by that process or not.

I/O Protection:
With I/O protection, an OS ensures that following can be never done by a processes:
1. Termination I/O of other process – This means one process should not be able to
terminate I/O operation of othe processes.
2. View I/O of other process – One process should not be able to access the data
being read/written by other processes from/to the Disk(s).
3. Giving priority to a particular process I/O – No process must be able to priorotize
itself or other processes which are doing I/O operations, over other processes.

Q4.

When our computer is switched on, it can be started by hardware such as a button
press, or by software command, a computer's central processing unit (CPU) has no
software in its main memory, there is some process which must load software into main
memory before it can be executed. Below are the six steps to describe the boot process
in the operating system, such as:

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

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

For example, if the boot device sequence is:

● Floppy Disk
● Hard Disk

● CDROM

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

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

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


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

Step 6: The last file is to be loaded and executed is the AUTOEXEC.BAT file that
contains a sequence of DOS commands. After this, the prompt is displayed. We can
see the drive letter of bootable drive displayed on the computer system, which indicates
that the operating system has been successfully on the system from that drive.

______________________________________________________________________

You might also like