IO(from Linux Device Drivers http://www.xml.com/ldd/chapter/book/ch08.html)
Some platforms -- most notably the i386 -- can have problems when the processor tries to transfer data too quickly to or from the bus. The problems can arise because the processor is overclocked with respect to the ISA bus, and can show up when the device board is too slow. The solution is to insert a small delay after each I/O instruction if another such instruction follows. If your device misses some data, or if you fear it might miss some, you can use pausing functions in place of the normal ones. The pausing functions are exactly like those listed previously, but their names end in _p; they are called inb_p, outb_p, and so on. The functions are defined for most supported architectures, although they often expand to the same code as nonpausing I/O, because there is no need for the extra pause if the architecture runs with a nonobsolete peripheral bus.
There are also some more general docs on linux and pci programming:
A: yes, have a look at:
https://mail.rtai.org/pipermail/rtai/2003-October/005352.html
http://www.beyondlogic.org/spp/parallel.htm
http://people.redhat.com/twaugh/parport/html/parportguide.html
From the mailinglist:
outb(value,address) Standard parport (SPP) registers are at three consecutive addresses: base+0 = data register (read/write) base+1 = status register (read only) base+2 = control port (read/write) legacy ports have the base at 0x378 (LPT1) and 0x278 (LPT2). When the port is in output mode, a 1 in the data register will send that data line to ~3V, a 0 to about 0V. Your LED could be wired such that it goes on when the line goes to 0. You can (on PS/2 or EPP ports) switch the data lines into input mode by setting bit 5 in the control register. The input lines go high-impedance and their state will be mirrored when reading the data register. Here is an excellent paper about driving the parallel port: http://www.beyondlogic.org/spp/parallel.htm The examples are meant for DOS, so you need to translate: inportb(address) is inb(address) outportb(address,data) is outb(data,address)