zoukankan      html  css  js  c++  java
  • 【转载】關於 ROMonly Files System——这个对掉电保存非常有用

    關於 ROM-only Files System

    這幾天在弄 WinCE 5.0 OS

    OS Catalog 裡面 Core OS/Windows CE devices/ Files Systems and Data Store

    下面 有一個 File System - Internal(Choose 1)

    有一個 RAM and ROM File System

    ROM-only File System

    選了 ROM-Only , 原本使用 mDOC 會在掛在 /Mounted Volume 變成掛在 "/"(Root) 下面

    WinCE Help 裡的 Object Store 泛指系統內的各種被儲存的物件(Object) (Ex. Registry, Files, .......)

    而選了 RAM and ROM 在下面所述應該會可以將Object 存在 RAM 裡面, 這樣有了一個問題在於 Suspend 需要將 RAM 內的 Object 保存的問題。

    而採用 ROM-only 如果有一個 External Files System 則可以將 Object 存在 External Files System ( CF Card, SD, mDOC, OneNAND)


    來自MSDN http://msdn2.microsoft.com/en-us/library/ms886144.aspx

    Platform Builder for Microsoft Windows CE 5.0

    Selecting the Internal File System for your Target Device

    The internal file system in your target device controls access to ROM. The file system can also provide file storage in the object store, which is in RAM. Two internal file system options are available: the RAM and ROM file system and the ROM-only file system. These have different properties and you will want to select the correct one for your target device. Both internal file systems provide the ability to mount additional external file systems, such as file allocation table (FAT).

    The RAM and ROM file system provides file storage in the object store, as well as access to the ROM. The object store is the root of the file system, and all data under the root is stored in the object store, with the exception of external file systems, which are mounted as directories under the root. Data in ROM is accessible through the Windows directory. The RAM and ROM file system is most useful in target devices that continuously power RAM because the object store is lost when RAM is not refreshed.

    The ROM-only file system does not allow applications to place files in the object store. Data in ROM is accessible through the Windows directory, and external file systems are again mounted as directories under the root. Additionally, with the ROM-only file system, you have the option of choosing an external file system to be placed at the root of the file system. If you mount a file system as the root, all data below the root directory is stored in that file system, with the exception of other external file systems.


    來自 MSDN http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcedata5/html/wce50conMountinganInstallableFileSystemastheRootDirectory.asp

    Platform Builder for Microsoft Windows CE 5.0

     

    Mounting an Installable File System as the Root Directory

    Send Feedback on this topic to the authors

    A Windows Mobile-based device can mount an installable file system as the root of the virtual file system ("/"). When you mount an external file system as the root, all data below the root directory is stored in the mounted file system. Files and directories of the external file system appear as directories off the root directory; subdirectories of the external file system appear as subdirectories of the root directory. Calls routed to other external volumes, such as /NETWORK or /HardDisk, will retain those names, and calls into those volumes will be routed appropriately.

    Including the ROM-only component

    To implement an installable file system as the root, you must include the ROM-only file system component in the run-time image instead of the ROM/RAM file system component (SYSGEN_FSROMONLY=1). If the combined RAM and ROM object store system is present in the run-time image, then the object store will always become the root file system.

    Note   If you choose to use a file system other than the object store as the root file system, the majority of ActiveSync functionality will not work correctly. ActiveSync assumes that the object store is used as the root file system.

    Only one file system may be registered as the root file system. After one root file system is registered, any subsequent file system making the attempt will be registered, but will not become the root file system. To register a different file system as the root file system, first de-register the previous root file system. At that point, there will be no root file system and the directory Windows will no longer be shadowed.

    Registering the file system as root

    When drivers are loaded and file systems are mounted, the desired file system is registered in a special way to indicate that it should become the root. Before this registration is made, all file API calls accessing files or directories in paths off the root will fail, except those paths that are in ROM.

    The following list describes important registry values that must be set in the HKEY_LOCAL_MACHINE/System/StorageManager/Profiles/<MyProfile>/<MyFileSystem> registry key.

    Value:type

    Description

    MountAsRoot: dword

    To explicitly mount a file system as the root directory, set the MountAsRoot value to 1.

    The root file system is defined as the first file system volume to mount that has the MountAsRoot property. The property is specified in the registry profile of a storage device.

    MountAsBootable: dword

    To explicitly mount a file system as the boot file system, set the MountAsBootable value to 1.

    If multiple mounted file systems have the MountAsBootable value set, the first one to mount will be used as the boot file system.

    For most target devices, Microsoft recommends mounting the same file system as both the root and boot file system.

    MountPermanent

    To explicitly prevent a file system from being programmatically dismounted, set the MountPermanent value to 1.

    A boot partition typically contains critical system files, such as the registry. If you mount a partition as bootable, this value ensures that the bootable partition cannot later be programmatically dismounted.

    Example

    The following example mounts the first FATFS partition on a storage device reporting profile MyProfile as both the root and boot file system, and makes the partition permanent to prevent programmatic dismounting:

    [HKEY_LOCAL_MACHINE/System/StorageManager/Profiles/<MyProfile>/FATFS]

        "MountAsRoot"=dword:1

        "MountAsBootable"=dword:1

        "MountPermanent"=dword:1

    File shadowing

    In Windows CE 4.x, true shadowing was not possible; the /Windows directory was either the installed file system, or a ROM-only file system, rather than the combination of both implied by the term shadow.

    In Windows CE versions 5.0 and later, an installed file system provides true shadowing between a Windows directory at the root and the ROM; that is, the files a user sees are in a combination of the two places.

    See Also

    Installable File System

     

    Form:

    http://kunyi.spaces.live.com/blog/cns!30484CDA412A1D29!545.entry

  • 相关阅读:
    How to produce the first draft of research paper?
    ETL
    BDA chapter 10
    <转>Java转iOS-第一个项目总结(2):遇到问题和解决方案
    <转>从Java转iOS第一个项目总结
    (转)总结iOS 8和Xcode 6的各种坑
    iOS开发之Xcode6之后不再自动创建Pch预编译文件,该如何解决这个问题?
    iOS开发:Objective-C中通知与协议的区别?
    PT和PX是什么鬼?
    使用cocoaPods经常出现的问题以及解决方案
  • 原文地址:https://www.cnblogs.com/gooogleman/p/2176038.html
Copyright © 2011-2022 走看看