Nicolas Besson - Microsoft Windows Embedded CE 6.0 Exam Preparation Kit

Здесь есть возможность читать онлайн «Nicolas Besson - Microsoft Windows Embedded CE 6.0 Exam Preparation Kit» весь текст электронной книги совершенно бесплатно (целиком полную версию без сокращений). В некоторых случаях можно слушать аудио, скачать через торрент в формате fb2 и присутствует краткое содержание. Город: Redmond, Год выпуска: 2008, Издательство: Microsoft, Жанр: Руководства, ОС и Сети, Программы, на английском языке. Описание произведения, (предисловие) а так же отзывы посетителей доступны на портале библиотеки ЛибКат.

Microsoft Windows Embedded CE 6.0 Exam Preparation Kit: краткое содержание, описание и аннотация

Предлагаем к чтению аннотацию, описание, краткое содержание или предисловие (зависит от того, что написал сам автор книги «Microsoft Windows Embedded CE 6.0 Exam Preparation Kit»). Если вы не нашли необходимую информацию о книге — напишите в комментариях, мы постараемся отыскать её.

Microsoft Windows Embedded CE 6.0 Exam Preparation Kit — читать онлайн бесплатно полную книгу (весь текст) целиком

Ниже представлен текст книги, разбитый по страницам. Система сохранения места последней прочитанной страницы, позволяет с удобством читать онлайн бесплатно книгу «Microsoft Windows Embedded CE 6.0 Exam Preparation Kit», без необходимости каждый раз заново искать на чём Вы остановились. Поставьте закладку, и сможете в любой момент перейти на страницу, на которой закончили чтение.

Тёмная тема
Сбросить

Интервал:

Закладка:

Сделать

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

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

#include "$(_TARGETPLATROOT)\SRC\DRIVERS\String\string.reg"<\/code> <\/p>

6. Build the string driver by right clicking it in Solution Explorer and selecting Build.<\/p>

7. Make a new run-time image in Debug mode.<\/p>

NOTE<\/div>
Building the run-time image in Release mode<\/div>

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.<\/p> <\/cite>

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_MACHINE\Drivers\BuiltIn\String subkey to load the driver at startup.<\/p>

9. Load the generated image on the Device Emulator.<\/p>

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<\/strong>, as illustrated in Figure 6-11.<\/p>

► Access the Driver from an Application<\/p> <\/div>

1. Create a new WCE Console Application subproject as part of your OS design by using the Windows Embedded CE Subproject Wizard. Select WCE Console Application and the template A Simple Windows Embedded CE Console Application.<\/p>

2. Modify the subproject image settings to exclude the subproject from the image by right clicking the OS design name in the solution view and selecting Properties.<\/p>

3. Include and <\/p>

4. Add code to the application to open an instance of the driver by using CreateFile. For the second CreateFile parameter (dwDesiredAccess), pass in GENERIC_READ | GENERIC_WRITE. For the fifth parameter (dwCreationDisposition), pass in OPEN_EXISTING. If you open the driver with the $device naming convention, be sure to escape the slashes and not include the colon at the end of the filename.<\/p>

HANDLE hDrv = CreateFile(L"\\$device\\STR1",<\/code> <\/p>

GENERIC_READ|GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0);<\/code> <\/p>

5. Copy the IOCTL header file (String_ioctl.h) from the string driver folder to the new application's folder and include it in the source code file.<\/p>

6. Declare an instance of a PARMS_STRING structure defined in String_iocontrol.h, included along with the rest of the sample string driver, to enable applications to store a string in the driver using the following code:<\/p>

PARMS_STRING stringToStore;<\/code> <\/p>

wcscpy_s(stringToStore.szString, STR_MAX_STRING_LENGTH,<\/code> <\/p>

L"Hello, driver!");<\/code> <\/p>

7. Use a DeviceIoControl call with an I/O control code of IOCTL_STRING_SET to store this string in the driver.<\/p>

8. Run the application by building it and selecting Run Programs from the Target menu.<\/p>

9. The Debug window should show the message Stored String "Hello, driver!" Successfully<\/strong>when you run the application, as shown in Figure 6-12.<\/p>

► Adding Power Management Support<\/p> <\/div>

1. Turn off and detach from the Device Emulator.<\/p>

