內(nèi)容課件教案ch_第1頁
內(nèi)容課件教案ch_第2頁
內(nèi)容課件教案ch_第3頁
內(nèi)容課件教案ch_第4頁
內(nèi)容課件教案ch_第5頁
已閱讀5頁,還剩35頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

1、1.2Silberschatz, Galvin and Gagne 2005Operating System Concepts 7th Edition, Jan 12, 2005nWhat Operating Systems DonComputer-System OrganizationnComputer-System ArchitecturenOperating-System StructurenOperating-System OperationsnProcess ManagementnMemory ManagementnStorage ManagementnProtection and

2、SecuritynDistributed SystemsnSpecial-Purpose SystemsnComputing Environments1.3Silberschatz, Galvin and Gagne 2005Operating System Concepts 7th Edition, Jan 12, 2005nTo provide a grand tour of the major operating systems componentsnTo provide coverage of basic computer system organization1.4Silbersch

3、atz, Galvin and Gagne 2005Operating System Concepts 7th Edition, Jan 12, 2005nA program that acts as an intermediary between a user of a computer and the computer hardware.nOperating system goals:lExecute user programs and make solving user problems easier.lMake the computer system convenient to use

4、.nUse the computer hardware in an efficient manner.1.5Silberschatz, Galvin and Gagne 2005Operating System Concepts 7th Edition, Jan 12, 2005nComputer system can be divided into four componentslHardware provides basic computing resources4CPU, memory, I/O deviceslOperating system4Controls and coordina

5、tes use of hardware among various applications and userslApplication programs define the ways in which the system resources are used to solve the computing problems of the users4Word processors, compilers, web browsers, database systems, video gameslUsers4People, machines, other computers1.6Silbersc

6、hatz, Galvin and Gagne 2005Operating System Concepts 7th Edition, Jan 12, 20051.7Silberschatz, Galvin and Gagne 2005Operating System Concepts 7th Edition, Jan 12, 2005nOS is a resource allocatorlManages all resourceslDecides between conflicting requests for efficient and fair resource usenOS is a co

7、ntrol programlControls execution of programs to prevent errors and improper use of the computer1.8Silberschatz, Galvin and Gagne 2005Operating System Concepts 7th Edition, Jan 12, 2005nNo universally accepted definitionn“Everything a vendor ships when you order an operating system” is good approxima

8、tionlBut varies wildlyn“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 program1.9Silberschatz, Galvin and Gagne 2005Operating System Concepts 7th Edition, Jan 12, 2005nbootstrap progr

9、am is loaded at power-up or rebootlTypically stored in ROM or EPROM, generally known as firmwarelInitializates all aspects of systemlLoads operating system kernel and starts execution1.10Silberschatz, Galvin and Gagne 2005Operating System Concepts 7th Edition, Jan 12, 2005nComputer-system operationl

10、One or more CPUs, device controllers connect through common bus providing access to shared memorylConcurrent execution of CPUs and devices competing for memory cycles1.11Silberschatz, Galvin and Gagne 2005Operating System Concepts 7th Edition, Jan 12, 2005nI/O devices and the CPU can execute concurr

11、ently.nEach device controller is in charge of a particular device type.nEach device controller has a local buffer.nCPU moves data from/to main memory to/from local buffersnI/O is from the device to local buffer of controller.nDevice controller informs CPU that it has finished its operation by causin

12、g an interrupt.1.12Silberschatz, Galvin and Gagne 2005Operating System Concepts 7th Edition, Jan 12, 2005nInterrupt transfers control to the interrupt service routine generally, through the interrupt vector, which contains the addresses of all the service routines.nInterrupt architecture must save t

13、he address of the interrupted instruction.nIncoming interrupts are disabled while another interrupt is being processed to prevent a lost interrupt.nA trap is a software-generated interrupt caused either by an error or a user request.nAn operating system is interrupt driven.1.13Silberschatz, Galvin a

14、nd Gagne 2005Operating System Concepts 7th Edition, Jan 12, 2005nThe operating system preserves the state of the CPU by storing registers and the program counter.nDetermines which type of interrupt has occurred:lpollinglvectored interrupt systemnSeparate segments of code determine what action should

15、 be taken for each type of interrupt1.14Silberschatz, Galvin and Gagne 2005Operating System Concepts 7th Edition, Jan 12, 20051.15Silberschatz, Galvin and Gagne 2005Operating System Concepts 7th Edition, Jan 12, 2005nAfter I/O starts, control returns to user program only upon I/O completion.lWait in

