Each device controller is in charge of a specific type of device (for example, a disk drive, audio device, or graphics display). Depending on the controller, more than one device may be attached. For instance, one system USB port can connect to a USB hub, to which several devices can connect. A device controller maintains some local buffer storage and a set of special-purpose registers. The device controller is responsible for moving the data between the peripheral devices that it controls and its local buffer storage.
입출력 장치의 입력(읽기) 동작 = device → local buffer
입출력 장치의 출력(쓰기 동작 = local buffer → device
Typically, operating systems have a device driver for each device controller. This device driver understands the device controller and provides the rest of the operating system with a uniform interface to the device. The CPU and the device controllers can execute in parallel, competing for memory cycles. To ensure orderly access to the shared memory, a memory controller synchronizes access to the memory.
CPU, device controllers compete for memory cycle: CPU와 입출력 장치가 메모리 접근을 두고 경쟁
CPU burst and I/O burst: 한 프로세스가 CPU 연산 및 입출력에 사용하는 시간
cycle stealing: CPU가 메모리를 사용하지 않는 intruction cycle 동안 입출력 장치가 메모리에 접근
입출력 작업 명령 방법: CPU가 장치 컨트롤러 레지스터에 특정 값을 쓰면 장치 컨트롤러는 입출력 작업을 시작한다.
인터럽트 핸들러 = 인터럽트 서비스 루틴