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.

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

FSRAMPERCENT = number
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章