Download as pdf or txt
Download as pdf or txt
You are on page 1of 31

Chapter 1: Introduction

Objectives
 To provide a grand tour of the major operating systems components

 To provide coverage of basic computer system organization


What is an Operating System?

 A program that acts as an intermediary between a user of a


computer and the computer hardware

 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
Computer System Structure

 Computer system can be divided into four components:


 Hardware – provides basic computing resources
 CPU, memory, I/O dev ices

 Operating system
 Controls and coordinates use of hardware among v arious
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, v ideo
games
 Users
 People, machines, other computers
Four Components of a Computer System
What Operating Systems Do
 Depends on the point of view
 Users want convenience, ease of use
 Don’t care about resource utilization

 Handheld computers are resource poor, optimized for usability and


battery life
 Some computers have little or no user interface, such as embedded
computers in devices and automobiles
Operating System Definition

 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 System Definition (Cont.)

 No universally accepted definition

 “The one program running at all times on the computer” is the


kernel. Everything else is either a system program or an
application program.
Operating System Kernel

 Along with the kernel there are two other types of programs.
 system program
 application program
 System programs are associated with the operating system but
are not necessarily part of the kernel.
 System programs coordinates the complete system hardware
and provides an environment for all the other types of software
to work in it.
 Drivers, networking system, website servers, data backup
Operating System Kernel

 Application programs include all programs not associated with


the operation of the system.
 Application programs help the user to perform task of his
choice.
 Non-essential, install and run depending upon requirement.
 Editors, word processors, games, browsers
Operating System Kernel

 Kernel is the central module of the OS.


 It is the part of OS that loads first and it remains in main
memory.
 It is important for the kernel to be as small as possible while still
providing all the essential services required by the other part of
the OS and applications.
 Kernel code is usually loaded into a protected area of memory
to prevent it from being overwritten by programs or other parts
of the OS.
 Every OS has the kernel.
Computer Startup
 bootstrap program is loaded at power-up or reboot
 Typically stored in ROM or EPROM
 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
Interrupts
 Interrupt is an event generated by a device in a computer to
get the attention of CPU.
 Interrupt handler deals with the cause of the interrupt.
 When interrupt is generated, the execution of the current
process is stopped.
 Control goes to the OS kernel.
 OS save the state of the CPU through program counter register.
 Control is transferred to the interrupt service routine(ISR)
generally, through the interrupt vector, which contains the
addresses of all the service routines.
 An operating system execute the appropriate interrupt service
routine to handle the interrupt.
Interrupts

 When interrupt is handled, control goes to the program again


and the next instruction of the program is executed.

 Separate segments of code determine what action should be


taken for each type of interrupt.
 An operating system must be interrupt driven.
Trap

 A trap is a software-generated interrupt caused either by an


error or a user request.
 Divide by zero or invalid memory address.
 Trap service routines (TSR) are used to handle the traps.
 When trap is generated, the execution of the current process is
terminated.
 Control goes to the OS kernel.
 OS kernel call the appropriate TSR to handle the trap.

 In case of traps, the state of the CPU is not stored.


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

 Magnetic 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
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
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
Types of OS
 Within the broad family of operating systems, following are
few well known OS’s
 Batch OS
 Single User, single task OS
 Single User, Multitasking OS
 Multiprogramming OS
 Multiprocessing OS
 Real time OS
 Mobile OS
 Time sharing OS
 Distributed OS
Batch Operating system

 In the era of 1970s, the Batch processing was very popular.


The Jobs were executed in batches. People were used to
have a single computer which was called mainframe.
 In this type of system, there is no direct interaction between
user and the computer.
 The user has to submit a job (written on cards or tape) to a
computer operator.
 Then computer operator places a batch of several jobs on
an input device.
 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.
Single User, Single Task
 This type of operating systems are designed to manage
the computer so that one user can effectively do one
thing at a time.
 The Palm OS for Palm handheld computers is a good
example of a modern single-user, single-task operating
system (e.g., PDA and MS-DOS)
Single User, Multitask
 This type of operating systems are mostly used in desktop
or/and laptop computers today.
 Microsoft's Windows and Apple's Mac OS platforms are
both examples of operating systems that will let a single
user have several programs in operation at the same time.
Multiprogramming OS
 Multi-programming increases CPU utilization by organizing
jobs (code and data) so that the CPU always has one to
execute. The idea is to keep multiple jobs in main memory.
If one job gets occupied with IO, CPU can be assigned to
other job.
Multiprocessing Operating System
 In Multiprocessing, Parallel computing is achieved. There
are more than one processors present in the system which
can execute more than one process at the same time. This
will increase the throughput of the system.
Real Time Operating System
 In Real Time systems, each job carries a certain deadline
within which the Job is supposed to be completed,
otherwise the huge loss will be there or even if the result is
produced then it will be completely useless.
 The Application of a Real Time system exists in the case of
military applications, if you want to drop a missile then the
missile is supposed to be dropped with certain precision.
 Hard real time operating system
 Soft real time operating system
Mobile Operating System
 A mobile OS controls a mobile device and its design to
supports wireless communication and mobile applications.
 It has built-in support for mobile multimedia formats. Tablet
PCs and smart phones run on mobile operating systems.
Time-sharing operating systems
 Multiple jobs are executed by the CPU by switching
between them, but the switches occur so frequently. Thus,
the user can receive an immediate response. For example,
in a transaction processing, the processor executes each
user program in a short burst or quantum of computation.
That is, if n users are present, then each user can get a time
quantum. When the user submits the command, the
response time is in few seconds at most.
 The operating system uses CPU scheduling and
multiprogramming to provide each user with a small
portion of a time.
Distributed operating systems
 Distributed computing
 Collection of separate, possibly heterogeneous, systems
networked together
 Network is a communications path, TCP/IP most common
 Local Area Network (LAN)
 Wide Area Network (WAN)
 Metropolitan Area Network (MAN)
 Personal Area Network (PAN)

 Network Operating System provides features between


systems across network communication scheme allows
systems to exchange messages

You might also like