You are on page 1of 73

TECHNOLOGICAL UNIVERSITY OF THE PHILIPPINES VISAYAS

Capt. Sabi St., City of Talisay, Negros Occidental

College of Automation and Control

LEARNING MODULE

MXT122 OPERATING SYSTEMS

COMPILED BY
MARIA RODELYN S. TIBON
2020

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
VISION

The Technological University of the Philippines shall be the premier


state university with recognized excellence in engineering and technology
at par with leading universities in the ASEAN region.

MISSION

The University shall provide higher and advanced vocational,


technical, industrial, technological and professional education and training
in industries and technology, and in practical arts leading to certificates,
diplomas and degrees.
It shall provide progressive leadership in applied research,
developmental studies in technical, industrial, and technological fields and
production using indigenous materials; effect technology transfer in the
countryside; and assist in the development of small-and-medium scale
industries in identified growth center. (Reference: P.D. No. 1518, Section 2)

QUALITY POLICY

The Technological University of the Philippines shall commit to


provide quality higher and advanced technological education; conduct
relevant research and extension projects; continually improve its value to
customers through enhancement of personnel competence and effective
quality management system compliant to statutory and regulatory
requirements; and adhere to its core values.

CORE VALUES

T - Transparent and participatory governance


U - Unity in the pursuit of TUP mission, goals, and objectives
P - Professionalism in the discharge of quality service
I - Integrity and commitment to maintain the good name of the University
A - Accountability for individual and organizational quality performance
N - Nationalism through tangible contribution to the rapid economic growth of the country
S - Shared responsibility, hard work, and resourcefulness in compliance to
the mandates of the university

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
TABLE OF CONTENTS

............................. 5

LEARNING GUIDE(WEEK1) ....................................................................................................... 7


TOPIC/S .................................................................................................................................... 7
EXPECTED COMPETENCIES ....................................................................................................... 7
REVIEW OF COMPUTER SYTEMS .............................................................................................. 7
PROGRESS CHECK ................................................................................................................... 12
REFERENCES ........................................................................................................................... 13
LEARNING GUIDE(WEEK2) ..................................................................................................... 15
EXPECTED COMPETENCIES ..................................................................................................... 15
CONTENT/TECHNICAL INFORMATION ................................................................................... 14
PROGRESS CHECK ................................................................................................................... 24
REFERENCES ........................................................................................................................... 25
LEARNING GUIDE(WEEK3) ..................................................................................................... 26
EXPECTED COMPETENCIES ..................................................................................................... 26
CONTENT/TECHNICAL INFORMATION ................................................................................... 26

REFERENCES ........................................................................................................................... 38
LEARNING GUIDE(WEEK4) ..................................................................................................... 39
EXPECTED COMPETENCIES ..................................................................................................... 39
CONTENT/TECHNICAL INFORMATION ................................................................................... 39
PROGRESS CHECK ................................................................................................................... 47
REFERENCES ........................................................................................................................... 72
LEARNING GUIDE(WEEK6-7) .............................................................................................. 51
EXPECTED COMPETENCIES ..................................................................................................... 39
CONTENT/TECHNICAL INFORMATION ................................................................................... 39
PROGRESS CHECK ................................................................................................................... 47
REFERENCES ........................................................................................................................... 72

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
LEARNING GUIDE(WEEK8-10) .............................................................................................. 51
EXPECTED COMPETENCIES ..................................................................................................... 56
CONTENT/TECHNICAL INFORMATION ................................................................................... 56
PROGRESS CHECK ................................................................................................................... 63
REFERENCES ........................................................................................................................... 64
LEARNING GUIDE(WEEK11-13) .............................................................................................. 65
EXPECTED COMPETENCIES ..................................................................................................... 65
CONTENT/TECHNICAL INFORMATION ................................................................................... 65
PROGRESS CHECK ................................................................................................................... 71
REFERENCES ........................................................................................................................... 72

COURSE DESCRIPTION

This course gives the overview of the basic concepts and functions
common
to all operating systems. Students will learn how the development of the different
computer systems and the increasing demand of the user has driven the
improvements and updates of the operating system. Along with this, the course will
include topics on the various features, capabilities and design of the different
operating for different types of platforms.
The course will cover the different types of Operating Systems for
different
platforms like of the desktop, mobile and network operating systems. These
different operating systems will be gauged according to the following features: user
interface capability, process management, memory management, and file systems
and support for distributed systems.
Particular emphasis will be given to components, functionality, and
features
of the current popular operating systems in the industry.

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
COURSE OUTCOMES

By the end of the course, the students will be able to do the following:

LO1: Describe the functions of operating systems

LO2: Differentiate the different operating systems used in the different platforms.

LO3: Classify and exemplify the operating system features

LO4: Use the desktop operating system and customize user interfaces, file system and
other components

LO5: Gain experience in establishing concurrency and connectivity of OS in mobile and


network systems

GENERAL GUIDELINES/CLASS RULES

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
DURATION
This module can be undertaken under a self-phased learning; however,
the learner should also take note that the course may have total time
duration to accomplish. It is therefore encouraged that the learner should
properly read, analyze concepts and ideas presented, and reflect on them.
PRE ASSESMENT
At the start of the module, the learner is advised to take a personal
preassessment test to gauge the knowledge and skills requirements to
understand the course.
ASSESSMENT
At the end of every module the Activities and Progress-Check Questions
will help the learner assess their own progress on the course.
Assessment Tasks may be individual or by group. Group work is
indicated before the assignment. It is advised to have at least 2 members
with stable internet connection
Each individual or group may also be provided with a folder using
GOOGLE DRIVE where they can drop their outputs for each
assessments.
Use the File format when uploading or sending files via the net:
ModuleNo_AssessmentNo_FileNo_GroupNo ex. M01_A01_F01_G01.
Include the List of References/URL Links/Resources in your document
Use the available resources, installed software and search engine to do
research on the given topics.
These activities and assessments may be written on the module and may
also be submitted online within a specified due date. Note: Please
inform the teacher ahead on the preferred submission method.
POST ASSESMENT
At the end of the course, a post evaluation will be given as a summary of
the overall performances of the learner in the course.
Students are expected to maintain complete honesty and integrity in their
academic work. Acts of academic dishonesty, such as cheating,
plagiarism, or inappropriately using the work of others to satisfy course
requirements, will not be tolerated and may result in failure of the
affected assignments and/or failure of this class.

STUDENTS WITH SPECIAL NEEDS:


A student with special medical needs is advised to inform the instructor
as to how he/she can best assist him/her. All information will be
considered confidential.

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
LEARNING EVIDENCES/COURSE OUTPUTS

LEARNING ASSESSMENT METHOD DUE DATE


OUTCOME
LO1 LO6 Learning Activity Every end of the 4th week after the
Performed corresponding activity was performed

Project/Work piece At the end of the term.


submission
Projects and Examinations

