[comp.os.mach] Memory Management Question

bijan@yosemite.ucsb.edu (Bijan Forutanpour) (01/11/90)

I had a question to ask those who are familiar with the HAT / IPT, and SEGMENT
TABLES... This is for MACH running on the IBM PC RT, but I'm not sure if that is
is too relevent here.

I'm trying to figure out exactly what virtual addresses are translated to what
physical addresses.
Please correct me if I'm wrong about the following: 

* Segment 15 (0xF0000000) is for the IOCC, which I assume translate into AT bus
  addresses, right?

* Segment 0xE0000000 is the "system" segment, which maps directly page for
  page into physical memory, right? So virtual 0xE0001000 is the same as
  physical 0x00001000 ?  

* Whenever I malloc space, I get a (virtual) address in segment 1 (0x10000000)
  and not in segment 0.  That is because the operating system is loaded
  in the first 500K of physical memory, starting at physical address 0, right?
  So nothing exists in the remaining virtual address space of segment 0.

* WHERE is this "user space" mapping of segment 1 made? Its not in ca/lohatipt.s
  At least I couldn't find it there where segment E and F are taken care of
  (my assembly *is* rusty though).

Thanks for your time...

Bijan

bijan%cs@hub.ucsb.edu
  

Richard.Draves@CS.CMU.EDU (01/12/90)

Excerpts from netnews.comp.os.mach: 11-Jan-90 Memory Management Question
.. Bijan Forutanpour@yosemi (1168)

> I had a question to ask those who are familiar with the HAT / IPT, and SEGMENT
> TABLES... This is for MACH running on the IBM PC RT, but I'm not sure if
> that is
> is too relevent here.

> I'm trying to figure out exactly what virtual addresses are translated to what
> physical addresses.
> Please correct me if I'm wrong about the following: 

You seem to be asking about the address space seen by a user task on an RT.

Segment F is the IO address space.  Segment E is the kernel text and
data structures.  The kernel text (small addresses in segment E) maps
directly onto low physical memory.   Kernel text is always readable;
kernel data is only accessible during system calls.  Segment D is stack.
 Segment 0 is program text.  Segment 1 is program data.  This
organization was taken from IBM's Acis/4.3 Unix so that Mach can run
Acis binaries.

When you vm_allocate() memory, the kernel will look for unused parts of
the address space; the part of the kernel that does this doesn't know
about the segmentation.  The effect is to first allocate from the unused
part of segment 0, then segment 1, segment 2, etc.  The malloc heap
starts in segment 1.

The pmap module manages the translations from virtual to physical memory.

Rich