A registry implementation scheme based on Smartphone class

Abstract: At present, the SmartphcIne type of mobile phone registry is implemented by database. Now it is necessary to use COMS to implement it. The specific method is to use two FLASHs with size of 64 KB to simulate CMOS. On this basis, the registry management is realized. Start directly from the FLASH driver layer. The registry record changes the traditional Windows approach, using a simplified method, regardless of the directory level, consisting of a primary key plus a key value, the primary key is a null-terminated string, can contain directory information, this is a successor The application development of mobile phone software has established a good development foundation.
Keywords: registry; Smartphone: CMOS; FLASH

0 Introduction With the rapid development of multimedia mobile terminals (PDAs, smart phones), it is no longer just a handheld device for voice communication, but an embedded communication platform that integrates additional functions such as MP3, MP4 and Internet mobile office. . Smartphon is an embedded RTOS product developed by Accelerator Technology. Its operating system is Nucleus. You can get the source code of the operating system by purchasing Licenses at one time. Accelerator Technology has made a number of optimizations for wireless communications and voice text messaging modules at the bottom.
Nucleus is an excellent embedded real-time operating system (RTOS) with preemptive and time slice rotation task scheduling methods, mainly used in time-critical embedded applications. About 95% of Nucleus is written in ANSIC and loaded into the application code as a library. There are many Nucleus in the mobile phone industry. The basic architecture of the Smartphone platform is divided into:
Wireless stack layer: responsible for the final data transmission and reception processing, it controls the hardware details of receiving and transmitting, highlighting the core content of wireless communication, which is the lowest layer of the Smartphone operating platform.
Core API Layer: They can be used for development related to wireless communication and voice services, mainly using MSDN.
Logical layer: In order to simplify development, the system wraps some APIs into individual function blocks to call similar controls. This layer provides the interface of each control.
Application layer: is the application that provides services to users in the system.

1 Interface design and implementation scheme Most of the current smartphone registry is originally implemented in a database. Now it should be implemented with COMS. The specific method is to use two FLASHs with a size of 64 KB to simulate CMOS. Implement the management of the registry, starting directly from the FLASH driver layer. The registry record changes the traditional Windows approach, using a simplified method, regardless of the directory level, consisting of a primary key plus a key value. The primary key is a null-terminated string that can contain directory information, or it can be written as "\APP\WINDOW\POSITION\X". Considering the convenience of the search, the primary key string must be capitalized and start with "\". There are 3 categories of key values, namely DWORD, Binary and string. Among them, DWORD occupies 4 B; String is a string whose null ends; Binary is composed of a 4 B Size plus content. Taking into account the FLASH read and write characteristics and portability, the entire record information is aligned to 4 B, and redundant bits are padded with 0s.
1.1 Data Structure The size of the registry is 64 KB, and the other 64 KB is used for backup during erasing. The entire 64 KB space is divided into 2 large blocks, namely index blocks and data blocks, where the index block size is 4 KB and the data block is 60 KB. The index block consists of HEAD of 32 B and an offset table. HEAD consists of one 4 B chip select word plus one 28 B reserved bit. The reserved bit is recommended to be filled in as “HTW CMOS VER1.0”, chip select word. Used as a protection against power loss during erasing. Each item of the offset table accounts for 4 B, with a total of 1,016 items. Each offset item consists of an offset of 28 b low and a flag of 4 b high. The flag is used for protection against power loss during addition and modification. The data block consists of records that are variable length by one, each record content is aligned to 4 B, and redundant bits are padded with 0s. The record consists of 4 B control field + 4 BCHECKSUM + primary key + key value. Among them, the control field = 28 b SIZE + 4 b FLAG. SIZE is the lower 28 bits, which is the first 28 bits of the physics. It represents the size of the entire record, including itself and CHECKSUM, primary key, key value, and so on. FLAG is the upper 4 bits, that is, the last 4 bits of the physics. It represents the attribute of the key value and is used as a judgment flag for the power failure protection.
1.2 About power-down protection information Power-down protection should be done well. There are two necessary conditions. First, when the system is started, it has the ability to know whether the last shutdown is a normal shutdown or an abnormal power-off shutdown. Second, the system is in any Sudden power loss, the ability to trace back to the information before the power failure. There are three pieces of information used by the registry system for power-down protection, which are the chip select word, the offset of the offset entry, and the FLAG of the record control field. The chip selection has a total of two 64 KB FLASH, and the top 4 B of each block is the chip selection information. Under normal circumstances, the piece that is being used (remember A) chip selection information writes 00 00 00 C0, another piece (remember B) Write FF FF FF FF, and B is a very clean empty block that has been erased. The remaining possible values ​​of A are 00 00 00 80, and the remaining possible values ​​of B are 00 00 00 F0 and 00 0000 E0, which is basically the same as the usage in FMM. When A is full, it needs to be sorted, it will run a finishing process, and these values ​​will be used. Each offset entry consists of a low 28 b offset value and a high 4 b flag bit. When the flag bit is normal, 0xC0 means valid, 0x8 means deleted; the remaining possible values ​​are 0xF means idle or Write, 0xE means just modified. These values ​​are used for the addition, modification, and deletion of the registry. Recording the control word's FLAG Each record control word consists of a low 28 b SIZE and a high 4 b FLAG. The value of FLAG is described above. In normal cases, 0xE indicates that the key value is DW0RD, 0xC indicates that the key value is Binary, and 0x8 indicates that the key value is String. Other values ​​indicate that the control field is suddenly powered off. SIZE is unreliable and the entire block of data should discard these 4 bytes. The value of the next offset table entry should only exceed these 4 bytes. This FLAG is used for operations such as adding, modifying, and deleting the registry. It is used together with the flag bits of the offset table entry to jointly perform power-down protection for these types of operations.
1.3 Part of the API function example The registry system provides 4 API interfaces to the application. There is also an initialization and a block erase process, namely RegCreateKey(), RegDeleteKey() delete, RegQueryValueEx() query, RegSetValue. () setting; Reg_Initialize() initialization; Reg_EraseChip() erasing.

2 Development Environment This software module is developed on a PC. After the compiled tool Embedded Visual C++, it runs under the hardware platform of the ARM920T.
Programming language: C language Operating system: Nucleus
Nucleus kernel version: 2.4.20
Cross Compilation Tools: VC++&ADS
Compilation environment: Visual C++
Hardware platform: SC32442X or ARM920T

3 Conclusion Because the use of Smartphone has become more and more extensive, it proposes a more efficient and efficient mobile phone registry implementation for Smartphone. This has established a good development foundation for the application development of subsequent mobile phone software, with superior performance and easy portability. It has been successfully applied to embedded operating systems such as Linux and Windows CE. At present, the program has been used in many wireless mobile multimedia terminal projects, and the effect is satisfactory.

This article refers to the address: http://

Classroom Management Software Smart Media PRO

Smart Media Pro,Software Video Platform,Video Resource Management Platform,Video Resource Management Platforms

SZ REACH TECH,.CO LTD , https://www.szreachtech.com