Windows 5.0 kernel Startup Process

Source: Internet
Author: User
Tags windows 5

From: http://blog.csdn.net/ln2002/archive/2007/06/29/1671360.aspx

 

This article briefly describes the Startup Process of the wince5.0 kernel. The MIPs CPU is used as an example. Msdn has an article called Microsoft Windows CE 5.0 board support package, boot loader, and kernel startup sequence.

1. startup. First, the code first executed by the kernel is located in oal, called Startup, Which is customized by Microsoft for developers. Of course, there are ready-made code in each reference BSP, and developers only need to modify it on this basis. At the end of startup (), the kernelstart function is displayed.

2. kernelstart. The assembly code is located in winceroot/private/winceos/coreos/nk/kernel/MIPS/startup. S. Is the operation that all MIPS development boards need to perform. Therefore, it will be determined based on different CPU types. Although it is assembly code, there are still a lot of comments in it. Through these comments, we can see what it is mainly about.

3. kernelrelocate. after necessary initialization, kernelstart calls the kernelrelocate function, which is an important function in winceroot/private/winceos/coreos/nk/kernel/loader. c. it will copy the data used by the kernel to the ram. The specific functions are described in msdn. Here, Ram is the storage area with the ram attribute specified in config. bib, not ramimage. kernelrelocate with ptoc as the parameter. Where does the ptoc value come from? Even if you have searched all the files, the ptoc is assigned a value. Changes the content of NK. Bin.

4. After the process of mipsinit. kernelrelocate is completed, mipsinit will be called. Located in winceroot/private/winceos/coreos/nk/kernel/MIPS/mdsched. c. here is the general MIPS processing, in which oeminitdebugserial in OAL will be called to initialize the serial port used for debugging.

5. Oeminit. The next step is the well-known oeminit. This function is customized by developers. C language. From the above analysis, we know that the serial port has been initialized when we enter oeminit, so now we can print some debugging information through the serial port. Before that, we can only make some simple display through the LED method.

6. Kernelfindmemory. Located in winceroot/private/winceos/coreos/nk/kernel/loader. c
This function is called after oeminit returns. This function divides ram into two parts: the object store and the available parts of the application. The object store is used to store the RAM File System of wince. For example, the/Windows directory we see after the startup is located in the RAM file system.

7. Kernelinit. Located in winceroot/private/winceos/coreos/nk/kernel/kwin32.c
This part has nothing to do with the CPU. It is the kernel that needs to complete its own initialization. At this point, all kernel Initialization is complete and thread scheduling can be started.

In addition, after the kernel Initialization is complete, it will call oemiocontrol with ioctl_hal_postinit as the parameter. Therefore, we can print a sentence here to indicate that the kernel Initialization is complete.

In addition to kernel(nk.exe), Which of the following is the first created path.
Although it is not a part of the kernel itself, if there is no file system, WinCE is not a good choice. Registry initialization is completed by the file system.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.