2015/10/14 10/8OS作業 | |
---|---|
名稱 | 10/8OS作業 |
日期 | 2015/10/14 |
課程名稱 | 作業系統 |
指導教師 | 劉艾華 |
1.
Give two reasons why caches are useful.
What problems do they solve?
What problems do they cause?
If a cache can be made as large as the device for which it is caching
(for instance, a cache as large as a disk), why not make it that large and eliminate the device?
一
Caches are useful when two or more components need to ex-change data, and the components perform transfers at differing speeds.
If the fast device finds the data it needs in the cache, it need not wait for the slower device.
二
Caches solve the transfer problem.
三
If a component has a data value change, and the datum is also in the cache, the cache must also be updated.
四
If the component retains its data when electricity is removed, the cache must retain data as well.
Faster storage tends to be more expensive
2.
What Is the purpose of interrupts? What are the differences between a trap and an interrupt?
Can traps be generated intentionally by a user program?
If so, for what purpose?
一
An interrupt is a hardware-generated change of flow within the system.
二
An interrupt handler is called to deal with the cause of the interrupt; control is then returned to the interrupted context and instruction.
A trap is a software-generated interrupt. An interrupt can be used to signal the completion of an I/O to obviate the need for device polling.
三
A trap can be generated intentionally by a user program. It can be used to call operating system routines or to catch arithmetic errors.
3.
Please tell the functional differences between CPU and device controller.
Is there any similarity between them?
A device controller is a part of a computer system that makes sense of the signals going to, and coming from the CPU .
Because of the different CPU architectures such as data/instruction format,distribution,decoding,different interface and mode of operation are different,but use may also be mixed.
4.
Please discuss, in your own words, the cycle of the handling of an interrupt.
When the CPU is interrupted, it stops what it is doing and immediately transfers execution to a fixed location.
The fixed location usually contains the starting address where the service routine for the interrupt is located.
The interrupt service routine executes; on completion, the CPU resumes the interrupted computation.
更新日期:2015/10/15 下午 08:49:11