Re: Interrupts and PIO within Linux

Rogier Wolff (R.E.Wolff@BitWizard.nl)
Fri, 17 Oct 1997 09:54:22 +0200 (MET DST)


Richard B. Johnson wrote:
>
>
>
> Sorry this is large...

> This is intended to be a definitive report on the Intel
> REP OUTSB and
> REP OUTSW
> REP OUTSD
> operations used within the Linux Kernel.
>
> o These instructions have been used since the first
> PC/AT for loading the hard disk sector buffer which is a
> hardware FIFO. The BIOS source code is provided in the IBM
> Technical Reference Manual for the IBM Personal Computer AT.
>
> o These instructions have also been used for loading
> Serial Network Interface Controllers (SNICS) in various
> Network cards.
>
> o The Intel reference manuals, including the Intel 486
> Programmer's Reference Manual document their use. ISBN 1-
> 55512-159-4. Page 26-245 and Page 26-227.
>
> o These instructions allow a programmer to use the
> Microprocessor as a DMA controller, reading data from memory
> and writing it to a port. The source address memory pointer
> is automatically adjusted and a counter is automatically
> decremented during the Microprocessor's execution of these
> codes. The data transfer operation stops when the counter
> register is decremented to zero. This is generally called
> Programmed I/O (PIO) operation.
>
> After each transfer, and after the counter is decremented,
> the CPU will acknowledge any pending interrupt. As long as
> the values within the appropriate registers are saved and
> then restored by the ISR, operation will continue after an
> interrupt. If the registers ESI(si), EDX(dx), ECX(cx), or
> the direction flag is changed, operation is undefined.
> Otherwise, operation continues after interrupt execution.

Richard, Nobody on the linux-kernel needs convincing that these
instructions exist, are documented and can be used to transfer to/from
harddisks.

> o Unlike DMA, the CPU is used continually for the
> operation. Therefore, in many applications, these
> instructions may n