Книга: Microsoft Windows Embedded CE 6.0 Exam Preparation Kit

? Add a Stream Interface Driver to a Run-Time Image

? Add a Stream Interface Driver to a Run-Time Image

1. Clone the Device Emulator BSP and create an OS design based on this BSP as outlined in Lab 2, "Building and Deploying a Run-Time Image."

2. Copy the string driver source code that you can find on the companion CD in the LabsStringDriverString folder into your BSP folder in the path %_WINCEROOT%Platform<BSPName>SrcDrivers. This should result in a folder named String in your platform in the Drivers folder, and immediately inside this folder you should have the files from the driver on the companion CD, such as sources, string.c, string.def. It's possible to write a driver from scratch, but starting from a working example such as this is much quicker.

3. Add an entry to the Dirs file in the Drivers folder above your new String folder to include the string driver into the build process.

CAUTION

Include In Build option

Do not use the Include In Build option in Solution Explorer to include the string driver into the build process. Solution Explorer removes important CESYSGEN directives from the Dirs file.

4. Add an entry to Platform.bib to add the built string driver, contained in $(_FLATRELEASEDIR), to the run-time image. Mark the driver module as a hidden system file.

5. Add the following line to Platform.reg to include the string driver's .reg file into the run-time image's registry:

#include "$(_TARGETPLATROOT)SRCDRIVERSStringstring.reg"

6. Build the string driver by right clicking it in Solution Explorer and selecting Build.

7. Make a new run-time image in Debug mode.

NOTE

Building the run-time image in Release mode

If you want to work with the Release version of the run-time image, you must change the DEBUGMSG statements in the driver code to RETAILMSG statements to output the driver messages.

8. Open the generated Nk.bin in the flat release directory to verify that it contains String.dll and registry entries in the HKEY_LOCAL_MACHINEDriversBuiltInString subkey to load the driver at startup.

9. Load the generated image on the Device Emulator.

10. Open the Modules window after the image starts by pressing CTRL+ALT+U, or open the Debug menu in Visual Studio, point to Windows, and then select Modules. Verify that the system has loaded string.dll, as illustrated in Figure 6-11.


Figure 6-11 Modules window with loaded string driver

Оглавление книги


Генерация: 2.442. Запросов К БД/Cache: 3 / 1
поделиться
Вверх Вниз