Documente Academic
Documente Profesional
Documente Cultură
Outline
1.1 What is OS 1.2 Computer System Organization 1.3 Computer System Architecture 1.4 OS Structure 1.5 OS Operations 1. !1." #rocess$ %emory$ Storage management 1.& #rotection and Security 1.1'( Systems
An operating system is a program that manages the computer hard*are. It also pro+ides a ,asis -or application programs and acts as an intermediary ,et*een the computer user and computer hard*are.
.he computer system can ,e di+ided roughly into -our components/ .he hard*are .he operating system .he application so-t*are .he 0sers
1. 2. 3. 4.
0S12 3ie* o- OS
S8S.1% +ie* o- OS
OS is a resource allocator %anages all resources 4C#0 time$ memory space$ storage space$ I9O and so on6 :ecides ,et*een con-licting re;uests -or e--icient and -air resource use OS is a control program Controls e<ecution o- programs to pre+ent errors and improper use o- the computer
Computer Startup
Bootstrap program is loaded at po*er up or re,oot .ypically stored in 2O%$ generally 7no*n as firmware Initialize all aspects o- system >oads operating system 7ernel and starts e<ecution
I9O de+ices and the C#0 can e<ecute concurrently. 1ach de+ice controller is in charge o- a particular de+ice type. 1ach de+ice controller has a local ,u--er.
Interrupt .imeline
.here-ore$ most computer pro+ide secondary storage as e<tension to store *e, ,ro*ser$ compliers$ *ord processors?etc
Storage systems organized in hierarchy. Speed Cost 3olatility Caching@copying in-ormation into -aster storage systemA main memory can ,e +ie*ed as a last cache -or secondary storage.
Caching
In-ormation in use copied -rom slo*er to -aster storage temporarily Important principle$ per-ormed at many le+els in a computer 4in hard*are$ operating system$ so-t*are6
Caching
Cache is usually smaller than storage ,eing cached Cache management is an important design pro,lem Cache size and replacement policy
On a single processor system$ there is only one main C#0 capa,le o- e<ecuting a general purpose instruction set. Some other special!purpose processors may also included. Such as/ C#0 :is7!controller microprocessor Dey,oard microprocessor
Also called Parallel Systems Ad+antages/ Increase throughput 1conomy o- scale Increase relia,ility 4-ault tolerant6
1. 2. 3.
1. Asymmetric multiprocessing 4master and sla+e processors6 2. Symmetric multiprocessing 4Shared memory system6
Clustered computers share storage and are closely lin7ed +ia Local-area network (LA ! or a -aster interconnection.
1.4 OS Architecture
One o- the most important aspect o- OS is the a,ility to Multiprogramming
Single user cannot 7eep C#0 and I9O de+ices ,usy at all times One Eo, selected and run +ia "o# sc$eduling When it has to *ait 4-or I9O -or e<ample6$ OS s*itches to another Eo,
Multiprogramming
Fo,s are stored in GFo, #oolH Virtual memory is the use-ul techni;ue -or the limitation size o- p$ysical memory
1.5 OS operations
We need to ma7e sure that an error in a user program could cause pro,lems only -or the one program that *as running 4such as in-inite loop6
%ual-mode operation allo*s OS to protect itsel- and other system components It contains user mode 4mode ,it/16 and &ernel mode 4mode ,it/'6
.he operating system loaded user application starts in user mode. Whene+er a trap or interrupt occurs$ hard*are s*itches to 7ernel mode.
Privileged instructions/ some machine instructions that may cause harm$ can only ,e e<ecuted in 7ernel mode.
Such as instruction s*itch to user modeA I9O controlA timer management$ and interrupt management.
.imer
.o pre+ent the OS out o- control ,y C#0
Set interrupt a-ter speci-ic period Operating system decrements counter When counter zero generate an interrupt Set up ,e-ore scheduling process to regain control or terminate program that e<ceeds allotted time
#rocess management
A process is a program in e<ecution. It is a unit o- *or7 *ithin the system. #rocess needs resources to accomplish its tas7 C#0$ %emory$ -iles$ I9O de+ices #rocess termination re;uires reclaim oany reusa,le resources
#rocess management
Single!threaded process has one program counter (P'! speci-ying location o- ne<t instruction to e<ecute
#rocess e<ecutes instructions se;uentially$ one at a time until completion
#rocess management
.he operating system is responsi,le -or the -ollo*ing acti+ities in connection *ith process management/
Creating and deleting ,oth user and system processes 4Ch36 Suspending and resuming processes 4Ch56 #ro+iding mechanisms -or process synchronization 4Ch 6 #ro+iding mechanisms -or process communication 4Ch46 #ro+iding mechanisms -or deadloc7 handling4chN6
%emory %anagement
All data in memory ,e-ore and a-ter processing All instructions in memory in order to e<ecute %emory management determines *hat is in memory *hen optimizing C#0 utilization and computer response to users
Deeping trac7 o- *hich parts o- memory are currently ,eing used and ,y *hom :eciding *hich processes and data to mo+e into and out o- memory Allocating and deallocating memory space as needed
Storage %anagement
OS pro+ides uni-orm$ logical +ie* oin-ormation storage
file 1ach medium is controlled ,y de+ice 4i.e.$ dis7 dri+e$ tape dri+e6
Storage %anagement
Bile!System management Biles usually organized into directories Access control on most systems to determine *ho can access *hat OS acti+ities include 1. Creating and deleting -iles and directories 2. #rimiti+es to manipulate -iles and dirs 3. %apping -iles onto secondary storage 4. =ac7up -iles onto sta,le 4non!+olatile6 storage media
0sually dis7s used to store data that does not -it in main memory or data that must ,e 7ept -or a GlongH period o- time. OS acti+ities Bree!space management Storage allocation :is7 scheduling .ertiary storage includes optical storage$ magnetic tape 3aries ,et*een WO2% 4*rite!once$ read!many! times6 and 2W 4read!*rite6
1. 2. 3. 4. 5.
Protection@any mechanism -or controlling access o- processes or users to resources de-ined ,y the OS 4Ch146 Security@de-ense o- the system against internal and e<ternal attac7s e+en *hen protection is acti+ated 4Ch156
4including denial!o-!ser+ice$ *orms$ +iruses$ identity the-t$ the-t o- ser+ice6
0ser identities 4user (%s$ security I:s6 include name and associated num,er$ one per user 0ser I: then associated *ith all -iles$ processes othat user to determine access control Croup identi-ier 4group (%6 allo*s set o- users to ,e de-ined and controls managed$ then also associated *ith each process$ -ile Privilege escalation allo*s user to change to e--ecti+e I: *ith more rights
Computing 1n+ironments
.raditional computer
Client!Ser+er computing
Another model o- distri,uted system #2# does not distinguish clients and ser+ers
Instead all nodes are considered peers %ay each act as client$ ser+er or ,oth Oode must Eoin #2# net*or7
1. 2. 3.
We,!=ased computing
We, has ,ecome u,i;uitous %ore de+ices ,ecoming net*or7ed to allo* *e, access$ such as *or7 stations$ e+en cell phone
0ser inter-ace #rogram e<ecution Bile!system manipulation Communication 1rror detection 2esource allocation Accounting #rotection and security