Re: The Linear Address Space
From: Ivan Korotkov (koroNOSPAMtkov2_at_ztelDOT.ru)
Date: 04/29/04
- Next message: BONDOK: "AM186 instructions"
- Previous message: Cameron Gibbs: "Re: The Linear Address Space"
- In reply to: Cameron Gibbs: "Re: The Linear Address Space"
- Next in thread: Bjarni Juliusson: "Re: The Linear Address Space"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 29 Apr 2004 17:50:53 +0000 (UTC)
> There is an I/O Address Space and the Address Space described in the IA-32
> manuals under the heading of Basic Execution Environment (called the
Virtual
> Address Space).
Yes!
> When a computer starts up, hardware sets up the addresses for things like
> the Hard Drive which works to assign address values to things like it's
> accessible registers and these addresses are a part of the I/O address
> space.
To confuse you completely: some hardware registers are mapped to i/o space,
and some - to memory address space :). For example, my Ultra ATA storage
controller uses i/o addresses 9400-940f (for transferring commands I
believe) and memory addresses E5800000-E58003FF (for transferring data
blocks). I/O space isn't used for fast transferring of data that is big in
size (except for COM/LPT ports) cause it's too slow to do it byte-by-byte
and 64k i/o space won't allow to use big blocks.
> Alot of registers for other devices are included here too.
> A programmer uses these registers (at their assigned address) to write
> binary numbers to it that act to command the device.
> In the case of a Hard Drive, the registers can be used to send packets of
> data (512b or 1k packets) to RAM which are then executed or read by a
> program.
What do you actually understand under RAM? System memory or ANY random
access storage?
> So if you want to access a byte of Hard Disk space, one first commands
it's
> HDD sector to read it into RAM
<snip>
The following happens: first the driver sends SEEK and READ requests to IDE
(or SCSI) controller by IN/OUT instructions (that is, writes this commands
to HDD's registers via I/O space) and then read block of data from memory
address range that is used by controller. You see, there is no big
difference between system memory and any other
hardware buffers mapped to physical memory address space. When CPU executes
a MOV or IN/OUT command it does the following:
1) calculates the physical address in case of MOV command (for i/o space,
there is no paging)
2) writes the address to A0-A31 pins of system bus (actually, some lower
bits in address aren't used because of alignment)
3) sets M/IO# line to 0 if access is made to memory a. space, or 1 if to i/o
space
4) sets R/W# line which indicates whether to read or write data
5) asserts the signal on ADS (Address Data Strobe) line thus telling the
world to process the request
6) all devices connected directly to system bus (RAM, PCI bridge, BIOS,
etc.) verify whether this address does belong to any of them; the device
that has then recognized it's address writes the reply data to D0-D63 lines
and asserts READY line.
For example, physical address 00034567 will be recognized by RAM,
FFFFFFF0 - by BIOS, E8000000 (on my system) - by PCI bus (and some device
connected to it), i/o address 378 - by ISA bus (if it's connected to system
bus) or by PCI-to-ISA bridge, etc.
> A few things still to clear up (sowwy I'm slow :):
> If for example a program has a loop in it, then at some stage it has to
> point (address) back to a previous part of itself.
> When writing a program, one would use the Virtual Address Space and can
> start using the addresses from 00.
> If you write another program, does it also use the same Virtual Address
> Space and can it also start from the address 00?
All OSes are different and use different memory mapping schemes. For
example, 32-bit Windows's assign each process it's own virtual address space
(more precisely, lower 2GB are private, and upper 2GB is the kernel memory
that is mapped equally for all processes).
And most programs are loaded at the same base address 00400000 (or, another
frequent base, 10000000).
> When you put these two programs into RAM, if they are both using the same
> Address Spaces, how does the processor make the distinction?
They use different mappings and **different virtual** a.s.
> Is this where paging is needed?
Yes.
> Can you do this without paging?
Yes. Win 3.x did it using segmentation but it's worse.
> I think I can summarize by saying that one addresses the HDD in blocks,
and
> these blocks have addresses within them that use the Virtual Address
Space.
No. Like I said before, HDD maps it's buffers at concrete *physical*
addresses which may be or not be mapped to the VA space of the process.
> I no longer think this is related but out of curiosity, does RAM have it's
> own set of addresses (probably in the I/O Address Space)?
??? :-O
Ivan
- Next message: BONDOK: "AM186 instructions"
- Previous message: Cameron Gibbs: "Re: The Linear Address Space"
- In reply to: Cameron Gibbs: "Re: The Linear Address Space"
- Next in thread: Bjarni Juliusson: "Re: The Linear Address Space"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|