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

[VxW] USER RESERVED MEMORY

309 views
Skip to first unread message

Kashif Haidery

unread,
Apr 29, 2003, 4:50:44 AM4/29/03
to VxWorks Users Group List
Is this memory in anyway different from whatever memory the application has,
at runtime? By reserving memory, do you intend to change the value of
USER_RESERVED_MEM so that your application doesn't access these areas, in
normal functioning?

> -----Original Message-----
> From: Samaresh Majumder [SMTP:sama...@centillium.com]
> Sent: Tuesday, April 29, 2003 1:53 PM
> To: VxWorks Users Group List
> Subject: RE: [VxW] USER RESERVED MEMORY
>
> It starts from base_addr = sysMemTop() - USER_RESERVED_MEM;
> -- Samaresh
> Hello,
> I would like to reserve memory for my applications on my board, but I
> don't know how to do it.
> I found in my prjParams.h file a USER_RESERVED_MEM field, but it is only
> a size of memory and I don't know where
> this reserved memory starts. Can anyone help me?
> Thank you.
>
> Loic.
>
> _______________________________________________
> VxWorks Users Group mailing list
> VxWe...@lbl.gov
> http://www-csg.lbl.gov/vxworks/

loic-m pouliquen

unread,
May 5, 2003, 2:13:26 AM5/5/03
to vxwe...@csg.lbl.gov


>
> Date: Tue, 29 Apr 2003 14:20:44 +0530
> From: Kashif Haidery <Hai...@navionicseng.com>
> To: "'VxWorks Users Group List'" <vxwe...@csg.lbl.gov>


> Subject: RE: [VxW] USER RESERVED MEMORY

> Message-ID: <61F913041356D511B1B0000102947D964A664C@MFDW>
> Content-Type: text/plain
> MIME-Version: 1.0
> Precedence: list
> Reply-To: VxWorks Users Group List <vxwe...@csg.lbl.gov>
> Message: 8


>
> Is this memory in anyway different from whatever memory the application has,
> at runtime? By reserving memory, do you intend to change the value of
> USER_RESERVED_MEM so that your application doesn't access these areas, in
> normal functioning?
>
>

In fact what I want is preventing an amount of memory from being written by VxWorks. I mean I want a memory zone free of data and program (to
perform a test of memory access time). I didn't find the file to define the place in the memory where my application must be loaded, so sometimes
the memory I want to test is free, and sometimes it is not.

> > -----Original Message-----
> > From: Samaresh Majumder [SMTP:sama...@centillium.com]
> > Sent: Tuesday, April 29, 2003 1:53 PM
> > To: VxWorks Users Group List
> > Subject: RE: [VxW] USER RESERVED MEMORY
> >
> > It starts from base_addr = sysMemTop() - USER_RESERVED_MEM;
> > -- Samaresh
> > Hello,
> > I would like to reserve memory for my applications on my board, but I
> > don't know how to do it.
> > I found in my prjParams.h file a USER_RESERVED_MEM field, but it is only
> > a size of memory and I don't know where
> > this reserved memory starts. Can anyone help me?
> > Thank you.
> >
> > Loic.
> >
> > _______________________________________________
> > VxWorks Users Group mailing list
> > VxWe...@lbl.gov
> > http://www-csg.lbl.gov/vxworks/

> ------------------------------

Joseph Hadzima

unread,
May 5, 2003, 7:59:31 AM5/5/03
to VxWorks Users Group List
Hello

USER_RESERVED_MEM is the amount of memory between the
values returned from

LastPhyAddress = sysPhysMemTop();

LastHeapAddress = sysMemTop();

What makes this area special, is that vxWorks does NOT zero
it out during a WARM reboot. All RAM is cleared on cold
boot, but if you type -> reboot or call teh function
sysToMonitor() vxWorks does all the usual stuff to
reboot(initialize devices, load, etc), except zero out this
area of RAM.

Why you may ask? Consider an ISR which causes an exception
(i.e. dereference NULL pointer), causing vxWorks to reboot.
You could do the following:

/* set pointer to end of system memory pool (heap) */
char *MyMsgBuf = sysMemTop();

/* sprinkle in your code */
MyMsgBuf += sprintf(MyMsgBuf, "some status message");

Now if your system crashes, you can dump the contents of
USER_RESERVED_MEM and see all your status messages, after
it reboots.

Another use it to use taskInit() and taskActivite() rather
than taskSpawn(). taskInit() allows you to specify a
starting address for the task stack. If you pick something
somewhere in the USER_RESERVED_MEM area, you will then
preserve the stack contents after a warm restart. Which may
also help in debugging.

USER_RESERVED_MEM is just what is sounds like ... memory
reserved for the user, it is removed from the system, and
preserved after a warm restart. You can NOT change the
value of USER_RESERVED_MEM, it is a compiletime option, and
used to in the macro sysMemTop() which equals
sysPhyMemTop() - USER_RESERVE_MEM. Since it's a macro you
can't modify it at run time.

I hope this helps clear up what USER_RESERVED_MEM is all
about.

happy coding!
hadz (a.k.a. Ha...@MccSystems.com)


--- loic-m pouliquen <loic-m.p...@fr.thalesgroup.com>
wrote:


=====
HADZ.

Never be afraid to try something new. Remember, amateurs built the ark. Professionals built the Titanic.

(this Email sent using 100% recycled electrons)

__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

0 new messages