COURSE EVALUATION:
Evaluation of the level of performance in the learning evidences shall be based on the grading
criteria as follows:
Term percentage distribution
o Prelim (Week No. 1 -
Week: 4 weeks) o Midterm (Week No. 6 -
(Allotted Lecture Week: 3 weeks) o Finals (Week No. 10 - Week No.

Assessments may be given (within the prescribed allotted week) as part of the grade of a
student. Assessments in a form of either of the following:
o Online Quizzes/Written Quizzes /Researches o Recorded Practical Activity
(Individual / Group) /Projects

GRADING SYSTEM
The student will be graded according to the following:
o Average of written/online examinations - 50% o
Average of written/online assessment - 50%
Prelim Grade : [(Prelim Exam x 0.50) + (Assessment x 0.50)]
Midterm Grade : [(Midterm Exam x 0.50) + (Assessment x 0.50)] End
term Grade : [(Final Exam x 0.50) + (Assessment x 0.50)] Final Grade:
(Prelim Grade x 0.30) + (Mid-Term Grade x 0.30 + (End Term Grade x 0.40) The
passing grade for this course is 5.0.

For inquiries and/or clarifications, please email


mariarodelyn_tibon@tup.edu.ph or send a private
message through messenger.
Queries posted after 6:00 P.M. will have a response the following day.

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
LEARNING GUIDE
Week No.: __1__

TOPIC/S
COMPUTER SYTEM COMPONENTS
AND THE OPERATING SYSTEMS: OVERVIEW

EXPECTED COMPETENCIES
1. Distinguish the elements of the computer system including the operating
system 2. Associate the Operating System with the function of the
hardware and software

CONTENT/TECHNICAL INFORMATION

1) Review of Computer Systems


A computer system can be divided into 4 components:
- Hardware (CPU, memory, input/output devices, etc.),
- Operating system, System Utilities, Application programs1

- Users/Other devices

Figure 1
Computer System

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
1. Computer Hardware
These are computer system components that can be touched by the human
hand. Examples include:
Display monitor.
Keyboard.
Mouse.
Motherboard.
Memory modules. Disk drive.
These parts are housed within the laptop or the desktop system-unit. For the
desktop, however, the keyboard and mouse are attached and used externally

Figure 2
Computer Hardware

2. Humanware

1. Computer Professionals : Those people who write programs and develop


software (Software Engineers).
2. End Users : The end user is the individual who uses the computer after
it has been fully developed. All of us are end users. We use computer to
post on our blog. You use your computer to read those posts. 2

Figure 3

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
Users

3. Computer Software
Figure 4
Software

The software component refers to the instructions, programs, data, and


protocols which run on top of hardware. It is also retained temporarily and
persistently in primary and secondary hardware media. Software can be
divided into :

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
Application Software
This is designed for end users to perform a specialized assignment in
order to output useful information.
An example would be a word processing application used to compose
letters or brochures, such as Microsoft Word.
Other popular examples include Adobe Photoshop, Corel Draw, and
AutoCAD.
A collection of application software is bundled in a package that is
commonly known as a software suite. A typical suite includes software
for word processing, presentation, graphic design, and spreadsheet.
Examples include Microsoft Office, OpenOffice, and iWork.
Software is written in computer languages such as Visual Basic, C, and
Java. Malicious Software
Malware, is short for malicious software, which is a generic term that
refers to exploitative code designed by criminals and black hat hackers
to maim normal operations of a computer. Malware attack will result in
data loss and hacker access to private information.
Affected computers can also be converted into zombies and used in a
bigger mission of criminal activities like launching denial of service
attack and spreading spam.
Malware scripts are delivered to the computer as viruses, trojans,
rootkits, keyloggers, worms, or through email and websites as adware,
spyware, ransomware and scareware. Programming Software
These are tools used by developers to create all kinds of software like
Windows OS and Word processing. Also called languages, they are used
to write source codes, debug errors, maintain and create new software
for computers and write malicious scripts like viruses and trojans.
Popular examples of high-level languages are Java, Javascript, BASIC,
PHP, Visual Basic, Visual C++, Visual Basic, Python, Ruby, Perl, Java.

System Software
The system manages other software and devices inside the computer.
The foremost example of system software is the operating system (OS).
In a typical setup, the operating system is like the motherboard for
software. It is the first thing that is installed, followed by applications
and other software. Three popular operating systems for traditional
computers include Windows, Mac OS X, and Linux.
Popular mobile operating systems include Android OS, iPhone OS,
Windows Phone OS, and Firefox OS.3

Looking back

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
software that
Today, operating system is a broad term that may
not only encompass the control of hardware but can control and manage
vastly different remote systems in a more powerful, efficient and portable
means.4

System Software or plainly called Operating system (OS) is a


program or set of programs, which acts as an interface between a user of
the computer and the computer hardware. The main purpose of an OS is to
provide an environment in which we can execute programs.

The main goals of the OS are


1. To make the computer system convenient to use,
2. To make the use of computer hardware in efficient way. 5

Figure 5
Operating System Functions

PROGRESS CHECK
This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
ANSWER WITH TRUE OR FALSE

Question 1. Operating System is a software

Question 2. Windows 10 is an example of a graphical user interface (GUI) system.

Question 3. Computer online games cannot work without OS.

Question 3 Printers can still function without OS

Question 4. The latest Operating Systems includes antivirus


softwares

Question 5. When your system freezes up you should terminate the


process by unplugging the power to your computer.

REFERENCES

Textbook/s :

William Shay (January 14, 1997). An Introduction to Operating


Systems. Prentice Hall

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
Silberschatz A., Galvin P.B. Operating System Concepts, 5 th
Edition, John Wiley and Sons. Dhamdhere D.M., Tata. Systems
Programming and Operating
Systems, 2nd Revised Edition, McGraw Hill Publishing Company Ltd.,
New
Delhi.

Laboratory Manuals:

Please see separate laboratory module

On-Line Resources:

1. https://www.learncomputerscienceonline.com
2. http://ssc.xaam.in
3. https://turbofuture.com
4. http://ssc.xaam.in
5. https://medium.com
6. http://www.vvitengineering.com
7. https://wps.prenhall.com

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
LEARNING GUIDE

Week No.: __2__

TOPIC/S: OPERATING SYSTEMS FUNCTIONS

EXPECTED COMPETENCIES
1. Comprehend the primary functions of Operating Systems
2. Differentiate and categorize the key functions of an operating system
(OS).

CONTENT/TECHNICAL INFORMATION

Operating system as the program that make the hardware and the other
application software useable.
It is defined as the set of programs that controls, manages and govern a
computer system.
An Operating system is the software that makes the it possible for the User
to use the Software and Hardware according to purpose.

Figure 6
Operating System as Intermediary System

All the computers need basic software known as an Operating System (OS)
to function.
The OS acts as the platform interface between the User, Application
Programs, Hardware and the System Peripherals. The OS is the first

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
software to be loaded when a computer starts up. The other application
programs are loaded and permitted to run
only after the OS activates.6

Operating System is system software, which may be viewed as


collection of software consisting of procedures for operating the computer
and providing an environment for execution of programs. It is also the
interface between user and computer. In a nutshell, OS makes everything in
the computer to work together smoothly and efficiently.

Figure 6.1
Operating System Diagram7

Some of The Operating System Tasks Includes:8

OS can also be viewed as a control program, used to control the various I/O

sending output to the display screen. Keeping track of files and directories
on the disk. Running peripheral devices such as disk drives and printers.

OS as a resource allocator. A computer system has many resources, which


are to be required to solve a computing problem. These resources are the
CPU time, memory space, files storage space, input/output devices and so
on.
The OS acts as a manager of all of these resources and allocates them to the
specific programs and users as needed by their tasks.
This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
It may check and even prevent errors and improper use of the computer
resources.

The OS is also responsible for security, ensuring that unauthorized users do


not access the system.

It is in charge of interconnecting, interfacing and communicating with other


devices

It provides programming interface for application developers and a friendly


environment for users. The commands are accepted and executed by a part
of the OS called the command processor or command line interpreter. In
modern systems, the OS has the graphical user interface which makes it easy
for the user to navigate and control the system.
9

Figure 7
Functions of operating system

THE MAJOR FUNCTIONS OF OS


Resource Manager

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
Overall, the role of the OS is to manage system resources. A
computer system has many resources as mentioned on the previous module.
Since there can be many conflicting requests for the resources, the OS must
decide which requests are to be allocated resources to operate the computer
system fairly and efficiently.

The OS as a resources manager has a primary view as the OS is a

memory, processors, peripheral devices, and information. It is the function


of OS to see that they are used efficiently and to resolve conflicts arising
from competition among the various users. The OS must keep track of status
of each resource; decide which process is to get the resource, allocate it, and
eventually reclaim it. 10

Figure 7.1
Resource Allocator

Memory Management Functions

Memory management is all about making sure there is as much available


memory space as possible for new programs, data and processes to
execute.14
This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
To execute a program, it must be mapped to absolute addresses and loaded
into memory. As the program executes, it accesses instructions and data from
memory by generating these absolute addresses. In multiprogramming
environment, multiple programs are maintained in the memory simultaneously.

The OS is responsible for the following memory management functions:

Keep track of which segment of memory is in use and by whom.11

Deciding which processes are to be loaded into memory when space


becomes available. In multiprogramming environment, it decides which
process gets the available memory, when it gets it, where does it get it,
and how much.

Allocation or de-allocation the contents of memory when the process


request for it otherwise reclaim the memory when the process does not
require it or has been terminated. 12

Figure 8
Memory Management Function

Processor/Process Management Functions

A process is an instance of a program in execution. While a program is


just a passive entity, process is an active entity performing the
intended functions of its related program. To accomplish its task, a
process needs certain resources like CPU, memory, files and I/O
devices. In multiprogramming environment, there will a number of
simultaneous processes existing in the system. The OS is responsible
for the following processor/ process management functions:

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
Provides mechanisms for process synchronization for sharing of
resources amongst concurrent processes.

Keeps track of processor and status of processes. The program that


does this has been called the traffic controller.

Decide which process will have a chance to use the processor; the
job scheduler chooses from all the submitted jobs and decides which
one will be allowed into the system. If multiprogramming, decide
which process gets the processor, when, for how much of time. The
module that does this is called a process scheduler.

Allocate the processor to a process by setting up the necessary


hardware registers. This module is widely known as the dispatcher.

Providing mechanisms for deadlock handling.


Reclaim processor when process ceases to use a processor, or
exceeds the allowed amount of usage. 13

Figure 9 Process Management Function

I/O Device Management Functions

An OS will have device drivers to facilitate I/O functions involving I/O


devices. These device drivers are software routines that control respective I/O
devices through their controllers. The OS is responsible for the following I/O
Device Management Functions:

Keep track of the I/O devices, I/O channels, etc. This module is
typically called I/O traffic controller.

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
Decide what is an efficient way to allocate the I/O resource. If it is
to be shared, then decide who gets it, how much of it is to be
allocated, and for how long. This is called I/O scheduling.

Allocate the I/O device and initiate the I/O operation. 6

Reclaim device as and when its use is through. In most cases I/O
terminates automatically.

Figure 10
I/O Management Function16

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
22

Information/File Management Functions

Keeps track of the information, its location, its usage, status, etc. The
module called a file system provides these facilities. 7

Decides who gets hold of information, enforce protection mechanism, and


provides for information access mechanism, etc.

Allocate the information to a requesting process, e.g., open a file.

De-allocate the resource, e.g., close a file.

Figure 11
File Management Function18

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
23

Network Management Functions

An OS is responsible for the computer system networking via a distributed


environment. 14

A distributed system is a collection of processors, which do not share


memory, clock pulse or any peripheral devices. Instead, each processor is
having its own clock pulse, and RAM and they communicate through
network.

Access to shared resource permits increased speed, increased functionality


and enhanced reliability.

Various networking protocols are TCP/IP (Transmission Control Protocol/


Internet Protocol), UDP (User Datagram Protocol), FTP
(File Transfer Protocol), HTTP (Hyper Text Transfer protocol), NFS
(Network File System)
etc. 15

Figure 12
Network Management Function

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
24

Figure 12
Network Operating Systems

Figure 13
Summary Of Operating Functions

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
25

PROGRESS CHECK

ENCIRCLE the letter of the correct choice

Question 1. An operating system is _____.


a) A means to control devices like memory
b) A means to perform underlying computer functions
c) The brains of a computer
d) All of these answers are correct.

