Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

vxWorks, vxsim and memory

166 views
Skip to first unread message

BabboNakele

unread,
Jan 11, 2011, 5:42:43 AM1/11/11
to
Hi everyone.

I'm stuck with some memory management under the vxsim.
Host is a Linux machine. I'm developing a system that will run on a
multi processor board that will communicate through a DPR.

Since the other cpu is not running vxWorks (it will never run it), I
need to access the memory in raw mode. The SM_OBJECT of vxWorks is
definetly not an option.

On the simulator I'm having some troubles trying to setup a shared memory.
I'm trying to set it up calling the vxsimHostShMemInit (undocumented)
api that seems the one that the linux BSP uses to setup the memory
mapped file that will act as shared memory.

But even the task that calls the api can't write the memory that has
been mapped.

Here's the sequence that I tried:

vallocated a suitable memory area (that is mmu page aligned)
invoked the vxsimHostShMemInit over that area

tried to set vmStateSet to allow read/write access and disabling cache.

Everything seems to work fine, but changing any byte of that area
results in nothing.
If I put Eclipse in interactive debugging mode and try to change values
from there, change is accepted and is reflected to the mmapped file too.

What am I doing wrong?

Is there any other way that I can follow to achieve the result?

Thanks in advance

BN

Posted using www.webuse.net

BabboNakele

unread,
Jan 11, 2011, 7:19:11 AM1/11/11
to
BabboNakele <1712i...@webuse.net> wrote:

> Hi everyone.
>
> I'm stuck with some memory management under the vxsim.
> Host is a Linux machine. I'm developing a system that will run on a
> multi processor board that will communicate through a DPR.

[...]


> Thanks in advance
>
> BN
>
> Posted using www.webuse.net

Probably I'm done.

I thrown away that api and tried to work with the host function calls.

Since a memory mapping is not a 1-api operation (you must open file,
stretch it, map and on close you must unmap), I created a my own shmem
shared object that exposes two fuctions: shMalloc and shFree. (sh stands
for SHared)

At this point I hit again against the really poor documentation of
vxworks: the dllload and getaddr functions do not provide any information
on why they don't work. In addition, the dll load returns always OK.

Since my project is on SMP, I had to set the cpu affinity to execute the
function only onto cpu0 (vxWorks requirement, yet not documentated).

At the end of all this trial-and-error I made it working.
I can map a file into memory and access it.

Just a question remains: what do the vxsimHostDllLoadEx do more than the
non-Ex one?

BN

Posted using www.webuse.net

Kanicule

unread,
Jan 12, 2011, 8:12:04 AM1/12/11
to

BN,

On Jan 11, 1:19 pm, "BabboNakele" <1712inva...@webuse.net> wrote:

> Just a question remains: what do the vxsimHostDllLoadEx do more than the
> non-Ex one?

vxsimHostDllLoadEx() is a private API. The purpose of this API in SMP
mode is to be able to load a module on all SMP "CPU" (aka vxsim
binary) while vxsimHostDllLoad() does always load the module on CPU 0.

Hope this helps.

Philippe

0 new messages