Documents related to wince Reg

Source: Internet
Author: User
Tags builtin

Reg file

 

Registry file, which is basically the same as the registry file used in the Windows operating system. In BSP, it is mainly platform. reg. The Registry File describes the configurations related to the hardware platform, most of which are used to describe the driver information.

The registration subject format is as follows:

De> [key1] de>

De> "valuename1" = {Value Type }:{ data} de>

De> "valuename2" = {Value Type }:{ data} de>

De> [key2] de>

De> "valuename1" = {Value Type }:{ data} de>

Value Type and data correspond to each other, and different value types correspond to different data, as follows:

Value Type

Data  
REG_SZ "My string" String type
REG_DWORD DWORD: NNNN (hex number) DWORD type
Reg_multi_sz Multi_sz: "my_string_1", "my_string_2" Multi-string type
REG_BINARY HEX: XX, XX, xx Binary type
HEX Hex (XXXXXXXX): XX, xx Hexadecimal type

In the registry, you can also use if/endif for condition inclusion. The condition can be an environment variable in wince, and you can add a space after the environment variable and an exclamation point ("! "), It indicates that no value is set or not equal to, for example:

De> If environment variable [= value] [!] De>

De> [key1] de>

De> "valuename1" = {Value Type }:{ data} de>

De> "valuename2" = {Value Type }:{ data} de>

De> [key2] de>

De> "valuename1" = {Value Type }:{ data} de>

De> endifde>

If a row in the Registry starts with a semicolon (";"), this line is commented out. There are also some exceptions, such as the following when the hive registry is supported:

; Hive boot section

... Reg data...

; End hive boot section

I have introduced the hive registry before. I will not talk about it here. In the registry, we create, Delete keys, assign values, and perform other operations.

Create a registry key:

[Key1]

"Valuename" = "value type"

Delete a registry key:

[-Key1]

Delete A registry value:

"Valuename1" =-

The Registry configurations related to BSP and hardware platforms are stored in the platform. reg file. The configurations related to the wince project should be placed in the project. reg file.

 

 

From Forum

Http://topic.csdn.net/u/20081008/15/750119c7-efec-4140-9ecc-309dcb0ed7a4.html? 1882204088

 

Beginner, simple questions about the wince reg file
1: This is a backlight.
[HKEY_LOCAL_MACHINE/Drivers/builtin/bak] // What is the description of this sentence?
"Index" = DWORD: 1 // What does Index mean? 1 indicates what?
"Prefix" = "Bak" // What is prefix?
"DLL" = "backlight. dll"
"Order" = DWORD: 1 // What does this mean?
"Iclass" = "{A32942B7-920C-486b-B0E6-92A702A99B35}" // What Does this represent and where does this string of data come from?
; Power-manageable generic

[HKEY_CURRENT_USER/controlpanel/backlight] // What is the difference between this and above?
"Actimeout" = DWORD: 3C // are these associated with the program?
"Batterytimeout" = DWORD: 1e
"Backlightontap" = DWORD: 1
"Acbacklightontap" = DWORD: 1
"Brightness" = DWORD: 32
2: Touch Screen
[HKEY_LOCAL_MACHINE/hardware/devicemap/touch] /// what is the difference between this and above?
"Maxcalerror" = DWORD: 7
; Portrait
"Calibrationdata" = "480,668 127,212 133,1128 838,1120 827,212" // how can this string of data be obtained? Where can I get it? How can it be combined with the source program?

3: Serial Port
[HKEY_LOCAL_MACHINE/Drivers/builtin/serial1]
"Devicearrayindex" = DWORD: 0 //?
"IRQ" = DWORD: 1C //?
"Membase" = DWORD: 50000000 //?
"Memlen" = DWORD: 2C //?
"Interruptbitsshift" = DWORD: 0; UART 0 interrupt sub register shift bit .//?
"Isttimeouts" = DWORD: 200; every 512 ticks checking modem status .//?
"Prefix" = "com "//?
"Index" = DWORD: 1 //?
"DLL" = "serial_smdk2440.dll"
"Order" = DWORD: 0 //?
"Priority" = DWORD: 0 ///?
"Port" = "COM1 :"//?
"Devicetype" = DWORD: 0 //?
"Friendlyname" = loc_displayname_com1 //?
"TSP" = "unimodem. dll "//?
"Iclass" = "{CC5195AC-BA49-48a0-BE17-DF6D1B0173DD }"//?
"Devconfig" = HEX: 10, 00, 00, 00, 00, 01, 00, 00, 4B, 08, 00, 00, 00, 00, 00, 00, 00 //?

 

Reply:

Index "= DWORD: 1 // What does Index mean? 1 indicates what? ------------ Index,

