心得分享

Card image cap

郭同學 報告/作業 分享經驗 10/08 OS作業

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

1.
Caches are useful when two or more components need to ex-change data, and the components perform transfers at differing speeds. Caches solve the transfer problem by providing a buffer of intermediate speed between the components. 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.
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),
and
(b) the cache is affordable, because faster storage tends to be more expensive.

2.
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 pooling. A trap can be used to call operating system routines or to catch arithmetic errors.

3.
The main functions of a device controller are interfacing with the computer system and I/O device, receiving and decoding commands from the computer, generating control signals to I/O device, transferring data form the computer to the device or form the device to the computer.
The similarity between device controller and CPU is the importance in operating system. Because device controller, CPU knows when it should stop the instruction. In the meanwhile, without CPU, we can’t implement almost everything in a computer.

4.
Interrupt handlers have a multitude of functions, which vary based on the reason the interrupt was generated and the speed at which the interrupt handler completes its task. For example, pressing a key on a computer keyboard, or moving the mouse, triggers interrupts that call interrupt handlers which read the key, or the mouse's position, and copy the associated information into the computer's memory.
An interrupt handler is a low-level counterpart of event handlers. These handlers are initiated by either hardware interrupts or interrupt instructions in software, and are used for servicing hardware devices and transitions between protected modes of operation such as system calls.

更新日期:2015/10/15 下午 12:00:08