Peripherals are any of the many external devices that connect to the the computer.

The communication channel between the processor an the peripherals is called a bus

Interrupts

An interrupt allows the device to literally interrupt the processor to flag some information.

Devices are generally connected to an programmable interrupt controller (PIC), a separate chip that is part of the mother board which buffers and communicate interrupt information to the main processor.

Saving state

Operating system will save any state of the operation that is running when an interrupt happen, to return to the running operation when finished handling the interrupt.

Types of Interrupts

There are two main ways of signalling interrupts on a line - level and edge triggered.

Level-triggered interrupts define a voltage of the interrupt line being held high to indicate an interrupt is pending. Edge-triggered interrupts detect transitions on the bus; that is when the line voltage goes from low to high.

Non-maskable interrupts

non-maskable interrupts (NMI) are the interrupts which couldn’t be masked or prevented from work. The typical example is the reset interrupt.

NMIs can be useful for implementing things such as a system watchdog, where a NMI is raised periodically and sets some flag that must be acknowledged by the operating system.

DMA

Direct Memory Access (DMA) is a method of transferring data directly between an peripheral and system RAM.