Saving an array of strings to Ram?

Saving an array of strings to Ram?

Post by James Gaurald » Tue, 15 Jul 2003 10:09:48



I added a section to my config.bib so I could write an array to ram as
follows

MYRESERVE 80200000  00020000  RESERVED

(I removed the ETHERDMA entry as it is not needed.)

So my question is what windows ce api's would I use to write and read to
that memory addresss?

tx

 
 
 

Saving an array of strings to Ram?

Post by Dean Ramsie » Tue, 15 Jul 2003 22:36:18


You just need to map in those addresses, then use them.  See the
VirtualAlloc/VirtualCopy APIs, or MmMapIoSpace function.  The pointer that
is returned from these functions should be valid for your use.

--
Dean Ramsier - eMVP
Accelent Systems
http://www.accelent.com


Quote:> I added a section to my config.bib so I could write an array to ram as
> follows

> MYRESERVE 80200000  00020000  RESERVED

> (I removed the ETHERDMA entry as it is not needed.)

> So my question is what windows ce api's would I use to write and read to
> that memory addresss?

> tx


 
 
 

Saving an array of strings to Ram?

Post by James Gaurald » Thu, 17 Jul 2003 14:16:35


That worked for allocation.
Now one last thing I hope someone can help with, and that is reading a
string "hello world" from that address fails.  It seems like it succesfully
wrote there, because the new virt address of 00060000 now has FF's there in
the de* instead of ?? marks as where there before.

So this is the code and it is causing an access violation at
AnsiToMultiByte..

 PHYSICAL_ADDRESS physicalBase;
 char* virtualBase;
 TCHAR tcaBufff[MAX];
 physicalBase.LowPart=0x800D0000;
 physicalBase.HighPart=0;
 virtualBase =  (char*)MmMapIoSpace(physicalBase,0x00010000,FALSE);
 memset(virtualBase,0,0x0001000);

 AnsiToMultiByte(tcaBufff,virtualBase);   //fails here
 MessageBox(NULL,tcaBufff,NULL,MB_OK);

..fyi I write to that address with  this....
virtualBase =  (char*)MmMapIoSpace(physicalBase,0x00010000,FALSE);
 pchEnumVal = "hello world";
  strcpy(virtualBase,pchEnumVal);

thanks
James


> You just need to map in those addresses, then use them.  See the
> VirtualAlloc/VirtualCopy APIs, or MmMapIoSpace function.  The pointer that
> is returned from these functions should be valid for your use.

> --
> Dean Ramsier - eMVP
> Accelent Systems
> http://www.veryComputer.com/



> > I added a section to my config.bib so I could write an array to ram as
> > follows

> > MYRESERVE 80200000  00020000  RESERVED

> > (I removed the ETHERDMA entry as it is not needed.)

> > So my question is what windows ce api's would I use to write and read to
> > that memory addresss?

> > tx

 
 
 

Saving an array of strings to Ram?

Post by James Gaurald » Thu, 17 Jul 2003 16:58:12


A little more info...
it seems the problem is actually in the writing to the ram address.
although the app runs fine, it is not actually putting the string into that
memory address.
I tried putting it into the unused reserved section of the config.bib, but
when I set a breakpoint before and after it writes there is no change.
the virtual base address of 0x00060000 always shows ?????????? (same as
FFFFF..) as being at that location.
any ideas on how to allow writing to the reserved memory address?


> That worked for allocation.
> Now one last thing I hope someone can help with, and that is reading a
> string "hello world" from that address fails.  It seems like it
succesfully
> wrote there, because the new virt address of 00060000 now has FF's there
in
> the de* instead of ?? marks as where there before.

> So this is the code and it is causing an access violation at
> AnsiToMultiByte..

>  PHYSICAL_ADDRESS physicalBase;
>  char* virtualBase;
>  TCHAR tcaBufff[MAX];
>  physicalBase.LowPart=0x800D0000;
>  physicalBase.HighPart=0;
>  virtualBase =  (char*)MmMapIoSpace(physicalBase,0x00010000,FALSE);
>  memset(virtualBase,0,0x0001000);

>  AnsiToMultiByte(tcaBufff,virtualBase);   //fails here
>  MessageBox(NULL,tcaBufff,NULL,MB_OK);

