OPERATING
SYSTEM
Introduction
Program that manages the computer hardware
Acts as an intermediary between the computer user
and the computer hardware
Computer System Structure
OS provides an environment within which other programs can do useful work
Computer System Structure
Computer system can be divided into four components:
Hardware – provides basic computing resources
CPU, memory, I/O devices
Operating system - Controls and coordinates use of
hardware among various applications and users
Application programs – define the ways in which the
system resources are used to solve the computing
problems of the users
Word processors, compilers, web browsers, database
systems, video games
Users
People, machines, other computers
Operating system goals
Execute user programs and make solving user problems
easier
Make the computer system convenient to use
Use the computer hardware in an efficient manner
What is OS ?
OS is a resource allocator
Manages all resources
Decides between conflicting requests for efficient and
fair resource use
OS is a control program
Controls execution of programs to prevent errors and
improper use of the computer
What is OS ?
No universally accepted definition
“The one program running at all times on
the computer” is the kernel.
Everything else is either a system
program (ships with the operating
system) or an application program.
Operating system
Computer System Operation
Storage Structure
Process Management
A process is a program in execution
It is a unit of work within the system
Program is a passive entity, process is an
active entity
Process needs resources to accomplish its
task
CPU, memory, I/O, files
Initialization data
Process Management
Process termination requires reclaim of any
reusable resources
Single-threaded process has one program
counter specifying location of next
instruction to execute
Process executes instructions sequentially,
one at a time, until completion
Multi-threaded process has one program
counter per thread
Process Management
The operating system is responsible for the
following activities in connection with process
management:
Creating and deleting both user and system
processes
Suspending and resuming processes
Providing mechanisms for process
synchronization
Providing mechanisms for process communication
Providing mechanisms for deadlock handling
Memory Management
Main memory is a repository of quickly accessible
data shared by the CPU and I/O devices.
All data in memory before and after processing
All instructions in memory in order to execute
Memory management determines what is in
memory while
Optimizing CPU utilization and computer response
to users
Memory Management
To improve both the utilization of the cpu and
the speed of the computer’s response to its
users, general-purpose computers must keep
several programs in memory, creating a need for
memory management
Memory management activities
Keeping track of which parts of memory are currently
being used and by whom
Deciding which processes (or parts thereof) and data to
move into and out of memory
Allocating and deallocating memory space as needed
Storage Management
Operating system provides a uniform, logical view of
information storage
Abstracts from the physical properties of its storage
devices to define a logical storage unit file
Each medium is controlled by device (i.e., disk drive, tape
drive)
Varying properties include access speed, capacity, data-
transfer rate, access method (sequential or random
I/O Subsystem
One purpose of OS is to hide peculiarities of
hardware devices from the user
I/O subsystem responsible for:
Memory management of I/O including buffering
(storing data temporarily while it is being transferred),
caching (storing parts of data in faster storage for
performance), spooling (the overlapping of output of
one job with input of other jobs)
General device-driver interface
Drivers for specific hardware devices
Protection & Security
Protection – any mechanism for controlling access of
processes or users to resources defined by the OS
Security – defence of the system against internal and
external attacks
Huge range, including denial-of-service, worms, viruses,
identity theft, theft of service
Protection & Security
Systems generally first distinguish among users, to
determine who can do what
User identities (user IDs, security IDs) include name and
associated number, one per user
User ID then associated with all files, processes of that
user to determine access control
Group identifier (group ID) allows set of users to be defined
and controls managed, then also associated with each
process, file
Privilege escalation allows user to change to effective ID
with more rights
OS Services
OS Provides the fwg services
User interface
Program execution
I/0 operations
File-system manipulation
Communications
Error detection
Resource allocation
Accounting
Protection and security
OS Services
User interface
All operating systems have a user interface (UI)
Command-Line Interface (CLI) uses text
commands
Graphical User Interface (GUI) uses a window
system with a pointing device to direct I/O,
choose from menus and make selections and a
keyboard to enter text
Batch interface, in which commands and
directives to control those commands are
entered into files, and those files are executed
OS Services
Program execution
System must be able to load a program into
memory and to run that program
The program must be able to end its
execution, either normally or abnormally
I/0 operations
Program may require I/O, which may involve
a file or an I/O device
Users don’t control I/O, OS provides a
means to access I/O
OS Services
File-system manipulation
Programs need to read and write files and directories.
They also need to create and delete them by name, search for a given
file, and list file information.
Some programs include permissions management to allow or deny
access to files or directories based on file ownership
OS Services
Communications
Processes may exchange information, on the
same computer or between computers over a
network
Communications may be via shared memory
or through message passing (packets moved
by the OS)
OS Services
Error detection
OS needs to be constantly aware of possible
errors
May occur in the CPU and memory hardware,
in I/O devices, in user program
For each type of error, OS should take the
appropriate action to ensure correct and
consistent computing
Debugging facilities can greatly enhance the
user’s and programmer’s abilities to
efficiently use the system
OS Services
Resource allocation
Multiple users or multiple jobs running at
the same time, resources must be allocated
to each one of them
Resources are managed such as CPU cycles,
main memory, file storage, I/O device
CPU-scheduling routines
Routines to allocate printers, modems, USB
storage drives, other peripheral devices
OS Services
Accounting
keep track of which users use how much and what kinds
of computer resources
Used for improving the resource utilisation and may be
billing
Protection and security
The owners of information stored in a multiuser or
networked computer system may want to control use of
that information
Protection involves ensuring that all access to system
resources is controlled
Security of the system from outsiders requires user
authentication, extends to defending external I/O
devices from invalid access attempts
Virtual Machines
The fundamental idea behind a virtual
machine is to abstract the hardware of a
single computer into several different
execution environments
CPU, memory, disk drives, network interface
cards, and so forth
Creating the illusion that each separate
execution environment is running its own
private computer
Virtual Machines
The virtual-machine approach does not provide any
such additional functionality but rather provides an
interface that is identical to the underlying bare
hardware
Each process is provided with a (virtual) copy of
the underlying computer
Ability to share HW and run different execution
environments
Some sharing of file can be permitted, controlled
Commutate with each other, other physical systems
via networking
Useful for development, testing
Virtual Machines
(a) Nonvirtual machine (b) virtual machine
VMware
Hypervisors
A hypervisor, also known as a virtual machine monitor
or VMM, is software that creates and runs virtual
machines (VMs)
A hypervisor allows one host computer to support
multiple guest VMs by virtually sharing its resources,
such as memory and processing
Hypervisors
Type 1 “bare metal”
A type 1 hypervisor acts like a lightweight operating
system and runs directly on the host’s hardware
Type 2 “hosted”,
A type 2 hypervisor runs as a software layer on an
operating system, like other computer programs.
Hypervisors
NETWORKING
INTRO
A network is the interconnection of a set of
devices capable of communication
Computer networks aimed at
◦ Resource Sharing
◦ Robustness
◦ Load Balancing
◦ Location Independence
◦ Productivity
Network Criteria
Performance
◦ Throughput and Delay
Reliability
◦ Frequency of failure
◦ Time it takes a link to recover from a failure
Security
◦ Unauthorized access
◦ Protecting data from damage
Data Comn
Data comn are the exchange of data b/w two devices via some
form of txn medium such as wire cable.
These comn devices must be part of a comn sys (combination
of HW & SW)
Effectiveness of data comn depends upon
Delivery
Accuracy
Timeliness
Jitter (displacement)
Data Comn
Delivery. The system must deliver data to the correct destination. Data must
be received by the intended device or user and only by that device or user
Accuracy. The system must deliver the data accurately. Data that have been
altered in transmission and left uncorrected are unusable
Timeliness. The system must deliver data in a timely manner. Data delivered
late are useless. In the case of video and audio, timely delivery means delivering
data as they are produced, in the same order that they are produced, and
without significant delay. This kind of delivery is called real-time transmission
Jitter. Jitter refers to the variation in the packet arrival time. It is the uneven
delay in the delivery of audio or video packets. For example, let us assume that
video packets are sent every 30 ms. If some of the packets arrive with 30-ms
delay and others with 40-ms delay, an uneven quality in the video is the result
Types of Connections
Network Topologies
Bus
One long cable acts as a backbone to link all the devices
Nodes are connected to the bus cable by drop lines and taps
Bus
Advantages
◦ Ease of installation
◦ Less cabling
Disadvantages
◦ Difficult fault isolation
◦ Reconfiguration
Mesh Topology
Every device has a dedicated point-to-point link to every other device
n (n – 1) / 2 Links for n stations
Mesh Topology
Advantages
◦ Robust, if one link becomes unusable, it does not incapacitate the entire system
◦ Guaranteed dedicated link
◦ Security/Privacy
◦ Easy fault isolation
Disadvantages
◦ Cabling Reqmts
◦ Initial installation
◦ No of I/O Ports
Star Topology
Each device has a dedicated point-to-point link only to a central controller,
usually a hub
Star Topology
Advantages
◦ Easy to install and reconfigure
◦ Lesser Cabling than Mesh
◦ Robustness, if one link fails, only that link is affected
◦ Easy fault identification
Disadvantages
◦ Dependency of the whole topology on one single point, the hub
Ring Topology
Each device has a dedicated point-to-point connection with only the two
devices on either side of it
A signal is passed along the ring in one direction, from device to device,
until it reaches its destination
Ring Topology
Advantages
◦ Easy to install and reconfigure
◦ Lesser Cabling
◦ Easy fault identification
Disadvantages
◦ Break in the ring can disable the entire network
◦ Communication delay is directly proportional to the number of nodes
Types of Networks
LAN
MAN
WAN
PAN
TYPES OF NETWORK DEVICES
51
REPEATERS AND HUBS
REPEATER
• Repeater is a device designed to circumvent the max length
limitation of twisted-pair cable networks
• Two RJ 45 ports connected internally by an amp
• Can sp upto 100 mtr of cable at both ends
• Doubles the reach of the cable
HUB
• Repeater with more than 2 ports e.g. 4 or 8 ports
• Sig amplified and repeated to all other ports
• No more in use anymore due to formation of collision domains
REPEATERS
HUBS
SWITCHES
• Intelligent hubs
• Looks at the destination address and repeats the
incoming packet only on the port which can del the
packet to its intended destination
• MAC address
Unique throughout the entire world
Enables unique iden of every component in a
network
48 bits
Six octets (8 bits, written as 2 digit hexadecimal No)
separated by hyphens e.g. 48-E5-6A-1E-59-3D
SWITCHES
PACKETS
• Small units of data
• Incl MAC address of both sender and destination
• Header info
• Payload
• Ethernet Packet
56 bit preamble - synch
Start of frame marker – 1 Byte
Destination MAC address – 6 Bytes
Senders MAC address - 6 Bytes Frame
Tag – optional for VLAN
Ethertype – 2 bytes indicating specific info of protocol in the
payload
Payload – 46-1500 bytes
SWITCHES : FUNCTIONS
Learning
Examines the sending MAC address while
receiving
Maps that port with the MAC address
Adds this info to MAC address table
Forwarding database
SWITCHES : FUNCTIONS
Forwarding
Examines the destination MAC address
Looks up in the MAC address table, finds the port where it
can be reached, and forwards the packet out to that port.
Mandates memory buffers associated with ports
Doesn’t modify packet in any way
No idea or concern of the contents of the payload
SWITCHES : FUNCTIONS
Flooding
MAC address not present in the table
No way to know what port to forward packet to
Revert to act like hub : Forward to all avbl ports other
than the one where it arr
Packet forwarded even to ports for which the switch
has already learned a MAC address
BRIDGES
• A bridge is a network device that connects multiple LANs
(local area networks) together to form a larger LAN
• Operate at the data link layer
• Connects two or more different LANs that has a similar
protocol and provides communication between the devices
(nodes) in them
• Since they operate at data link layer, they transmit data as
data frames. On receiving a data frame, the bridge consults
a database to decide whether to pass, transmit or discard
the frame.
BRIDGES
ROUTERS
• Routers are networking devices operating at layer 3 or
a network layer
• responsible for receiving, analysing, and forwarding
data packets among the connected computer
networks
• When a data packet arrives, the router inspects the
destination address, consults its routing tables to
decide the optimal route and then transfers the
packet along this route.
ROUTERS