Minhaj university Lahore
Operating system
SYED FAHAD ZAKIR
Roll # 01
Reg # 2018f-mulbscs-085
Assignment # MID TERM ASSIGNMENT
Submitted to: Sir Saif Ali
Types of OS & Utilization of CPU
pg. 1
Table of Content
Abstract
• Introduction
(It’s all about the operating system, types of operating system and also utilization of CPU’s.
which covers first of all what is OS with examples, precisely one by one types and then
scheduling.)
• Conclusion
(This one is the main concept to understand about Computer science b/c every system to do
work firstly need OS.)
• Recommendations
(I want to recommend for beginner’s)
• References
(it’s mine idea so, contact me for further info)
• Appendix
Types of OS & Utilization of CPU
pg. 2
Question no 1: write briefly note on Types of Operating Systems?
Definition
An operating system (OS) is system software that manages computer
hardware, software resources, and provides common services for computer programs.
An operating system is a program that acts as an interface between the user and the
computer hardware and controls the execution of all kinds of programs.
Examples:
Some popular Operating Systems include
Linux Operating System, Windows
Operating System, VMS, OS/400, AIX,
z/OS, etc.
An Operating System (OS) is an interface
between a computer user and computer
hardware. An operating system is a
software which performs all the basic
tasks like file management, memory
management, process management,
handling input and output, and
controlling peripheral devices such as
disk drives and printers.
Types of Operating Systems:
Single-tasking and multi-tasking
A single-tasking system can only run one program at a time.
while a multi-tasking operating system allows more than one program to be running
in concurrency.
This is achieved by time-sharing, where the available processor time is divided between
multiple processes.
These processes are each interrupted repeatedly in time slices by a task-scheduling
subsystem of the operating system.
Types of OS & Utilization of CPU
pg. 3
Single- and multi-user
i. Single-user operating systems have no facilities to distinguish users, but may allow
multiple programs to run in tandem.
ii. A multi-user operating system extends the basic concept of multi-tasking with facilities
that identify processes and resources.
iii. such as disk space, belonging to multiple users, and the system permits multiple users to
interact with the system at the same time.
iv. Time-sharing operating systems schedule tasks for efficient use of the system and may
also include accounting software for cost allocation of processor time, mass storage,
printing, and other resources to multiple users.
Distributed
i. A distributed operating system manages a group of distinct, networked computers and
makes them appear to be a single computer
ii. As all computations are distributed (divided amongst the constituent computers).
Templated
i. In the distributed and cloud computing context of an OS, templating refers to creating a
single virtual machine image as a guest operating system, then saving it as a tool for
multiple running virtual machines.
ii. The technique is used both in virtualization and cloud computing management, and is
common in large server warehouses.
Embedded
i. Embedded operating systems are designed to be used in embedded computer systems.
ii. They are designed to operate on small machines with less autonomy.
iii. They are very compact and extremely efficient by design, and are able to operate with a
limited amount of resources.
iv. Windows CE and Minix 3 are some examples of embedded operating systems.
In preemptive multitasking, the operating
system slices the CPU time and dedicates a
slot to each of the programs.
Unix-like operating systems, such
as Solaris and Linux—as well as non-Unix-
like, such as AmigaOS—support
preemptive multitasking.
32-bit versions of both Windows NT and
Win9x used preemptive multi-tasking.
Cooperative multitasking is achieved by
relying on each process to provide time
to the other processes in a defined
manner.
16-bit versions of Microsoft Windows
used cooperative multi-tasking
Multi-tasking may be characterized in preemptive and co-operative types.
Types of OS & Utilization of CPU
pg. 4
Real-time
i. A real-time operating system is an operating system that guarantees to process events or
data by a specific moment in time.
ii. A real-time operating system may be single- or multi-tasking.
iii. when multitasking, it uses specialized scheduling algorithms so that
a deterministic nature of behavior is achieved.
iv. Such an event-driven system switches between tasks based on their priorities or external
events, whereas time-sharing operating systems switch tasks based on clock interrupts.
Library
i. A library operating system is one in which the services that a typical operating system
provides.
ii. such as networking, are provided in the form of libraries and composed with the
application and configuration code to construct a unikernel(a specialized, single address
space, machine image that can be deployed to cloud or embedded environments.)
………………………………………………………………………………………………………
……………
Question no:2 Illustrate the Basic Concepts Which Help to
Improve the Utilization of CPU’s
What is CPU Scheduling?
CPU scheduling is a process which allows one process to use the CPU while the
execution of another process is on hold (in waiting state) due to unavailability of any
resource.
like I/O etc., thereby making full use of CPU.
The aim of CPU scheduling is to make the system efficient, fast and fair.
Whenever the CPU becomes idle, the operating system must select one of the processes
in the ready queue to be executed.
The selection process is carried out by the short-term scheduler (or CPU scheduler).
The scheduler selects from among the processes in memory that are ready to execute, and
allocates the CPU to one of them.
Also we can say that, CPU utilization is the sum of work handled by a Central Processing
Unit.
It is also used to estimate system performance.
Types of OS & Utilization of CPU
pg. 5
CPU utilization can vary according to the type and amount of computing task
because some tasks require heavy CPU time while others require less CPU time.
Process time is another name for CPU time and is the amount of time used by a CPU for
processing instruction of an operating system or a computer program.
CPU time is quantified in clock ticks or seconds.
CPU utilization shows the burden on a processor in terms of percentage that indicates if
any changes are to be made in the system otherwise it may get exhausted of capacity.
CPU utilization can be calculated by using the following formulas.
Let us define CPU utilization as U:
U = 100% - (Percentage of time that is spent in idle task)
(Take the average time period of background task without load) * 100%
% time in idle task = -------------------------------------------------------------------------------
(Avg. period of background task including some load)
(BG loop count computed during 25 ms) *100%
Percentage time in idle task = ----------------------------------------------------------------
(BG loop count projected in an unloaded CPU)
Scaled % * (100%)
Actual % = ------------------------------
max value 8 bit value
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).