Question 2. Which of the following is probably NOT a function of


common operating systems available today?

a) All of these functions are available on operating systems today


b) Checking to ensure that there is sufficient disk space in the hard
disk before the user can save contents
c) Raising an alert when there is a failure detected on a major
component of the computer system like memory or CPU
d) Allowing for multitasking, so that multiple jobs can run
concurrently.

Question 3. What are the two main functions of an operating


system? a) Booting up the system when the computer
is first switched on
b) Opening the internet
c) Protecting the computer from hackers
d) Managing memory during multi-tasking

Question 4 Which among the statement/s is/are true?

a) The OS must decide which requests are to be allocated


resources
b) It may check and even prevent errors and improper use of the
computer resources.
c) The OS is also responsible for security, ensuring that
unauthorized users can access the system.
d) It is incharge of interconnecting, interfacing and communicating
with other devices

Question 5. What OS function is incharge of keeping track of the


information, its location, its usage, status, etc.
a) Memory management
This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
26

b) Processor management
c) I/O management
d) File management

REFERENCES

Textbook/s :
William Shay (Author). An Introduction to Operating Systems.
Prentice Hall (January 14, 1997)
Operating System Concepts, 5th Edition, Silberschatz A., Galvin
P.B., John Wiley and Sons.
Systems Programming and Operating Systems, 2 nd Revised
Edition, Dhamdhere D.M., Tata McGraw Hill Publishing
Company Ltd., New Delhi.

Laboratory Manuals:

Please see separate laboratory module

On-Line Resources:

1. https://medium.com
2. http://www.vvitengineering.com
3. https://wps.prenhall.com
4. https://www.unf.edu
5. https://sea.pcmag.com
6. http://www.ddegjust.ac.in
7. https://procodersp.blogspot.com
8. https://www.kullabs.com
9. https://www.cs.uic.edu
10. https://www.enterprisestorageforum.com
11. https://www.computerscienceeducationhub.in

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
27

LEARNING GUIDE

Week No.: __3__