> ..fyi I write to that address with  this....
> virtualBase =  (char*)MmMapIoSpace(physicalBase,0x00010000,FALSE);
>  pchEnumVal = "hello world";
>   strcpy(virtualBase,pchEnumVal);

> thanks
> James



> > You just need to map in those addresses, then use them.  See the
> > VirtualAlloc/VirtualCopy APIs, or MmMapIoSpace function.  The pointer
that
> > is returned from these functions should be valid for your use.

> > --
> > Dean Ramsier - eMVP
> > Accelent Systems
> > http://www.veryComputer.com/



> > > I added a section to my config.bib so I could write an array to ram as
> > > follows

> > > MYRESERVE 80200000  00020000  RESERVED

> > > (I removed the ETHERDMA entry as it is not needed.)

> > > So my question is what windows ce api's would I use to write and read
to
> > > that memory addresss?

> > > tx

 
 
 

Saving an array of strings to Ram?

Post by James Gaurald » Thu, 17 Jul 2003 18:50:41


resolved, although I had it reserved in the config.bib I was not not able to
write to it from ce for some reason, I changed the offset and was fine


> A little more info...
> it seems the problem is actually in the writing to the ram address.
> although the app runs fine, it is not actually putting the string into
that
> memory address.
> I tried putting it into the unused reserved section of the config.bib, but
> when I set a breakpoint before and after it writes there is no change.
> the virtual base address of 0x00060000 always shows ?????????? (same as
> FFFFF..) as being at that location.
> any ideas on how to allow writing to the reserved memory address?



> > That worked for allocation.
> > Now one last thing I hope someone can help with, and that is reading a
> > string "hello world" from that address fails.  It seems like it
> succesfully
> > wrote there, because the new virt address of 00060000 now has FF's there
> in
> > the de* instead of ?? marks as where there before.

> > So this is the code and it is causing an access violation at
> > AnsiToMultiByte..

> >  PHYSICAL_ADDRESS physicalBase;
> >  char* virtualBase;
> >  TCHAR tcaBufff[MAX];
> >  physicalBase.LowPart=0x800D0000;
> >  physicalBase.HighPart=0;
> >  virtualBase =  (char*)MmMapIoSpace(physicalBase,0x00010000,FALSE);
> >  memset(virtualBase,0,0x0001000);

> >  AnsiToMultiByte(tcaBufff,virtualBase);   //fails here
> >  MessageBox(NULL,tcaBufff,NULL,MB_OK);

> > ..fyi I write to that address with  this....
> > virtualBase =  (char*)MmMapIoSpace(physicalBase,0x00010000,FALSE);
> >  pchEnumVal = "hello world";
> >   strcpy(virtualBase,pchEnumVal);

> > thanks
> > James



> > > You just need to map in those addresses, then use them.  See the
> > > VirtualAlloc/VirtualCopy APIs, or MmMapIoSpace function.  The pointer
> that
> > > is returned from these functions should be valid for your use.

> > > --
> > > Dean Ramsier - eMVP
> > > Accelent Systems
> > > http://www.veryComputer.com/



> > > > I added a section to my config.bib so I could write an array to ram
as
> > > > follows

> > > > MYRESERVE 80200000  00020000  RESERVED

> > > > (I removed the ETHERDMA entry as it is not needed.)

> > > > So my question is what windows ce api's would I use to write and
read
> to
> > > > that memory addresss?

> > > > tx

 
 
 

1. URGENT: 2D array / array of arrays

We are new to MFC, and need to do a very specific thing: to create a dynamic
array of dynamic arrays. We have been trying to use CArray for this, but while
we can get this right for an array of doubles, for example, we keep getting
strange errors when we have a CArray of CArrays.

This is very urgent: any help at all will be greatly appreciated.

Julia and Terry
University of the Witwatersrand
South Africa

  ____  ____  __  __

   )(   _)(_  )    (   Johannesburg, South Africa
  (__) (____)(_/\/\_)  Tel: +27 11 475 0051

2. Remote Access problems

3. String and array classes

4. "Sender's Name" suggests wrong name

5. using string array as function parameter

6. DVD slow

7. strings, arrays and general weirdness

8. Any tool to tell what program is using resource?

9. Problem assigning an Array to an Array subclass

10. Saving a wave file to an array for processing

11. How can I convert from a Unicode string to a ANSI string?

12. How to convert UNICODE string to ASCII string