Access to hardware registers

Stefan Kalkowski stefan.kalkowski at ...1...
Mon Nov 16 09:01:21 CET 2015


Hi Jack,

On 11/09/2015 12:30 PM, jack at ...358... wrote:
> Hello Genodians,
> 
> I have a program which needs access to some hardware registers.
> The Region Manager (RM) is complaining, because he cannot find the address.
> 
>     no RM attachment (faulter fb710c with IP 36b614 attempts to write to address
>     43c00004)
> 
> How can I add this region?
> In the runscript as a config setting for RM?
> Add these addresses to the platform_support.cc?
> Or do I need a driver to gain access to these registers?

Please, do not mix up the virtual memory of a program administrated by
its RM session with a physical address. A portion of memory mapped I/O
(hardware registers), in form of an IOMEM dataspace within Genode, is a
resource and has to be requested with a session call like other
resources too. So your driver code first needs to open an IOMEM session
(given the physical address of the hardware registers as argument),
request the dataspace, and attach that dataspace to its RM session. The
concepts behind this are explained in more detail in the "Genode
Foundations" chapter 3.4 [].

A software tool which incorporates all of these steps is the
Attached_io_mem_dataspace in file
repos/os/include/os/attached_io_mem_dataspace.h.

So incorporating:

  Attached_io_mem_dataspace iomem(HARDWARE_REG_ADDR, HARDWARE_REG_SIZE);

should be sufficient. Calling the 'local_addr' member of the object
delivers the address where you can access the hardware registers within
your component.

Regards
Stefan

> 
> Best regards,
> Jack
> 
> 
> 
> ------------------------------------------------------------------------------
> Presto, an open source distributed SQL query engine for big data, initially
> developed by Facebook, enables you to easily query your data on Hadoop in a 
> more interactive manner. Teradata is also now providing full enterprise
> support for Presto. Download a free open source copy now.
> http://pubads.g.doubleclick.net/gampad/clk?id=250295911&iu=/4140
> 
> 
> 
> _______________________________________________
> genode-main mailing list
> genode-main at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/genode-main
> 

-- 
Stefan Kalkowski
Genode Labs

http://www.genode-labs.com/ ยท http://genode.org/




More information about the users mailing list