TOPIC/S: EVOLUTION OF OPERATING SYSTEMS


TYPES OF OPERATING SYSTEMS

EXPECTED COMPETENCIES
1. Comprehend how the Operating System features evolve and improve
through time and need.
2. Compare the different types of operating systems

CONTENT/TECHNICAL INFORMATION
A major OS will evolve over time for a number of reasons: 21

Figure 13

Why OS should evolve

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
28

EVOLUTION OF PROCESSING TRENDS

It is obvious that bare machines cannot work without instructions. Thus,


it is also important to understand how these instructions evolve along with the
development of hardware.
The complexity of the instruction is fairly parallel with the computing power of
the computing machines. Along with this is the increase in the need for more services

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
29

and functions from the users, applications and processes. Thus, the operating system
should also evolve to cater to the development.

In this module, in order to understand the functions of the instructions, aka


operating systems, it is important to go through the development stages from the
serial processing, batch processing, parallel processing, multiprocessing,
multithreading and object oriented approach. 21

Figure 14
Evolution of OS and the hardware

Serial Processing

In early computer from late 1940 to the mid-1950, every computer system
may be programmed in its machine language, with no systems software support.
Programming of the bare machine was customary for early computer systems.
Programs for the bare machine can be developed by manually translating
sequences of instructions into binary or to some mnemonic code Instructions. 18
During the first stage of computing ages, data are then entered into the computer

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
30

by means of console switches on coded keyboards. The intructions are loaded


and processed based on the sequence they are encoded into the machine. This
process is usually first in first out. Results of execution are obtained by
examining the contents of the relevant registers and memory
locations. 22

Figure 15
Serial Processing

The next significant evolutionary step in computer-system usage came


about with the advent of input/output devices, such as punched cards and paper
tape, and of language translators. Programs, now coded in a programming
language, are translated into executable form by a computer program, such as a
compiler or an interpreter.

Another program, called the loader, automates the process of loading


executable programs into memory. The user places a program and its input data
on an input device, and the loader transfers information from that input device
into memory. After transferring control to the loader program by manual or
automatic means, execution of the program commences. The executing program
reads its input from the designated input device and may produce some output
on an output device. Once in memory, the program may be rerun with a different
set of input data.6

The disadvantage of this process is when syntax errors are detected, the
whole process must be repeated from the beginning. Another program called the
debugger detects the errors.16

Control and access of different input and output devices must be in


sequence. This process mostly rely on human operators and processing is very
low.

Batch Processing

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
31

The processing time was reduced when storage devices were invented.
The batch processing relied on stack of punched cards or tape for the input, but
the jobs are still processed serially, without the interaction of the user. Each user
prepares his job on an offline device like punch cards and submits it to the
computer operator. To speed up processing, jobs with similar needs are batched
together and run as a group. The programmers leave their programs with the
operator and the operator then sorts the programs with similar requirements into
batches. The users of a batch operating system do not interact with the computer
directly. 16

Figure 16
Batch Processing23

Generally, OS commands are statements written in Job Control Language


(JCL). These commands are embedded in the job stream, together with user
programs and data. A memory resident portion of the batch operating system-
sometimes called the batch monitor- reads, interprets, and executes these
commands.

The efficiency of these systems was measured in the number of jobs completed in
a given amount of time called as throughput.

Although there was an improvement on the serial processing, the


difference in speed between the processor and the input output devices that loads
the program makes it more challenging. With this problem, the direct memory
access (DMA) channels, peripheral controllers, and dedicated input/output
processors with additional program for the control of input and output were
added.

To summarize the batch system,


This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
32

The user has less interaction with the job.


Jobs are batched together by type of languages and requirement.
Then a special program, the monitor, manages the execution of each
program in the batch.
The monitor is always in the main memory and available for execution.
CPU is often idle, because the speed of the mechanical I/O devices is slower
than the CPU. Difficult to provide the desired priority.20

Multiprogramming

In multiprogramming, many processes are simultaneously resident in memory,


and execution switches between processes. 13

Figure 16
Multiprogramming system

A multiprogramming system permits multiple programs to be loaded into


memory execute the programs concurrently. Concurrent execution of programs
has a significant potential for improving system throughput and resource
utilization relative to batch and serial processing.

This capability of an operating systems makes the use of resources of a computer


system available among a multiple running programs. 19 Multitasking
Operating System
An instance of a program in execution is called a process or a task. A
multitasking OS is distinguished by its ability to support concurrent execution
of two or more active processes. Multitasking is usually implemented by
maintaining code and data of several processes in memory simultaneously, and
by multiplexing processor and I/O devices among them.

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
33

Multitasking capability depends on the hardware of the system. The


hardware should also have a protection capability to switch from one task to
another without conflict, that is, to run concurrently.

There are two basic types of multitasking5:

1. preemptive- parcels out CPU time slices to each program.


( OS/2, Windows 95, Windows NT,and UNIX)

2. cooperative- each program can control the CPU for as long as it needs it.
If a program is not using the CPU, however, it can allow another program
to use it temporarily. (Microsoft Windows, MultiFinder)
Figure 17
Multitasking vs Multiprocessing

Multiprocessing
In multitasking, only one CPU is involved, but it switches from one
program to another so quickly that it gives the appearance of executing all of the
programs at the same time. 24
Multiprocessing sometimes implies that more than one CPU (multicore)
is
share data and programs.

These multiple processors also share operating system resources such as


memory, buses, printers, and other peripheral devices.16

Figure 18

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
34

Multiprocessor System

They support processes to run in parallel, thus, increased throughput. 25


Multi-threading features improve performance reducing the overall
operating time. However, malfunctioning of one processor may affect
ther overall speed of the system
It is powerful to use in areas such as artificial intelligence, expert systems,
image processing, etc, but can be expensive. It is cost effective for
heavy processing as it dynamically shares resources among multiple
processors in the system architecture.
It has shared data and resources such as memory, buses, and peripheral
devices. It requires larger resources for many processes.25

Multi-user Operating System


A multi user operating system allows to permission of multiple users for
accessing the single machine at a time. All different users can access that system
running operating system with the help of several terminals, which are connected
in networking form.26 Operating systems that can create multiple users enables
the creation of different accounts and resources.

In general, multiprogramming implies multitasking, but multitasking does


not imply multi-programming. In effect, multitasking operation is one of the
mechanisms that a multiprogramming OS employs in managing the totality of
computer-system resources, including processor, memory, and I/O devices.

Multitasking operation without multi-user support can be found in operating


systems of some advanced personal computers and in real-time systems.

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
35

Multi-access operating systems allow simultaneous access to a computer


system through two or more terminals. In general, multi-access operation does
not necessarily imply multiprogramming. Except for management and
scheduling of multiple processors, multiprocessor operating systems provide the
usual complement of other system services that may qualify them as
timesharing, real-time, or a combination operating system.

Multithreading

Allows different parts of a single program to run concurrently. The programmer must
carefully design the program in such a way that all the threads can run at
the same time without interfering with each other. 27 Figure
19

Time-sharing system

Time-sharing is a technique which enables many people, located at


