Re: I/O Address Space

From: Robert Wessel (robertwessel2_at_yahoo.com)
Date: 05/07/04


Date: Fri, 7 May 2004 01:37:06 +0000 (UTC)


"Cameron Gibbs" <odly@hotmail.com> wrote in message news:<4099eb1f$1@news.comindico.com.au>...
> Hey folks.
>
> I got the impression from what I was told in the Linear Address Space thread
> that the I/O port addresses were mapped by hardware.
> However after reading the Input/Output section again in the IA-32 Software
> Developer's Manuals, it says things like:
> "I/O port addresses 0F8H through 0FFH are reserved. Do not assign I/O ports
> to these addresses."
> AND
> "Like words in memory, 16-bit ports should be aligned to even addresses (0,
> 2, 4, ...) so that all 16 bits can be transferred in a single bus cycle."
>
> I think they are probably just mistakenly talking to hardware developers in
> a Software Developer's manual however it does raise the question:
>
> Are I/O addresses mapped (assigned) by hardware or can they be assigned any
> address by a programmer?
> If they can be assigned by a programmer, how?

They're mapped by hardware. The hardware, in some case, can be
reprogrammed to use specific addresses. For example, an I/O port BAR
on a PCI card can be set to a specific I/O port by the BIOS or OS.
What happens then is that the PCI interface chip on the card then
listens on the programmed port. In the case of PCI you can't really
misalign a block of ports since the assigned block must be a power of
two and at least four bytes in size.

The 0xf8-0xff ports are just reserved for Intel and various processors
have various things with those ports. For example, the 286 used
several of those ports to talk to the 287.

As to the alignment comment, it's hard to talk about the I/O
instructions without talking about hardware, and it's also something
of an admonition to not access an I/O port with anything other than
the "correct" size I/O instruction.



Relevant Pages

  • Re: open command failing on serial port
    ... >> it attempts to discover my port configuration, ... > IRQ and IO address for that card. ... once it is installed you can't modify that card. ... the 8th column is the ending I/O port address. ...
    (comp.unix.sco.misc)
  • Re: How to generate a #SMI?
    ... management mode (SMM for short). ... there is only one way to enter SMM, which is through #SMI. ... the system provides a special I/O port; ... only occurs on read or writes for the I/O port. ...
    (comp.lang.asm.x86)
  • Re: [patch 04/16] I/O driver for 8250-compatible UARTs
    ... PCI or MMIO UART, because you don't know what its name will be. ... If you gave up the convenience and just always required an I/O port ... This syntax doesn't really make sense on ia64, ...
    (Linux-Kernel)
  • Re: Clarification on IO Operations
    ... the I/O port read/write signal combination. ... it is either a part of the instruction itself ... tauno voipio iki fi ...
    (comp.os.linux.development.system)
  • [PATCH]PCI Express Port Bus Driver
    ... A PCI Express Port is a logical PCI-PCI Bridge structure. ... physical device to be handled by only a single driver. ... service drivers will compete for a single PCI-PCI Bridge device. ...
    (Linux-Kernel)