l4sigma0_map_iomem Allowed Addresses

Alexander Warg alexander.warg at os.inf.tu-dresden.de
Tue Oct 18 22:45:32 CEST 2011


On Tue, 2011-10-04 at 00:37 +0000, Wesley at wesman.net wrote:
> > On Thu Sep 29, 2011 at 15:34:38 -0700, Wesley Miaw wrote:
> >> I'm having some trouble understanding the acceptable values usable in a
> >> call to l4sigma0_map_iomem....
> >>
> >> But what addresses should be allowed? My Verstaile Express board has 1GB
> >> RAM starting at physical address 0x60000000 but I can't use this
> >> address.
> >
> > l4sigma0_map_iomem is used to map IO-mem, i.e. non-RAM. For RAM
> > (0x60000000-0x9fffffff) use l4sigma0_map_anypage()/l4sigma0_map_mem().
> 
> I tried requesting physical memory 0x60000000 of size 0x40000000 mapped
> onto virtual 0x60000000 using l4sigma0_map_mem() and am still getting the
> error. I also tried a few other smaller sizes like 0x80000000 size
> 0x20000000 and 0x64000000 size 0x1c000000. But they are all failing as
> well.
> 
> I thought based on the RAM printout maybe I had to request a portion that
> was in restricted to one of the "contiguous blocks" printed out. I think
> owner '0' equals Sigma0 and owner '4' equals Root, so Sigma0 should be
> able to give me 0x64000000 size 0x1c000000.
> 
> Here's some log output:
> 
> SIGMA0: Hello!
>   KIP @ 60002000
>   allocated 4KB for maintenance structures
> SIGMA0: Dump of all resource maps
> RAM:------------------------
> [0:60000000;60000fff]
> [0:60066000;6008ffff]
> [0:60097000;60097fff]
> [0:6009f000;6013ffff]
> [4:60140000;60176fff]
> [0:60177000;60177fff]
> [4:60178000;6018efff]
> [0:6018f000;6100efff]
> [4:6100f000;6100ffff]
> [0:61010000;6209afff]
> [4:6209b000;6247dfff]
> [0:6247e000;9effffff]
> IOMEM:----------------------
> [0:0;5fffffff]
> [0:a0000000;ffffffff]
> MOE: Hello world
> MOE: found 1027436 KByte free memory
> MOE: found RAM from 60000000 to 9f000000
> MOE: allocated 1008 KByte for the page array @0x6018f000
> MOE: virtual user address space [0-bfffffff]
> prog   | l4sigma0_map_mem(64000000, 64000000, 1c000000)
> prog   | l4sigma0_map_mem: size 1c000000; phys 64000000; virt 64000000
> prog   | [init] Error: Cannot map physical memory: (-2147451396) No fpage
> received.
> 

After Moe has started it has allocated all memory (RAM) from sigma0 and
you cannot get any RAM from sigma0 any more. The dump is done at sigma0
startup and represents the initial memory regions. IOMEM is different
and is MMIO of potential devices, the dump shows a0000000;ffffffff
this memory is not allocated by Moe and can be requested from sigma0 via
l4sigma0_map_iomem.  Note, this is not RAM! And the requester needs to
know what it is doing, you can easily crash the system when accessing
MMIO memory the wrong way.

-- 
Alex





More information about the l4-hackers mailing list