ESSENTIALS OF INFORMATION TECHNOLOGY BESC104E/204E
Operating Systems: The History of Operating Systems, Operating System Architecture, Coordinating the
Machine’s Activities, Handling Competition Among Processes, Security.
Algorithms: The Concept of an Algorithm, Algorithm Representation, Algorithm Discovery.
Textbook 1: Chapter-3, Chapter-5 (5.1-5.3)
Dept Of CSE(BLDEACET) pg. 1
ESSENTIALS OF INFORMATION TECHNOLOGY BESC104E/204E
2.1 Operating Systems
2.1 Definition of Operating system (OS) :
An operating system is the software that controls the overall operation of a computer. It
provides the means by which a user can store and retrieve files, provides the interface by which
a user can request the execution of programs, and provides the environment necessary to
execute the programs requested.
OS A program that acts as an intermediary between a user of a computer and the computer
hardware
Ex: Windows , UNIX, etc.
2.2 The History of Operating Systems
a) Early Computers (1940s–1950s):
Computers were large and inefficient; setup was manual and time-consuming.
Program execution (called a job) involved:
o Mounting tapes
o Loading punched cards
o Flipping switches
Users signed up for time slots and had full control of the machine during their session.
b) Batch processing
Operating systems began as tools to simplify program setup and job transitions. A computer operator
handled job submissions, loading programs and data into mass storage. The OS executed these jobs one
at a time without user interaction, marking the start of batch processing—processing jobs in groups
(batches) automatically.
the execution of jobs by collecting them in a single batch, then executing them without further
interaction with the user is called Batch Processing
Dept Of CSE(BLDEACET) pg. 2
ESSENTIALS OF INFORMATION TECHNOLOGY BESC104E/204E
c) Interactive processing
new operating systems were developed that allowed a program being executed to carry on a dialogue
with the user through remote terminals—a feature known as interactive processing (Figure 3.2). (A
terminal consisted of little more than an electronic typewriter by which the user could type input and
read the computer’s response that was printed on paper.
Disadvantages: For interactive processing to be effective, the computer must respond quickly to the
user's actions.
D) Real-time processing
The computer is forced to execute tasks under a deadline, a process that became known as real-
time processing in which the actions performed are said to occur in real-time. A computer performs a
task in real time means that the computer performs the task in accordance with deadlines in its
(external real-world) environment
E) Time-sharing:
Many people needed to use one computer at the same [Link] computer gave each user
a small amount of time in [Link] happened so fast that everyone felt the
computer was responding to them instantly.
F) Multiprogramming:
The computer ran part of one job, then quickly moved to [Link] repeated this cycle for all
users’ [Link] made it seem like many programs were running at once, even on one machine.
Dept Of CSE(BLDEACET) pg. 3
ESSENTIALS OF INFORMATION TECHNOLOGY BESC104E/204E
Model QP: With block diagrams, distinguish between Batch processing and Interactive processing in
operating systems
( refer for block diagram above fig 3.1 and 3.2)
Batch Processing Interactive Processing
Users interact with the system while processes
Jobs are collected and executed in batches.
run.
Requires continuous user input and quick system
No user interaction during execution.
responses.
Low response time is essential for good user
High turnaround time but efficient for large tasks.
experience.
Suitable for real-time, command-line, or GUI-
Suitable for long, repetitive, or data-heavy jobs.
based tasks.
Examples: payroll processing, billing, data Examples: web browsing, text editing, online
analysis. transactions.
3.2 Operating System Architecture
Software & its types:
A Software is defined as set of programs. It is divided into two broad categories: application
software and system software
Application software consists of the programs for performing tasks particular to the machine’s
utilization. Examples of application software include spreadsheets, database systems, desktop
publishing systems, accounting systems, program development software, and games.
System software performs those tasks that are common to computer systems. System software
manage and control the hardware components of a computer and provide a platform for
running application software System software are two categories: operating system itself and
the other consists of software units collectively known as utility software.
Dept Of CSE(BLDEACET) pg. 4
ESSENTIALS OF INFORMATION TECHNOLOGY BESC104E/204E
Q. List the components of a typical operating system and summarize the role of each in a
single phrase. Or
QExplain how different components of an operating system cooperate to manage hardware and
software resources efficiently (from Model QP)
User Interface:
The part of the operating system that allows users to interact with the computer.
Older systems used text-based interfaces (shells), while modern systems use Graphical
User Interfaces (GUIs), which display icons and allow actions via a mouse or touch.
Users can interact with GUIs using input devices like a mouse, stylus, or touch screen.
Some advanced systems even research 3D and sensory interfaces.
Kernel:
The core part of the operating system that handles essential functions.
It includes several key components like the file manager, device drivers, and memory
manager, which help coordinate tasks like storing files, managing hardware, and
controlling memory.
File Manager:
Manages files on mass storage devices, keeping track of where each file is stored, who
can access them, and how much space is available.
Files can be organized into directories and subdirectories, forming a directory path.
The file manager controls access to files, ensuring that only authorized requests are
granted.
Device Drivers:
These are software components that communicate with hardware devices (like printers,
monitors, etc.).
Each device has a specific driver that translates commands from the OS into the device's
specific language, so the OS doesn’t need to know the technical details of how each
device works.
Memory Manager:
Manages the computer’s main memory (RAM), ensuring each program gets enough
memory and that they don’t interfere with each other.
Dept Of CSE(BLDEACET) pg. 5
ESSENTIALS OF INFORMATION TECHNOLOGY BESC104E/204E
In multitasking environments, the memory manager may use paging to move data
between memory and storage, creating the illusion of more memory than physically
available (virtual memory).
Scheduler and Dispatcher:
Scheduler decides which tasks should be executed next in a multiprogramming system.
Dispatcher allocates time to these tasks, ensuring they run efficiently without
overlapping or crashing the system.
Q. What is virtual memory?
When a computer needs more memory than it actually has, the memory manager uses a trick
called paging to make it seem like there is more memory. For example, if a program needs 8GB
of memory but the computer only has 4GB, the memory manager sets aside extra space on
mass storage. It divides the program’s data into small pieces called pages and moves them back
and forth between mass storage and main memory. Only the pages needed at the moment
stay in main memory. This creates a “fake” larger memory called virtual memory, allowing the
computer to work as if it really has 8GB.
Q. Summarize the booting procedure
When a computer is turned on, its main memory is empty because it is made of volatile
memory that loses data when the power is off. But the computer still needs a program in memory
right away to start working—specifically, it needs to load the operating system.
To solve this, computers have a small part of memory made from nonvolatile memory, called
ROM (Read-Only Memory). ROM keeps its contents even when the computer is turned off.
Dept Of CSE(BLDEACET) pg. 6
ESSENTIALS OF INFORMATION TECHNOLOGY BESC104E/204E
Inside ROM is a small, permanent program called the boot loader.
Here’s what happens during the boot process:
1. The CPU starts at a fixed memory address and automatically runs the boot loader stored
in ROM.
2. The boot loader copies the operating system from a predetermined location in mass
storage into main memory.
3. After the operating system is loaded, the boot loader hands control over to it.
4. The operating system then begins managing the computer and allows users to open
applications and utilities.
Dept Of CSE(BLDEACET) pg. 7
ESSENTIALS OF INFORMATION TECHNOLOGY BESC104E/204E
Model QP: Distinguish between time-sharing and multitasking systems
Multi-tasking Operating System Time-sharing Operating System
The operating system that can run more Time sharing is technique in which many
than one task at a time is called a people working at different terminals use the
multitasking operating system. particular computer system at same time
The processor time is shared between
The processor time is shared between multiple
different tasks based on the time-sharing
users
concept.
It is an operating system that runs more than
It is a type of time-sharing Operating System
one program in a single CPU parallel.
It is less efficient than the time-sharing
It is comparatively more efficient
operating system
It requires large storage to work on a time- Integration of multi-programming reduces the
sharing basis. storage need
Example
Online ticket booking systems
Example:
Smartphones running background apps. Multiple customers accessing the same
backend server.
3.3 Coordinating the Machine’s Activities
Program: A static set of instructions stored on disk is called Program.
Process: Dynamic execution of set of instructions is called Process. The activity of executing a
program is controlled by operating system.
Process State: This represents the current activity of a process in an operating system
Process Administration:
Model QP: Define process in operating systems. Explain the roles of the scheduler and dispatcher in
process management within operating system
Scheduler
The scheduler is responsible for managing all processes in the operating system. It maintains the process
table, adds new processes when programs are started, removes processes that finish, and records
Dept Of CSE(BLDEACET) pg. 8
ESSENTIALS OF INFORMATION TECHNOLOGY BESC104E/204E
whether each process is in the ready or waiting state. Its role is to organize and track all active processes
in the system.
Process Table
The process table is a data structure in main memory that stores essential information about every
active process. Each entry includes the memory allocated to the process, its priority, and its current
state (ready or waiting). The scheduler uses this table to manage and monitor process activity efficiently.
Dispatcher
The dispatcher oversees the actual execution of processes by assigning each one a short time slice. It
performs context switches, allowing the CPU to alternate between processes. When a process’s time
slice ends, the dispatcher selects the next highest-priority ready process to run, ensuring fair and
efficient CPU usage.
Difference between Program and Process.
Program Process
A program is a static set of instructions stored
A process is a dynamic execution of a program.
on disk.
It is passive and does not use system resources It is active and uses CPU, memory, and other
until executed. resources.
Exists as a running activity in the operating
Exists as a file (e.g., .exe, .py).
system.
Has a process state (program counter, registers,
Does not have a state.
memory, etc.).
Difference between Scheduler and Dispatcher.
Scheduler Dispatcher
Decides which process should run next. Actually runs the selected process on the CPU.
Maintains the process table and process Assigns time slices and performs context
states. switching.
Focuses on decision-making. Focuses on execution and control transfer.
Adds new processes and removes completed
Handles interrupts and restores process state.
ones.
Dept Of CSE(BLDEACET) pg. 9
ESSENTIALS OF INFORMATION TECHNOLOGY BESC104E/204E
3.4 Handling Competition among Processes
An operating system must allocate various resources—such as peripheral devices, files, memory, and
CPU time. This is called Resource Allocation. Improper Allocation of resources will cause problem.
Therefore, the OS must use reliable algorithms to handle all possible situations.
Example: The computer has only one printer, so the operating system must make sure that only
one process uses it at a time. To do this, the OS keeps a flag (a bit in memory) that shows
whether the printer is free (0) or busy (1).
At first, this seems easy:
If the flag is clear → give the printer to the process and set the flag
If the flag is set → make the process wait
When a process finishes → clear the flag or give the printer to a waiting process
If flag is set incorrectly there will be problem, which is solved using Semaphore
Semaphore:
A semaphore is a tool used in operating systems to control which process can use a shared resource
(like a printer).It makes sure that only one process uses the resource at a time.
A semaphore is like a signal that says:
“Resource free” → value 1
“Resource busy” → value 0
Critical Region: A sequence of instructions that should be executed by only one process at a
time. Such a sequence of instructions is called a critical region.
Mutual Exclusion: The requirement that only one process at a time be allowed to execute a
critical region is known as mutual exclusion.
To enter the critical region, a process must find the semaphore = 0 and then set the
semaphore=1 before entering the critical region; then upon exiting the critical region, the
process must clear the semaphore.
Deadlock
Deadlock is a situation where two or more processes cannot continue because each process is
waiting for a resource held by another process
Example:
1st process may have access to the computer’s printer but be waiting for access to the computer’s CD
player, while 2nd process has access to the CD player but is waiting for the printer
Dept Of CSE(BLDEACET) pg.
10
ESSENTIALS OF INFORMATION TECHNOLOGY BESC104E/204E
Model QP: Explain the necessary conditions for deadlock to occur. How to avoid
the deadlock?
Deadlock occurs if all three of the following conditions are satisfied:
1. There is competition for Non-sharable resources.
2. The resources are requested on a partial basis; that is, having received some resources, a process will
request and wait for more resources. It is called HOLD and WAIT
3. Once a resource has been allocated, it cannot be forcibly taken. it is called No Pre-emption
Methods to handle Deadlocks:
Deadlock detection and correction schemes :
The deadlock problem can be removed by preventing any one of the three conditions:
Techniques that prevent the occurrence of third condition fall is known as deadlock detection
and correction schemes. Here the approach is to detect deadlock and then correct it by forcibly
taking back the allocated resources from .
Deadlock Avoidance Schemes:
Techniques that attack the first two conditions are known as deadlock avoidance schemes.
To avoid deadlock, we can break the rules that cause [Link] easy ideas are:
i). Ask for all resources at once
Instead of asking for resources one by one, a process asks for everything it needs in a single
request.
If all resources are free → the process runs.
If not → it waits.
This avoids circular waiting.
Dept Of CSE(BLDEACET) pg.
11
ESSENTIALS OF INFORMATION TECHNOLOGY BESC104E/204E
ii) Make resources sharable
Some resources cause deadlock because only one process can use them at a time (non-sharable).
If we change them so that many processes can use them together, then no one gets stuck
waiting.
Spooling:
Spooling is the process in which the operating system stores output data (like print jobs) in a
temporary storage area so that the actual device (like a printer) can use it later when it
becomes free.
How spooling works (simple steps)
When a process asks for the printer, the OS says “OK”.
But instead of sending the output directly to the printer,
the OS sends the process’s printing data to a file in mass storage (like a queue).
The process thinks it is printing normally and continues working.
Later, when the real printer becomes free,
the OS takes the stored data (the print job) and prints it.
3.5 Security
The operating system (OS) controls all activities in a computer. So OS must be secure .Security
problems happen in two main ways:
1. Attacks from outside (unauthorized people trying to get in)
2. Attacks from inside (someone already inside misusing access)
Attacks from outside (unauthorized people trying to get in):
In this Security problems often happen because users:
Choose easy passwords
Share passwords
Don’t change passwords
Move storage devices carelessly
Install unapproved software
Attacks from inside (someone already inside misusing access):
Dept Of CSE(BLDEACET) pg.
12
ESSENTIALS OF INFORMATION TECHNOLOGY BESC104E/204E
An intruder may try to:
Access files they should not see
Use more memory than allowed
Modify system data
Protection: To keep the data Secure , CPU works in two modes:
1. Privileged mode → can execute all instructions
2. Nonprivileged mode → limited instructions, where user can access all data. hence data
is safe.
Distinguish between Batch processing and Interactive processing in operating systems.
Batch Processing Interactive Processing
Users interact with the system while processes
Jobs are collected and executed in batches.
run.
Requires continuous user input and quick system
No user interaction during execution.
responses.
Low response time is essential for good user
High turnaround time but efficient for large tasks.
experience.
Suitable for real-time, command-line, or GUI-
Suitable for long, repetitive, or data-heavy jobs.
based tasks.
Examples: payroll processing, billing, data Examples: web browsing, text editing, online
analysis. transactions.
Module 2 - Second Part
Dept Of CSE(BLDEACET) pg.
13
ESSENTIALS OF INFORMATION TECHNOLOGY BESC104E/204E
Algorithms: The Concept of an Algorithm, Algorithm Representation, Algorithm Discovery.
An Informal Review
An algorithm is a clear and finite set of steps used to complete a task or solve a problem, whether in
daily life or in computing.
Example 1 from computing:
The machine cycle executed by the CPU is essentially a basic algorithm comprising the repeated
processes of fetching, decoding, and executing instructions.
Example 2 from daily Life: un-shelling peanuts
a. Take a pea from the basket.
b. Break open the pea pod.
c. Dump the peas from the pod into the bowl.
d. Discard the pod.
Formal Definition of an Algorithm
An algorithm is an ordered, unambiguous, executable set of steps that defines a terminating
process.
Requirements of Algorithm
Steps in algorithm must be effective and unambiguous (meaningful)
Algorithm should contain steps to end the execution of task i.e terminating process
The Abstract Nature of Algorithms
An algorithm is abstract (general form rather than a specific form.). A single algorithm can be
represented in many ways.
Ex: Algorithm for converting temperature readings from Celsius to Fahrenheit is represented as the
1. algebraic formula: F = (9 ⁄5) C + 32
2. But it could be represented by the instruction :
“Multiply the temperature reading in Celsius by 9 ⁄5 and then add 32 to the product”
Therefore an algorithm here in 1 and 2 is same , but its representation differs .
Program : A program is the representation of an algorithm,
Process: A process is the activity of executing an algorithm
Dept Of CSE(BLDEACET) pg.
14
ESSENTIALS OF INFORMATION TECHNOLOGY BESC104E/204E
5.2 Algorithm Representation
The representation of an algorithm requires some form of language.
Primitives: Computer science approaches these problems by establishing a well-defined set of building
blocks from which algorithm representations can be constructed. Such a building block is called a
primitive.
Programming language: A collection of primitives along with a collection of rules stating how the
primitives can be combined to represent more complex ideas constitutes a programming language.
Syntax & Semantics: Each primitive has its own syntax and semantics. Syntax refers to the primitive’s
symbolic representation; semantics refers to the meaning of the primitive.
Model QP(3b): Explain pseudo code representation of an algorithm with a suitable example.
Pseudocode:
A pseudocode is a notational system in which ideas can be expressed informally during the algorithm
development process
It is not a real programming language, but a way to write the logic of a program clearly and
understandably before coding.
Notation used for Different Statements in Pseudo code:
1. Assignment: Assigning or storing a computed value into a variable.
2. STRUCTURE OF Conditional statement:
a) IF ELSE :
if (condition):
activity
else:
activity
Example: if (year is leap year):
daily total = total / 366
else:
daily total = total / 365
b) IF :
if (condition):
Activity
Example: if (sales have decreased):
lower the price by 5%
3. Structure of WHILE:
Dept Of CSE(BLDEACET) pg.
15
ESSENTIALS OF INFORMATION TECHNOLOGY BESC104E/204E
While (condition): Activity
Example: while (tickets remain to be sold):
sell a ticket
4. A function:
Example 1: Pseudo code for addition of two numbers
BEGIN
INPUT value A
INPUT value B
RESULT ← A + B
OUTPUT RESULT
END
5.3 Algorithm Discovery
The development of a program consists of two activities—
Discovering the underlying algorithm and
Representing that algorithm as a program
The Art of Problem Solving:
Mathematician G. Polya in 1945 defined the basic principles for artistic nature of problem solving .These
basic principles are:
Phase 1. Understand the problem.
Phase 2. Get an idea of how an algorithmic function might solve the problem.
Phase 3. Formulate the algorithm and represent it as a program.
Phase 4. Evaluate the program for accuracy.
The Foot-in-the-Door Concept: means to understand the problem and develop Suitable
accurate solution for it. The idea of "getting your foot in the door" is central to problem solving.
This is the first step to identify problem and give solution.
Problem-Solving Approaches:
Stepwise Refinement: Stepwise refinement involves breaking a problem down into
smaller, more manageable sub problems. There are two types: top down and Bottom-Up
Dept Of CSE(BLDEACET) pg.
16
ESSENTIALS OF INFORMATION TECHNOLOGY BESC104E/204E
i) In a top-down approach where the overall problem is decomposed into smaller
tasks. Strategy is to work from input to output.
ii) In bottom up, One strategy is to work backward from the desired output to the
initial input.
Solving Related Problems: Another approach is to apply the solution of a simpler or
related problem to the current one..
Example 1 : Pseudo code for addition of two numbers
BEGIN
INPUT value A
INPUT value B
RESULT ← A + B
OUTPUT RESULT
END
Example 2: Algorithm for Euclidean
START
INPUT X, Y
WHILE X ≠ 0 AND Y ≠ 0
IF X > Y THEN
X ← X mod Y
ELSE
Y ← Y mod X
ENDWHILE
IF X = 0 THEN
GCD ← Y
ELSE
GCD ← X
OUTPUT GCD
END
Dept Of CSE(BLDEACET) pg.
17