PowerPC VxWorks BSP analysis (4.2) -- BSP Customization

Source: Internet
Author: User
2. The first-stage execution process uses the functions (rominit-& gt; romstart-& gt; usrinit-& gt; syshwinit-& gt;) in the source file on the left; usrkernelinit-& gt; usrroot); the second-stage execution process uses the functions in the source file on the right (sysinit-& gt; usrinit-& gt; syshwinit-& gt; usrkernelinit-& gt; usrroot-& gt; usrappinit ). The first stage is rominit. s: rominit () ø after the system is powered on, the first function to be called is rominit () ø disable interruption (cold start/hot start) put it on the stack. Clear cache. initialize the basic CPU registers. Call the SDRAM initialization function to initialize UPM. Then, Jump directly to bootinit. c: romstart () bootinit. c: romstart () ø copy the code segment and data segment from bootrom to ram. ø decompress the program image (if the image is compressed) ø jump to bootconfig. c: usrinit () bootconfig. c: usrinit () ø the first C language completed in Vxworks OS. The initialization program required to run the operating system kernel. Cache library initialization ø clear the BSS segment of the system ø initialize the interrupt vector table ø make the hardware work in a "quiet" state, do not generate various interruptions or exceptions as much as possible. Control is handed over to kernelinit (), and The usrroot root task is generated. ø parse bootline in the usrroot root task to generate a bootloop task for starting and loading the VxWorks image. /Target/config/All/bootconfig. c is the boot Rom setting module used to load the VxWorks image. The execution process is: usrroot () ---- & gt; boot1_loop (void) command line selection, or autobooting ---- & gt; bootload (pline, & entry) load modules to memory (Network, tffs, TSFS ...) ---- & gt; netifattach () ---- & gt; go (entry) ---- & gt; (entry) () starts from the entry and does not return. Stage 2: bootconfig. c: bootload () ø load the VxWorks image, switch to its loading address, and run the VxWorks image sysalib from the sysinit entry. s: sysinit () ø and rominit. s: the initialization process of rominit () is similar, but memory (DRAM and memory controller are not initialized once) usrconfig. c: usrinit () ø set the cache working mode, initialize the board-level hardware, initialize the wind kernel, and start the usrroot () Root task usrconfig. c: usrroot () ø initialize memory, system clock, I/O system, standard input/output error, exception handling, and add user applications. ROM-based images (Compression/ No compression)Compared with the above startup method, this startup method saves some steps. After executing romstart (), it has loaded VxWorks into RAM. Therefore, the next step is to give control to VxWorks, run the command from sysinit () on VxWorks. The specific process is as follows :{
Window. Open ("http://blog.51cto.com/viewpic.php? Refimg = "+ this. SRC)
} 'Src = "http://img1.51cto.com/attachment/200903/3/109393_1236100033YB2M.jpg" border = "0" alt = "clip_image007" Height = "173"> rominit. s: rominit () ø after the system is powered on, the first function to be called is rominit () ø disable interruption (cold start/hot start) put it on the stack. Clear cache. initialize the basic CPU registers. Call the SDRAM initialization function to initialize UPM. Then, Jump directly to bootinit. c: romstart () bootinit. c: romstart () ø copy the code segment (if it is a vxworks_romresident image, do not copy the code segment) and data segment from bootrom to ram. ø decompress the program image (if the image is compressed) ø jump to sysalib. s: Sysin It () sysalib. s: sysinit () ø re-initialize the CPU kernel (mainly cache), which works in rominit. s: rominit () is the first code in Ram to jump to usrconfig. c: usrinit () usrconfig. c: usrinit () ø the Code completed in the first C language in VxWorks. The initialization program required to run the operating system kernel. Cache library initialization ø clear the BSS segment of the system ø initialize the interrupt vector table ø make the hardware work in a "quiet" state, do not generate various interruptions or exceptions as far as possible. Control is handed over to kernelinit () to generate the usrroot root task. Rom-resident Images :The loading of this image is basically the same as that of the previous one, and the execution sequence is: file rominit. in S, the rominit () ---- & gt; file bootinit. romstart () ---- & gt; file usrconfig. in C, usrinit () ---- & gt; syshwinit () ---- & gt; usrkernelinit () ---- & gt; kernelinit (usrroot ,...). Main functions of the usrroot () task include: Initialize the memory Partition Table (memory partition Library), initialize the system clock (system clock), and initialize the input/output system (I/O system) ---- (optional) create devices ---- (optional) configure network ---- (optional) Activate wdb target communication (activate wdb agent) ---- (optional) Activate Application)

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.