Tuesday, January 29, 2013

THIS IS IT 1 & 2



http://msdn.microsoft.com/en-us/library/aa447027.asp


TLBClear (Windows CE 5.0)

Windows CE 5.0This topic has not yet been rated - Rate this topicSend FeedbackThis function is deprecated. To flush and invalidate the instruction and data TLBs, use the OEMCacheRangeFlush function instead.This function is used to flush and invalidate the instruction and data TLBs and is specific to ARM processors.void TLBClear(void);

Parameters

None.

Return Values

None.

Remarks

TLBClear is called during the end of KernelStart, prior to the MMU and virtual memory being enabled. It is called when a process switch occurs between a trusted and nontrusted application and when the virtual memory APIs are used to allocate, free, or manipulate memory.

Requirements

OS Versions: Windows CE .NET 4.0 and later.Header: Not applicable.Link Library: Nk.lib.

See Also

FlushICache | FlushDCache | OEMCacheRangeFlush
Initializing the RAM-based Registry (Windows CE 5.0)

Hints for Using the Registry (Windows CE 5.0)

Windows CE 5.0This topic has not yet been rated - Rate this topicSend FeedbackFor

Windows CE development, memory usage is an important consideration and the registry is no exception.

The following guidelines are based on the fact that it takes less memory to store a value than to store a key:Keep your key depth as shallow as possible.

Eliminate unnecessary subkeys.When possible, replace subkeys with values.

For example, a subkey Colors might be replaced with a value named Colors.Store as much information in one value as possible. For example, a date value could be formatted to include the time rather than using two values.

See Also



Master Key Storage (Windows CE 5.0)

Windows CE 5.0This topic has not yet been rated - Rate this topicSend FeedbackProtected

Store API or Data Protection API (DPAPI) encrypt/decrypt sensitive data, such as a user passwords, using a secret key called the master key.

The master keys are 3DES-encrypted using a key derived from the user's password, before they can be stored. Master keys can be stored in a file in the Windows folder or in the system registry.

A master key file has a .mky file extension. When a user changes his or her logon password, master keys are automatically unencrypted and re-encrypted using the new password.The two CryptoAPI functions, CryptProtectData and CryptUnprotectData, make up the Protected Store API.By default, master keys are stored in files in the file system.

They may be stored in the system registry if certain persistent registry implementations need to retain the master keys after losing and regaining power.

If a hive-based registry is used, the keys are saved in the same volume as the registry hive.


ñThe following registry keys control the location of the master key files. These registry values should be pre-configured in the OS design because they are only checked on system start up.

If a hive-based registry is used, the values should be saved in the boot section of the registry.To specify the file path for the master keys, set the following registry value to the absolute path of the directory.[HKEY_LOCAL_MACHINE\init\BootVars] "MasterKeyFileDir"="\\windows\\" To activate storage of master keys in the registry instead of as a file in the Windows folder, you must set the following registry value in the run-time image:[HKEY_LOCAL_MACHINE\init\BootVars] "MasterKeysInRegistry"=dword:1

If you do not set this key, or if you set this key to 0, the master keys are stored in a file.Note   It is important to note that if you have the master keys stored in the registry, an unauthorized user may gain access to them more easily.

See Also

Advanced Registry Concepts | Protected Store | CryptProtectData | CryptUnprotectData | Hive-Based Registry Stored in RAMSend Feedback on this topic to the authorsFeedback FAQs© 2006 Microsoft Corporation. All rights reserved.Did you find

Hive-Based Registry Stored in RAM (Windows CE 5.0)

Windows CE 5.0This topic has not yet been rated - Rate this topicSend FeedbackYou can specify a region of RAM to store a registry hive in, rather than using the hive as a memory-mapped file on a file system.

Presumably, the region of RAM is static RAM (SRAM) chip or similar permanent storage, although, it can be a reserved area of RAM specified in the Config.bib file.

When the file system brings up the registry, the file system calls IOCTL_HAL_GET_HIVE_RAM_REGION to retrieve the necessary information for storing the hive-based registry.

