[okl4-developer] About the memory management in OKL4
Geoffrey Lee
glee at ok-labs.com
Fri Jun 13 19:08:03 EST 2008
On Fri, Jun 13, 2008 at 12:49:53AM +0800, kashin Lin wrote:
> Hi,
>
Hi Kashin
> i want to understand the memory management in OKL4 and has following
> questions:
>
> 1. for using virtual memory in a supported architecture (ex: arm926), it
> need to setup the "translation table" for
> the hardware MMU (TLB) in system initial time to indicate the virt &
> phys mapping and sets the memory region
> are cacheable or not.
> i wonder how does OKL4 set the "translation table"?
> ie. what address ranges are included, how the default virt to phys maps?
> (direct mapping?), cacheability?
Manipulating the pagetable is done through the MapControl() system call.
Have a look at pistachio/src/map.cc which contains the entry point
for MapControl().
>
> 2. i got confused about the address space in OKL4 microkernel and memory
> section in Iguana. it seems they are
> all mappings from virt to phys. what is the relationship between them?
> do they use other data structures to maintain the mapping or effect the
> "translation table" directly?
>
You can assume that in general there is no relationship between how the
virtual and the physical addresses are mapped. What data structure is
used to implement the pagetable will depend on the specific
architecture, some architectures, such as IA-32 requires a specific
format because the hardware dictates it, while for others such as MIPS
the pagetable format is dictated by software.
The pagetable data structures is located in arch/<arch>/pistachio/include/,
the specific files are ptab.h and/or pgent*.h
> 3. in following codes:
> mem_sect = memsection_create_user(leng, &virt);
> result = hardware_back_memsection(mem_sect, phys, L4_IOMemory);
> will the memory section (base is "virt") cacheable? (cacheability is
> controled by attribute L4_IOMemory or function hardware_back_memsection ?)
The last argument specifies the attributes. L4_IOMemory means device
memory.
>
> 4. if i using above codes in two Iguana application (create two memsections
> in two application to map to the same phys),
> will they get the same "virt"?
No, the memsection_create_user() API will allocate two different
virtual address ranges to enforce the single address space
restriction.
-gl
>
>
> thanks in advance.
>
>
> best,
> kashin lin
> _______________________________________________
> Developer mailing list
> Developer at okl4.org
> https://lists.okl4.org/mailman/listinfo/developer
--
More information about the Developer
mailing list