chapter 1 of Operating system by gagne.ppt

51b48265a74f87 629 views 63 slides Feb 14, 2024
Slide 1
Slide 1 of 63
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49
Slide 50
50
Slide 51
51
Slide 52
52
Slide 53
53
Slide 54
54
Slide 55
55
Slide 56
56
Slide 57
57
Slide 58
58
Slide 59
59
Slide 60
60
Slide 61
61
Slide 62
62
Slide 63
63

About This Presentation

Os slide


Slide Content

1.1 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
Course Introduction
Course Name: Operating Systems
Credit Hours: 3 (2-3)
Contact Hours: 2-3
Pre-requisites: Data Structures
Reference Materials: (or use any other standard and latest books)
1.OperatingSystemsConcepts,9theditionbyAbrahamSilberschatz
2.ModernOperatingSystems,4theditionbyAndrewS.Tanenbaum
3.OperatingSystems,InternalsandDesignPrinciples,9theditionbyWilliam
Stallings

1.2 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
Course Learning Outcomes

Silberschatz, Galvin and Gagne ©2013Operating System Concepts –9
th
Edit9on
Chapter 1: Introduction

1.4 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
Chapter 1: Introduction
What Operating Systems Do
Computer-System Organization
Computer-System Architecture
Operating-System Structure
Operating-System Operations
Process Management
Memory Management
Storage Management
Protection and Security
Kernel Data Structures
Computing Environments
Open-Source Operating Systems

1.5 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
Objectives
To describe the basic organization of computer systems
To provide a grand tour of the major components of operating systems
To give an overview of the many types of computing environments
To explore several open-source operating systems

1.6 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
What is an Operating System?
Anoperatingsystemmanagesacomputer’shardware.
Italsoprovidesabasisforapplicationprogramsandacts
asanintermediarybetweenthecomputeruserandthe
computerhardware
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

1.7 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
What is an Operating System?
Anoperatingsystemislargeandcomplex,itmustbe
createdpiecebypiece.
Eachofthesepiecesshouldbeawell-delineatedportion
ofthesystem,withcarefullydefinedinputs,outputs,and
functions.

1.8 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
Computer System Structure
Computer system can be divided into four components:
1.Hardware –provides basic computing resources
CPU
Memory
I/O devices
2.Operating system
Controls and coordinates use of hardware among
various applications and users

1.9 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
Computer System Structure
3.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
4.Users
People, machines, other computers

1.10 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
Four Components of a Computer System

1.11 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
What Operating Systems Do: User View
On Personal Computer (PC) Users want
convenience, easeofuse
Don’t care about resourceutilization
Butsharedcomputersuchasmainframeor
minicomputermustkeepallusershappy.The
operatingsysteminsuchcasesisdesignedto
maximizeresourceutilization

1.12 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
What Operating Systems Do: User View
Usersofdedicatesystemssuchasworkstationshave
dedicatedresourcesbutfrequentlyusesharedresources
fromservers.Therefore,theiroperatingsystemis
designedtocompromisebetweenindividualusabilityand
resourceutilization.
Handheldcomputersareresourcepoor,optimizedfor
usabilityandbatterylife
Somecomputershavelittleornouserinterface,suchas
embeddedcomputersindevicesandautomobiles

1.13 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
Operating System Definition: System View
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

1.14 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
Operating System Definition (Cont.)
Nouniversallyaccepteddefinition
“Everythingavendorshipswhenyouorderanoperating
system”isgoodapproximation
Butvarieswildly
“Theoneprogramrunningatalltimesonthecomputer”
isthekernel.Everythingelseiseitherasystemprogram
(shipswiththeoperatingsystem)oranapplication
program.

1.15 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
Computer Startup
bootstrap programis 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

1.16 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
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

1.17 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
Computer-System Operation
I/OdevicesandtheCPUcanexecuteconcurrently
Eachdevicecontrollerisinchargeofaparticular
devicetype
Eachdevicecontrollerhasalocalbuffer

1.18 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
Computer-System Operation
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

1.19 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
Common Functions of Interrupts
Interrupttransferscontroltotheinterruptserviceroutine
generally,throughtheinterruptvector,whichcontains
theaddressesofalltheserviceroutines
Interruptarchitecturemustsavetheaddressofthe
interruptedinstruction
Atraporexceptionisasoftware-generatedinterrupt
causedeitherbyanerrororauserrequest
Anoperatingsystemisinterruptdriven

1.20 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
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
vectoredinterrupt system
Separate segments of code determine what action
should be taken for each type of interrupt

