[okl4-developer] problems with physical memory access from an iguana example
Geoffrey Lee
glee at ok-labs.com
Mon May 26 23:12:39 EST 2008
On Sat, May 24, 2008 at 04:27:20PM -0700, Gabi Voiculescu wrote:
> Hello
>
> I am trying to access a few register sets directly from an iguana example build on top of the OKL4 2.1 'empty' example.
>
> I have tried using hardware_back_memsection without success. I have also seen a previous post on this matter:
> http://lists.okl4.org/pipermail/developer/2008-February/000607.html
> and tried to apply the same rules to my weaver.xml. Obtained the file below. That does not map the physical page(s) either.
>
> My problem is that I don't see the sections added in the page table, and the mapping_test function does not work.
Hi Gabi
The way I find easiest is to call memsection_create_user() and
then hardware_back_memsection(). From what I can see in your code
you haven't called memsection_create_user() prior to calling
hardware_back_memsection(). Maybe that is the cause of your
problem?
-gl
>
> On top of that, whenever I change something in the code machines.py gets overwritten with a file that has nothing defined in the <program_name section of the weaver file. I have to execute my build script twice, copying the weaver.xml back into build/images/ the second time to have the images build correctly.
>
> q0: Is hardware_back_memsection usefull in the OKL4 2.1? It always returns an error -1 when I try to use it in my example user application. I have tried the following code, not having the physical memory region premapped in the kernel (plat.cc) or in machies.py.
>
> struct etm_struct
> {
> memsection_ref_t ms;
> uintptr_t ms_base;
> };
> ....
> struct etm_struct etm;
> int res;
> res = hardware_back_memsection(etm.ms, 0x10132000, L4_IOMemory);
>
>
> q1: Is the above mentioned email procedure still valid in OKL4 2.1?
>
> q2: what am I doing wrong in weaver.xml?
>
> q3: Do I need to modify machines.py or the SConstruct file from iguana/examples/empty folder to keep weaver.xml unchanged when I change my code?
>
> q4: Where do I need to modify so that the
> <memsection name= ..../>
> lines don't disappear each time I change a file.
>
> From what I can see adding more memory['xxx'] = [Region(....)] in machines.py only creates entries for
>
> <physical_memory name= ....
> ....
> </physical_memory>
>
> and
>
> <physical_pool name= ....
> ....
> </physical_pool>
>
> and not for the memsection entries for my user program
>
> <memsection name = ....>
>
>
> Thank you,
> Gabi Voiculescu
>
>
> --------------------------------------------------------------------------------------------------------------
> weaver.xml file:
> <?xml version="1.0"?>
> <!DOCTYPE image SYSTEM "weaver-1.1.dtd">
> <image>
> <machine>
> <word_size size="0x20" />
> <virtual_memory name="virtual">
> <region base="0x1000" size="0xdffff000" />
> </virtual_memory>
> <physical_memory name="physical">
> <region base="0x100000" size="0x7eff000" type="conventional" />
> </physical_memory>
> <physical_memory name="etm_mem">
> <region base="0x10132000" size="0x1000" />
> </physical_memory>
> <physical_memory name="meter_mem">
> <region base="0xc0000000" size="0x1000" />
> </physical_memory>
> <physical_memory name="meter_ram_mem">
> <region base="0xe0000000" size="0x1000" />
> </physical_memory>
> <physical_memory name="tpiu_mem">
> <region base="0x10135000" size="0x1000" />
> </physical_memory>
> <page_size size="0x1000" />
> <page_size size="0x10000" />
> <page_size size="0x100000" />
> </machine>
>
> <virtual_pool name="virtual">
> <memory src="virtual" />
> </virtual_pool>
>
> <physical_pool name="physical" direct="true">
> <memory src="physical" />
> </physical_pool>
>
> <physical_pool name="etm_pool" direct="true">
> <memory src="etm_mem" />
> </physical_pool>
> <physical_pool name="meter_pool" direct="true">
> <memory src="meter_mem" />
> </physical_pool>
> <physical_pool name="meter_ram_pool" direct="true">
> <memory src="meter_ram_mem" />
> </physical_pool>
> <physical_pool name="tpiu_pool" direct="true">
> <memory src="tpiu_mem" />
> </physical_pool>
>
> <kernel file="/tst/port_2.1/build/pistachio/bin/kernel" xip="false" >
> <dynamic max_threads="0x400" />
> <config>
> <option key="root_caps" value="1024"/>
> </config>
> </kernel>
>
> <rootprogram file="/tst/port_2.1/build/iguana_server/bin/ig_server" virtpool="virtual" physpool="physical" >
> </rootprogram>
>
> <program name="empty_example" file="/tst/port_2.1/build/iguana/bin/empty_example" >
> <memsection name="etm_memsect" size="0x1000" physpool="etm_pool" />
> <memsection name="tpiu_memsect" size="0x1000" physpool="tpiu_pool" />
> <memsection name="meter_memsect" size="0x1000" physpool="meter_pool" />
> <memsection name="meter_ram_memsect" size="0x1000" physpool="meter_ram_pool" />
> </program>
>
> </image>
>
>
>
> _______________________________________________
> Developer mailing list
> Developer at okl4.org
> https://lists.okl4.org/mailman/listinfo/developer
--
More information about the Developer
mailing list