Configure the Windows CE operating system (Reposted 21IC) using Platform Builder

xiaoxiao2021-03-06  167

Configure Windows CE operating systems using Platform Builder

HTTP: //www.21ic.com/info/images/dpj/200210/2.htm ?? Introduction Embedded system refers to the operating system and function software integrated into the computer hardware system, simply the system Application software and system hardware integration, similar to BIOS work. It has the characteristics of small software code, high automation, and fast response speed. Windows CE is a powerful open 32-bit real-time embedded operating system, which is suitable for quick build a new generation of smart devices, such as industrial controllers, handheld devices, smart phones, set-top boxes and retail point equipment, etc. . Not only that, Windows CE also provides a new generation of tailored embedded system platform for developing smart mobile devices. Windows CE supports a variety of processor product families, including X86, XScale, ARM, MIPS, and SH, so it allows developers to choose the most ideal hardware. Microsoft Windows CE Platform Builder 3.0 is used to create, cut, and customize Windows CE operating systems. Platform Builder provides many profiles and development commissioning tools for creating Windows CEs. Since Windows CE is suitable for real-time and multi-tasking systems with specific purposes, the device driver of dedicated hardware devices is often developed for the target platform. The peripherals can work properly after adding the appropriate device driver to WinodWs CE. Take the RTL8139 network card driver as an example to explain how to add a Windows CE device driver by modifying the configuration file. 1 Establish a hardware and software environment configuration and debugging Windows CE requires 1 high-performance development workstation and 1 target debugging device in WINDOWS. Platform Builder 3.0 runs on a high-performance development workstation in Windows 2000 or above. Platform Builder provides an integrated development environment created and debugging Windows CE mapping nk.bin, such as a wizard and toolbar, supporting an Activity Template Library (ATL), Microsoft Basic Library (MFC), and Visual Basic, providing supported processor families Compiler, kernel debugger, and a variety of remote debugging tools. The target debug platform may be a normal PC after proper configuration, or an embedded microprocessor module. The development workstation is connected to the target platform through Ethernet or string, parallel ports, and downloads the Windows CE operating system image file nk.bin to the target platform. After the download is complete, Windows CE is started at the target platform. On the development workstation, you can use the debugging tools provided by Platform Builder to view the operation of Windows CE. Ethernet and strings, the difference between the two connection types of parallel ports is listed in Table 1. Table 1 Difference between Ethernet and string, parallel port connection

Ethernet connection string, the parallel port connection download speed is fast download speed slowly download speed? Development workstation requires Ethernet network card, the target platform requires the NE2000 compatible debugging Ethernet network card serial port, parallel port image files and debugging tools use Ethernet images Document Using Parallel Download, Target Platform debugging information Use Serial port Transfer 2 Platform Builder 3.0 provides 4 file profiles: binary image generation file .bib, registry file .reg, directory, and file allocation table File .dat, database file .db. Crop You can cut the Windows CE by modifying these profiles. The user can create its own profile as needed, and the primary configuration file provided by PB is listed in Table 2. Table 2 Profile list

.BIB file .REG file .DAT files .DB file Common.bibCommon.regCommon.datCommon.dbDcom.bibDcom.regServers.dat Msmq.bibMsmq.reg Platform.bibPlatform.regPlatform.datPlatform.dbProject.bibProject.regProject.dat Wceshellfe.bibWceshellfe .regwceshellfe.datwceshellfe.dbwceappsfe.bibwceappsfe.regwceappsfe.datwceappsfe.dbconfig.bibscript reg 2.2 binary image generation file .bib .bib file is a text file, identifying the target modules, components, and files included in the Windows CE image. One .bib file contains 4 parts: Files, Modules, Memory, and Config. (1) Files section FILES assigns part of memory space to static data files. This part mainly includes a font file (.ttf), text file (.txt), bitmap file (.bmp), and sound file (.wav), etc. For example:; name path memory type; ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --- ----------- ----- Tahoma.ttf $ (_ flatreleaseDir) .ttf NK SHU Name: The file name in the Windows CE system. PATH: The location of the file in the development workstation. Memory: The memory area to which the file belongs. TYPE: Defines the file properties. The files in the Windows CE have the following file properties: S is the system file, H is an implied file, U is a non-compressed file, and R is a compressed resource file, c is a compressed file. One file can have several properties at the same time. The above example indicates that the NK memory area contains $ (_ flatreleaseDir) .ttf files for the workstation. In the Windows CE system, the file attribute of Tahoma.ttf is the system implied non-compressed file. (2) The modules section lists the target modules and components loaded in memory, including all executables .exe and dynamic link library.dll. For example:; name path memory type; ----------------------------------------- ---- -------------- Device.exe $ (_ flatreleaseDir) .exe NK SH Device module is loaded into the memory area. Device.exe in the Windows CE system has system and implied properties. (3) The MeMeory section divides the physical memory into two parts: data storage area and program storage area. For example, Name Start Address Size; ------------------------------------ -------- NK 80200000 00600000 Ramimage Ram 80800000 00800000 RAM In the Windows CE system, memory is divided into three types: RAM, RAMIMG, and RESERVED. RAM specifies the memory size; RamIMG specifies the ROM space; reserved is the memory space, the kernel cannot use this part of the memory, but the application can access. The above example indicates that the starting address of NK is 80200000, which occupies 6MB memory space as a ROM for the data store.