various terminals, to use a particular computer system at the same time.
Timesharing or multitasking is a logical extension of multiprogramming.
Processor's time which is shared among multiple users simultaneously is termed
as timesharing. It attempts provide equitable sharing of common resources to
multiple jobs rapidly switching between them. Users with more demanding
processing requirements are made to wait longer.20 Some features of timesharing
system are as follows:

Efficient terminal response while running multiple tasks


No duplication of data but its data integrity maybe an issue.
No duplication of software applications however, contention may cause
unreliability.
Reduces CPU idle time but can be prone to hardware connection problems. 25

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
36

Figure 20
Time Sharing System

The main difference between Multiprogrammed Batch Systems and


Time-Sharing Systems is that in case of Multiprogrammed batch systems, the
objective is to maximize processor use, whereas in Time-Sharing Systems, the
objective is to minimize response time.20

Real-time systems

Real time systems are used in time critical environments where data must
be processed extremely quickly because the output influences immediate
decisions.
Real time systems are used for space flights, airport traffic control, industrial
processes, sophisticated medical equipment, telephone switching etc.

The time taken by the system to respond to an input and display of


required updated information is termed as the response time. A real time system
must be 100 percent responsive in time. Response time is measured in fractions
of seconds. In real time systems the correctness of the computations not only
depends upon the logical correctness of the computation but also upon the time
at which the results is produced. If the timing constraints of the system are not
met, system failure is said to have occurred. Real-time operating systems are
used in environments where a large number of events, mostly external to the
computer system, must be accepted and processed in a short time or within
certain deadlines.

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
37

Figure 21
Real Time System

A primary objective of real-time systems is to provide quick


eventresponse times, and thus meet the scheduling deadlines. A real-time
operating system must have welldefined, fixed time constraints, otherwise the
system will fail. For example, Scientific experiments, medical imaging systems,
industrial control systems, weapon systems, robots, air traffic control systems,
etc.

There are two types of real-time operating systems.28

Hard real-time systems

Hard real-time systems guarantee that critical tasks complete on time.


In hard realtime systems, secondary storage is limited or missing and the
data is stored in ROM. In these systems, virtual memory is almost never
found.
Figure 21
Hard vs Soft Real Time System29

Soft real-time systems


Soft real-time systems are less restrictive. A critical real-time task gets
priority over other tasks and retains the priority until it completes. Soft realtime
systems have limited utility than hard real-time systems. For example,

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
38

multimedia, virtual reality, Advanced Scientific Projects like undersea


exploration and planetary rovers, etc. 20

PROGRESS CHECK

WRITE ANSWER ON THE BLANK PROVIDED.


Identify The Type of Operating Systems with The Following Features:

Features Types Of OS

support concurrent execution of two or more


active processes

accessing the single machine at a time. All


different users can access that system running
operating system with the help of several
terminals, which are connected in networking
form

relied on stack of punched cards or tape for


the input, but the jobs are still processed
serially, without the interaction of the user

used in time critical environments where data


must be processed extremely quickly because
the output influences immediate decisions

data are then entered into the computer by


means of console switches on coded keyboards

provide equitable sharing of common


resources to multiple jobs rapidly switching
between them

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
39

REFERENCES

Textbook/s :

William Shay (January 14, 1997). An Introduction to Operating Systems.


Prentice Hall
Silberschatz A., Galvin P.B. Operating System Concepts, 5 th Edition, John
Wiley and Sons. Dhamdhere D.M., Tata. Systems Programming and
Operating Systems, 2nd Revised Edition, McGraw Hill Publishing Company
Ltd., New Delhi.

Laboratory Manuals:

Please see separate laboratory module

On-Line Resources:

5. https://medium.com
6. http://www.vvitengineering.com
7. https://wps.prenhall.com
8. https://www.unf.edu
9. https://sea.pcmag.com
10. http://www.ddegjust.ac.in
11. https://procodersp.blogspot.com
12. https://www.kullabs.com
13. https://www.cs.uic.edu
14. https://www.enterprisestorageforum.com
15. https://www.computerscienceeducationhub.in
16. http://cs.wellesley.edu
17. https://ecomputernotes.com
18. https://medium.com
19. http://www.idc-online.com/technical_references
20. https://www.geeksforgeeks.org/differencebetweenmultita
skingmultithreading-and-multiprocessing/
21. https://www.tutorialspoint.com
22. https://www.coursehero.com
23. https://www.researchgate.net

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
40

24. http://faculty.salina.k-state.edu
25. https://diffzi.com
26. https://prepinsta.com
27. http://digitalthinkerhelp.com
28. https://www.geekboots.com 29. https://study.com

LEARNING GUIDE

Week No.: __4__

TOPIC/S:
DISTRIBUTED OPERATING SYSTEMS MODERN
OPERATING SYSTEMS

EXPECTED COMPETENCIES
1. Recognize functions of distributed operating systems
2. Appreciate how the operating system has evolved for mobility

Distributed Operating
Systems

A distributed computer system is a collection of independent computer


systems communicating and interconnecting with each other. It can be
synonymous to the extended network operating system which supports highly
integrated machines which are connected to carry out a single task.
Depending on how the devices are connected, the whole system may stil
work even if one of its connected component fails. Processes can be carried by
physically distant devices at the same time.
The most powerful feature of a distributed system is scalability.
Distributed operating systems usually provide the means for system-wide
sharing of resources, such as computational capacity, files,and I/O devices.
In addition to typical operating-system services provided at each node for
the benefit of local clients, a distributed OS may facilitate access to remote
resources, communication with remote processes, and distribution of
computations.
Following are the two types of distributed operating systems used 31 Client-
Server Systems

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
41

Centralized systems today act as server systems to satisfy requests generated


by client systems. The general structure of a client-server system is depicted in
the figure below:

Figure 21
Client-Server System

Server Systems can be broadly categorized as: Compute Servers and File
Servers31.

Compute Server systems, provide an interface to which clients can send


requests to perform an action, in response to which they execute the action
and send back results to the client.
File Server systems, provide a file-system interface where clients can create,
update, read, and delete files.

Peer-to-Peer Systems
While the client server has one central management system that caters to
other components, peer to peer systems consist of a collection of processors
that do not share memory or a clock. Instead, each processor has its own
local memory. The processors communicate with one another through
various communication lines, such as highspeed buses or telephone lines.
These systems are usually referred to as loosely coupled systems (or

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
42

distributed systems). The general structure of a client-server system is


depicted in the figure below:
Figure 22
Peer-to-Peer Systems

Distributed systems use multiple central processors to serve multiple


real-time applications and multiple users. Data processing jobs are accordingly
distributed among the processors named as nodes or sites.

The advantages of distributed systems are as follows16

With resource sharing facility, a user at one site may be able to use the
resources available at another.
Speedup the exchange of data with one another via electronic mail.
If one site fails in a distributed system, the remaining sites can potentially
continue operating.
Better service to the customers.
Reduction of the load on the host computer.
Reduction of delays in data processing.31

Clustered Systems
Every node of a cluster system has cluster software which is responsible
for monitoring the operations of the cluster system. In case any of the cluster
nodes fails, then the rest of the nodes takes control of all its storage and resources
and restarts the functioning of the cluster system.

Like parallel systems, clustered systems gather together multiple CPUs to


