当前位置:高等教育资讯网  >  中国高校课件下载中心  >  大学文库  >  浏览文档

上海交通大学:《操作系统 Operating System》课程教学资源(课件讲稿)OS-process_Lec4

资源类别:文库,文档格式:PDF,文档页数:21,文件大小:356.66KB,团购合买
点击下载完整版文档(PDF)

OPERATING SYSTEMS 1 龚玲 lgong@sjtu.edu.cn

OPERATING SYSTEMS 龚玲 lgong@sjtu.edu.cn 1

REVIEW o Interrupt o Dual Mode o System Calls vs.APIs o Multiprogramming/Concurrency ohttp://wenku.baidu.com/course/study/77fldcccda38376ba flfae94#665ea0c7aa00b52acfc7ca94

REVIEW  Interrupt  Dual Mode  System Calls vs. APIs  Multiprogramming/Concurrency  http://wenku.baidu.com/course/study/77f1dcccda38376ba f1fae94#665ea0c7aa00b52acfc7ca94

INTERRUPT TIMELINE CPU user process executing L I/O interrupt processing l/O idle device transferring 1/0 transfer V/O transfer request done request done

INTERRUPT TIMELINE

COMMON FUNCTIONS OF INTERRUPTS o Interrupt transfers control to the interrupt service routine generally,through the interrupt vector, which contains the addresses of all the service routines. o Interrupt architecture must save the address of the interrupted instruction. o Incoming interrupts are disabled while another interrupt is being processed to prevent a lost interrupt. o A trap is a software-generated interrupt caused either by an error or a user request. o An operating system is interrupt driven

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 save 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 OPERATIONS o Interrupt driven by hardware o Software error or request creates exception or trap Division by zero,request for operating system service o Other process problems include infinite loop, processes modifying each other or the operating system

OPERATING-SYSTEM OPERATIONS  Interrupt driven by hardware  Software error or request creates exception or trap  Division by zero, request for operating system service  Other process problems include infinite loop, processes modifying each other or the operating system

INTERRUPT HANDLING o The operating system preserves the state of the CPU by storing registers and the program counter. o Determines which type of interrupt has occurred: ·polling vectored interrupt system o Separate segments of code determine what action should be taken for each type of interrupt user process user mode user process executing calls system call return from system call (mode bit=1) kernel trap return mode bit =0 mode bit =1 kernel mode execute system call (mode bit =0)

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

OPERATING SYSTEM STRUCTURE o Multiprogramming needed for efficiency Single user cannot keep CPU and I/O devices busy at all times Multiprogramming organizes jobs (code and data)so CPU always has one to execute A subset of total jobs in system is kept in memory One job selected and run via job scheduling When it has to wait (for I/O for example),OS switches to another job

OPERATING SYSTEM STRUCTURE  Multiprogramming needed for efficiency  Single user cannot keep CPU and I/O devices busy at all times  Multiprogramming organizes jobs (code and data) so CPU always has one to execute  A subset of total jobs in system is kept in memory  One job selected and run via job scheduling  When it has to wait (for I/O for example), OS switches to another job

OPERATING SYSTEM STRUCTURE (CONT.) Timesharing (multitasking)is logical extension in which CPU switches jobs so frequently that users can interact with each job while it is running, creating interactive computing Response time should be 1 second Each user has at least one program executing in memory →process If several jobs ready to run at the same timeCPU scheduling If processes don't fit in memory,swapping moves them in and out to run Virtual memory allows execution of processes not completely in memory

OPERATING SYSTEM STRUCTURE (CONT.)  Timesharing (multitasking) is logical extension in which CPU switches jobs so frequently that users can interact with each job while it is running, creating interactive computing  Response time should be < 1 second  Each user has at least one program executing in memory process  If several jobs ready to run at the same time  CPU scheduling  If processes don’t fit in memory, swapping moves them in and out to run  Virtual memory allows execution of processes not completely in memory

MEMORY LAYOUT FOR MULTIPROGRAMMED SYSTEM 0 operating system job 1 job2 job 3 job 4 512M

MEMORY LAYOUT FOR MULTIPROGRAMMED SYSTEM

CONCURRENCY o What problem does concurrent mechanism solve? o Why use concurrent mechanism?

CONCURRENCY  What problem does concurrent mechanism solve?  Why use concurrent mechanism?

点击下载完整版文档(PDF)VIP每日下载上限内不扣除下载券和下载次数;
按次数下载不扣除下载券;
24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
共21页,试读已结束,阅读完整版请下载
相关文档

关于我们|帮助中心|下载说明|相关软件|意见反馈|联系我们

Copyright © 2008-现在 cucdc.com 高等教育资讯网 版权所有