Memory Architecture

The Windows CE kernel supports a single, flat, or unsegmented, virtual address space that all processes share. Instead of assigning each process a different address space, Windows CE protects process memory by altering page protections. Because it maps virtual addresses onto physical memory using the kernel, you do not need to be concerned with the physical layout of the target system's memory.

Approximately 1 GB of virtual memory is available to processes. It is divided into 33 slots, each 32 MB in size. The kernel protects each process by assigning it to a unique slot with one slot reserved for the currently running process. Thus, the number of processes is limited to 32, but there is no limit, aside from physical memory, on the total number of threads.

The kernel prevents an application from accessing memory outside of its allocated slot by generating an exception. Applications can check for, and handle, such exceptions by using the try-except statement.

Windows CE allows memory mapping, which permits multiple processes to share the same physical memory. Memory mapping results in very fast data transfer between cooperating processes, or between a driver and an application. Approximately 1 GB of virtual address space, distinct from that used for the slots, is allocated for memory mapping.

Windows CE always allocates memory to applications one page at a time. The system designer specifies page size when the operating system is built for the target hardware platform. On a Handheld PC (H/PC), for example, the page size is typically either 1 KB or 4 KB.