accomplish computational work.
Clustered systems differ from parallel systems, however, in that they are
composed of two or more individual systems coupled together.
The definition of the term clustered is not concrete; the general accepted
definition is that clustered computers share storage and are closely linked via LAN
networking.
Clustering is usually performed to provide high availability.
This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
43

A layer of cluster software runs on the cluster nodes. Each node can
monitor one or more of the others. If the monitored machine fails, the monitoring
machine can take ownership of its storage, and restart the application(s) that were
running on the failed machine. The failed machine can remain down, but the users
and clients of the application would only see a brief interruption of service.
Asymmetric Clustering - In this, one machine is in hot standby
mode while the other is running the applications. The hot standby
host (machine) does nothing but monitor the active server. If that
server fails, the hot standby host becomes the active server.
Symmetric Clustering - In this, two or more hosts are running
applications, and they are monitoring each other at the same time.
Parallel Clustering - Parallel clusters allow multiple hosts to
access the same data on the shared storage using special versions
of software and special releases of applications.26

Clustered technology is rapidly changing. Clustered system's usage and it's


features should expand greatly as Storage Area Networks(SANs). SANs allow
easy attachment of multiple hosts to multiple storage units. Current clusters are
usually limited to two or four hosts due to the complexity of connecting the hosts
to shared storage. 31

Handheld Systems/ Mobile Operating Systems


Different operating systems run on different types of hardware and are
designed for different types of applications. For example, iOS is designed for
iPhones and iPad tablets, while Mac desktops and laptops use macOS. Your
computer or smartphone comes equipped with an OS, but you can install another
one in some cases32

The rapid development of technology has shifted the demand from huge devices
installed in specific spot to handheld devices/ mobile devices.
The innovation in the phone industry has capacitated the small device with
features that were once seen in personal and office computing devices. Along
with the increase processing and storing features of mobile phones, software has
played a big role in making the small devices work like any other processing
devices.

For mobile phones, OSs have been developed to enable users to use phones
in much the same way as personal computers were used 1 or 2 decades ago. The
most well-known mobile OSs are Android, iOS, Windows phone OS, and
Symbian. The market share ratios of those OSs are Android 47.51%, iOS
41.97%, Symbian 3.31%, and Windows phone OS
2.57%. There are some other mobile OSs that are less used (BlackBerry, Samsung, etc.)
[46]. In the next section, we will briefly explain each of these OSs.33 iOS
This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
44

Apple's very own operating system, iOS runs the company's iPod, iPad,
iPhone, and Apple Watch devices. It is only available on Apple products and
responds to commands from the user's fingertips. iOS features iTunes for music
and the App Store for everything else. One of the benefits of the Apple operating
system is its built-in video chatting and Apple Music capabilities. Figure 23 iOS

Android

Android's OS is owned by Google and is considered open-source to Apple's


closed system. With an open-source system, software developers can build
applications and programs until their heart's content and users reap the benefits
of tons of free software. Most Android lovers cite the operating system's
openness, which leads to more personalization options, as the reason they're
hardcore devotees.

Figure 24

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
45

Android

Windows

Windows is no stranger to computer operating systems, but is a relatively


newcomer to mobile OS. Its latest version uses the tiled layout common to its
most recent computer OS. These tiles can be rearranged and moved to the user's
preferences. Figure 25
Windows on Mobile

BlackBerry OS

A lesser known, but still used, OS is the one designed for BlackBerry
devices, common among business users. The BlackBerry operating system is
well-liked for its enhanced security and safety measures. It was the phone of
choice for former President Barack Obama! BlackBerry has been far more
successful with an operating system that requires a trackball (like a computer
mouse) and a physical keyboard than a touch screen device like the iPhone .34
This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
46

Figure 26
BlackBerry

Figure 27
Popular Mobile Systems (1999-2019), Gartner reports, companies SEC filings

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
47

Characteristics of Modern operating system35

Microkernel architecture:
Assigns only a few essential functions to the kernel, including address spaces,
interposes communication, and basic scheduling.

Multithreading:

The process is divided into threads that can run simultaneously.

Thread:
Thread is a dispatchable unit of work.
It includes a processor context program counter and stack pointer and its
own data storage for the stack. It executes sequentially and is
interruptable.

Process
Collection of one or more threads and associated system resources are
known as processes.

Symmetric multiprocessing:
o Standalone computer with multiple processors that share the same
memory and I/O facilities connected by a communication bus.

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
48

o All processors can perform the same functions. Distributed


operating systems: o Provide the illusion of a single main memory
and single secondary memory space.

o It is also used for distributed file system.

Object-oriented design:

o It is used for adding modular extensions to a small kernel. o It also


enables programmers to customize an operating system without
disrupting system integrity.

Combination of Operating Systems

More sophisticated and advance systems may require different features from
different types of operating systems as discussed.

Different applications may run on the same platforms. They may need the
combined and comprised set of services.

Thus, modern operating system may play between computational power, speed,
resource management, efficiency and reliability. 31

PROGRESS CHECK

Research on the development of mobile phones, include the development in the mobile
operating systems. Print Screen their graphical user interfaces. Give a short review.

Fill out the table below for at least three (3) OS MOBILE:

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
49

Mobile OS and Date Released Features Mobile Phone


version that supports the
OS

Compare the common features of the mobile OS listed above with the features of the
personal computer OS in terms of speed, reliability, security and resource efficiency.

Textbook/s:

William Shay (January 14, 1997). An Introduction to Operating Systems. Prentice Hall
Silberschatz A., Galvin P.B. Operating System Concepts, 5th Edition, John Wiley and Sons.
Dhamdhere D.M., Tata. Systems Programming and Operating Systems, 2 nd Revised Edition,
McGraw Hill Publishing Company Ltd., New Delhi.

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
50

Laboratory Manuals:

Please see separate laboratory module

On-Line Resources:

19. https://www.geeksforgeeks.org/differencebetweenmultita
skingmultithreading-and-multiprocessing/
20. https://www.tutorialspoint.com
21. https://www.coursehero.com
22. https://www.researchgate.net
23. http://faculty.salina.k-state.edu
24. https://diffzi.com
25. https://prepinsta.com
26. http://digitalthinkerhelp.com
27. https://www.geekboots.com
28. https://study.com
29. https://www.ni.com
30. https://www.studytonight.com
31. https://smallbusiness.chron.com
32. https://www.sciencedirect.com

33. https://study.com/academ

34. https://www.ques10.com

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
51

LEARNING GUIDE

Week No.: __6-7__

TOPIC/S:
PROCESSES and PROCESS STATES

EXPECTED COMPETENCIES
1. Define Process
2. Analyze process states
3. Demonstrate communications on client server systems

CONTENT/TECHNICAL INFORMATION

I. Process Concept

An operating system executes a variety of programs:


Batch system jobs
Time-shared systems user programs or tasks
Process a program in execution; process execution must progress in sequential
fashion.
A process includes:
program counter
stack
text section
heap
data section36

Program is passive entity stored on disk (executable file), process is


active
Program becomes process when executable file loaded into
memory
Execution of program started via GUI mouse clicks, command
line entry of its name, etc
One program can be several processes
Consider multiple users executing the same program

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
52

