Muti-bin的一些相關函數和設置

This function saves the number of .bin files to be downloaded and their addresses and sizes.
這個函數保存要下載的.bin文件的數目和他們的地址以及大小。
句式:
void OEMMultiBINNotify(
  const PMultiBINInfo pInfo
);
參數:
pInfo
[in] Contains information about the downloaded .bin files.
返回值:
NONE
備註:
The number of .bin files to be downloaded and their addresses and sizes are necessary to successfully cache all the OS images in RAM, if they are destined for flash memory.
如果.bin文件要下載的數目和他們的地址、大小的目的地址是flash memory,他們是很有必要成功地緩存到RAM裏面的操作系統鏡像文件。
g_pOEMMultiBINNotify is a function pointer. You can assign the address of a custom BIN notify routine that the BLCOMMON code then calls at the appropriate time through this function pointer. The following code example shows how you can perform this routine.
g_pOEMMultiBINNotify是一個函數指針。你可以分配一個定製的BIN通知例程的地址,這個例程的BLCOMMON代碼接着在合適的時間通過這個函數指針調用。下面的代碼例子顯示了你是如何執行這個例程的。

BOOL OEMMultiBINNotify(const PMultiBINInfo pInfo);
g_pOEMMultiBINNotify = OEMMultiBINNotify;
要求:
Header blcommon.h
Library blcommon.lib
Windows Embedded CE Windows CE .NET 4.2 and later

==========================================================-------------==========
Adding Support for Multiple-BIN Image Notification

Platform Builder and the BLCOMMON library support downloading multiple .bin files during the same download session. This is useful when developing a multi-BIN run-time image.
Platform Builder and the BLCOMMON library 支持多bin文件的下載在統一下載階段。當你在開發多bin運行時鏡像文件這是很有用的。

The BLCOMMON library can notify third-party code about each .bin file to be downloaded, and the .bin file's address and length, through a function pointer.
The BLCOMMON library可以識別第三方代碼關於每個要下載的.bin文件,.bin文件的地址和長度,通過一個函數指針來進行下載。

This information is useful when deciding how to temporarily cache a multi-BIN run-time image in RAM before writing it to flash memory. For more information, see OEMMultiBINNotify.
這個信息是有用的,當決定如何去臨時的緩存一個在RAM中的多bin運行時鏡像文件,並把它寫入進flash memory。對於更多的消息,可以查閱OEMMultiBINNotify.

The following code example shows an implementation of OEMMultiBINNotify.
下面的代碼例子顯示了OEMMultiBINNotify的實現。
void OEMMultiBINNotify(const PMultiBINInfo pInfo)
{
    BYTE nCount;

    if (!pInfo || !pInfo->dwNumRegions)
    {
        EdbgOutputDebugString("WARNING: OEMMultiBINNotify: Invalid BIN region descriptor(s)./r/n");
        return;
    }

    g_dwMinImageStart = pInfo->Region[0].dwRegionStart;

    EdbgOutputDebugString("/r/nDownload BIN file information:/r/n");
    EdbgOutputDebugString("-----------------------------------------------------/r/n");
    for (nCount = 0 ; nCount < pInfo->dwNumRegions ; nCount++)
    {
        EdbgOutputDebugString("[%d]: Base Address=0x%x  Length=0x%x/r/n" , nCount, pInfo->Region[nCount].dwRegionStart, pInfo->Region[nCount].dwRegionLength);
        if (pInfo->Region[nCount].dwRegionStart < g_dwMinImageStart)
        {
            g_dwMinImageStart = pInfo->Region[nCount].dwRegionStart;
            if (g_dwMinImageStart == 0)
            {
                EdbgOutputDebugString("WARNING: OEMMultiBINNotify: Bad start address for region (%d)./r/n", nCount);
                return;
            }
        }
    }

    memcpy((LPBYTE)&g_BINRegionInfo, (LPBYTE)pInfo, sizeof(MultiBINInfo));
}

When using BLCOMMON during boot loader initialization, for example, OEMDebugInit, the multi-BIN notification function pointer should be assigned to the OEM's notification routine.

