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

Memory access in ReadRegistryFromOEM/WriteRegistryFromOEM

9 views
Skip to first unread message

Andi Anderegg

unread,
Mar 27, 2000, 3:00:00 AM3/27/00
to
I want to implement the persistent registry on a x86 PC platform under
Windows CE 2.11. I have an SRAM memory of 32KByte with the physical address
0x80800000 and want to access this memory from the functions
ReadRegistryFromOEM and WriteRegistryFromOEM. Now I have troubles with the
access of the physical memory of the SRAM.

I tried the functions VirtualAlloc() and VirtualCopy(). But I get linker
errors like 'unresolved external symbol'.

What is the correct way for the memory access?

Thanks for any help, Andi Anderegg, aand...@cobatec.ch


Holger

unread,
Mar 27, 2000, 3:00:00 AM3/27/00
to
Hello,

the functions xxxRegistryFromOEM are called in the context of the
Kernel-mode. In this mode you can directly access the memory without calling
VirtualCopy/Alloc.

Kind Regards

Holger Frölich

----------------------------------------------------------------------------
--------------------
F&S Elektronik Systeme GmbH
Holger Froelich: mailto:froe...@fs-net.de
Home Page: http://www.fs-net.de

Andi Anderegg <aand...@cobatec.ch> schrieb in im Newsbeitrag:
uGnrL57l$GA.197@cppssbbsa05...

Andi Anderegg

unread,
Mar 27, 2000, 3:00:00 AM3/27/00
to
Thanks for the response.

I don't know how I can access the memory in the kernel mode. In which mode
is the x86 CPU in the kernel mode? Can I use a simple pointer on the
physical address to access the memory?

I checked the memory access with an application by using the functions
VirtualAlloc and VirtualCopy. In the context of the application it works
fine.

If I access the memory in the function ReadRegistryFromOEM with a pointer on
the address 0x80800000 all read bytes are 0.

I also can not find any documentation on the kernel mode in the online help
of the platform builder 2.11.

Thanks for any help, Andi Anderegg, aand...@cobatec.ch


Holger <froe...@fs-net.de> schrieb in im Newsbeitrag:
#GBvPX#l$GA....@cppssbbsa02.microsoft.com...

Steve Maillet

unread,
Mar 27, 2000, 3:00:00 AM3/27/00
to
Examine the use of the BOOTARGS structure throughout the OAL. Also if your
hardware is at TRUE physical address 0x80800000 you have a problem as that
address cannot be reached by Windows CE at present. If instead it's TRUE
physical address is 0x00800000 then it will be accesible through the
following:

BYTE* pCachedSRAM = (BYTE*)(0x80800000);
BYTE* pNonCachedSRAM = (BYTE*)(0xA0800000);

--
Steve Maillet
Entelechy Software Consulting
"Where Hardware Meets Software"
Home of the Windows CE Embedded FAQ
www.EntelechyConsulting.com
smaillet AT EntelechyConsulting DOT com

"Andi Anderegg" <aand...@cobatec.ch> wrote in message
news:OUOp$7$l$GA...@cppssbbsa02.microsoft.com...

Andi Anderegg

unread,
Mar 27, 2000, 3:00:00 AM3/27/00
to
Thanks a lot for your response, Steve.

On my target hardware it's possible to access the SRAM at the physical
address 0x80800000 and 0x000D0000. I will try it with the lower address.

Some times I ask me what I am doing wrong because it's so hard to find the
right information in the documentation of the platform builder. For example,
where can I find the information that the physical address 0x80800000 can
not be reached?

Best regards, Andi Anderegg, aand...@cobatec.ch

Steve Maillet wrote in message <#STYsEBm$GA.285@cppssbbsa05>...

Andi Anderegg

unread,
Mar 27, 2000, 3:00:00 AM3/27/00
to

Steve Maillet

