I am trying to find out if I can allocate an area of memory below
sysMemTop as unusable by VxWorks using sysLib.c (or other VxWorks OS call).
The situation is this, I am using an embedded pentium CPU board with
128MB of DRAM, I need to let VxWorks manage all of this memory except for a
window to a battery backed memory device which is at the addresses between
0xF00000 and 0xFFFFFF (15 to 16MB). I cannot move this device to another
location so I need to mark it in some way so VxWorks will not use it
although sysMemTop still needs to be at 0x8000000 (128MB). I can't seem to
find a way of doing this, any bright ideas????
thanks,
Mark.
what's about this:
- define USER_RESERVED_MEM in config.h to 113MB (128 - 15)
- call memAddToPool(0x01000000,0x07000000) - latest in usrApplInit(), best
after memory initialization.
Now you have a memory with a hole of 1MB.
System will be loaded and run in the first 15MB until you call
memAddToPool(). So you only have to take care that your kernel isn't too
big. Objects loaded later will be run somewhere in mem - don't care.
HTH
--
Mit freundlichen Grüßen,
Michael Lawnick
==============================================
SOFTEC GmbH Tel +49-731-96600-0
Promenade 17 Fax +49-731-96600-23
D-89073 Ulm Michael Lawnick
Germany law...@softec.de
==============================================
<@logica.com> schrieb im Newsbeitrag
news:10022051...@ernani.logica.co.uk...
Looks like you need an entry for that address range in sysPhysMemDesc
(in sysLib.c), marking that address range as read-only. (Doesn't your
BSP already do that?) See section 8.3 of the Programmer's Manual for
examples.
Since VxWorks allocates from high-to-low (aside from vector tables and
such in low memory), worst-case is you end up with only 112MB (128-16)
of useable DRAM.
Lee
// create dual ported memory devices (IP queue)
if (memDevCreate("/ipmmQ", (char*)0x00700000, 0x10400) != OK)
{
return false;
}
This reserves 10400 bytes at address 0x00700000.
Not sure if this is what you want to do but it's a possibility.
Regards
Paul
No it doesn't...
It creates a memDev device using the specified memory.
If that was part of your normal available memory it won't stop malloc()
returning those addresses. Chaos will ensue...
To get memory at a know physical address build a BSP that won't use the
memory.
In theory you can defien USER_RESERVED_MEMORY to get some free space at the
top of the image - but beware that the ARM builds allocate 16k for a page
table there - and free it using a different rule to that which allocated it.
(ie if you reserve more memory it frees the wrong piece).
Safer is to steal some more low memory, increase RAM_LOW_ADDRS so that
vxWorks
loads above your fixed area. The first bit will still be used, and the
very early stack goes down from RAM_LOW_ADDRS. But you still get a load
of memory at known physical address to use for screen buffers (etc).
This lets you do a DRAM grope for variable sized memory and keep it
contiguous.
David