10/8 OS作業

名稱
10/8 OS作業
日期
10/12
課程名稱
作業系統
指導教師
劉艾華
心得
1.
Caches are useful when two or more components need to exchange 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 cacheand the component have equivalent state-saving capacity (that is, if the componentretains 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.
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.
Each device controller has a local buffer and a command register. It communicates with the CPU by interrupts. A device's controller plays an important role in the operation of that device; it functions as a bridge between the device and the operating system.
A CPU uses complex algorithms and programming to interpret signals and code.A CPU retrieves information from the code within programs. It reads it to understand what the code is for, and then it executes the instructions.
They use binary and digital codes.

4.
In systems programming, an interrupt is a signal to the processor emitted by hardware or software indicating an event that needs immediate attention. An interrupt alerts the processor to a high-priority condition requiring the interruption of the current code the processor is executing. The processor responds by suspending its current activities, saving its state, and executing a function called an interrupt handler (or an interrupt service routine, ISR) to deal with the event. This interruption is temporary, and, after the interrupt handler finishes, the processor resumes normal activities.There are two types of interrupts: hardware interrupts and software interrupts.
Each interrupt has its own interrupt handler. The number of hardware interrupts is limited by the number of interrupt request (IRQ) lines to the processor, but there may be hundreds of different software interrupts. Interrupts are a commonly used technique for computer multitasking, especially in real-time computing.