unread,
Mar 27, 2000, 3:00:00 AM3/27/00
to
The information on that is spread around the docs and sample code. THe
reason it can't be reached is the way CE maps memory. It uses a single 4GB
virtual address space for the entire system that are considered Physical
addresses after KernelStart (KernelInitialize on x86) is called. (Each
process gets a 32M Slot in that space) the first 2G is all virtual address
spaces used by the various processes and memory mapped files. The upper 2G
is used to map in TRUE physical addresses. The first 512MB of TRUE Physical
memory is mapped in to 0x80000000 and is mapped as cached access. Reads and
writes to this area will be cached. at 0xA0000000 it maps the first 512M of
TRUE Physical memory again but this time as non-cached.

The top 1G of the memory space is currently unused. Ultimately this implies
that CE can access a maximum of 512M of memory starting from TRUE Physical
address 0.

By TRUE Physical Address I mean the address as seen on the processors
address bus.

--
Steve Maillet
Entelechy Software Consulting
"Where Hardware Meets Software"
Home of the Windows CE Embedded FAQ
www.EntelechyConsulting.com
smaillet AT EntelechyConsulting DOT com

"Andi Anderegg" <aand...@cobatec.ch> wrote in message

news:ugsv8bBm$GA.87@cppssbbsa04...

Andi Anderegg

unread,
Mar 28, 2000, 3:00:00 AM3/28/00
to
Thanks for the information.
Now I can access the SRAM with the physical address 0x000D0000 by using a
pointer of 0xA00D0000.

It's interesting that it's possible to access memory with physical addresses
higher than 0x7FFFFFFF (i.e. 0x80800000) from an application by using
VirtualAlloc/VirtualCopy.

Best regards, Andi Anderegg, aand...@cobatec.ch

Steve Maillet <nob...@nospam.com> schrieb in im Newsbeitrag:
OGXnDXDm$GA.247@cppssbbsa05...

Steve Maillet

unread,
Mar 28, 2000, 3:00:00 AM3/28/00
to
Yeah it's a little weird in that you can use PAGE_PHYSICAL to get the real
physical address mapped in to a process but can't access it directly. Nor is
it available to applications as general purpose memory.

--
Steve Maillet
Entelechy Software Consulting
"Where Hardware Meets Software"
Home of the Windows CE Embedded FAQ
www.EntelechyConsulting.com
smaillet AT EntelechyConsulting DOT com

"Andi Anderegg" <aand...@cobatec.ch> wrote in message
news:OWwD3LJm$GA.246@cppssbbsa03...

Sonja Gail Little

unread,
Jun 13, 2000, 3:00:00 AM6/13/00
to
Just checking my connection

Andi Anderegg <aand...@cobatec.ch> wrote in message

news:uGnrL57l$GA.197@cppssbbsa05...


> I want to implement the persistent registry on a x86 PC platform under

> Windows CE 2.11. I have an SRAM memory of 32KByte with the physical
address


> 0x80800000 and want to access this memory from the functions
> ReadRegistryFromOEM and WriteRegistryFromOEM. Now I have troubles with the
> access of the physical memory of the SRAM.
>
> I tried the functions VirtualAlloc() and VirtualCopy(). But I get linker
> errors like 'unresolved external symbol'.
>
> What is the correct way for the memory access?
>

Thomas Sandscheiper

unread,
Jun 15, 2000, 3:00:00 AM6/15/00
to
Hello Sonja,

it pretty simple in the OAL.You can directly modify the memory.
But you should use the memory without cache.


e.g.

#define REG_RAM_BASE 0xA0800000

DWORD ReadRegistry(DWORD dwFlags, BYTE * lpData, DWORD cbData)
{
..
memcpy(lpData,(const void *)(REG_RAM_BASE),cbData);
..
}

Thomas

Sonja Gail Little <sgli...@email.msn.com> wrote in message
news:#4J57tX1$GA.197@cppssbbsa04...

0 new messages