"Prefix" = "Bak" // What is prefix? ----- Prefix of the driver Function
"DLL" = "backlight. dll"
"Order" = DWORD: 1 // What does this mean? --------------- Start sequence.
"Iclass" = "{A32942B7-920C-486b-B0E6-92A702A99B35}" // What Does this represent and where does this string of data come from? -------- At Microsoft, each peripheral has a fixed guid.

 

 

 

Registry File in WinCE

Http://blog.ednchina.com/bluehacker/248746/message.aspx

The Registry file is a very important file in wince. The configuration information of all drivers is stored in the registry. When the system starts, it loads the builtin Driver Based on the information in the registry. The partition driver and file system driver are loaded to flash or SD card based on the registry information.

The Registry in wince generates the reginit. ini file based on several registry files during platform build. This file is the Registry file of the final system image. This is completed at the final makeimg stage of the build process. Reginit. ini files are generated from several. Reg files, as long as there are files such as platform. Reg, common. Reg, wceshell. Reg, ie. Reg, and project. Reg.

These files are very confusing. Today, I carefully read Microsoft's documents and finally figured out what the relationship is and merged to generate reginit. INI files are merged in the following order.

1. merge the general Reg settings of common operating systems such as common. Reg, ie. Reg, and wceapps. Reg.

2. Merge the project. reg file, that is, the reg settings of the project.

3. The last step is platform. Reg.

That is to say, if the project. reg file and common. if Reg has the same registry key, project. reg will overwrite common. in reg; similarly, platform. reg will overwrite the project. reg.

 

Research on Embedded system registry based on WinCE

 

Abstract: This article first describes the importance of the Windows CE registry, which plays a key role in the normal operation of the entire embedded system. Then we introduced two registry storage methods, and focused on the hive-based registry. This article describes in detail how to store data in the hive-based registry and how to implement the hive registry. Finally, the system successfully modifies the registry. The study in this article also has reference significance for registry modification of other operating systems.

0 Introduction

The embedded operating system Windows CE uses the registry like the desktop operating system to save application, driver, user settings, and other configuration information, the registry usually stores the status information of the operating system calling program, so it plays a very important role. It is the core of the Windows CE operating system. Without a registry, the operating system will not be able to obtain the required information to run and control the affiliated devices and applications and to correctly respond to user input [1] [2].

1 Windows CE registry Overview

The Registry structure of Windows CE is similar to that of other Windows operating systems. The Registry is a collection of primary key word Subtrees. It has the same level as the file directory tree. Each subtree consists of a lower-layer subtree, a key, and a key value. The key is equivalent to the directory of the file system. Each key contains several key-value items. The key-value item is equivalent to a file at the end of the file system. It consists of the key-Value Name, data type, and key-value. The key value is the data stored in the registry.

Windows CE has some restrictions on the registry value: the name of a key or key value item can contain a maximum of 255 characters, the maximum data size is 4 K, and the key nesting level is a maximum of 16 layers. Therefore, when using Registry programming, try to make the keys and key-value items take up the minimum space. In addition, in the registry, key-value items occupy a larger storage space than key-value items.

The Windows CE registry contains four root keys [2], as shown in table 1.

Table 1 Windows CE registry Root Key


2 Windows CE registry type

Due to the characteristics of the embedded system, some embedded devices do not have external storage. Therefore, the Windows CE registry provides two implementation methods: the ram-based registry and hive-based registry [3]. We can use any registry in Windows CE. The Registry type is transparent to users and applications. The ram-based registry is very efficient on frequently-hot-started devices, while the performance on frequently-cold-started devices is disappointing. It is best suited for personal electronic consumer products with battery backups. For devices that often use cold start or do not use hot start mode
The hive registry is very efficient and most suitable for permanent storage and multi-user environments.

2.1 Ram-based registry

As the name suggests, the ram-based registry stores the entire registry as an object in Ram. This means that if the system breaks power on the ram battery, all changes to the registry will be lost. That is to say, their validity is consistent with that of the data in Ram. However, using the ram registry allows you to perform fast and efficient read/write operations on the registry. In earlier versions of Windows CE, a large number of Ram-based registries are applied. If the ram-based registry is used for devices that require frequent cold start, the Registry needs to be saved when the system is powered off and restored when the system is restarted.

2.2 hive-based registry

The hive system contains system settings that do not belong to any user information. The hive system is called by the OEM layer. Generally, the hive file is system. HV, but its storage location may change with the platform. This storage method saves the system the need to back up and restore the registry data before and after power failure, which makes the system faster during cold start.

The hive-based registry is divided into two parts: System hive, which stores all system data; user hive, which stores all relevant data for specific users. A multi-user system will include several user hive. When a user logs on, the corresponding user hive will be activated. When the user exits, the corresponding user hive will also be revoked. All user hive names are named by user. HV and put in different user directories. Each directory is named by the user name it belongs.