1.21 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
I/O Structure
AfterI/Ostarts,controlreturnstouserprogramonlyupon
I/Ocompletion
WaitinstructionidlestheCPUuntilthenextinterrupt
Waitloop(contentionformemoryaccess)
AtmostoneI/Orequestisoutstandingatatime,no
simultaneousI/Oprocessing

1.22 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
I/O Structure
AfterI/Ostarts,controlreturnstouserprogramwithout
waitingforI/Ocompletion
Systemcall–requesttotheOStoallowusertowait
forI/Ocompletion
Device-statustablecontainsentryforeachI/O
deviceindicatingitstype,address,andstate
OSindexesintoI/Odevicetabletodeterminedevice
statusandtomodifytableentrytoincludeinterrupt

1.23 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
Storage Definitions and Notation Review
Computerstorageisgenerallymeasuredandmanipulated
inbytesandcollectionsofbytes.
1.akilobyte,orKB,is1,024bytes
2.amegabyte,orMB,is1,024
2
bytes
3.agigabyte,orGB,is1,024
3
bytes
4.aterabyte,orTB,is1,024
4
bytes
5.apetabyte,orPB,is1,024
5
bytes

1.24 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
Storage Definitions and Notation Review
Thebasicunitofcomputerstorageisthebit.Abitcancontainoneoftwovalues,0and1.
Allotherstorageinacomputerisbasedoncollectionsofbits.Givenenoughbits,itis
amazinghowmanythingsacomputercanrepresent:numbers,letters,images,movies,
sounds,documents,andprograms,tonameafew.Abyteis8bits,andonmostcomputers
itisthesmallestconvenientchunkofstorage.Forexample,mostcomputersdon’thavean
instructiontomoveabitbutdohaveonetomoveabyte.Alesscommontermisword,
whichisagivencomputerarchitecture’snativeunitofdata.Awordismadeupofoneor
morebytes.Forexample,acomputerthathas64-bitregistersand64-bitmemory
addressingtypicallyhas64-bit(8-byte)words.Acomputerexecutesmanyoperationsinits
nativewordsizeratherthanabyteatatime.
Computer storage, along with most computer throughput, is generally measured and
manipulated in bytes and collections of bytes.
A kilobyte, or KB, is 1,024 bytes
a megabyte, or MB, is 1,024
2
bytes
a gigabyte, or GB, is 1,024
3
bytes
a terabyte, or TB, is 1,024
4
bytes
a petabyte, or PB, is 1,024
5
bytes
Computer manufacturers often round off these numbers and say that a megabyte is 1
million bytes and a gigabyte is 1 billion bytes. Networking measurements are an exception
to this general rule; they are given in bits (because networks move data a bit at a time).

1.25 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
25
Metric Units
The metric prefixes

1.26 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
Direct Memory Access Structure
Usedforhigh-speedI/Odevicesabletotransmit
informationatclosetomemoryspeeds
Devicecontrollertransfersblocksofdatafrombuffer
storagedirectlytomainmemorywithoutCPUintervention
Onlyoneinterruptisgeneratedperblock,ratherthanthe
oneinterruptperbyte

1.27 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
Storage Structure
Main memory –only large storage media that the CPU
can access directly
Randomaccess
Typically volatile
Secondary storage –extension of main memory that
provides large nonvolatilestorage capacity

1.28 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
Storage Structure
Magneticdisks–rigidmetalorglassplatterscovered
withmagneticrecordingmaterial
Disksurfaceislogicallydividedintotracks,whichare
subdividedintosectors
Thediskcontrollerdeterminesthelogicalinteractionbetween
thedeviceandthecomputer
Solid-statedisks–fasterthanmagneticdisks,
nonvolatile
Varioustechnologies
Becomingmorepopular

1.29 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
Storage Hierarchy
Storage systems organized in hierarchy
Speed
Cost
Volatility
Caching–copyinginformationintofasterstorage
system;mainmemorycanbeviewedasacachefor
secondarystorage
Device Driver for each device controller to manage I/O
Provides uniform interface between controller and kernel

1.30 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
Storage-Device Hierarchy

1.31 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
Caching
Importantprinciple,performedatmanylevelsina
computer(inhardware,operatingsystem,software)
Informationinusecopiedfromslowertofasterstorage
temporarily
Fasterstorage(cache)checkedfirsttodetermineif
informationisthere
Ifitis,informationuseddirectlyfromthecache(fast)
Ifnot,datacopiedtocacheandusedthere
Cachesmallerthanstoragebeingcached
Cachemanagementimportantdesignproblem
Cachesizeandreplacementpolicy