2. Add the IClass for generic power management devices with the following line to the string driver's registry key in String.reg:<\/p>

"IClass"=multi_sz:"{A32942B7-920C-486b-B0E6-92A702A99B35}"<\/code> <\/p>

3. Add the power management code that you can find in the StringDriverPowerCode.txt file under \Labs\StringDriver\Power on the companion CD to the string driver's IOControl function to support IOCTL_POWER_GET, IOCTL_POWER_SET, and IOCTL_POWER_CAPABILITIES.<\/p>

4. Add code to the string driver's device context so it stores its current power state:<\/p>

CEDEVICE_POWER_STATE CurrentDx;<\/code> <\/p>

5. Add the header <\/strong>to the application, and add calls to SetDevicePower with the name of the string driver and different power states; for example:<\/p>

SetDevicePower(L"STR1:", POWER_NAME, D2);<\/code> <\/p>

6. Run the application again, and observe the power state-related debug messages when Power Manager changes the string driver's power state, as shown in Figure 6-13.<\/p>

Chapter Review<\/p> <\/div>

Windows Embedded CE 6.0 is extraordinarily modular in its design and supports ARM-, MIPS-, SH4-, and x86-based boards in a multitude of hardware configurations. The CE kernel contains the core OS code and the platform-specific code resides in the OAL and in device drivers. In fact, device drivers are the largest part of the BSP for an OS design. Rather than accessing the hardware directly, the operating system loads the corresponding device drivers, and then uses the functions and I/O services that these drivers provide.<\/p>

Windows Embedded CE device drivers are DLLs that adhere to a well-known API so that the operating system can load them. Native CE drivers interface with GWES while stream drivers interface with Device Manager. Stream drivers implement the stream interface API so that their resources can be exposed as special file system resources. Applications can use the standard file system APIs to interact with these drivers. The stream interface API also includes support for IOCTL handlers, which come in handy if you want to integrate a driver with Power Manager. For example, Power Manager calls XXX_IOControl with an IOControl code of IOCTL_POWER_SET passing in the requested device power state.<\/p>

Native and stream drivers can feature a monolithic or layered design. The layered design splits the device driver logic in an MDD and a PDD part, which helps to increase the reusability of the code. The layered design also facilitates driver updates. Windows Embedded CE also features a flexible interrupt-handling architecture based on ISRs and ISTs. The ISR's main task is to identify the interrupt source and notify the kernel with a SYNTINR value about the IST to run. The IST performs the majority of the processing, such as time-consuming buffer copying processes.<\/p>

In general, you have two options to load a driver under Windows Embedded CE 6.0. You can add the driver's registry settings to the BuiltIn registry key to start the driver automatically during the boot process or you load the driver automatically in a call to ActivateDeviceEx. Depending on the driver's registry entries, you can run a driver in kernel mode or user mode. Windows Embedded CE 6.0 includes a user-mode driver host process and a Reflector service that enables most kernel-mode drivers to run in user mode without code modifications. Because device drivers run in different process spaces than applications on Windows Embedded CE 6.0, you must marshal the data in either a mapping of physical memory sections or copying process to facilitate communication. It is imperative to validate and marshal embedded pointers by calling CeOpenCallerBuffer and CeAllocAsynchronousBuffer and properly handling asynchronous buffer access so that a user application cannot exploit a kernel-mode driver to take over the system.<\/p>

Читать дальше
Тёмная тема
Сбросить

Интервал:

Закладка:

Сделать

Похожие книги на «Microsoft Windows Embedded CE 6.0 Exam Preparation Kit»

Представляем Вашему вниманию похожие книги на «Microsoft Windows Embedded CE 6.0 Exam Preparation Kit» списком для выбора. Мы отобрали схожую по названию и смыслу литературу в надежде предоставить читателям больше вариантов отыскать новые, интересные, ещё непрочитанные произведения.


Отзывы о книге «Microsoft Windows Embedded CE 6.0 Exam Preparation Kit»

Обсуждение, отзывы о книге «Microsoft Windows Embedded CE 6.0 Exam Preparation Kit» и просто собственные мнения читателей. Оставьте ваши комментарии, напишите, что Вы думаете о произведении, его смысле или главных героях. Укажите что конкретно понравилось, а что нет, и почему Вы так считаете.

x