none
WinCE 6.0 Kernel space and User space memory...some questions RRS feed

  • Question

  • Hello,

    reading Windows Embedded CE 6.0 Foundamentals book, I have found the virtual memory space mapping. In upper 2 GB (Kernel Space) there is the area from 0xF0000000 to 0xFFFFFFFF (256 MB) that is named "CPU Virtual Memory" and is described as "Captures system calls and includes kernel data pages". What does it mean ?

    In lower 2 GB (User Space) there are 64 KB at bottom with user kernel data...what does it mean ?

    Thanks, Paolo.

    Friday, October 29, 2010 7:31 AM

All replies

  • Paolo,

    The utilization of both VM areas you are asking about are CPU-dependent, meaning that how they are used depends on which CPU family the CE 6.0 kernel is running on.

    First, there is the area at 0xF0000000 and up.  The memory map shows this as CPU-dependent, system trap and kernel data page.  Again, "CPU-dependent" means that actual utilization depends on the processor family, but there are some commonalities across processor families.  The area is used in part by the kernel for access and execution trapping.  This is where the CE kernel needs to intercept a function call or a memory access.  The kernel can use an address in this region that is protected (via the page table descriptors) from access or execution, and if a user mode process attempts to access an address or execute code in this area, an exception occurs which is trapped inside the kernel, and the kernel can then take whatever steps are needed to process the attempted access.  One way this VM region is used by the kernel is to implement Protected Server Libraries (PSL), the most well-known of which is the Win32 API.  When an application calls an API in a PSL, that call is eventually routed to an address in the protected VM area above 0xF0000000 where it it trapped by the kernel and routed to the appropriate process.

    Also within this region is a CPU-dependent data structure known as kernel data, or KData.  This is data used internally by the kernel, and the fields of this structure depend on which CPU-family the kernel is running on.

    Also contained in the region at and above 0xF0000000, depending on CPU family, are the kernel's first level page table, exception vectors and the vector jump table, interrupt and FIQ (ARM) stacks, the abort stack , the kernel stack.

    The second area you asked about was the bottom 64K bytes, labeled user kernel data.  This is another CPU-dependent region.  it is reserved in all cases, in-part to allow the OS to detect and trap attempts to dereference null pointers.  In addition, for all non-ARM CPU families, this area contains a user-mode accessible mapping of the KData structure which is located at a fixed address of 0x00005800.  In the ARM processor family, this address, known as PUserKData, is located at 0xFFFFC800 and is equivalent to the KData pointer I mentioned above. 

    Since you are asking this level of questions, I encourage you, if you haven't already, to install the CE Shared Source that comes with Platform Builder, and study the code therein.  There is a great deal of knowledge that can be gained by doing so, including the answers to these questions.  But, be aware that there are specific licensing terms that come with the installation and use of the Shared Source code that can be read in the CE 6.0 installer if you haven't done so already.


    Tom Gensel PTG Systems, LLC
    http://www.ptgsystems.com
    Saturday, October 30, 2010 12:42 AM
  • Can you give me some directory path under WINCEROOT where I can found these information ?

    Thank you very much.

    Saturday, October 30, 2010 6:43 AM
  • If you have installed the Shared Source, it will be in \WINCE600\PRIVATE.  For information about the VM map, look at the kernel source under WINCE600\PRIVATE\WINCEOS\COREOS\NK\KERNEL.  The various subfolders (ARM, MIPS, SH, X86) therein contain the CPU-dependent portions.  As needed, you may need to search about in both the PRIVATE and PUBLIC trees for header files.
    Tom Gensel PTG Systems, LLC
    http://www.ptgsystems.com
    Saturday, October 30, 2010 4:01 PM
  • In addiot to the path Tom indicated, many of the kernel mode address setup is initialized in PRIVATE\WINCEOS\COREOS\NK\LDR. And most of the header files used by kernel are in PUBLIC\COMMON\OAK\INC, PUBLIC\COMMON\SDK\INC and PRIVATE\WINCEOS\COREOS\NK\INC
    Saturday, October 30, 2010 7:36 PM