1.32 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
Computer-System Architecture
Mostsystemsuseasinglegeneral-purposeprocessor
Most systems have special-purpose processors as well. Such as
disk, keyboard, and graphics controllers;
Theoperatingsystemcannotcommunicatewiththese
(special-purpose)processors;theydotheirjobs
autonomously

1.33 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
Computer-System Architecture
Multiprocessors:Suchsystemshavetwoormore
processorsinclosecommunication,sharingthecomputer
busandsometimestheclock,memory,andperipheral
devices
Multiprocessorsystemsfirstappearedprominently
appearedinserversandhavesincemigratedto
1.Desktop
2.Laptopsystems
3.Mobiledevices
4.SmartphonesandTabletcomputers

1.34 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
Computer-System Architecture
Multiprocessorssystems growing in use and importance
Also known as parallel systems, tightly-coupled systems
Advantages include:
1.Increased throughput
2.Economy of scale
3.Increased reliability –graceful degradationor fault
tolerance
Theabilitytocontinueprovidingserviceproportionaltothe
levelofsurvivinghardwareiscalledgraceful
degradation.Somesystemsgobeyondgraceful
degradationandarecalledfaulttolerant,becausethey
cansufferafailureofanysinglecomponentandstill
continueoperation

1.35 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
Computer-System Architecture
Multiprocessing systems are of two types:
1.AsymmetricMultiprocessing:therelationship
betweenmulticoreprocessors(heterogeneousor
homogeneous)ofasymmetricmultiprocessingisa
master-slaverelationship
2.SymmetricMultiprocessing:Allprocessorsof
sametype(maybeeitherheterogeneousor
homogeneous)ofsymmetricmultiprocessingare
peers;

1.36 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
Computer-System Architecture
Morespecifically,eachCPUinsymmetricmultiprocessing
runsthesamecopyoftheOS,whileinasymmetric
multiprocessing,theysplitresponsibilitiestypically,
thereforeeachmayhavespecialized(different)software
androles.

1.37 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
How a Modern Computer Works
A von Neumann architecture

1.38 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
Multi-chip and Multicore Architecture

1.39 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
A Dual-Core Design
Uniformmemory access(UMA)isashared
memoryarchitectureusedinparallelcomputers.
AlltheprocessorsintheUMAmodelsharethephysical
memoryuniformly.
InaUMAarchitecture,accesstimetoamemorylocation
isindependentofwhichprocessormakestherequestor
whichmemorychipcontainsthetransferreddata.

1.40 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
A Dual-Core Design
Non-uniformmemoryaccess(NUMA)isacomputer
memorydesignusedinmultiprocessing,wherethe
memoryaccesstimedependsonthememorylocation
relativetotheprocessor.
UnderNUMA,aprocessorcanaccessitsownlocal
memoryfasterthannon-localmemory(memorylocalto
anotherprocessorormemorysharedbetween
processors).

1.41 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
A Dual-Core Design
NUMA
UMA

1.42 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
A Dual-Core Design
Systems containing all chips vs. blade servers
Chassis containing multiple separate systems

1.43 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
Clustered Systems
They are composed of two or more individual systems—or
nodes—joined together.
Like multiprocessor systems, but multiple systems working
together
Usuallysharingstorageviaastorage-areanetwork(SAN)
Providesahigh-availabilityservicewhichsurvivesfailures
Someclustersareforhigh-performancecomputing(HPC)
Somehavedistributedlockmanager(DLM)toavoidconflicting
operations

1.44 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
Clustered Systems

1.45 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
Operating System Structure
Multiprogrammingisneededforefficiency.
Multiprogrammingisalsotheabilityofanoperating
systemtoexecutemorethanoneprogramonasingle
processormachine.
Morethanonetask/program/job/processcanresideinto
themainmemoryatonepointoftime.
Acomputerrunningexcelandfirefoxbrowser
simultaneouslyisanexampleofmultiprogramming.

1.46 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
Operating System Structure

1.47 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
Operating System Structure
Timesharing(multitasking)istheabilityofan
operatingsystemtoexecutemorethanonetask
simultaneouslyonasingleprocessormachine.
Thoughwesaysobutinrealitynotwotasksona
singleprocessormachinecanbeexecutedatthe
sametime.
ActuallyCPUswitchesfromonetasktothenexttask
soquicklythatappearsasifallthetasksare
executingatthesametime.
Morethanonetask/program/job/processcanreside
intothesameCPUatonepointoftime.

1.48 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
Memory Layout for Multiprogrammed System

