storage memory和program memory劃分

來源:互聯網
上載者:User

 具體的設定可以在系統啟動後,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.

 Remarks

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.

 

 Parameters
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

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.