For example, to have BLCOMMON call OEMMultiBINNotify to validate the image signature, you should do the following in OEMDebugInit.
在boot loader初始化的時候使用BLCOMMON,例如,OEMDebugInit,the multi-BIN 通知函數指針應該分配給OEM的通知例程。
例如,讓BLCOMMON 調用 OEMMultiBINNotify使鏡像簽名有效,你可以在OEMDebugInit中進行如下設置:
g_pOEMMultiBINNotify = OEMMultiBINNotify;

-----------------------------------------------------------------------------------------------------------------

This function verifies that the address provided is in valid memory.
這個函數校驗有效內存中提供的地址。
句式:
BOOL OEMVerifyMemory(
  DWORD dwStartAddr,
  DWORD dwLength
);
參數:
dwStartAddr
[in] Address to be verified.

dwLength
[in] Length of the address, in bytes.
返回值:
TRUE indicates success. FALSE indicates failure.
備註:
g_pOEMVerifyMemory is a function pointer. An OEM can assign the address of a custom verify memory routine that the BLCOMMON code then calls at the appropriate time through this function pointer. The following code example shows how you can perform this routine.
g_pOEMVerifyMemory是一個函數指針。OEM可以分配給一個定製的校驗內存例程分配例程,是在適當的時間通過這個函數指針調用 BLCOMMON代碼實現的。下面的代碼的例子顯示了你可以執行這個例程。

BOOL OEMVerifyMemory(DWORD dwStartAddr, DWORD dwLength);
g_pOEMVerifyMemory = OEMVerifyMemory;
要求:
Header blcommon.h
Library blcommon.lib
Windows Embedded CE Windows CE .NET 4.2 and later

-----------------------------------------------------------------------------------------------------------

Mount settings can be located anywhere along a multi-level hierarchy of registry keys starting at HKEY_LOCAL_MACHINE/System/StorageManager/Profiles. The scope of the mount setting narrows at each level in the same manner as variable scope in a C++ program. At any particular level, Storage Manager combines the applicable settings to generate the proper mount settings for a specific instance of a mounted file. Settings at a lower level in the hierarchy override values that might have been set at a higher level.
Mount可以和多級別的註冊鍵值一起被定位在HKEY_LOCAL_MACHINE/System/StorageManager/Profiles的任何地方。mount的範圍可以在C++程序中的每一級別以同樣的方式作爲可視的範圍進行狹窄的設置。再任何特定的級別,Storage Manager結合適當的設置可以對一個掛載區域的特定的實例進行適當的mount設置。在其更低一級別的設置可能比更高一級的設置的優先級要高。

    * Mount settings under the base profile key(在基本的文件鍵值)
      Settings at [HKLM/System/StorageManager/Profiles] pertain to all file systems on all profile-based storage devices; that is, any file system with a block device. Note that this excludes AutoLoad file systems.
      在[HKLM/System/StorageManager/Profiles] 分區下的設置,對於在所有基於文件存儲設備上的所有文件系統,任何文件系統都有塊設備。注意這個排除了 AutoLoad文件系統。

    * Mount settings under a specific profile key(指定的文件鍵值)
      Settings at [HKLM/System/StorageManager/Profiles/<MyProfileName>], pertain to all mounted instances of all file systems on storage devices reporting the profile <MyProfileName>.
      在[HKLM/System/StorageManager/Profiles/<MyProfileName>]下進行設置,對於在存儲設備上的所有文件系統的掛載實例的分區,記錄着<MyProfileName>文件。

    * Mount settings under a file system sub-key of a profile specific key(一個給定文件系統鍵值下的一個文件系統的子鍵)
      Settings under a file system sub-key, [HKLM/System/StorageManager/Profiles/< MyProfileName>/<MyFileSystemName >], pertain to only mounted instances of < MyFileSystemName > on storage devices reporting the profile <MyProfileName>.
      在一個文件系統子鍵下進行設置,[HKLM/System/StorageManager/Profiles/< MyProfileName>/<MyFileSystemName >],只
在存儲設備上掛載的< MyFileSystemName >實例記錄profile <MyProfileName>的分區。
    * Mount settings under a partition sub-key of a profile specific key(一個給定文件系統的鍵值下的一個分區子鍵)
      Settings at [HKLM/System/StorageManager/Profiles/<MyProfileName>/<MyPartitionName>], pertain to only the partition named <MyPartitionName> when mounted on devices reporting the profile <MyProfileName>.
     在[HKLM/System/StorageManager/Profiles/<MyProfileName>/<MyPartitionName>]進行設置,分區只存在 <MyPartitionName>的分區。當掛載在設備記錄着文件<MyProfileName>。

