心得分享

Card image cap

呂同學 報告/作業 分享經驗 10/15 10/8 OS作業

10/15 10/8 OS作業
名稱 10/8 OS作業
日期 10/15
課程名稱 作業系統
指導教師 劉艾華

1.(I)Caches are useful when two or more components need to ex-change data, and the components perform transfers at differing speeds.

(II)Caches solve the transfer problem by providing a buffer of intermediate speed between the components.

(III)If the fast device finds the data it needs in the cache, it need not wait for the slower device. The data in the cache must be kept consistent with the data in the components. If a component has a data value change, and the datum is also in the cache, the cache must also be updated. This is especially a problem on multiprocessor systems where more than one process may be accessing a datum.

(IV)A component may be eliminated by an equal-sized cache, but only if:
(a) the cache and the component have equivalent state-saving capacity (that is, if the component retains its data when electricity is removed, the cache must retain data as well)
(b) the cache is affordable, because faster storage tends to be more expensive.


2.(I) An interrupt is a hardware-generated change-of-flow within the system. An interrupt handler is summoned 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 used to call operating system routines or to catch arithmetic errors.

(II)Interrupt:Hardware generated interrupt ; Trap:Software generated interrupt

(III)yes

(IV)User programs create traps for debugging purposes. A trap can be used to call the OS routines or to catch arithmetic errors.

3.The differences between CPU and device controller is that CPU is the device,which controls all the operations, but device controller translates software input into something a hardware device understands.CPU and device controllers all use a common bus for communication
A device controller is a part of a computer system that makes sense of the signals going to, and coming from the CPU.

4.First, the device driver will load the appropriate registers
within the device controller. Then, the device controller
examines the contents of these registers to determine
what action to take. The device controller starts to transfer
data form the device to its local buffer. When the transfer
is complete, the device controller will send interrupt to
device driver. The device driver then returns control to the
operating system.

更新日期:2015/10/15 上午 03:16:47