KERNEL AND USER DRIVER MODES

The kernel implements the core functions of the operating system. System reliability requires that user application drivers cannot halt the OS by corrupting, blocking, or overloading the kernel. To implement that requirement, Compact 7 like a lot of operating systems has two modes under which processes and threads can operate. The kernel runs in kernel mode, which is a protected mode. User applications run in user mode, which prohibits direct access to the kernel and its resources. Drivers can be loaded in kernel and user modes. Kernel mode drivers get full protection from both user applications and user mode drivers. A crashed user mode driver can’t bring the system down and can typically be restarted.

As shown in Figure 30-8, every driver that runs in a Windows Embedded Compact system runs in either kernel mode or user mode. Applications whether they are native or managed run in user mode. Services, such as http, ftp, and so on run in user mode. Drivers are configured to run in user mode or kernel mode (or both) via the Registry.

Kernel mode drivers have full access to the system operating system and hardware. A driver that needs to hook into the OS interrupts needs to run in kernel mode. If it needs to manipulate hardware registers directly, it needs to run in kernel mode. A virtual driver would be configured in user mode because it ...

Get Professional Windows® Embedded Compact 7 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.