Rather than using a file on the file system, the registry data is stored directly in the region of RAM.

There can only be one user and the user data is stored in the same RAM region as the system data.

If you want to support multiple users, all users have to share the same data under the HKEY_CURRENT_USER registry subtree.To support IOCTL_HAL_GET_HIVE_RAM_REGION, you must set certain registry keys to specified values.

The following registry key example shows how to support IOCTL_HAL_GET_HIVE_RAM_REGION:[HKEY_LOCAL_MACHINE\init\BootVars] "Flags"=dword:0 "NoDefaultUser"=dword:0 Setting Flags equal to zero prevents Device.exe from starting in the first boot phase.

Setting NoDefaultUser equal to zero simply logs in a default user.Storing the hive-based registry in RAM and the incorporation of the user hive into the same RAM space has certain implications, as follow:There is no OS-provided save-and-restore mechanism for the registry when it is stored in the RAM region. RegCopyFile, RegRestoreFile, RegReplaceKey, WriteRegistryToOEM and ReadRegistryFromOEM are not supported.

The registry data persists as long as its region of RAM persists, and atomic transactioning of changes protects the registry data against corruption. RegSaveKey is supported; when an application calls RegSaveKey, the OS will make a call to the OEM's implementation of IOCTL_HAL_SAVE_HIVE_RAM_REGION.

This mechanism allows the OEM to save the registry when it is in a steady state.RegFlushKey is unsupported.

The RAM region assumes persistence, so there is no need to flush anything.

IOCTL_HAL_GET_HIVE_CLEAN_FLAG is applicable in this case and you can use it to force the registry to be cleaned.

However, because there is only one user and the data for that user is stored together with the system data, there is only one call to IOCTL_HAL_GET_HIVE_CLEAN_FLAG, along with HIVECLEANFLAG_SYSTEM, to determine whether you want to clean the entire registry.

If you clean the registry, the cleaning does not affect the user profile directories.

While there will not be any user registry data stored in the user profile directories, these directories may be used to hold other user-specific data and settings.

Therefore, you are responsible for implementing your own cleanup mechanism to remove user profiles.The registry security mechanism applies with no differences.


Because VirtualCopy receives the region of RAM to obtain a virtual address to access the RAM with, the region resides inside the memory space of Filesys.exe as long as it is under 2 MB in size.

If the region is larger than 2 MB, it will be in public memory space.

---+-++This is significant+-+++--
becausy6e in public memory space, any application can read and overwrite the data stored in 2 region.

Therefore, limit the registry RAM region to 2 MB or less if possible.There is only one copy of user data stored. You can still implement multiple-user support by leaving the data under the HKEY_CURRENT_USER subtree. All users share the data under this subtree.

 SetCurrentUser will still succeed in switching between users. User profile directories will still be created for each user, and will be placed in the object store as specified by the "ProfileDir" registry subkey.

For more information see User Profile Storage.If the OAL does not support IOCTL_HAL_GET_HIVE_RAM_REGION, or if IOCTL_HAL_GET_HIVE_RAM_REGION fails for any reason, the registry hives are stored in the object store.

See Also

Advanced Registry Concepts | Registry | IOCTL_HAL_GET_HIVE_RAM_REGION | IOCTL_HAL_SAVE_HIVE_RAM_REGION | Master Key Storage


Persisting Data with the RAM-Based Registry (Windows CE 5.0)

Windows CE 5.0This topic has not yet been rated - Rate this topicSend FeedbackYou can persist the registry data of your OS with the RAM-based registry when the RAM, which contains the object store, is not being powered.

With the RAM not powered, you have additional protection against tjhe possibility of invalid data configurations. The preferred method for persisting registry data is to use the hive-based registry. For more information, see Persisting Data with the Hive-Based Registry.

Addithional methods for persisting data with the RAM-based registry using the OAL are also available. For more information, see Data Persistence with the RAM-based Registry Using the OAL.

Before you can persist the registry data of you OS, you must already have created, built, and downloaded a OS image to your target device.