II. Process in Memory

II. Process State

As a process executes, it changes state


new: The process is being created
running: Instructions are being executed
waiting: The process is waiting for some event to occur
ready: The process is waiting to be assigned to a processor
terminated: The process has finished execution

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
53

II. Process Block

Information associated with each process (also called task control block)

Process state running, waiting, etc


Program counter location of
instruction to next execute
CPU registers contents of all process centric registers
CPU scheduling information- priorities, scheduling queue pointers
Memory-management information memory allocated to the
process

Accounting information CPU used, clock time elapsed since start, time
limits

I/O status information I/O devices allocated to process, list of


open files

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
54

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
55

PROGRESS CHECK

What is a process?

Describe the process state. What happens when a program runs?

Download an animated video on how the process works

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
56

LEARNING GUIDE Week No.: __8-10__

TOPIC/S:
CPU Scheduling Scheduling Algorithms

EXPECTED COMPETENCIES
1. Introduce the basic CPU scheduling concepts
2. Analyze how jobs are executed in ordered
3. Evaluate the different scheduling algorithms

CONTENT/TECHNICAL INFORMATION

Preemptive vs. Non-preemptive Resources

fall into two classes:

Preemptible: processor or I/O channel. Can take resource away, use it for
something else, then give it back later.
Non-preemptible: once given, it cannot be reused until process gives it back.
Examples are file space, terminal, and maybe memory.

OS makes two related kinds of decisions about resources:

Allocation: who gets what.


Given a set of requests for resources, which processes
should be given which resources in order to make most
efficient use of the resources? Implication is that
resources are not easily preemptible.

Scheduling: how long can they keep it.


When more resources are requested than can be granted
immediately, in which order should they be serviced?
Examples are processor scheduling (one processor, many

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
57

processes), memory scheduling in virtual memory


systems. Implication is that resource is preemptible.

CPU Scheduling
Processes may be in any one of three general scheduling states:
Running.

Ready. That is, waiting for CPU time. Scheduler and dispatcher determine
transitions between this and running state.

Blocked. Waiting for some other event: disk I/O, message, semaphore, etc.
Transitions into and out of this state are caused by various processes.

There are two parts to CPU scheduling:

The dispatcher provides the basic mechanism for running processes.


The scheduler is a piece of OS code that decides the priorities of processes and
how long each will run.

This is an example of policy/mechanism separation.

Goals for Scheduling Disciplines


Efficiency of resource utilization (keep CPU and disks busy).
Minimize overhead (context swaps).
Minimize response time. (Define response time.)
Distribute cycles equitably. What does this mean?

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
58

CPU scheduling is a mechanism to migrate processes to various states


from/to various queues

CPU Scheduler

Selects from among the processes in ready queue, and allocates the CPU
to one of them
Queue may be ordered in various ways.
CPU scheduling decisions may take place when a process:
1. Switches from running to waiting state (preemptive) 2. Switches from running to
ready state (nonpreemptive)
3. Switches from waiting to ready (preemptive)
4. Terminates (nonpreemptive)

Dispatcher
Dispatcher module gives control of the CPU to the process selected by
the shortterm scheduler; this involves:

switching context

switching to user mode

jumping to the proper location in the user program to restart


that program

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
59

Dispatch latency time it takes for the dispatcher to stop one process and start
another running.

Long-term scheduler is invoked very infrequently (seconds, minutes) (may


be slow)
The long-term scheduler controls the degree of multiprogramming (how many
jobs are admitted to run on CPU)
Short-term scheduler is invoked very frequently (milliseconds) (must be fast)

Processes can be described as either: o I/O-bound process spends more time


doing I/O than computations, many short CPU bursts
o CPU-bound process spends more time doing computations; few very
long CPU bursts

Scheduling Criteria
CPU utilization keep the CPU as busy as possible
Throughput # of processes that complete their execution per time unit
Turnaround time amount of time to execute a particular process
Waiting time amount of time a process has been waiting in the ready queue
Response time amount of time it takes from when a request was submitted
until the first response is produced, not output (for time-sharing environment)

Scheduling Algorithm Optimization Criteria


Max CPU utilization
Max throughput
Min turnaround time
Min waiting time
Min response time

FCFS (also called FIFO): run until finished.

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
60

In the simplest case this means uniprogramming.


Usually, "finished" means "blocked". One process can use CPU while another
waits on a semaphore. Go to back of run queue when ready.
Problem: one process can monopolize CPU.

Solution: limit maximum amount of time that a process can run without a context
switch.
This time is called a time slice.

Round Robin: run process for one time slice, then move to back of queue.
Each process gets equal share of the CPU. Most systems use some variant of
this. What happens if the time slice is not chosen carefully?

Originally, Unix had 1 sec. time slices. Too long. Most timesharing systems today use
time slices of 10,000 - 100,000 instructions.

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
61

Implementation of priorities: run highest priority processes first, use roundrobin


among processes of equal priority. Re-insert process in run queue behind all
processes of greater or equal priority.

Even round-robin can produce bad results occasionally. Go through example of ten
processes each requiring 100 time slices.

STCF: shortest time to completion first with preemption. This minimizes the average
response time.

As an example, show two processes, one doing 1 ms computation followed by


10 ms I/O, one doing all computation. Suppose we use 100 ms time slice: I/O
process only runs at 1/10th speed, effective I/O time is 100 ms. Suppose we use
1 ms time slice: then computebound process gets interrupted 9 times
unnecessarily for each valid interrupt. STCF works quite nicely. Unfortunately,
STCF requires knowledge of the future. Instead, we can use past performance to
predict future performance.

Exponential Queue (also called "multi-level feedback queues"): attacks both


efficiency and response time problems.

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
62

Give newly runnable process a high priority and a very short time slice. If
process uses up the time, slice without blocking then decrease priority by 1 and
double time slice for next time.
Go through the above example, where the initial values are 1ms and priority
100.
Techniques like this one are called adaptive. They are common in interactive
systems.

Linux's new scheduler (version 2.6) makes this all-very complex:

Two queues: one with active (eligible to run) processes and with expired (not
eligible to run) processes.
140 priority levels, but the top 100 are reserved for "real time" processes.
Always choose a process from the highest non-empty priority level.
Priority level is the sum of its static priority and its dynamic priority bonus,
which the scheduler assigns as an estimate of its interactivity.
Static priorities range from 0-39 (number of queues) and dynamic priority
bonuses range from -5 to +5.
This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
63

Time slices assigned based on static priority, giving higher-priority tasks larger
time slices and lower-priority tasks shorter time slices.
A task might not use all of its time slice at once, since it could block or be
preempted before it finishes, but eventually it consumes the entire amount.
When that happens, the task is usually placed on the expired array with a new
time slice and a recalculated priority.
An interactive task receives the same time slice as others at the same static
priority, but the slice is divided into smaller pieces. When it finishes a piece, the
task will round robin with other tasks at the same priority level. Execution
rotates more frequently among interactive tasks of the same priority, but higher-
priority tasks will run for longer before expiring

PROGRESS CHECK

Differentiate preemptive and non-preemptive scheduling.

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
64