16、struction idles the CPU until the next interruptlWait loop (contention for memory access).lAt most one I/O request is outstanding at a time, no simultaneous I/O processing.nAfter I/O starts, control returns to user program without waiting for I/O completion.lSystem call request to the operating syst

17、em to allow user to wait for I/O completion.lDevice-status table contains entry for each I/O device indicating its type, address, and state.lOperating system indexes into I/O device table to determine device status and to modify table entry to include interrupt.1.16Silberschatz, Galvin and Gagne 200

18、5Operating System Concepts 7th Edition, Jan 12, 2005SynchronousAsynchronous1.17Silberschatz, Galvin and Gagne 2005Operating System Concepts 7th Edition, Jan 12, 20051.18Silberschatz, Galvin and Gagne 2005Operating System Concepts 7th Edition, Jan 12, 2005nUsed for high-speed I/O devices able to tran

19、smit information at close to memory speeds.nDevice controller transfers blocks of data from buffer storage directly to main memory without CPU intervention.nOnly one interrupt is generated per block, rather than the one interrupt per byte.1.19Silberschatz, Galvin and Gagne 2005Operating System Conce

20、pts 7th Edition, Jan 12, 2005nMain memory only large storage media that the CPU can access directly.nSecondary storage extension of main memory that provides large nonvolatile storage capacity.nMagnetic disks rigid metal or glass platters covered with magnetic recording material lDisk surface is log

21、ically divided into tracks, which are subdivided into sectors.lThe disk controller determines the logical interaction between the device and the computer. 1.20Silberschatz, Galvin and Gagne 2005Operating System Concepts 7th Edition, Jan 12, 2005nStorage systems organized in hierarchy.lSpeedlCostlVol

22、atilitynCaching copying information into faster storage system; main memory can be viewed as a last cache for secondary storage.1.21Silberschatz, Galvin and Gagne 2005Operating System Concepts 7th Edition, Jan 12, 20051.22Silberschatz, Galvin and Gagne 2005Operating System Concepts 7th Edition, Jan

23、12, 2005nImportant principle, performed at many levels in a computer (in hardware, operating system, software)nInformation in use copied from slower to faster storage temporarilynFaster storage (cache) checked first to determine if information is therelIf it is, information used directly from the ca

24、che (fast)lIf not, data copied to cache and used therenCache smaller than storage being cachedlCache management important design problemlCache size and replacement policy1.23Silberschatz, Galvin and Gagne 2005Operating System Concepts 7th Edition, Jan 12, 2005nMovement between levels of storage hier

25、archy can be explicit or implicit1.24Silberschatz, Galvin and Gagne 2005Operating System Concepts 7th Edition, Jan 12, 2005nMultitasking environments must be careful to use most recent value, no matter where it is stored in the storage hierarchynMultiprocessor environment must provide cache coherenc

26、y in hardware such that all CPUs have the most recent value in their cachenDistributed environment situation even more complexlSeveral copies of a datum can existlVarious solutions covered in Chapter 171.25Silberschatz, Galvin and Gagne 2005Operating System Concepts 7th Edition, Jan 12, 2005nMultipr

27、ogramming needed for efficiencylSingle user cannot keep CPU and I/O devices busy at all timeslMultiprogramming organizes jobs (code and data) so CPU always has one to executelA subset of total jobs in system is kept in memorylOne job selected and run via job schedulinglWhen it has to wait (for I/O f

28、or example), OS switches to another jobnTimesharing (multitasking) is logical extension in which CPU switches jobs so frequently that users can interact with each job while it is running, creating interactive computinglResponse time should be 1 secondlEach user has at least one program executing in

29、memory processlIf several jobs ready to run at the same time CPU schedulinglIf processes dont fit in memory, swapping moves them in and out to runlVirtual memory allows execution of processes not completely in memory1.26Silberschatz, Galvin and Gagne 2005Operating System Concepts 7th Edition, Jan 12

30、, 20051.27Silberschatz, Galvin and Gagne 2005Operating System Concepts 7th Edition, Jan 12, 2005nInterrupt driven by hardwarenSoftware error or request creates exception or traplDivision by zero, request for operating system servicenOther process problems include infinite loop, processes modifying e

