原创
WinCE中划分Storage Memory和Program Memory
ms-help://MS.WindowsCE.500/wcecoreos5/html/wce50conMemoryArchitecture.htm
The RAM on a Windows CE–based device is divided into two areas: the object store and the program memory.
- The object store resembles a permanent, virtual RAM disk. Data in
the object store is retained when you suspend or perform a soft reset
operation on the system. Devices typically have a backup power supply
for the RAM to preserve data if the main power supply is interrupted
temporarily. When operation resumes, the system looks for a previously
created object store in RAM and uses it, if one is found. Devices that
do not have battery-backed RAM can use the hive-based registry to
preserve data during multiple boot processes. - The program memory consists of the remaining RAM. Program
memory works like the RAM in personal computers — it stores the heaps
and stacks for the applications that are running. 具体的设置可以在系统启动后,Control Panel -> System -> Memory 里面看到。默认的是把内存五五开,一半给Storage Memory, 一半给Program Memory用.
划分的方法也很简单,在BSP的config.bib里 CONFIG 区添加这个变量 FSRAMPERCENT = 0xXXXXXX,
FSRAMPERCENT是一个4byte长度的十六进制数, 我们用代数假设 FSRAMPERCENT = 0xQXYZ, 其中Q,X,Y,Z都是十六进制数
那么最终划分给Storage Memory的大小 = ( Q + X + Y + Z ) / 0x400 * TOTAL_RAM_SIZE
以文中的例子来算, FSRAMPERCENT=0x10203040, 假设TOTAL_RAM_SIZE=64M, 那么StorageMemory= (0x10 + 0x20 + 0x30 + 0x40) / 0x400 * 64M = 10M
文章评论(0条评论)
登录后参与讨论