University of Mines and Technology
Operating Systems and Systems
Programming
Course Instructor
Mrs Ivy Botchway Essandoh
(PhD) 1
Lesson 1: Introduction to Operating Systems
Lesson 2: Operating System Architecture and
Interrupt Architecture
Lesson 3:Processes, Threads, Synchronization and
Protection Issues
Course Lesson 4: CPU Scheduling and Memory
Outline
Management
Lesson 5: Input-Output Architecture and Device
Management
Lesson 6: File Systems and Multitasking
Lesson 7: Advanced Topics
2
❑ Doeppner T. W. (2010), “Operating
Systems in Depth”, 462 pp.
❑ Matthews,S. J., Newhall, T. and Webb, K.
C. (2022), Dive Into Systems: A Gentle
Introduction to Computer Systems,
Octal Publishing, LLC, 814 pp.
Reference
Materials ❑ Comer, D. (2015), Operating System
Design: The Xinu Approach, 2nd Edition,
Chapman and Hall/CRC., 694 pp.
3
Course Assessment
Factor Weight Location Date
Attendance 10 % In class Random
Grading System
Quizzes (2) 15% In class DTBA
Participation 5% In class TBA
Assignments 10% - TBA
Final Exam 60 % TBA TBA
4
Attendance
• Attendance is mandatory for every student;
• Attendance shall be taken at random;
• The only acceptable excuse for absence is the one authorized by
the Dean of Students.
• A student can also ask permission from Me with a tangible reason.
• A student who misses all the five random attendances marked
WOULD not be allowed to take the final exams.
5
Introduction to Operating
Systems
6
What you will learn
In this lecture
We’ll learn about:
• Operating systems and their importance
• Functions of operating systems
• Tasks Performed by the OS
• Evolution of operating systems
• Types of operating systems
7
Why study Operating Systems?
Abstraction
• Abstraction simplifies the interaction between hardware and software. It allows
the complex hardware and software resources to be presented in a simpler,
more manageable form for users and applications.
Resource Management
• At the hardware level resources are typically dedicated. There is the efficient
and effective allocation, utilization, and recycling of system resources such as
CPU time, memory, file storage, and input/output devices.
Performance Analysis and Contention Resolution
• The OS ensures the system operates efficiently under various workloads and
minimizes bottlenecks caused by resource contention. Contention arises from
resource sharing and can be resolved through queuing, or prioritization.
Computer System Design
• How much emphasis is placed on reliability? Performance? Cost?
Maintainability?
8
What is an Operating System?
• Operating systems (OS) are the most important type of system
software, as they provide the foundational framework for all other
software and applications to run on the computer.
• An operating system is a program that controls the execution of
application programs, and acts as an interface between applications
and the computer hardware.
• It can be thought of as having three objectives:
✓ Convenience
✓ Efficiency
✓ Ability to evolve
9
Operating Systems
• OS manages computer resources, such as memory and processing
power, and provides a user interface for users to interact with the
system.
• It also manages secondary memory and I/O (input/output) devices on
behalf of its users.
• It controls and keeps a record of the execution of all other programs
that are present in the computer, including application programs and
other system software.
10
The Operating System as a User/Computer
Interface
• The hardware and software used in providing applications to a user
can be viewed in a layered fashion. The OS masks the details of the
hardware from the programmer, and provides the programmer with a
convenient interface for using the system. It acts as a mediator, making
it easier for the programmer and application programs.
11
The Operating System as Resource Manager
• The OS is responsible for controlling the use of a computer’s resources, such as
I/O, main and secondary memory, and processor execution time. During
program execution, the OS decides how processor time is to be allocated and
which computer resources are available for use.
• The OS decides when an I/O device can be
used by a program in execution, and controls
access to and use of files.
• The processor itself is a resource, and the OS
must determine how much processor time is to
be devoted to the execution of a particular user
program.
12
Why are Operating Systems Used?
The Operating System handles the following responsibilities:
✓ It controls all the computer resources.
✓ It coordinates the execution of user programs.
✓ It provides resources for user programs.
✓ It provides an interface (virtual machine) to the user.
✓ It hides the complexity of software.
✓ It supports multiple execution modes.
✓ It monitors the execution of user programs to prevent errors.
13
Role of the Operating System in a Computing
Environment
• An Operating System is the first program that runs when a
typical computer is turned ON, and the last one to finish
running when a computer is turned OFF.
• It manages the hardware and software resources of the
computer system, often invisibly. These include the processor,
memory, disk drives, etc.
• It provides a simple, consistent way for applications to interact
with the hardware without having to know all the details of the
hardware.
14
Tasks Performed by the OS
The main functions of operating systems are as follows:
• Resource Management: The operating system manages and
allocates memory, CPU time, and other hardware resources
among the various programs and processes running on the
computer.
• Process Management: The operating system is responsible for
starting, stopping, and managing processes and programs. It
also controls the scheduling of processes and allocates
resources to them.
15
Tasks Performed by the OS
The main functions of operating systems are as follows:
• Memory Management: The operating system manages the
computer’s primary memory and provides mechanisms for
optimizing memory usage.
• Security: The operating system provides a secure environment
for the user, applications, and data by implementing security
policies and mechanisms such as access controls and
encryption. 16
Tasks Performed by the OS
The main functions of operating systems are as follows:
• File Management: The operating system is responsible for
organizing and managing the file system, including the creation,
deletion, and manipulation of files and directories.
• Device Management: The operating system manages
input/output devices such as printers, keyboards, mice, and
displays. It provides the necessary drivers and interfaces to
enable communication between the devices and the computer. 17
Services Provided by an Operating System
Operating System provides certain services to users which can be
listed as:
• User Interface: Almost all operating systems have a user
interface (UI). This interface can take several forms. One is a
command-line interface (CLI), which uses text commands and a
method for entering them. Another is a batch interface, in which
commands and directives to control those commands are
entered into files, and those files are executed. Most commonly,
a graphical user interface (GUI) is used.
18
Services Provided by an Operating System
• Program Execution: The Operating System is responsible for
the execution of all types of programs whether it be user
programs or system programs.
• Handling Input/Output Operations: The Operating System is
responsible for handling all sorts of inputs, (from the keyboard,
mouse, etc) and outputs (printer, projector, speaker, etc).
• Manipulation of File System: The Operating System is
responsible for making decisions regarding the storage of all
types of data or files, i.e., floppy disk/hard disk/pen drive
19
Services Provided by an Operating System
• Resource Allocation: The Operating System ensures the proper use
of all the resources available by deciding which resource to be used
by whom for how much time. All decisions are taken by the OS.
• Accounting: The Operating System tracks an account of all the
functionalities taking place in the computer system at a time. Details
such as the types of errors that occurred are recorded by the OS.
• Information and Resource Protection: The Operating System is
responsible for using all the information and resources available on
the machine in the most protected way.
20
Services Provided by an Operating System
• Communication: The OS implements communication between
one process to another process to exchange information. Such
communication may occur between processes that are
executing on the same computer or between processes that are
executing on different computer systems tied together by a
computer network.
• System Services: The operating system provides various system
services, such as printing, time and date management, and
event logging.
21
Evolution of Operating Systems
First Generation of Computers (Serial Processing)
• Time Period: The late 1940s and mid 1950s.
• Size and Cost: The early computers were huge and costly.
• Basic Functions: Despite their size and cost, they could only do
simple tasks.
• No OS: These computers were run from a console consisting of
display lights, toggle switches, some form of input device, and a
printer.
• Serial Processing: One task is finished before starting the next.
22
Evolution of Operating Systems
Second Generation of Computers (Batch Operating System)
• Time Period: Developed in the mid 1950s to 1960s by General
Motors for use on an IBM 701.
• In a batch system, tasks (or jobs) are grouped into batches and then
processed sequentially without any user interaction. The goal was to
automate the processing of jobs and minimize the setup time.
• A scripting language, Job Control Language (JCL), was introduced
to manage these batches. It allows operators to specify the sequence
of jobs to be executed.
23
Evolution of Operating Systems
Third Generation Operating System (Multiprogrammed Batch OS)
• Multiprogramming allows multiple jobs to reside in the main
memory at once.
• Since multiple jobs are done at once, there was a need for more
advanced memory management and it is important to decide
which job to execute first, second, or last.
24
Evolution of Operating Systems
Third Generation Operating System
• The complexity of the OS was increased, and system utilities were
developed to help manage files, devices, and other system
resources.
• Operating systems were accompanied by hardware like ICs, which
allowed for smaller, faster, and more reliable computers.
25
Evolution of Operating Systems
Third Generation Operating System
26
Evolution of Operating Systems
Uniprogramming Multiprogramming
Processor use 20% 40%
Memory use 33% 67%
Disk use 33% 67%
Printer use 33% 67%
Elapsed time 30 min 15 min
Throughput 6 jobs/hr 12 jobs/hr
Mean response time 18 min 10 min
27
Evolution of Operating Systems
Fourth Generation Operating System
• Graphical User Interface that allows users to interact with the
system using icons, and menus.
• Ability to run multiple applications simultaneously.
• Built-in capabilities to connect to and function on networks,
including the Internet.
• Automatically recognize and configure hardware devices.
• Advanced security mechanism to protect against malware,
unauthorized access.
• Compatibility with a wide range of hardware devices and
architecture. 28
Reasons for Evolution of Operating Systems
A major OS will evolve over time for a number of reasons:
• Hardware upgrades plus new types of hardware: Early versions of
some OS did not employ a paging mechanism. Subsequent
versions were modified to exploit paging capabilities. Also, the use
of graphics terminals and page-mode terminals instead of line-at-
a-time scroll mode terminals affects OS design.
• New services: In response to user demand, the OS expands to offer
new services.
• Fixes: OS has faults. These are discovered over the course of time
and fixes are made. 29
Types of Operating Systems
Multi Tasking
Network Distributed
Operating
Operating Operating
System
System System
Real Time Time Sharing
Simple Batch Operating Operating
Operating System System
System
Multi
Multi Processing
Programming Operating
Batch Operating System
System
30
Simple Batch Operating System
• In the 1970s, Batch processing was viral. In this technique,
similar types of jobs were batched together and executed in
time.
• In the Batch operating system, access is given to more than one
person; they submit their respective jobs to the system for
execution.
• The system puts all of the jobs in a queue on the basis of first
come, first serve and then executes the jobs one by one. The
users collect their respective output when all the jobs get
executed. 31
Simple Batch OS
Batch
Job1
Jobs
Job2
The purpose of this operating
system was mainly to transfer control Job3
from one job to another as soon as
the job was completed. Job4
It contained a small set of programs
called the resident monitor that Monitor
always resided in one part of the Operating System
main memory.
Hardware
The remaining part is used for
servicing jobs.
32
Advantages of Batch OS
• 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.
33
Advantages of Batch OS
• Simplified Management: They restructure job management by
automating the submission, scheduling, and implementation of
tasks.
• Cost Efficiency: By producing well-organized use of resources
and reducing processing time and errors, batch processing
systems can be a cost-effective option.
• Scalability: These classifications can manage a huge number of
tasks, making them scalable and appropriate for large
organizations with significant data processing needs.
34
Disadvantages of Batch OS
• Limited functionality: A batch operating system can solve only
simple tasks not solve more complex tasks. This can make them
difficult to use for certain tasks, like managing files or software.
• Security issues: Batch operating systems are not more secure
because they are not typically used for day-to-day tasks, so they
are not as secure as more common operating systems.
• Inefficiency: Batch systems are often slow and difficult to use,
which can lead to inefficiency in the workplace.
35
Multiprogramming Operating System
• Multiprogramming is an extension to batch processing where
the CPU is always kept busy. Each process needs two types of
system time: CPU time and IO time.
• In a multiprogramming environment, when a process does its
I/O, the CPU can start the execution of other processes.
Therefore, multiprogramming improves the efficiency of the
system.
36
Advantages of Multiprogramming OS
• Response time is reduced.
• 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.
• Since several jobs are being processed in parallel, significantly more
tasks could be completed within a certain amount of time, thus
enhancing the overall throughput of the system.
• 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. 37
Disadvantages of Multiprogramming OS
• Provides an environment in which various systems resources are used
efficiently, but they do not provide any user interaction with the
computer system.
• Increases system complexity, as the operating system needs to
manage multiple processes, memory management, and scheduling.
• It requires more memory compared to less sophisticated operating
systems because multiple programs run in memory simultaneously.
• The operating system has to switch between the running processes
continuously, and this leads to scheduling overhead and reduces
performance. 38
Multiprocessing Operating System
• In Multiprocessing, Parallel computing is achieved. There are
more than one processors present in the system which can
execute more than one process at the same time. This increases
the throughput of the system.
• In multiprocessing, several processors execute procedures in
collaboration. You can even split a procedure into parts that run
in parallel.
• Since several processors work concurrently, more tasks are
completed faster.
39
Multiprocessing Operating System
• Multiprocessing enhances the speed at which the system
executes since tasks scatter the processors, minimizing the
waiting period for procedures.
• If one processor is faulty, the others will continue running, hence
enhancing system reliability.
• Such an operating system is suited for highly computationally
intensive environments needing high processing power, for
example, scientific simulations, real-time data processing, and
server environments
40
Advantages of Multiprocessing OS
• Increased Reliability: Because multiple processors are present, if one
fails, others may take over it, thus stabilizing the system.
• 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.
• Efficient Resource Utilization: It acts more productively upon the
utilization of resources like CPU, memory, and I/O devices.
• Parallelism: Many processes can run parallel, which increases the
speed of execution to a large extent.
• Scalability: As the workload increases, more processors can be added
to enhance performance.
41
Disadvantages of Multiprocessing OS
• Complexity: There is a rise in the complexity of the system while
dealing with a number of processors and proper distribution of tasks.
• Increased Cost: Hardware equipment added in multiprocessing
systems increases their cost
• Communication Overhead: Generally, communication among
processors results in overhead and provides a slight reduction in
efficiency.
• Software Compatibility Problems: Generally, most software is not
designed to operate properly with multiprocessing systems.
42
Multitasking Operating System
• Multitasking OS provides a user with the ability 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 use of the CPU because it shifts between tasks
quickly; hence, it seems that they are running parallel.
• There are multitasking systems in almost all personal computers,
for example, a user might run a web browser, a music player,
and a document editor all at once.
43
Advantages of the Multitasking OS
• This system can handle multiple users or tasks at once; therefore, it is
best utilized in multi-user environments.
• The memory is allocated dynamically and efficiently to various tasks
so that there is optimal usage of system resources.
• More applications can be run at the same time, which increases
productivity because tasks are executed concurrently.
• It provides for rapid shifts between tasks, therefore, shortening the
response time for the user.
• Because the system keeps running by switching between tasks, CPU
time and other system resources are consumed more effectively.
44
Disadvantages of Multitasking OS
• The multitasking environment makes a number of processors busier
at the same time; that is, the CPU generates more heat.
• The managing of different tasks all together requires a more
sophisticated algorithm, which becomes complex to administer.
• Running too many applications at the same time can stress the
system to a point where performance degrades.
• In this scenario, multiple tasks will be competing for the same
resources, thereby delaying them.
• Multitasking systems usually require more powerful hardware,
especially in terms of memory and processing power, to run without a
hitch. 45
Network Operating System
• This is an operating system that exists to allow computers to
communicate and share resources over a network, almost like
the backbone of networking, ensuring that different devices
(like computers, printers, and even servers) can always connect
and interact seamlessly.
• NOS allows devices not only to communicate but also to share
software applications, files, and hardware so everyone in the
network can have what they need without a complicated setup.
• Examples of network operating systems are Microsoft Windows
Server, Linux, and Novell NetWare.
46
Advantages of Network OS
• Since network applications are split between the clients and the
servers, this minimizes the total number of communications on the
network, thus increasing performance.
• Configuring NOS is less expensive than other elaborate systems since
shared resources reduce duplication needed.
• It grants centralized control over data, security, and resource
management; administrations may easily manage a large network.
• Scaling of systems can be made easily.
• It shares resources like printers, files, and applications, which reduces
hardware and software redundancy.
47
Disadvantage of Network OS
• If one node or server fails, it affects the whole system, and network
functions gets interrupted. Hence, reliability is important.
• Security needs to be robust so that unauthorized access is restricted.
• The skilled network administrators involved need to handle system
performance, security configurations, and troubleshooting.
• An attacker, once able to gain access to one server, comes close to
achieving his goal for multiple resources contained in the entire
network.
48
Real 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.
• Real-time systems are widely used in areas where timing is the issue,
for example, the manufacturing of medical equipment, automotive
controls, or even industrial automation.
• For instance, in an anti-lock braking system (ABS) in a car, the response
must come in milliseconds in order to assure safety. 49
Advantages of Real-Time OS
• There is the maximum utilization of devices and systems in a
Real-Time Operating System.
• Fast response to events.
• High reliability in the performance of time-critical operations.
• Strict scheduling ensures the predictable execution of tasks.
50
Disadvantages of Real-Time OS
• Real-time operating systems are very expensive to design.
• Real-time operating systems are very resource-intensive and
consume critical CPU cycles.
• Less multitasking support.
• Lacks adaptability to new functions.
• At times, it demands specific hardware.
51
Time-Sharing Operating System
• Time-Sharing Operating System allows multiple users to access
the system concurrently, and this occurs by allocating a small
time slice or quantum to each task.
• The CPU switches between the tasks so rapidly that the users
feel their programs have been running concurrently. This kind of
operating system is most effective in systems where multiple
users require access to the central system in real-time or near
real-time.
52
How does it work?
• Scheduling: Operating systems use scheduling algorithms in order to
allow a particular block of CPU time, referred to as a time slice, for
each user or process. After each time slice, the CPU shifts to the
following process in the queue.
• Multiprogramming: The TSOS uses multiprogramming, where several
programs are resident in the memory at any given time. This allows
several programs to be executed simultaneously.
• Context Switching: Whenever the CPU needs to switch to another task,
the operating system saves the state of the current process and loads
the state of the next process. It is a process referred to as context
switching. That lets a task be resumed exactly where it left off. 53
Advantages of Time-Sharing OS
• The time-sharing operating system facilitates effective utilization
and sharing of resources.
• This system helps decrease CPU idle and response time.
• It allows various users to access and interact with their programs
at the same time, and it leads to greater productivity.
• Time-sharing assures better memory management because it
swaps programs into and out of main memory efficiently.
54
Disadvantages of Time-Sharing OS
• Data transmission rates compared to others are very high
• The integrity and security of the user programs loaded in
memory and data have to be ensured since many users access
the system concurrently.
• With time, context switches between tasks will incur overheads,
thereby impacting the overall efficiency of the system.
55
Distributed Operating System
• Distributed Operating system is not installed on a single
machine; it is divided into parts, and these parts are loaded on
different machines.
• A part of the distributed Operating system is installed on each
machine to make their communication possible.
• Distributed Operating systems are much more complex, large,
and sophisticated than Network operating systems because
they also have to take care of varying networking protocols.
56
Advantages of Distributed OS
• The distributed operating system offers resource sharing.
• This is a fault-tolerant system.
• Scalability is achieved and easily new nodes can be added to
the system.
• Distributed task execution improves its performance.
• Parallel processing helps in increasing the speed of job
execution and enhances efficiency in getting results.
57
Disadvantages of Distributed OS
• Management of the system is complex as it works in distributed
environment.
• Security may prove difficult on multiple nodes.
• The system highly depends on network stability for it to run
without hassles.
58
Developments Leading to Modern Operating
Systems
• Modern operating systems respond to new developments in
hardware, new applications, and new security threats.
• Among the key hardware drivers are multiprocessor systems, greatly
increased processor speed, high-speed network attachments,
increasing size and a variety of memory storage devices.
• In the application arena, multimedia applications, Internet access, and
client/server computing.
• With respect to security, Internet access to computers has greatly
increased the potential threat, and increasingly sophisticated attacks
(such as viruses, worms, and hacking techniques). 59
Developments Leading to Modern Operating
Systems
• The rate of change in the demands on operating systems
requires not just modifications and enhancements to existing
architectures, but new ways of organizing the OS. The following
are used to develop modern OS:
✓ Microkernel architecture
✓ Multithreading
✓ Symmetric multiprocessing
✓ Distributed operating systems
✓ Object-oriented design 60