Daniel Chicayban Bastos wrote:
> 13.3 I/O ADDRESS SPACE
>
> The processor’s I/O address space is separate and distinct from
> the physical-memory address space. The I/O address space consists
> of 2^16 (64K) individually addressable 8-bit I/O ports, numbered 0
> through FFFFH. I/O port addresses 0F8H through 0FFH are
> reserved. Do not assign I/O ports to these addresses. The result
> of an attempt to address beyond the I/O address space limit of
> FFFFH is implementation-specific; see the Developer’s Manuals for
> specific processors for more details.
These are also known as i/o ports, because each of the addresses in this
map were known as port registers.
> So, these 64K do not eat up my main memory, correct? However,
> memory-mapped i/o do, right? So I'd like to find out what sort of
> addresses the various hardware parts need and see what I am left with
> for kernel code and data, and user code and data.
There's two ways hardware can use up your memory map. One way is the way
video cards use it up, by reserving a part of the memory map and putting
its own ram in that location. They call this an aperture. The memory
addresses reserved by this method typically a fixed in size and location
(though often adjustable prior to boot with the BIOS setup screens).
Another way devices can use memory is to time-share the system memory.
This is how DMA and bus-mastering devices work. The device locks down a
part of the memory making it inaccessible even to the processor during
that time, and transfer data in and out. Once that operation is done,
then it releases the memory and the CPU can go in there and operate on
that data. It frees up the CPU from having to do the menial and
time-consuming task of transferring data for a device, by letting the
device itself do the transferal. The memory addresses that DMA can use
span the entire memory range, since they don't lock down the whole
memory for the complete duration of time that the computer is on.
Yousuf Khan
|