For more information, see How to Use the IDE to Create, Customize, and Build a Run-Time Image.To persist data with the RAM-based registryCopy the Oemregistry sample to your OS.

For example, copy the %\SystemRoot%\Public\Common\Oak\Drivers\FSD\Oemfs folder to your platform.Filesys.exe attempts to load the Oemregistry.dll file when the registry is initialized.

The Oemregistry.dll file must be stored in ROM and should not be stored on external media.Modify the source code for the OEM registry sample to export the ReadRegData, WriteRegData and RegistryOperation functions

.To add persistent password support, modify the source code for the OEM registry sample to export the ReadGenericData, and WriteGenericData functions.Initialize the RAM-based registry for your OS.For more information about performing this step, see Initializing the RAM-based Registry.

See Also

Persisting Data with the Hive-Base6u Registry |How to Use the IDE to Create, Customize, and Build a Run-Time Image | RAM-Based Registry | Data Persistence with the RAM-based Registry Using the OALSend Feedback on this topic to the authorsFeedback FAQs© 2006 Microsoft Corporation. All rights reserved.

-----
Windows CE 5.0This topic has not yet been rated - Rate this topicSend FeedbackTo persist data with the RAM-based registry, you must understand how an OS initializes the RAM-based registry.

The following list of steps shows the OS process of initializing the RAM-based registry:The OS initializes the kernel.The kernel runs Filesys.exe.Filesys.exe initializes the RAM file system.Filesys.exe initializes the database subsystem.Filesys.exe initializes the registry by checking for a registry in RAM. If one is found, proceed to step

7.If Filesys.exe does not find a registry in step 5, it restores the registry from ROM. Filesys.exe loads \Windows\Default.fdf, which was created using Makeimg.exe.Filesys.exe checks for the ReadRegistryFromOEM OEM adaptation layer (OAL) function.

If Filesys.exe does not findReadRegistryFromOEM it keeps the registry from ROM, as described in step 6.Filesys.exe attempts to restore \Windows\Restore.fdf, which is created with the RegCopyFile function. If Filesys.exe cannot restore \Windows\Restore.fdf, it keeps the registry from ROM, as described in step

6.Filesys.exe checks one more time for ReadRegistryFromOEM. If Filesys.exe does not find ReadRegistryFromOEM, it keeps the registry from ROM as described in step 6.Note   Files that exist on a PC Card or a device that is serviced by a

device driver cannot be accessed during initialization, because Device.exe has not been loaded. Also, memory cannot be allocated to pass to the OS because functionality for saving and loading the registry is implemented in the OAL.

The following procedure shows additional steps you must take in order to initialize the RAM-based registry of your OS.

To initialize a RAM-based registryExpose the ReadRegistryFromOEM and WriteRegistryToOEM functions in your OAL after Filesys.exe initializes the RAM file system.

For more information about developing an OAL, see How to Develop an OEM Adaptation Layer.If an OAL is not available, use the RegCopyFile and RegRestoreFile functions to initialize a registry from RAM.After RegRestoreFile succeeds, reset your device for the new registry settings to take effect.

To keep the user unaware that a reset is occurring, you can create a boot sequence by configuring the HKEY_LOCAL_MACHINE\Init registry key. In this registry key, you can restore the registry and reboot without running Gwes.exe.

You can then perform a full boot. By preventing Gwes.exe from running, the display does not become active, and therefore the user is unaware that any reset has occurred.Using RegCopyFile and RegRestoreFile to initialize a registry from RAM requires enough of the OS to be running to restore the registry.

The portions of the OS that must be running depend on where your registry file resides. For example, if your registry file resides on a PC Card, Device.exe must be running before the registry can be restored. Otherwise, the OS cannot access the registry file on the PC Card.

See Also

ReadRegistryFromOEM | RegCopyFile | WriteRegistryToOEM | How to Develop an OEM Adaptation Layer | RegRestoreFile | Persisting Data with the RAM-Based Registry

x

No comments:

Post a Comment