PowerPC VxWorks BSP analysis (4.1) -- BSP Customization

Source: Internet
Author: User
1 PowerPC BSP Customization

1. The main function of BSP is to configure the system hardware to make it work normally and complete data interaction between the hardware and the software, provides a hardware-independent software platform for OS and upper-layer applications. Therefore, from the execution point of view, it can be divided into two parts: ø hardware initialization and operating system boot routine during the startup of the target system, which is executed only once during the system startup process; the device driver that controls the hardware running on the target board to connect the hardware with the software. {
Window. Open ("http://blog.51cto.com/viewpic.php? Refimg = "+ this. SRC)
} 'Src = "http://img1.51cto.com/attachment/200903/3/109393_1236099802Pj8C.jpg" border = "0" alt = "clip_image002 [6]" Height = "185"> Figure 1 BSP Location in the systemGenerally, BSP design and development can be divided into the following steps: (1) establish a development environment. Install the VxWorks integrated development environment (tornado) and select an appropriate development tool. Almost every processor currently supports the JTAG/BDM interface. Most processors support JTAG/BDM debugging tools, such as vision ice, the use of the target board vendor's debug Rom debugging tool is also a way to consider. (2) select an appropriate BSP template. If possible, the selected template should be as close as possible to the hardware platform. Of course, the actual cost and full use of existing resources are taken into account, the selected template may need to be modified to be migrated to the required hardware platform. (3) modify or add the initialization code before the wind kernel is activated, including initializing the CPU kernel, MMU, and cache disabling/enabling. (4) After the kernel is activated, the connection system is interrupted, the system clock is used, and the required device driver is modified or added. (5) test and verification. The correctness and Stability of BSP play a vital role in the stability of upper-layer software and the entire system. Therefore, the BSP must be tested and verified. BSP main file directory composition and function :{
Window. Open ("http://blog.51cto.com/viewpic.php? Refimg = "+ this. SRC)
} 'Src = "http://img1.51cto.com/attachment/200903/3/109393_1236099812iZ0u.jpg" border = "0" alt = "clip_image004 [7]" Height = "116"> Target/config/all DirectoryThe files in this directory are shared by all BSP files. Do not change any files in this directory unless necessary. Configall. h: All VxWorks settings are defined by default. If you do not need the default settings, you can use the # define or # UNDEF method in the config. h file under the BSP directory to change the settings. Bootinit. C: After rominit. S, complete the second step of boot Rom initialization. Program from rominit. in S, rominit () jumps to romstart () in this file to perform necessary decompression and put the ROM image bootconfig. c: Initialize boot ROM image and control usrconfig. c: VxWorks image initialization code Target/config/comps/src DirectoryComponents related to the system core, mainly called by the function in usrconfig. c In target/config/all Target/config/bspname DirectoryCommand lines that contain BSP files related to the system or hardware control images generation readmebsp release records, versions, and general documentation config. h Includes all settings and definitions related to the CPU motherboard (supported des, definations) confignet. h: The main setting file of the network driver. It mainly sets the end driver. rominit. the S assembly language file is the entry to VxWorks boot ROM and Rom based image. For details, see sysalib. s assembly language file. programmers can put their own assembly functions in this file and call them at the upper layer. In this file, the entry point of VxWorks image _ sysinit is the first function syslib executed in Ram. C contains some system-related function routines and provides a board-level interface. VxWorks and applications can be generated in the form of system-indepent. This file also contains the target/config/comps/src driver sysscsi. the optional c file is used to set and initialize sysserial for the SCSI device. c optional files are used for all serial port settings and initialization bootrom. the hexasic file contains the VxWorks boot ROM code. VxWorks runs on the target machine and is complete. sym is complete. After the link, the VxWorks binary file with the symbol table is VxWorks. st completely. After the link, standalone, the VxWorks binary file with the symbol table

1.1 Startup Process

Vxworks OS has three types of images: ø loadable images: bootrom guides you through the network port or serial port to download to ram ø ROM-based images (compressed/not compressed): The image will be directly burned into the Rom, run the image Export command in Ram. Ø Rom-resident images: The instruction part of the image resides and runs in the Rom. Only the part of the data segment is merged into RAM. Note that all the three images mentioned here contain images of the real operating system VxWorks. The latter two images can be started and run directly, but the first one does not, it can only run with another image called Boot Image (which can be generated in build-& gt; build boot Rom in tornado, that is, boot image is used to boot and then download the loadable image that actually contains VxWorks through the network port or serial port before it can run. That is to say, the boot image is used with loadable image. Now there are four types of image files. Let's take a look at their composition: ø Boot Image: contains a program called Bootstrap programs + a ROM Boot Program program. Ø loadable images: an image composed of the Operating System VxWorks and applications. ROM-based images (compressed/uncompressed): contains a bootstrap programs program + loadable images (an image composed of the Operating System VxWorks and applications). Rom-resident images: as shown above, ROM-based images, Rom-resident images, and boot image contain a program called Bootstrap programs, which has the startup function, you can copy the code segments and data segments in the Rom to ram. Let's take a look at the startup sequence of the three Vxworks OS images: Boot Image + Loadable ImagesLoadable images is started by loading the boot image. First, the bootstrap programs program in the boot image loads the Boot Program program to ram_high_adrs in Ram, and then the control is handed over to the boot program, boot Program is responsible for a series of simple hardware initialization (network port, serial port, etc.), and starts Downloadable images (including the application's VxWorks operating system) to ram_low_adrs, then the control is handed over to the VxWorks operating system for execution. {
Window. Open ("http://blog.51cto.com/viewpic.php? Refimg = "+ this. SRC)
} 'Src = "http://img1.51cto.com/attachment/200903/3/109393_123609994897Ut.gif" border = "0" alt = "clip_image005" Height = "184">
Figure 2 loadable images VxWorks Startup Process

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.