Nk.exe Boot Process
2014-05-05 15:45
337 查看
During the kernel boot process, the following calls are made in the order shown:
StartUp()
KernelStart() / KernelInitialize()
<Main kernel initialization function>
OEMInitDebugSerial()
OEMInit()
KernelInit()
HeapInit()
InitMemoryPool()
ProcInit()
SchedInit()
FirstSchedule()
SystemStartupFunc()
IOCTL_HAL_POSTINIT
For more information about kernel initialization and specific kernel initialization considerations, see
Kernel Initialization.
The StartUp function performs the following tasks:
Performs minimal processor and hardware initialization
Disables interrupts, caches, and the memory management unit (MMU)
Once the StartUp function has initialized the CPU, it calls the
KernelStart or KernelInitialize function.
The StartUp function, found under %_WINCEROOT%\Platform\<Hardware Platform Name>\Src\Kernel\OAL\Startup.s, is usually written in assembly language and is shared with the boot loader.
KernelInitialize, for x86-based hardware platforms, or KernelStart, for all other hardware platforms. At this point, the MMU and caches should not be enabled.
The KernelStart or KernelInitialize function performs the following tasks:
Initializes the first-level page table based on the contents of
OEMAddressTable
Enables the MMU and caches
Until the MMU is enabled, the kernel symbolic addresses are invalid and must be translated through the
OEMAddressTable to obtain the correct physical addresses.
Initializes the stacks for each mode of operation
The implementation of the KernelStart and KernelInitialize function is under the private directory.
Once KernelStart or KernelInitialize has performed all its tasks, it calls the main initialization function for the kernel that you are using.
Initializes the debug serial port through a call to
OEMInitDebugSerial
Displays the Windows CE sign-on message through the debug port
Initializes the hardware platform through a call to
OEMInit
If you have an ARM kernel for example, KernelStart calls
ARMInit as the main kernel initialization function.
The debug functions typically communicate with a serial device. Because the boot loader implements the same code, a single implementation can be shared between the OAL and the boot loader.
These are serial debug functions that OEMs need to implement:
OEMDebugInit
OEMWriteDebugString
OEMWriteDebugByte
OEMReadDebugByte
The NK banner is displayed after the OEMInitDebugSerial function completes.
At this point in the kernel boot process, interrupts are disabled and the kernel is unable to handle exceptions. The only kernel service available to
OEMInit is
HookInterrupt. OEMInit can register interrupt service routines (ISRs) by calling
HookInterrupt.
At this point in the boot process, the following hardware initialization is usually required:
Interrupts
System timer
KITL interface
Depending on the hardware, optional initialization would include:
Bus interfaces
Sample implementations of the OEMInit function can be found in %_WINCEROOT%\Platform\<Hardware Platform Name>\Src\Kernel\OAL\Init.c.
Heap
Memory pool
Kernel process
Scheduler
Upon exiting this function, the system is ready to schedule the first thread through
SystemStartupFunc.
The implementation of the KernelInit function is under the private directory.
The implementation of the HeapInit function is under the private directory.
The implementation of the InitMemoryPool function is under the private directory.
The implementation of the ProcInit function is under the private directory.
The implementation of the SchedInit function is under the private directory.
The implementation of the FirstSchedule function is under the private directory.
IOCTL_HAL_POSTINIT. Implementation of this function can be handled by OEM code to complete the kernel initialization process.
The implementation of the SystemStartupFunc function is under the private directory.
StartUp()
KernelStart() / KernelInitialize()
<Main kernel initialization function>
OEMInitDebugSerial()
OEMInit()
KernelInit()
HeapInit()
InitMemoryPool()
ProcInit()
SchedInit()
FirstSchedule()
SystemStartupFunc()
IOCTL_HAL_POSTINIT
For more information about kernel initialization and specific kernel initialization considerations, see
Kernel Initialization.
StartUp()
StartUp is the first function called during kernel startup and it is responsible for initializing the CPU to a known state.The StartUp function performs the following tasks:
Performs minimal processor and hardware initialization
Disables interrupts, caches, and the memory management unit (MMU)
Once the StartUp function has initialized the CPU, it calls the
KernelStart or KernelInitialize function.
The StartUp function, found under %_WINCEROOT%\Platform\<Hardware Platform Name>\Src\Kernel\OAL\Startup.s, is usually written in assembly language and is shared with the boot loader.
KernelStart() / KernelInitialize()
The OEM adaptation layer (OAL) sets up any platform or CPU-specific settings that is required for the kernel to access ROM and RAM. To start the system, it then jumps toKernelInitialize, for x86-based hardware platforms, or KernelStart, for all other hardware platforms. At this point, the MMU and caches should not be enabled.
The KernelStart or KernelInitialize function performs the following tasks:
Initializes the first-level page table based on the contents of
OEMAddressTable
Enables the MMU and caches
Until the MMU is enabled, the kernel symbolic addresses are invalid and must be translated through the
OEMAddressTable to obtain the correct physical addresses.
Initializes the stacks for each mode of operation
The implementation of the KernelStart and KernelInitialize function is under the private directory.
Once KernelStart or KernelInitialize has performed all its tasks, it calls the main initialization function for the kernel that you are using.
Main kernel initialization function
The main kernel initialization function is responsible for calling the OEM supplied initialization functions. It also performs the following tasks:Initializes the debug serial port through a call to
OEMInitDebugSerial
Displays the Windows CE sign-on message through the debug port
Initializes the hardware platform through a call to
OEMInit
If you have an ARM kernel for example, KernelStart calls
ARMInit as the main kernel initialization function.
OEMInitDebugSerial()
OEMInitDebugSerial initializes the debug serial port on the target device.The debug functions typically communicate with a serial device. Because the boot loader implements the same code, a single implementation can be shared between the OAL and the boot loader.
These are serial debug functions that OEMs need to implement:
OEMDebugInit
OEMWriteDebugString
OEMWriteDebugByte
OEMReadDebugByte
The NK banner is displayed after the OEMInitDebugSerial function completes.
OEMInit()
OEMInit is implemented by OEMs to initialize all hardware interfaces for the target device.At this point in the kernel boot process, interrupts are disabled and the kernel is unable to handle exceptions. The only kernel service available to
OEMInit is
HookInterrupt. OEMInit can register interrupt service routines (ISRs) by calling
HookInterrupt.
At this point in the boot process, the following hardware initialization is usually required:
Interrupts
System timer
KITL interface
Depending on the hardware, optional initialization would include:
Bus interfaces
Sample implementations of the OEMInit function can be found in %_WINCEROOT%\Platform\<Hardware Platform Name>\Src\Kernel\OAL\Init.c.
KernelInit()
The KernelInit function encapsulates the initialization of the kernel. It initializes the following parts of the kernel through calls to different initialization functions:Heap
Memory pool
Kernel process
Scheduler
Upon exiting this function, the system is ready to schedule the first thread through
SystemStartupFunc.
The implementation of the KernelInit function is under the private directory.
HeapInit()
HeapInit initializes the kernel heap.The implementation of the HeapInit function is under the private directory.
InitMemoryPool()
InitMemoryPool initializes the kernel memory pool.The implementation of the InitMemoryPool function is under the private directory.
ProcInit()
ProcInit initializes the Windows CE kernel process.The implementation of the ProcInit function is under the private directory.
SchedInit()
SchedInit initializes the scheduler and creates the SystemStartupFunc thread.The implementation of the SchedInit function is under the private directory.
FirstSchedule()
FirstSchedule starts the scheduler.The implementation of the FirstSchedule function is under the private directory.
SystemStartupFunc()
SystemStartupFunc executesIOCTL_HAL_POSTINIT. Implementation of this function can be handled by OEM code to complete the kernel initialization process.
The implementation of the SystemStartupFunc function is under the private directory.
相关文章推荐
- Nk.exe Boot Process (Windows CE 5.0) 英文
- Nk.exe Boot Process
- Nk.exe Boot Process
- Filesys.exe Boot Process (Windows CE 5.0) 英文
- Filesys.exe Boot Process (Windows CE 5.0) 中文
- Boot process(启动过程)
- 【Qt学习笔记】在Qt编译好之后运行程序时提示:程序异常结束。The process was ended forcefully. ....exe crashed.
- Inside the Linux boot process
- vshost.exe调试宿主(VS Debug Host Process)进程详解
- ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_79\bin\java.exe'' finished with non-
- 问题描述:ADB not responding. You can wait more,or kill“abd.exe” process manually and click 'Restart'
- android boot process from power on
- cygwin在Win10下的问题 perl.exe: *** fatal error in forked process - fork: can't reserve memory for parent
- openwrt----The Boot Process
- The process "E:\Qt\4.8.5\bin\qmake.exe" exited with code 2.
- 用bootrec.exe工具修复vista的启动问题
- The Kernel Boot Process
- Android 编译生产adb.exe,fastboot.exe的方法
- Process 'command 'Java\jdk\bin\java.exe'' finished with non-zero exit value
- 【转】The Android boot process from power on