1.49 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
Operating System Structure
Multiprocessingistheabilityofanoperatingsystem
toexecutemorethanoneprocesssimultaneouslyon
amultiprocessormachine.Inthis,acomputeruses
morethanoneCPUatatime.

1.50 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
Operating-System Operations
Interruptdrivenbyhardware
Softwareerrororrequestcreatesexceptionortrap
Divisionbyzero,requestforoperatingsystem
service,infiniteloop,processesmodifyingeach
otherortheoperatingsystem
Dual-modeoperationallowsOStoprotectitselfand
othersystemcomponents
Usermodeandkernelmode

1.51 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
Operating-System Operations
Modebitprovidedbyhardware
Providesabilitytodistinguishwhensystemis
runningusercodeorkernelcode
Someinstructionsdesignatedasprivileged,
onlyexecutableinkernelmode
Systemcallchangesmodetokernel,returnfrom
callresetsittouser

1.52 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
Process Management
Aprocessisaprograminexecution.Itisaunitofwork
withinthesystem.Programisapassiveentity,processis
anactiveentity.
Processneedsresourcestoaccomplishitstask
CPU,memory,I/O,files
Initializationdata
Processterminationrequiresreclaimofanyreusable
resources
Single-threadedprocesshasoneprogramcounter
specifyinglocationofnextinstructiontoexecute
Processexecutesinstructionssequentially,oneata
time,untilcompletion

1.53 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
Process Management
Multi-threadedprocesshasoneprogramcounterper
thread
Typicallysystemhasmanyprocesses,someuser,
someoperatingsystemrunningconcurrentlyononeor
moreCPUs
ConcurrencybymultiplexingtheCPUsamongthe
processes/threads

1.54 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
Process Management Activities
Theoperatingsystemisresponsibleforthefollowing
activitiesinconnectionwithprocessmanagement:
1.Creatinganddeletingbothuserandsystemprocesses
2.Suspendingandresumingprocesses
3.Providingmechanismsforprocesssynchronization
4.Providingmechanismsforprocesscommunication
5.Providingmechanismsfordeadlockhandling

1.55 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
Memory Management
All data in memory before and after processing
All instructions in memory in order to execute
Memory management determines what is in memory
when
Optimizing CPU utilization and computer response to
users

1.56 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
Memory Management
Memorymanagementactivities
Keepingtrackofwhichpartsofmemoryarecurrently
beingusedandbywhom
Decidingwhichprocesses(orpartsthereof)anddata
tomoveintoandoutofmemory
Allocatinganddeallocatingmemoryspaceas
needed

1.57 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
Storage Management
File-System management
Files usually organized into directories
Access control on most systems to determine who can
access what
OS activities include
Creating and deleting files and directories
Primitives to manipulate files and dirs
Mapping files onto secondary storage
Backup files onto stable (non-volatile) storage media

1.58 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
Performance of Various Levels of Storage

1.59 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
Migration of Integer A from Disk to Register
Multitasking environments must be careful to use most recent value, no
matter where it is stored in the storage hierarchy
Multiprocessor environment must provide cache coherency in
hardware such that all CPUs have the most recent value in their cache
Distributed environment situation even more complex
Several copies of a datum can exist
Various solutions covered in Chapter 17

1.60 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
I/O Subsystem
OnepurposeofOSistohidepeculiaritiesofhardwaredevicesfromthe
user
I/Osubsystemresponsiblefor
MemorymanagementofI/Oincludingbuffering(storingdata
temporarilywhileitisbeingtransferred),caching(storingpartsofdata
infasterstorageforperformance),spooling(theoverlappingofoutput
ofonejobwithinputofotherjobs)
Generaldevice-driverinterface
Driversforspecifichardwaredevices

1.61 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
Protection and Security
Protection–anymechanismforcontrollingaccessof
processesoruserstoresourcesdefinedbytheOS
Security–defenseofthesystemagainstinternaland
externalattacks
Hugerange,includingdenial-of-service,worms,
viruses,identitytheft,theftofservice

1.62 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts –9
th
Edition
Writeanswerstoexercisequestionfrom1.1to1.11
Onlyhandwrittenneatandcleanhomeworkwillbe
accepted.
Pagesizeandpagequalitythroughoutthe
courseshouldremainthesame.
Throughoutthiscourse,homeworkshouldbe
submittedtoCRinnextclassaftertheclass
attendance.
Homework

Silberschatz, Galvin and Gagne ©2013Operating System Concepts –9
th
Edit9on
End of Chapter 1
Tags