What are the two bases for the OS to make decisions about resources?

What hardware components affect the Dispatcher latency?

Describe the advantages and disadvantages of the different scheduling algorithms.

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
65

Week No.: __11-13__

TOPIC/S:

Process Synchronization Deadlocks

EXPECTED COMPETENCIES

1. Describe process synchronization capabilities of an OS

2. Discover synchronization mechanisms

3. Illustrate deadlock processes, its detection, prevention, and avoidance.

CONTENT/TECHNICAL INFORMATION

Process Synchronization

In order to maximize computing capabilities, resources must be fully utilized.


Thus, running process must coordinate with each other when accessing
resources and use shared data. The operating system manages this coordination.

Cooperating processes are processes that share resources.


While executing many concurrent processes, process synchronization helps to maintain
shared data consistency and cooperating process execution.

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
66

Processes have to be scheduled to ensure that concurrent access to shared data does
not create inconsistencies.

Data inconsistency can result in what is called a race condition.

A race condition occurs when two or more operations are executed at the same
time, not scheduled in the proper sequence, and not exited in the critical section
correctly. 40

Critical Section Problem


A critical section is a segment of code that can be accessed by only one signal process
at a certain instance in time.
This section consists of shared data resources that need to be accessed
by other processes.

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
67

The entry to the critical section is handled by the wait () function,


The exit from a critical section is controlled by the signal () function
Only one process can be executed inside the critical section at a time.
Other processes waiting to execute their critical sections have to wait
until the current process finishes executing its critical section.

Solution to Critical Section Problem


A solution to the critical section problem must satisfy the following three
conditions:

1. Mutual Exclusion
Out of a group of cooperating processes, only one process can be in its critical
section at a given point of time.

2. Progress
If no process is in its critical section, and if one or more threads want to
execute their critical section then any one of these threads must be allowed to
get into its critical section.

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
68

4. Bounded Waiting
After a process makes a request for getting into its critical section, there
is a limit for how many other processes can get into their critical section, before
this process's request is granted. So after the limit is reached, system must grant
the process permission to get into its critical section.

5. Semaphore
A semaphore is simply a variable that stores an integer value. This
integer can be accessed by two operations: wait() and signal(). When a process
enters the critical section, P(s) is invoked and the semaphore s is set to 1. After
the process exits the critical section, s is re-initialized to 0.

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
69

DEADLOCKS

A deadlock is a situation faced by current operating systems in order to deal with


41
multiple processes.
A deadlock happens in operating system when two or more processes need some
resource to complete their execution that is held by the other process.

A set of processes is in a deadlock state if every process in the set is waiting for an
event (release) that can only be caused by some other process in the same set

In the above diagram, the process 1 has resource 1 and needs to acquire resource
2. Similarly process 2 has resource 2 and needs to acquire resource 1.

resource to complete their execution but neither of them is willing to relinquish


their resources.

Deadlock Detection

A deadlock can be detected by a resource scheduler as it keeps track of


all the resources that are allocated to different processes. After a deadlock is
detected, it
Terminate all process. This is not a good approach as all the progress
made by the processes is destroyed.
This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
70

Resources can be preempted from some processes and given to others


till the deadlock is resolved.

Deadlock Prevention

Restrain the ways request can be made. It is very important to prevent


a deadlock before it can occur. So, the system checks each transaction before it
is executed to make sure it does not lead to deadlock. If there is even a slight
chance that a transaction may lead to deadlock in the future, it is never allowed
to execute.

Deadlock Avoidance

It is better to avoid a deadlock rather than take measures after the


deadlock has occurred. The wait for graph can be used for deadlock avoidance.
This is however only useful for smaller databases as it can get quite complex in
larger databases.42

To avoid deadlock. the system requires some additional priori


information available Simplest and most useful model requires that each
process declare the maximum number of resources of each type that it may need
The deadlock-avoidance algorithm dynamically examines the
resourceallocation state to ensure that there can never be a circular-wait
condition Resource-allocation state is defined by the number of available and
allocated resources, and the maximum demands of the processes

Basic Facts

If a system is in safe state no deadlocks If a system is in unsafe state possibility of


deadlock

PROGRESS CHECK

Research on the following Classical Problems of Synchronization include their solutions


This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
71

Bounded Buffer (Producer-Consumer) Problem


Dining Philosophers Problem
The Readers Writers Problem

What happens when a system experiences deadlocks?

LIST OF REFERENCES

Textbook/s:

William Shay (January 14, 1997). An Introduction to Operating Systems.


Prentice Hall
Silberschatz A., Galvin P.B. Operating System Concepts, 5 th Edition, John
Wiley and Sons. Dhamdhere D.M., Tata. Systems Programming and
Operating Systems, 2nd Revised Edition, McGraw Hill Publishing Company
Ltd., New Delhi.

Laboratory Manuals:
Please see separate laboratory module

On-Line Resources:

1. https://www.learncomputerscienceonline.com
2. http://ssc.xaam.in
3. https://turbofuture.com
4. http://ssc.xaam.in
5. https://medium.com
6. http://www.vvitengineering.com
7. https://wps.prenhall.com
8. https://www.unf.edu
9. https://sea.pcmag.com
10. http://www.ddegjust.ac.in

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
72

11. https://procodersp.blogspot.com
12. https://www.kullabs.com
13. https://www.cs.uic.edu
14. https://www.enterprisestorageforum.com
15. https://www.computerscienceeducationhub.in
16. http://cs.wellesley.edu
17. https://ecomputernotes.com
18. https://medium.com
19. http://www.idc-online.com/technical_references
20. https://www.geeksforgeeks.org

21. https://www.tutorialspoint.com
22. https://www.coursehero.com 23.
https://www.researchgate.net
24. http://faculty.salina.k-state.edu
25. https://diffzi.com
26. https://prepinsta.com
27. http://digitalthinkerhelp.com
28. https://www.geekboots.com
29. https://study.com
30. https://www.ni.com
31. https://www.studytonight.com
32. https://smallbusiness.chron.com
33. https://www.sciencedirect.com
34. https://study.com/academ
35. https://www.ques10.com
36. http://www.cs.kent.edu/~farrell/osf03/lectures/ch4-2.pdf
37. http://www.facweb.iitkgp.ac.in/~isg/OS/SLIDES/ch3Processe
s.pdf
38. http://pages.cs.wisc.edu/~bart/537/lecturenotes/s11.html
39. http://www2.latech.edu/~box/os/ch05.pdf
40. https://www.unf.edu/public/cop4610/ree/Notes/PPT/Silbe
r/ch5.pdf
41. https://study.com/search/text/academy.html?q=+deadlock
s&src=studyAnswer&pageType=lesson#/topresults/%20d
eadlocks
42. https://www.tutorialspoint.com/process-deadlocks-
inoperating-system

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.
73

ABOUT THE AUTHOR/S

MARIA RODELYN TIBON


Faculty, Computer Technology Department
Mariarodelyn_tibon@tup.edu.ph
09083580346

This module is a property of Technological University of the Philippines Visayas and intended for
EDUCATIONAL PURPOSES ONLY and is NOT FOR SALE NOR FOR REPRODUCTION.

You might also like