storage memory和program memory划分

 具体的设置可以在系统启动后,Control Panel -> System -> Memory 里面看到。默认的是把内存五五开,一半给Storage Memory, 一半给Program Memory用。

 

 其实说白了就一句话, 在BSP的config.bib里 CONFIG 区添加这个变量 FSRAMPERCENT = 0xXXXXXX, 但注意两点,

(1) 必须写在config.bib的CONFIG区里, 不是plagform.bib不是config.reg等其他文件而是config.bib,也不是config.bib文件的任意地方而一定要在CONFIG REGION里.
(2) FSRAMPERCENT这个变量一定得写为FSRAMPERCENT, 不能写成FSROMPERCENT不能写成ILOVEU,。

 

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.

 

参考如下:

http://msdn.microsoft.com/en-us/library/aa908688.aspx

 

This configuration option specifies the percentage of RAM allocated for the file system.

This option uses the following syntax.

 

The value for FSRAMPERCENT must be set to 32 KB, or 0x00000004.

You can use FSRAMPERCENT to specify 16 to 255 4-KB blocks of memory. Although the memory is calculated in 4-KB blocks, the actual allocation is a contiguous section of RAM.

The minimum size for FSRAMPERCENT is 32 KB, or 0x00000004.

The default is FSRAMPERCENT=0x80808080, which specifies 50 percent of RAM allocated for the file system.

You can calculate the percentage of RAM is reserved by FSRAMPERCENT by dividing the amount of memory reserved in each byte by 1MB. For example, if FSRAMPERCENT is 0x20202020, each byte reserves 0x20 x 4KB = 128KB. 128KB divided by 1MB is .125, or 12.5% of the ram.

You can also calculate the value of FSRAMPERCENT from the desired percentage of RAM to be used in the file system. For example, if you want to reserve 12.5% of RAM for the file system, you would set each byte of FSRAMPERCENT to ((12.5% / 100) * (1MB / 4KB)), or 12.5% * 2.56. This example works out to 32, or 0x20. You would then set the 4-byte value of FSRAMPERCENT to 0x20202020.

The following code example shows how to use FSRAMPERCENT to allocate available RAM to the file system.

Copy Code
FSRAMPERCENT=0x10203040

In this example, 64 4KB chunks are allocated to byte 0. 48 4KB chunks are allocated to byte 1, 32 4KB chunks are allocated to byte 2, and 16 4KB chunks are allocated to byte 3. The total percentage of memory reserved for the file system would be ((64 + 48 + 32 + 16) * 4KB) / 4MB, or 15.6%.

The OAL now provides the function pointer pOEMCalcFSPages to change the default number of pages assigned to the object store during a cold boot. The minimum size for the object store is 32 KB and the maximum size is 128 MB.

 

number

A 4-byte hexadecimal number.

Each byte represents the number of 4-KB blocks per MB allocated for the file system, as follows:

byte 0 = # of 4-KB blocks per MB in the first two MB

byte 1 = # of 4-KB blocks per MB in the second two MB

byte 2 = # of 4-KB blocks per MB in the third two MB

byte 3 = # of 4-KB blocks per MB in the remaining memory

Copy Code
FSRAMPERCENT = number

你可能感兴趣的:(File,System,Parameters,each,byte,Allocation)