Chaper 1-OS and Its Structures
Chaper 1-OS and Its Structures
Operating Systems
Introduction
Computer software can be divided roughly into two kinds:
1. System software:- which manages the operation of the computer itself.
Operating system
and users
games
Users
a. User view
The user view of a computer system depends on the types
ways:
o Sequential sharing:- a resource is allocated for exclusive
quickly.
6. Distributed Systems:- Distribute the computation among
several physical processors.
Distributed OS runs on and controls the resources of multiple
machines.
Contd.
7. Parallel Systems:- Multiprocessor systems with more than on CPU
in close communication.
firmware
Initializes all aspects of system
storage temporarily
Faster storage (cache) checked first to determine if
information is there
If it is, information used directly from the cache (fast)
cheaper to store those data on one disk and to have all the
processors share them than to have many computers with
local disks and many copies of the data.
iii. Increased Reliability.
Functions being distributed properly among several
processors, failure of one processor will not halt the system,
only slow it down.
If 10 processors are there and if one fails, then each of the
A.Asymmetric multiprocessors
Each processor is assigned a specific task. A master
clustered Systems
is a type of multi-CPU system
Have multiple CPUs to accomplish computational
work(like multiprocessor systems)
They are composed of two or more individual systems
coupled together(difference with multiprocessors)
They share storages and are closely liked via a LAN or
faster interconnect such as InfiniBand.
Provide high availability service(service will continue
even if one or more systems in the cluster fail)
structure(cont)
Clustering can be
a. asymmetric mode
─ One machine is in hot-stand-by mode, while
the other is running the application.
─ The HSM host machine does nothing but
actively monitors the server. If server fails,
the HSM become the active server.
b. Symmetric mode
─ Two or more hosts are running applications,
and are monitoring each other.
─ More efficient as it uses all of the available
hardware.
Operating System Structure
Multiprogramming needed for efficiency
Single user cannot keep CPU and I/O devices busy
at all times
Multiprogramming organizes jobs (code and data)
so CPU always has one to execute
A subset of total jobs in system is kept in memory
One job selected and run via job scheduling
When it has to wait (for I/O for example), OS
switches to another job.
Timesharing (multitasking) is logical
extension in which CPU switches jobs so
frequently that users can interact with each job
while it is running, creating interactive
computing
Response time should be < 1 second
OPERATING SYSTEM STRUCTURE(CONT)
Processor
switches
from one
process
to an
other
when
ever an
I/O event
Figure :-4 processes
or Timer are loaded to memory
interrupt in Multiprogramming
occurs systems
Operating System Components
All OSs have similar core components
Shell(User level)
Kernel (core)
The shell exposes functions to users and
applications
Piece of software that provides an interface for users
using either command-line or graphical interface
Acts as an interface between the user and the kernel.
Normally reside on disks and are loaded into memory
when needed.
The kernel (nucleus) interacts with hardware devices
Allocates time & memory to programs and handles the
file store & communication in response to system calls
Reside in memory all the time and is the hub of the OS
Operating-System Operations
Modern OS are interrupt driven.
Software error or request creates exception
or trap
Division by zero or invalid memory access.
Other process problems include infinite loop,
processes modifying each other or the
operating system
Dual-mode operation allows OS to protect
itself and other system components
User mode and kernel mode
Mode bit provided by hardware
Provides ability to distinguish when system is
running user code or kernel code
Some instructions designated as privileged, only
executable in kernel mode
System call changes mode to kernel, return from
call resets it to user
During a transition from User to Kernel Mode an infinite
loop may occur.
To prevent infinite loop / process hogging resources a
Timer is used.how?
o Set interrupt after specific period
o Operating system decrements counter
o When counter zero generate an interrupt
o Set up before scheduling process to regain control or
terminate program that exceeds allotted time
A computer system executing tasks on behalf of a user
applications, the system is in user mode.
When a user application requests service from an OS(via
system call) it is in kernel mode.
At system boot time, the hardware starts in kernel mode. Then
the OS is loaded and starts execution of user applications in a
user mode.
System call provide the means for a user program to ask the
OS to perform tasks reserved for the OS on the user’s
programs behalf.
Operating system services
debugging information
Typically, these programs format and print the output to
each of which can call any of the other ones whenever it needs
to.
When this technique is used, each procedure in the system
mode.
The basic discipline in layered OS design is that the routines of
one layer use only the facilities of the layer directly below it,
that is, no layer in the structure can be bypassed.
LAYERED APPROACH(CONT
LAYERED OPERATING
the Netherlands by E. W. Dijkstra and his students.
SYSTEM
LAYERED APPROACH(CONT)
The layered approach suffers from two problems:
OPERATING SYSTEM
AND ITS STRUCTURES