For versions of Windows Embedded CE earlier than Windows CE 5.0, you can place mount settings in the MountFlags value. MountFlags value use bitwise OR combinations to specify how the partition should be mounted. Values for MountFlags and its replacements can be set at the Profiles level, and also within an individual profile.
對於Windows CE 5.0之前的版本,你可以進行mount設置在MountFlags value值裏。MountFlags value使用逐位或者組合在一起去明確分區是如何被裝載的。MountFlags的值和它的替代值可以在Profiles級別進行設置,也可以在每個Profiles下面進行設置。

For Windows CE 5.0 and later, the MountFlags registry flag has been deprecated. Replacement values are simpler: each replacement value can be dword:1, indicating that the setting is turned on, or dword:0, indicating that the setting is turned off.
對於Windows CE 5.0和之後的版本,MountFlags 註冊表 的flag已經不推薦使用了。用更簡單的值去替代:每個替代值可以被設置成dword:1,指出設置被打開,或者dword:0,指出設置設置被關閉

The following table provides summary descriptions of flags for setting mount values.
下表提供了關於mount值簡要的描述和屬性


Flag                 Description

"MountFlags"        Indicates how the partition is mounted.
                    This value has been deprecated for Windows CE 5.0 and later. It is                     recommended that you use the replacement registry keys listed below to                     indicate partition mount values.
指出分區是如何掛載的
這個值在Windows CE 5.0 and later已經不推薦使用了。它被推薦使用下面列出的標誌分區掛載值的註冊表鍵值來代替。

"MountHidden"       Specifies a hidden file system. Set to 1 to enable.

                    Replaces "MountFlags"=dword:1
明確一個隱藏的文件系統,設置1使能。代替了一簽版本使用的"MountFlags"=dword:1

"MountAsBootable"   Specifies that the file system may contain the system registry. The                          first mounted partition on the store gets the hive. Set to 1 to enable.

                    Replaces "MountFlags"=dword:2
明確了文件系統可能包含的系統註冊表。存儲設備上的第一個掛載的分區是基於蜂窩的,設置1去使能。代替了以往的:"MountFlags"=dword:2
"MountAsRoot"       Specifies to mount as the root of the file system. Set to 1 to enable.

                    Replaces "MountFlags"=dword:4
明確了作爲文件系統的根。設置1使能。替代以前版本的"MountFlags"=dword:4
"MountAsROM"        Specifies to mount as an external ROM file system. Set to 1 to enable.

                    Replaces "MountFlags"=dword:10
明確了掛載作爲一個擴展ROM文件系統,設置1去使能,替代以前版本的"MountFlags"=dword:10
"MountSystem"       Treats all files and subdirectories as system files. Set to 1 to enable.

                    Replaces "MountFlags"=dword:20
把所有的文件和子路徑看成系統文件。設置1使能,替代老版本的"MountFlags"=dword:20
"MountPermanent"    Indicates this volume can never be dismounted. Set to 1 to enable.

                    Replaces "MountFlags"=dword:40
指出了這個分區時永遠不能被掛載的,設置1使能。替代以前版本的"MountFlags"=dword:40
"MountAsNetwork"    Indicates this volume receives all UNC paths. Set to 1 to enable.

                    Replaces "MountFlags"=dword:80
指出了這個分區接收所有的UNC路徑,設置1使能。替代以前版本的"MountFlags"=dword:80


The following table shows examples of typical replacements for deprecated MountFlags values:
下表顯示了典型的替代不贊成使用的MountFlags的值:
Deprecated value:      Replacement values             Description

"MountFlags"=dword:6     "MountAsBootable"=dword:1"MountAsRoot"=dword:1
    

Mounts the partition at the root as a bootable partition.
掛載一個分區在根目錄作爲一個引導分區表

"MountFlags"=dword:11    "MountHidden"=dword:1"MountAsROM"=dword:1
    

Mounts the partition as ROM, and makes the partition not visible to users.
掛載一個分區作爲ROM,並使分區對於用戶是不可見的。

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