ch02-Comouter-System Structures.ppt_第1頁
ch02-Comouter-System Structures.ppt_第2頁
ch02-Comouter-System Structures.ppt_第3頁
ch02-Comouter-System Structures.ppt_第4頁
ch02-Comouter-System Structures.ppt_第5頁
已閱讀5頁,還剩24頁未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡介

1、Operating System Concepts,Chapter 2: Computer-System Structures,Computer System Operation I/O Structure Storage Structure Storage Hierarchy Hardware Protection General System Architecture,Operating System Concepts,Computer-System Architecture,Operating System Concepts,Computer-System Operation,I/O d

2、evices 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 i

3、t has finished its operation by causing an interrupt.,Operating System Concepts,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 s

4、ave the address of the interrupted instruction. Incoming interrupts are disabled while another interrupt is being processed to prevent a lost interrupt. A trap is a software-generated interrupt caused either by an error or a user request. An operating system is interrupt driven.,Operating System Con

5、cepts,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,Ope

6、rating System Concepts,Interrupt Time Line For a Single Process Doing Output,Operating System Concepts,I/O Structure,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 o

7、ne I/O request is outstanding at a time, no simultaneous I/O processing. After I/O starts, control returns to user program without waiting for I/O completion. System call request to the operating system to allow user to wait for I/O completion. Device-status table contains entry for each I/O device

8、indicating its type, address, and state. Operating system indexes into I/O device table to determine device status and to modify table entry to include interrupt.,Operating System Concepts,Two I/O Methods,Synchronous,Asynchronous,Operating System Concepts,Device-Status Table,Operating System Concept

9、s,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 on interrupt is generated per block, rather than the one inte

10、rrupt per byte.,Operating System Concepts,Storage Structure,Main memory only large storage media that the CPU can access directly. Secondary storage extension of main memory that provides large nonvolatile storage capacity. Magnetic disks rigid metal or glass platters covered with magnetic recording

11、 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.,Operating System Concepts,Moving-Head Disk Mechanism,Operating System Concepts,Storage Hierarchy,Storage systems org

12、anized in hierarchy. Speed Cost Volatility Caching copying information into faster storage system; main memory can be viewed as a last cache for secondary storage.,Operating System Concepts,Storage-Device Hierarchy,Operating System Concepts,Caching,Use of high-speed memory to hold recently-accessed

13、data. Requires a cache management policy. Caching introduces another level in storage hierarchy. This requires data that is simultaneously stored in more than one level to be consistent.,Operating System Concepts,Migration of A From Disk to Register,Operating System Concepts,Hardware Protection,Dual

14、-Mode Operation I/O Protection Memory Protection CPU Protection,Operating System Concepts,Dual-Mode Operation,Sharing system resources requires operating system to ensure that an incorrect program cannot cause other programs to execute incorrectly. Provide hardware support to differentiate between a

15、t least two modes of operations. 1.User mode execution done on behalf of a user. 2.Monitor mode (also kernel mode or system mode) execution done on behalf of operating system.,Operating System Concepts,Dual-Mode Operation (Cont.),Mode bit added to computer hardware to indicate the current mode: moni

16、tor (0) or user (1). When an interrupt or fault occurs hardware switches to monitor mode.,Privileged instructions can be issued only in monitor mode.,monitor,user,Interrupt/fault,set user mode,Operating System Concepts,I/O Protection,All I/O instructions are privileged instructions. Must ensure that

17、 a user program could never gain control of the computer in monitor mode (I.e., a user program that, as part of its execution, stores a new address in the interrupt vector).,Operating System Concepts,Use of A System Call to Perform I/O,Operating System Concepts,Memory Protection,Must provide memory

18、protection at least for the interrupt vector and the interrupt service routines. In order to have memory protection, add two registers that determine the range of legal addresses a program may access: Base register holds the smallest legal physical memory address. Limit register contains the size of

19、 the range Memory outside the defined range is protected.,Operating System Concepts,Use of A Base and Limit Register,Operating System Concepts,Hardware Address Protection,Operating System Concepts,Hardware Protection,When executing in monitor mode, the operating system has unrestricted access to both monitor and users memory. The load i

溫馨提示

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

最新文檔

評論

0/150

提交評論