Re: page fault on virtual bus

Adam Lackorzynski <[email protected]>
Newsgroups gmane.comp.micro-kernel.l4.devel
Message-ID <[email protected]>
On Mon May 26, 2014 at 20:55:19 +0200, ba_f wrote:
> i try to access some peripheral on my platform. But i get page faults when
> writing to the peripheral at 0x41220000:
> 
> MOE: Hello world
> MOE: found 505476 KByte free memory
> MOE: found RAM from 6f000 to 1f000000
> MOE: allocated 495 KByte for the page array @0x9f000
> MOE: virtual user address space [0-bfffffff]
> MOE: rom name space cap -> [C:501000]
>   BOOTFS: [116d000-116d117] [C:503000] periTest.cfg
>   BOOTFS: [116e000-116e1aa] [C:504000] periTest.io
>   BOOTFS: [116f000-1188494] [C:505000] l4re
>   BOOTFS: [1189000-129673c] [C:506000] io
>   BOOTFS: [1100000-1152c0c] [C:507000] ned
>   BOOTFS: [1153000-116c5e4] [C:508000] periTest
> MOE: cmdline: moe rom/periTest.cfg
> MOE: Starting: rom/ned rom/periTest.cfg
> MOE: loading 'rom/ned'
> Ned says: Hi World!
> Ned: loading file: 'rom/periTest.cfg'
> 
> periTest| L4Re[rm]: unhandled write page fault @41220000 pc=1000294
> periTest| L4Re: unhandled exception: pc=0x1000294

You cannot just directly access the physical memory address. You first
have to make it visible in your program. Please use the
l4io_request_iomem() function for that. And then use the address
returned by that function to access the device memory.

> Here is my CFG. My io-file looks like the one here
> https://os.inf.tu-dresden.de/L4Re/doc/io.html
> 
> ## cfg
> require("L4");
> 
> local loader = L4.default_loader;
> 
> local io_buses =
>   {
>     FOODEVICE = loader:new_channel();
>   };
> 
> loader:start({
>   caps ={
>     FOODEVICE = io_buses.FOODEVICE:svr(),
>   },
> },
>  "rom/periTest rom/periTest.io"
> );
> ## end CFG

That won't work. You need something like this, esp. you need to start io
as well.

local loader = L4.default_loader;
local io_buses =
  {
    vbus1 = loader:new_channel();
  };

loader:start({ caps = { client1 = vbus1:svr(),
	                icu    = L4.Env.icu,
			sigma0 = L4.cast(L4.Proto.Factory, L4.Env.sigma0):create(L4.Proto.Sigma0),
	     }}, "rom/io rom/periTest.io");

loader:start({ caps = { vbus = vbus1 }}, "rom/periTest");


An example is for example in l4/conf/examples/x86-fb.cfg.



Adam
-- 
Adam                 [email protected]
  Lackorzynski         http://os.inf.tu-dresden.de/~adam/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.