yakin

有了舞台就好好表演,没有舞台就静静地做观众

导航

About Intel PSM(4)

PSM as configured above loads asynchronously during the boot and typically completes mounting by the time the system finishes booting.However,you may want to add an additional registry key to cause PSM to load synchronously,for example,if the boot process defines files or drivers to be in a folder in PSM.The boot will wait for PSM to load and mount,guaranteeing it is available during or immediately after boot.
Here is how to make PSM load synchronously:
To the registry key:
  [HKEY_LOCAL_MACHINE\System\StorageManager\AutoLoad\PSM]
Add the following:
  "LoadFlags"=dword:1
Please note that this is a MIcrosoft WCE feature and not under the control of PSM,so the actual key and/or values may change.Please check with MS if the above information does not accomplish what you need.

Once these steps are done,Intel PSM will be included in the OS image,and applications can read and write files by specifying "IPSM" as the volume.Keep in mind that a FULL rebuild of the WCE image (including the kernel files) is required after all PSM integration and build steps are complete.
Also important to note is that the first time bringing up PSM on clean flash,the PSM folder will need to format.If you have not changed PLAT_FormatRecovery in PLAT_API.c,then a format will be triggered automatically.



Like any other media,the file partition in the flash contains tables,pointers and variables that must be initialized before files can be stored.This is done during a format operation.
Intel PSM gives the OEM control over how the media will be formatted,allowing the OEM to tailor PSM to their application.The default format settings are designed to work well in most systems,and an OEM,at least initially,need not modify them.

Media Management Overview
A linear flash memory is organized into erase blocks that are too large to efficiently store most files.Intel PSM includes a media manager that efficiently stores multiple files in these blocks and supports modifying them.It does this by logically dividing a large block into smaller allocation units,and then keeping track of what files are stored in which allocation units.
An allocation unit is a logical subdivision of a block.It is the minimum amount of memory Intel PSM can use to store a file.When an application creates and writes data into a file,PSM uses some number of allocation units to store it.
All allocation units in the file partition are the same size,and that size is one of the parameters the OEM can specify.Allocation units should be just enough to store the typical file in a system.If the system were a web appliance,and if the typical file were a cookie or a favorite(~100bytes),the size of the allocation units should be 256bytes,the smallest size PSM supports.
Deleting a File
When an application deletes a file,PSM looks through the control structures to find all allocation units that are being used to store the file.It can not erase those units because they reside in blocks that most likely have allocation units from other files.Instead,it sets a flag in the control structure that tells PSM not to use that allocation unit for any other data -the allocation unit is marked as "dirty."
Modifying a File
When an application modifies a file,parts of the old version are deleted and new sections written.As was the case with a deleted file,the deleted allocation units are marked dirty,and "clean" ones are used to store the modified sections.
Reclaim
Over time,as files are deleted and modified,blocks will fill up with dirty allocation units.When a block is "reclaimed," all allocation units that have valid data are copied into a spare block,the block is erased and the control structures are updated to note the new location of the data.  Whenever PSM marks an allocation unit dirty,it decides if that block should be reclaimed.The criteria for that decision is set in the format parameters.

Wear-leveling
Flash blocks can only be erased a limited number of times-typically 100,000 program-erase cycles/block.A typical file partition will have many blocks,and it is possible that some of the blocks could be erased more often than others.Those block would "wear out"sooner than the rest of the blocks.
PSM includes a wear-leveling algorithm that keeps track of how often each block has been erased and avoids erasing blocks that have been heavily erased.

posted on 2005-03-20 12:53  yakin  阅读(428)  评论(0编辑  收藏  举报