Chinaunix首页 | 论坛 | 博客
  • 博客访问: 588864
  • 博文数量: 169
  • 博客积分: 2656
  • 博客等级: 少校
  • 技术积分: 1685
  • 用 户 组: 普通用户
  • 注册时间: 2009-07-30 13:03
文章分类

全部博文(169)

文章存档

2011年(1)

2010年(135)

2009年(33)

我的朋友

分类: 嵌入式

2010-05-17 22:31:19

Vxworks实验步骤

IMPORTANT

安装Windriver montevina BSP package的之前,需要仔细看看Readme文档,以下是需要手动做些修改的步骤,我把它粘贴出来。

    Pre-Installation Requirement:

    1) Make a backup copies of the following directories:

       target/config/comps

    Post Installation Steps:

    1) Re-build vxbUsrCmdLine.c:

       Delete '$WIND_BASE/target/config/all/vxbUsrCmdLine.c'

     

       In the vxWorks Development Shell, go to '$WIND_BASE/target/

       config/comps/src/hwif' Run the command:

     

       make vxbUsrCmdLine.c

       Note, Windows users may have problems related to how directory

       delimiters are passed from 'make' to programs it calls. It may be

       necessary to temporarily change your WIND_BASE environment

       variable to use forward slashes before running the 'make' command.

       After running 'make vxbUsrCmdLine.c', be sure to restore the

       environment variable.

       For example, one would use the following before running 'make':

       set WIND_BASE=D:/WindRiver/vxworks-6.6

       And restore it as follows after running 'make':

       set WIND_BASE=D:\WindRiver\vxworks-6.6

    2) Rebuild CxrCat.txt:

       Go to the $WIND_BASE/target/config/comps/vxWorks directory, and delete

       (or rename if you wish to preserve a copy of) CxrCat.txt.

       Run the command:

      

           make CxrCat.txt

          

       This updates CxrCat.txt to include the AHCI (SATA) driver so it will

       will be available for builds from the graphical user interface.

1 编译库文件(可选)

第一次运行Workbench,最好先编译一下库文件,步骤

       1 点击 Vxworks Development shell

       2 进入 vxworks-6.6\target\src 目录,键入

              make CPU=PENTIUM4 TOOL=diab

2 创建Bootrom project

创建一个 Bootloader/BSP project,注意选择 montevina 这个BSP package,不要选择 copy file to project,因为在project下面进行编译,有时候会出现一些问题。如果要修改源文件,最好把原先的montevina文件夹备份一下,然后直接在vxworks-6.6\target\config\montevina进行修改,然后编译。其他选项default的就可以了。

3 USB启动修改

Windriver提供了很多种启动方式,对于我们来说,USB和网络启动比较实用,先从USB启动开始。

       修改 config.h,在第340行左右

       #define DEFAULT_BOOT_LINE \

       "usb(0,0)host:/bd0/vxWorks h=10.30.10.4 e=10.30.10.50:ffffff00 u=demo pw=demo tn=montevina f=0x0"                 /*"gei(0,0)host:d:/windriver3.0/vxworks-6.6/target/config/montevina/vxWorks h=10.30.10.4 e=10.30.10.50:ffffff00 u=demo pw=demo tn=montevina f=0x0"*/

       顺便说一下,usb(0,0):第一个0代表设备号,第二个0代表处理器0

       接下来,搜索一下“console definitions”,

#undef  INCLUDE_PC_CONSOLE 改为

#define INCLUDE_PC_CONSOLE      

       这是为了支持PC keyboard and VGA console,可以从显示器输出Boot信息。

4 Build Bootrom.bin

对于Bootrom设置基本修改完毕,然后打开Vxworks Development shell,进入vxworks-6.6\target\config\montevina,键入 make clean;再键入make bootrom.bin。当然你也可以在Workbench中完成project build

5 创建USB启动盘

接下来,要创建USB启动盘。在 montevina目录下有个vxsysnt.exe工具。具体用法如下:

D:\WindRiver3.0\vxworks-6.6\target\config\montevina>vxsysnt

Make a formatted drive bootable for VxWorks

usage:

vxsysnt -h

vxsysnt DRIVELETTER: -ownrisk [-systemdrive] [-ignore] [-f|-r|-b [filename]]

vxsysnt -ownrisk -ignore -b [filename]

    -h - display this message

    -ownrisk

        Indicate that you know, that working with direct disk access can make

        the host computer completely unusable, and that using this program is

        entirely your own risk, and authors and providers of this program do

        not take any liability for whatever direct or indirect damages caused

        by this program in any expected or unexpected situation, and do not

        provide any guarantee or warrantee for any behaviour of the program.

    -systemdrive

        Allow writing to a system drive.

        Attention! This will most likely make your computer completely unusable

        and is only provided as method of last ressort. Not needed for making

        data partitions bootable!

    -ignore

        Ignore errors. This will most likely make the affected drive unusable

        or write unusable data into a file!

    -f - Save the original bootsector of the drive to a file.

    -r - Restore the bootsector for the drive from a file.

    -b - Make bootsector bootable, but write to file instead of to bootsector.

        VXLD.BIN is the default name for the above files

       插入U盘,先格式化,然后记住盘符,我的是G盘,然后,在Vxworks Development shell中键入:

D:\WindRiver3.0\vxworks-6.6\target\config\montevina>vxsysnt -ownrisk g:

如果正常,反馈如下:

vxsysnt Progress: Original Bootloader and Disk Parameters read from g:

vxsysnt Progress: Original Disk parameters checked

vxsysnt Progress: Bootloader created

vxsysnt Progress: Bootloader written to Disk g:

vxsysnt Sucess: Done.

       然后键入:

D:\WindRiver3.0\vxworks-6.6\target\config\montevina>mkboot g: bootrom.bin

反馈如下:

VxSys 1.6 (c) Wind River 1993-2002

That's a hard disk!  Are you sure (y/n)?

这里你选择Y,会跳出一个警告窗口,直接选close即可。完成信息如下。

D:\WindRiver3.0\vxworks-6.6\target\config\montevina>mkboot g: bootrom.bin

VxSys 1.6 (c) Wind River 1993-2002

That's a hard disk!  Are you sure (y/n)? Y        1 file(s) copied.

System tranferred.  Checking e:BOOTROM.SYS is contiguous

chkdsk e:bootrom.sys

The type of the file system is FAT.

Volume Serial Number is C803-003C

Windows is verifying files and folders...

File and folder verification is complete.

Windows has checked the file system and found no problems.

  128,671,744 bytes total disk space.

      346,112 bytes in 1 files.

  128,325,632 bytes available on disk.

        2,048 bytes in each allocation unit.

       62,828 total allocation units on disk.

       62,659 allocation units available on disk.

All specified files are contiguous.

这下Bootrom是创建好了,在U盘下多了一个bootrom.sys的启动文件。

6 创建vxworks内核映像

接下来,需要创建一个vxworks映像project。在WorkbenchNew一个 VxWorks Image Project,选中对应的montevina BSPfinish

       创建完毕,双击左边Project Explorer中的Kernel Configuration,在里面要添加一个组件。你按 Ctrl + F 按键,搜索 include_sym,添加一个symbol shell commands的组件,只有添加这个组件,你才能在Vxworks内核启动之后进行命令输入。

       之后,Build project,映像生成,然后将生成的vxWorks拷贝到U盘。

      

       然后,将U盘插入CRBUSB口,开启CRB电源,大功告成。当然,板上必须自带BIOS,支持USB和网络启动。

阅读(1490) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~