The key-value item profiledir In the HKEY_LOCAL_MACHINE/init/bootvars in the registry stores the locations of all user directories. Systemhive, the key-value item in HKEY_LOCAL_MACHINE/init/bootvars, stores the path and file name of the system hive file.

Boot hive storage is only used for system settings when the system starts. Boot hive is read from ROM and used to start drivers and related file systems. This file system is used to start the hive file. After hive is started, boot hive is terminated. When the system hive is valid, the modified registry data during startup will be stored in the system hive. However, the boot hive data remains unchanged in the Rom. 3. Implement the hive registry by modifying the platform file of the system. the reg file contains the system startup information. The Startup Mode of the hive registry is different from that of the general registry. It needs to load the driver of the system storage media before the system loads the Device Manager, only in this way can the storage information of the device in the Registry be extracted from the Device Manager
The purpose of hive storage. The following describes how to enable the system to support hive Table 2 standard hive and Its supported files.


Registry storage:

1) modify the start information value of the Device Manager, "Start devmgr" = DWORD: 1. This volume indicates that the hive registry is used to store system information.

2) Add the system's storage media driver to the comments between "hive boot section" and "End hive boot section". After the comments are extracted by the compiler, before the Device Manager is loaded after the system is powered on

3) A flag item is provided on the system's storage media driver to perform logical operations on the target data.

"Flags" = DWORD: 1

By modifying the preceding parameters, the system supports hive registry storage.

Information in the hive registry, such as touch screen electric shock check information and system IP address. A large number of tests have proved that this method is effective and feasible. 4. system registry modification Analysis

4.1 touch screen driver registry settings below is the Multimedia System touch screen driver Registry Information settings, we need to store some calibration coordinate information in the Registry during calibration: [HKEY_LOCAL_MACHINE/controlpanel] "inputconfig" = DWORD: 3; 3 => keyboard and touch screen

[HKEY_LOCAL_MACHINE/hardware/devicemap/touch] "drivername" = "Touch: DLL" "maxcalerror" = DWORD: 10 "calibrationdata" = "500,512 762,268 758,760 244,758 241,266" // calibration information landscape "calibrationdata" = "515,503 763,748 258,749 269,255 764,255
"


Figure 1 files to be modified in the hive Registry

4.2 fixed IP addresses in the image

In our self-created debugging environment, you must manually modify the IP address to debug multiple users at the same time after each startup. Therefore, to fix the IP address, you must modify the registry. The changes to the IP address will be reflected in the system registry. That is to say, if you can add the changes to the custom operating system, after the image is started, it has a set IP Address [4].

After constant exploration, the conclusion is very good. Modify project. Reg of the platform file and add the following content to the file:

[HKEY_LOCAL_MACHINE/comm/vmini1/parms/TCPIP] "DefaultGateway" = multi_sz: "192.168.0.1" "subnetmask" = multi_sz: "255.255.0" "IPaddress" = multi_sz: "192.168.0.5" "enabledhcp" = DWORD: 0

The first is the default gateway, the second is the subnet mask, and the third is the IP address. The last one must be added, that is, DHCP is disabled. Only in this way can your settings take effect. Note: The registry key value type must be set. DWORD must be added in front of the above multi_sz; otherwise, the effect is still ineffective.

4.3 SD card driver Registry Information

The SD card is an important peripheral storage device of the on-board multimedia system. To flexibly implement the hot swapping function of the SD card, a stream interface is used to drive the model. The Storage Manager is responsible for the SD card driver and the file system it uses. During the startup of the Storage Manager, many configuration information is obtained from the registry of the system. Therefore, you must first create the following SD card registry information:

[HKEY_LOCAL_MACHINE/Drivers/builtin/sdcard] "D11" = "sdcard. D11" "prefix" = "SDC" "Index" = DWORD: 1

"Order" = DWORD: l

"FSD" = "fatfs. D11"

[HKEY_LOCAL_MACHINE/system/storagemanager/profiles/sdcard]

"Name" = "SD card"

"Folder" = "sdcard storage"

5 conclusion

The Registry is the core of the Windows CE operating system and plays a vital role. The configuration information of all drivers and applications of the on-board multimedia system is stored in the registry, improper modification or loading will make some functions of the entire system unavailable, and may even cause the Windows CE operating system to fail to start. The innovation of this article is to propose a method to implement the hive registry and the idea of modifying the registry. A lot of experiments have proved that this idea is very effective and can be used to modify more other configurations. With the vigorous development of China's automobile industry, the Multimedia System of Automobile Navigation has a broad application prospect. The economic benefit of this project is estimated to be around 0.8 million yuan.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.