31、ach other or the operating systemnDual-mode operation allows OS to protect itself and other system componentslUser mode and kernel mode lMode bit provided by hardware4Provides ability to distinguish when system is running user code or kernel code4Some instructions designated as privileged, only exec

32、utable in kernel mode4System call changes mode to kernel, return from call resets it to user1.28Silberschatz, Galvin and Gagne 2005Operating System Concepts 7th Edition, Jan 12, 2005nTimer to prevent infinite loop / process hogging resourceslSet interrupt after specific periodlOperating system decre

33、ments counterlWhen counter zero generate an interruptlSet up before scheduling process to regain control or terminate program that exceeds allotted time1.29Silberschatz, Galvin and Gagne 2005Operating System Concepts 7th Edition, Jan 12, 2005nA process is a program in execution. It is a unit of work

34、 within the system. Program is a passive entity, process is an active entity.nProcess needs resources to accomplish its tasklCPU, memory, I/O, fileslInitialization datanProcess termination requires reclaim of any reusable resourcesnSingle-threaded process has one program counter specifying location

35、of next instruction to executelProcess executes instructions sequentially, one at a time, until completionnMulti-threaded process has one program counter per threadnTypically system has many processes, some user, some operating system running concurrently on one or more CPUslConcurrency by multiplex

36、ing the CPUs among the processes / threads1.30Silberschatz, Galvin and Gagne 2005Operating System Concepts 7th Edition, Jan 12, 2005The operating system is responsible for the following activities in connection with process management:nCreating and deleting both user and system processesnSuspending

37、and resuming processesnProviding mechanisms for process synchronizationnProviding mechanisms for process communicationnProviding mechanisms for deadlock handling1.31Silberschatz, Galvin and Gagne 2005Operating System Concepts 7th Edition, Jan 12, 2005nAll data in memory before and after processingnA

38、ll instructions in memory in order to executenMemory management determines what is in memory whenlOptimizing CPU utilization and computer response to usersnMemory management activitieslKeeping track of which parts of memory are currently being used and by whomlDeciding which processes (or parts ther

39、eof) and data to move into and out of memorylAllocating and deallocating memory space as needed1.32Silberschatz, Galvin and Gagne 2005Operating System Concepts 7th Edition, Jan 12, 2005nOS provides uniform, logical view of information storagelAbstracts physical properties to logical storage unit - f

40、ilelEach medium is controlled by device (i.e., disk drive, tape drive)4Varying properties include access speed, capacity, data-transfer rate, access method (sequential or random)nFile-System managementlFiles usually organized into directorieslAccess control on most systems to determine who can acces

41、s whatlOS activities include4Creating and deleting files and directories4Primitives to manipulate files and dirs4Mapping files onto secondary storage4Backup files onto stable (non-volatile) storage media1.33Silberschatz, Galvin and Gagne 2005Operating System Concepts 7th Edition, Jan 12, 2005nUsuall

42、y disks used to store data that does not fit in main memory or data that must be kept for a “l(fā)ong” period of time.nProper management is of central importancenEntire speed of computer operation hinges on disk subsystem and its algorithmsnOS activitieslFree-space managementlStorage allocationlDisk sch

43、edulingnSome storage need not be fastlTertiary storage includes optical storage, magnetic tapelStill must be managedlVaries between WORM (write-once, read-many-times) and RW (read-write)1.34Silberschatz, Galvin and Gagne 2005Operating System Concepts 7th Edition, Jan 12, 2005nOne purpose of OS is to

44、 hide peculiarities of hardware devices from the usernI/O subsystem responsible forlMemory 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

45、 with input of other jobs)lGeneral device-driver interfacelDrivers for specific hardware devices1.35Silberschatz, Galvin and Gagne 2005Operating System Concepts 7th Edition, Jan 12, 2005nProtection any mechanism for controlling access of processes or users to resources defined by the OSnSecurity def

46、ense of the system against internal and external attackslHuge range, including denial-of-service, worms, viruses, identity theft, theft of servicenSystems generally first distinguish among users, to determine who can do whatlUser identities (user IDs, security IDs) include name and associated number

47、, one per userlUser ID then associated with all files, processes of that user to determine access controllGroup identifier (group ID) allows set of users to be defined and controls managed, then also associated with each process, filelPrivilege escalation allows user to change to effective ID with more rights1.36Silberschatz, Galvin and Gagne 2005Operating System Concepts 7th Edition, Jan 12,

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論