RAM starts at 80800000, occupying 8MB of memory space for program storage. (4) Part of the Config section is not necessary. Some attribute settings are performed in this part, such as whether compression and ROM size, and the like. 2.2 Registry file .regs Registry file establishes the registry entry for the operating system image. The registry is a data that stores a lot of configuration information, including application information, configuration information, user parameters, and other related data. When the target platform is cold start, makeimg.exe uses the .reg file to create a default registry. Platform.REG Configure registry information related to the platform, such as the device driver entry. Project.REG Sets the registry related to the project. Registry file format: [HKEY_LOCAL_MACHINE] "launch10" = "shell.exe" "launch20" = "device.exe" "launch30" = "gwes.exe" "depend 30" = "HEX: 14, 00" The above registry The entry setting specifies that the kernel must automatically run the shell.exe and Device.exe modules when starting, and the Gwes.exe module must run in DEVICE.EXE. 2.3 Database file. DB Windows CE provides a built-in lightweight database management system. The attribute database of Windows CE consists of 1 table containing records, each record contains many different properties, each attribute has 3 information: the ID number, type, and value of the flag attribute. For example: .record: Field: 402001F: "{000214A0-0000-0000-C000-000000000046}" Field: 42020003: 15 Field: 42030003: 2 END Attribute Database is a flat structure and cannot define relationships between attribute databases. Using Microsoft ActiveX Data Object for Windows CE (AdoCE) technology can access the property database, even you can use the SQL statement query information. 2.4 Directory Distribution Table File.dat .dat file Defines the Windows CE image NK.NIB Black-recognized directory and file structure. Note that WinodWS CE does not support the same drive drive like Windows 9x / 2000, and there is no concept of current directory. For example: root: -directory ("Program Files"): Directory ("My Work") root: -directory ("My Documents") Directory ("My Documents": - File ("MyFile .doc ") Generates 2 roots: Program Files and MyDocuments. Program Files has 1 subdirectory: My Work. The file Myfile.doc is located in the My Document directory. Note MyFile.doc must appear in a .bib file, so that there will be myfile.doc in the image file. 3 Set an environment variable to generate an image file nk.bin 3.1 Setting the environment variables in all configuration files, there is a conditional statement if Enviroment Value ... Endiff. When the condition is founded, the information between the IF and End IF is included in the image file nk.bin; the condition is not true when the condition is not established, and the related modules and files are not included. You can add or delete modules and components in nk.bin by setting up environment variables.

Take the .bib file as an example:; Name path memory type; ----------------------------------- ---------------- ------ IFIMGUSB IF CEPC_UHCI UHCI.DLL $ (_ FlatreleaseDir) .dll NK Sh Endif if Cepc_ohci ohci.dll $ (_ FlatReleaseDir) .dll NK Shidif USBD.DLL $ (_ flatreleaseDir) .dll NK Sh Usbhid.dll $ (_ flatreleaseDir) .dll NK Shidif here IMGUSB, Cepc_UHCI, CEPC_OHCI is a logical environment variable. In PB, you can use two methods to set environment variables. Method 1: Click on the Setting ..., open the platform settings dialog, and enter Variable and Value to set the environment variables separately. Method 2: Click on the Open Build Release Directory of the Build menu, open the Command Tips window, set the environment variable in the command prompt window. Enter setImgusb = 1 in the command line, dynamic link library USBD.DLL and USBHID.DLL are included to image file nk.bin. UHCI.DLL and OHCI.DLL are included in nk.bin, depending on the settings of the environment variable CEPC_UHCI and CEPC_OHCI. If set imgusb = 0, the above four dynamic link libraries are not included in Kn.bin. 3.2 MakeImg.exe Tool Generate Image File NK.bin is the last step of the platform creation process and is also the ultimate goal of configuring Windows CE. Makeimg.exe uses all profiles to combine target modules and files into a unique Windows CE image file nk.bin. Figure 1 shows the generation process of nk.bin. MakeImg Generates the specific steps of nk.bin: 1 full composite profile: All .bib files are merged into CE.bib. CE.BIB contains all files in Nk.bin; all .reg files are merged into reginit.int; all .dat files are megadownloadwandset when modifying the configuration file, be sure to pay attention to CE.bib, reginit.ini, initobj.dat, initdb .Ini is a file, modifying these files cannot be configured with Windows CE. 2 Compress the reginit.ini file into a binary default.fdf. 3 According to the setting of the environment variable country, replace the resources in the module so that the Windows CE image meets the needs of a particular language, and finally generates binary image file nk.bin. 4 Modify the configuration file Add RTL8139 NIC drive Since Windows CE has a core that is completely different from other Windows operating systems, the device driver running on other operating systems cannot be run directly on Windows CE. The original device driver code must be run after appropriate modification or all overwritten to run on the Windows CE system. Windows CE supports two types of device drivers; local device drivers and stream interface device drivers. The unit device driver is typically connected to Windows CE-based target platforms, and each native device driver has an accurate and special objective, this part of the driver is generally provided by the Original Equipment Manufacturer (OEM). The flow interface device driver is a dynamic link library (DLL) at the user level for driving the installed peripheral mayor. The RTL8139 network card driver is a flow interface device driver.

RTL8139 NIC driver RTL8139.DLL is generated using Platform Builder or Embedded Visual C 3.0. In _FlatReleaseDir, Platform.BIB and Platform.reg are modified separately. ① Add the following statement to Platform.BIB file: MEMORY RTL8139 8090000 00010000 RESERVED MODULES Rtl8139.dll $ (_ FLARTELEASEDIR) .dll NK SH ② add the following statement to Platform.REG in: [HKEY_LOCAL_MACHINE] "DisplayName" = "Realtek RTL8139 based Fast Ethernet Driver "" Group "=" NDIS "" ImagePath "=" rtl8139.dll "[HKEY_LOCAL_MACHINE]" Route "=" Rmulti_sz: TL81391 "[HKEY_LOCAL_MACHINE]" DisplayName "=" Realtek RTL8139 based Fast Ethernet Driver "" Group "= "NDIS" "ImagePath" = "rtl8139.dll" [HKEY_LOCAL_MACHINE] "BusNumber" = dword: 0 "BusType" = dword: 5 "ScanMethod" = dword: 0 "SharedInterrupt" = dword: 1 "PhysicalAddressBase" = dword: 001a0000 [HKEY_LOCAL_MACHINE] "enabledHCP" = DWORD: 0; MULTI_SZ type "defaultgateway" = ""; 0 represents broadcast addresses (or 255.255.255.255) "usezerbroadcast" = dword: 0; Nulti_SZ type, IP address "ipaddress" = "202.2. 4.77.16 "; MULTI_SZ type, subnet mask" SubnetMask "=" 255.255255.0 "[hkey_local_machine]" bind "= MULTI_SZ:" RTL81391 "3makeImg generate nk.bin Enter the MakeImg command in the command prompt window, Generate a new Windows CE image nk.bin. Download nk.bin to the target platform, directly connect the development workstation network card and the target platform RTL8139 network card through the Ethernet cable. The IP address of the FRTL8139 network card must be in the same subnet in the IP address of the development workstation, so that there will be a response when starting a workstock running the PING. 5 Summary Microsoft Windows CE Platform Builder 3.0 Integrated Development Environment Contains a series of development tools, context-related menus, toolbars, and shortcuts. Platform Builder creates, tested, cropping the platforms and components of Windows CE. Proficiency in the Profile and Development Debug tools that use Platform Builder can quickly customize Windows CE operating systems for the target platform, shorten the platform development cycle. Suitably, modify and set Profiles for Platform Builder .bib, .reg, .dat ,.db can crop and add related components to properly configure various device drivers. Windows CE is typically applied to a specific embedded system, in many cases, need to add external devices and device drivers to the target platform. This article adds the RTL8139 network card driver in Windows CE by modifying Platform.bib and Platform.REG profile.

转载请注明原文地址:https://www.9cbs.com/read-128473.html

New Post(0)