Kernel Migration (Windows CE 5.0)
The Windows CE kernel provides core operating system (OS) functionality for any Windows CE–based device. This functionality includes process, thread, and memory management. For more information, see Kernel Overview.
This topic provides information about the changes that have been made to the Windows CE kernel. The changes are grouped by the Windows CE version in which they were made.
Windows CE 5.0
For Windows CE 5.0, the following changes were made to the Windows CE kernel:
As part of the production-quality OAL model, the kernel directories, Kern, Kernkitl, and Kernkitlprof, are no longer under the %_WINCEROOT%\Platform\<Hardware Platform Name>\Kernel\Buildexe\Dirs directory.
Instead, these directories are now under the %_WINCEROOT%\Platform\<Hardware Platform Name>\Src\Kernel directory. For more information about the new directory structure, see BSP and CSP Directory Layout.
The ARMV4 kernel has been merged into the ARMV4I kernel.
The SH3 kernel is no longer supported.
Windows CE .NET 4.2
For Windows CE .NET 4.2, the following changes were made to the Windows CE kernel:
Page size has increased for SH4 kernels from 1 KB to 4 KB.
Once the page size has been increased, you must rebuild any application or device driver binary builds with a 1-KB page size. When you rebuild the binary builds, you increase the builds to a 4-KB page size. By doing this, you ensure that the kernel loads and runs correctly on Windows CE .NET 4.2 and later.
Note Prior to Windows CE .NET 4.2, the default page size for SHx kernels was 1 KB. If you do not enlarge the page size, any binary builds with a 1-KB page size will not run on more recent versions of Windows CE.
The ARMV4T (Thumb) kernel has been merged into the ARMV4I kernel.
With the ARMV4I kernel, 16-bit Thumb applications are still supported.
The MIPSIIB and MIPS16 kernels and OS builds have been merged into the MIPS II kernel and OS build.
With the merged MIPS II kernel, the NEC Vr41XXX CPUs and 16-bit applications are still supported.
The algorithm to correct priority inversion with priority inheritance has been simplified. As a result, in some cases, only one level of inheritance occurs.
The default thread quantum for the OS is 100 milliseconds, but you can change it.
Nested interrupts can now be used by microprocessors and hardware that support them.
Before calling the WaitForSingleObject function, you call the InterruptInitialize function with a valid interrupt service routine (ISR) for the hEvent parameter. If you use this hEvent parameter in WaitForSingleObject before calling InterruptInitialize with a valid ISR, InterruptInitialize fails.
In Windows CE .NET 4.2, the GetThreadPriority or CeGetThreadPriority functions return the thread's base priority, which might differ from the Windows CE 3.0 priority if the thread is boosted to overcome priority inversion.
In Windows CE 3.0 and earlier, a call to these functions returns the current priority.
In Windows CE .NET 4.2, a handle to an ISR can only be used in a call for WaitForSingleObject. This enables the kernel to optimize the setting of the ISR event that starts the waiting IST.
In Windows CE 3.0 and earlier, the handle of the event linked to an ISR can be used in a call to WaitForMultipleObjects. However, in doing this you can lose interrupts.
In Windows CE .NET 4.2 and later, the timer tick is a constant 1 millisecond when not in idle. When entering idle mode by calling OEMIdle, you are given information on how to reset the timer tick to an extended period.
In Windows CE 3.0 and earlier, you cannot redefine the timer tick.
Windows CE .NET 4.0
For Windows CE .NET 4.0, the following changes were made to the Windows CE kernel:
The dwMaximumSize parameter of HeapCreate is honored and allocates only as much memory as requested.
If you had previously passed in 0, you still get an unlimited heap as specified by Microsoft Win32®.
When there is an unrecoverable error, the system calls the kernel function lpNKHaltSystem.
You can use OEMInit to redirect the function pointer to your own system shutdown or reset function in the OAL. For more information, see System Halt.
The kernel libraries and their associated directories are different.
The debugger no longer statically links into the kernel. Instead, debugging takes place over the Kernel Independent Transport Layer (KITL). Also, the kernel's Withkd.exe and Profkd.exe files are obsolete and can be deleted.
The following list shows the new kernels for Windows CE 4.0:
- Kitlnokd.exe is now Kernkitl.exe.
- Nkprof.exe is now Kernkitlprof.exe.
- Kern.exe is built without support for the Kernel Independent Transport Layer (KITL).
The following changes are required in your BSP to account for the new kernels:
- Rename the old directories Nokd and profiler to Kernkitl and Kernkitlprof, respectively. Modify the sources files in each of these directories to have
TARGETNAME = kernkitl
andTARGETNAME = kernkitlprof
, respectively. - Add a new Kern directory to build a kernel without KITL support.
Windows CE 4.0 supports the following techniques to measure OS performance on a target device:
- Instrumented kernel profiling
- Hardware-assisted profiling
- Monte Carlo profiling, which uses frequent sampling to determine which routines are using the most CPU cycles
For information about how to implement these profiling techniques, see Platform Profiling.
Windows CE 3.0
For Windows CE 3.0, the following changes were made to the Windows CE kernel:
The priority system has 256 priority levels numbered 0 (zero) through 255, with priority level 0 being the highest priority level. The original 8 priority levels for Windows CE 2.12 and earlier versions are mapped to levels 248 through 255.
For more information, see Real-Time Priority System Levels.
Windows CE 2.12
For Windows CE 2.12, the following changes were made to the Windows CE kernel:
By default, the OS runs every thread in kernel mode to reduce overhead and increase performance of many functions. This enables all threads to access physical memory.
Before building your run-time image, you can set the default mode to user mode.
Complete implementation of the GetThreadTimes function is supported.
See Also
OAL Migration | Migrating a Board Support Package | Debugging and Testing
Send Feedback on this topic to the authors