Unit 1 Class 1
Unit 1 Class 1
INTRODUCTION
Computer System - Elements and
organization; Operating System Overview -
Objectives and Functions - Evolution of
Operating System; Operating System
Structures – Operating System Services - User
Operating System Interface - System Calls –
System Programs - Design and Implementation
- Structuring methods.
Internal Computer Hardware
Motherboard
• The motherboard connects all the components in the computer.
The Processor
• The processor is a computer chip that carries out
instructions given by computer programs and handles
all the day to day tasks that a PC has to do.
• They used to use up an entire circuit board, but
nowadays, microprocessors like this one handle
everything from just one chip.
RAM
• RAM is a type of temporary computer data storage.
• It deals with temporary data requests such as keeping windows
open on a desktop or just viewing a file.
• RAM can also be overloaded which is the situation when a
window freezes during shutdown or stops working.
Hard Disk Drive ( HDD )
• The Hard Disk drive is a type of permanent computer data storage.
• Data is retrieved by using a series of rapidly spinning magnetic disks
that store the data.
• The spindle physically writes the data to the magnetic disk and is a
very delicate piece of hardware that must be handled carefully.
• Unlike RAM, hard drives retain data even if the machine is powered
off or cut off unexpectedly because of a power cut.
• Data can be lost if the hard drive breaks or becomes corrupt.
Graphics Card
• The graphics card is a type of expansion card that
processes and produces outputs for displays.
• These are a crucial component that monitors rely on.
• They also handle output of video (such as S-Video) to
projectors.
• They also have their own fans as this type of card gets
hot quickly and needs instant cooling.
Solid State Drive ( SDD )
• Solid State Drives are drives that have no actual mechanical parts
and are a form of computer data storage.
• There construction resembles that of a giant memory card found
in digital cameras.
• These drives boot up faster than traditional hard disks, but they
have less storage than their magnetic disks counterparts.
• They are also less susceptible to shock than regular hard disks,
reducing damage to the drive itself.
Storage Structure
• Main memory – only large storage media that the CPU can
access directly
– Random access
– Typically volatile
• Secondary storage – extension of main memory that provides
large nonvolatile storage capacity
• Hard disks – rigid metal or glass platters covered with magnetic
recording material
– Disk surface is logically divided into tracks, which are
subdivided into sectors
– The disk controller determines the logical interaction
between the device and the computer
• Solid-state disks – faster than hard disks, nonvolatile
– Various technologies
– Becoming more popular
Storage Hierarchy
• Storage systems organized in hierarchy
– Speed
– Cost
– Volatility
• Caching – copying information into faster
storage system; main memory can be viewed as
a cache for secondary storage
• Device Driver for each device controller to
manage I/O
– Provides uniform interface between controller and
kernel
Storage-Device Hierarchy
Caching
• Important principle, performed at many levels in a
computer (in hardware, operating system, software)
• Information in use copied from slower to faster
storage temporarily
• Faster storage (cache) checked first to determine if
information is there
– If it is, information used directly from the cache (fast)
– If not, data copied to cache and used there
• Cache smaller than storage being cached
– Cache management important design problem
– Cache size and replacement policy
Direct Memory Access Structure
• Used for high-speed I/O devices able to
transmit information at close to memory
speeds
• Device controller transfers blocks of data from
buffer storage directly to main memory
without CPU intervention
• Only one interrupt is generated per block,
rather than the one interrupt per byte
What is an Operating System?
Operating System
• An Operating System can be defined
as an interface between user and
hardware.
• It is responsible for the execution of
all the processes, Resource
Allocation, CPU management, File
Management and many other tasks.
• The purpose of an operating system
is to provide an environment in
which a user can execute programs
in convenient and efficient manner.
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
• 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
Operating systems from two viewpoints
• User View
PC - ease of use
Mainframe or a minicomputer - to maximize resource
utilization
Workstations and servers – compromise between
individual usability and resource utilization.
Handheld computers -performance per unit of
battery life
• System View
Resource allocator - CPU time, memory space,
file-storage space, I/O devices, and so on.
Control program - manages the execution of user
programs to prevent errors and improper use of the
computer.
• Operating system is the one program
running at all times on the
computer—usually called the kernel
a computer program that is the heart and
core of an Operating System.
Whenever a system starts, the Kernel is the
first program that is loaded after the boot
loader because the Kernel has to handle the
rest of the thing of the system for the
Operating System.
The Kernel remains in the memory until the
Operating System is shut-down.
There are two other types of programs:
Systems programs
associated with the operating system but are not
part of the kernel
Application programs
include all programs not associated with the
operation of the system.
What happen when a Computer
Startup???
• bootstrap program is loaded at power-up or
reboot
– Typically stored in ROM or EPROM, generally
known as firmware
– Initializes all aspects of system
– Loads operating system kernel and starts
execution
Computer System Organization
• Computer-system operation
– One or more CPUs, device controllers connect
through common bus providing access to shared
memory
– Concurrent execution of CPUs and devices
competing for memory cycles
• I/O devices and the CPU can execute
concurrently.
• Each device controller is in charge of a
particular device type.
• Each device controller has a local buffer.
• CPU moves data from/to main memory
to/from local buffers.
• I/O is from the device to local buffer of
controller.
• Device controller informs CPU that it has
finished its operation by causing an interrupt.
Interrupt Handling
• An interrupt is a necessary part of Computer
System Organisation as it is triggered by
hardware and software parts when they
need immediate attention.
• An interrupt can be generated by a device or
a program to inform the operating system to
halt its current activities and focus on
something else.
• The types of interrupts are better explained
using the following diagram −
• Hardware and software interrupts are two
types of interrupts.
• Hardware interrupts are triggered by
hardware peripherals while software
interrupts are triggered by software function
calls.
• Hardware interrupts are of further two types.
• Maskable interrupts can be ignored or
disabled by the CPU while this is not possible
for non maskable interrupts.
Common Functions of Interrupts
• Interrupt transfers control to the interrupt
service routine generally, through the
interrupt vector, which contains the addresses
of all the service routines
• Interrupt architecture must save the address
of the interrupted instruction
• A trap or exception is a software-generated
interrupt caused either by an error or a user
request
• An operating system is interrupt driven
Interrupt Handling
• The operating system preserves the state of
the CPU by storing registers and the program
counter
• Determines which type of interrupt has
occurred:
• polling
• vectored interrupt system
• Separate segments of code determine what
action should be taken for each type of
interrupt
Interrupt Timeline
• Synchronous I/O: After I/O starts, control returns
to user program only upon I/O completion
– Wait instruction idles the CPU until the next interrupt
– Wait loop (contention for memory access)
– At most one I/O request is outstanding at a time, no
simultaneous I/O processing
• Asynchronous I/O: After I/O starts, control
returns to user program without waiting for I/O
completion
– System call – request to the OS to allow user to wait
for I/O completion
– Device-status table contains entry for each I/O device
indicating its type, address, and state
– OS indexes into I/O device table to determine device
status and to modify table entry to include interrupt
Two I/O methods
IO structure
● To start an I/O operation;
○ The device driver loads the appropriate registers within the
device controller.
○ The device controller, in turn, examines the contents of
these registers to determine what action to take (such as
"read a character from the keyboard").
○ The controller starts the transfer of data from the device to
its local buffer.
○ Once the transfer of data is complete, the device controller
informs the device driver via an interrupt that it has finished
its operation.
○ The device driver then returns control to the OS, possibly
returning the data or a pointer to the data if the operation
was a read.
How a Modern Computer Works