转自:https://blog.csdn.net/u014082689/article/details/81539174
一、硬件环境
WIN 10 + VmWare 12.0
WorkBench3.3 + VxWorks6.9(整系列套件)
二、移植步骤
1.建立dos虚拟机
- 网上下载MS-DOS6.2 镜像,在虚拟机中新建新的虚拟机,
- 自定义->硬件兼容性->下一步->稍后安装操作系统->操作系统选择 其他,版本选择其他64位->填写虚拟机名称及位置->处理器默认->内存默认->选择使用桥接方式->IO控制器选择推荐默认->硬盘类型IDE->创建新虚拟磁盘->磁盘存为单个文件,磁盘大小默认->定义磁盘文件名
- 自定义硬件->添加(需要管理员权限)->软盘驱动器->使用物理软盘驱动器
- 启动时连接勾选,自动连接->完成,关闭->完成新建虚拟机
2. 编辑虚拟机设置->软盘驱动器->勾选使用软盘映像文件->浏览,选择下载的dos镜像,确定完成并开启虚拟机
3.开机过程中,对话框无法连接ide1:0,忽略不管,选择否。
4启动虚拟机后,进入如下界面
选择 NONE 后,进入软驱 A:盘符,运行
- A:\>fdisk 创建 DOS 主分区,一路回车,最后一个回车会使虚拟机重启,再次选择 NONE
- A:\>fomat C: 格式化创建的主分区 选择输入y回车重新进入A:
- A:\>sys C: 成功后提示 System Transferred
- 这样 C 盘就安装了最简单的 DOS,顺便把以下几个文件从 A 盘拷贝到 C 盘
- A:\>copy HIMEM.SYS C:\
- A:\>copy EDIT.COM C:\
- 点击虚拟机停止按钮退出虚拟机,把软驱配置再改回连接物理软驱,如下图所示
5.重新启动虚拟机,按照格式输入时间或者默认回车,可以进入安装好的dos系统
6.在workbench安装目录中查找 vxload.com程序
- 新建config.ini文件,编辑启动菜单文件,内容如下
-
[menu]
-
menuitem=Boot_VX, Start with VxWorks69
-
menuitem=Boot_DOS, Start with MsDos622
-
menudefault=Boot_VX,3
-
menucolor=7,0
-
[Boot_VX]
-
device=c:\himem.sys /testmem:off
-
dos=high,umb
-
shell=c:\vxload.com c:\bootrom.sys
-
[Boot_DOS]
-
device=c:\himem.sys /testmem:off
-
dos=high,umb
-
[COMMON]
-
files=40
-
buffers=30
-
rem dos=high,umb
- 将config.ini 重命名位config.sys ,vxload.com与config.sys 文件拷贝到虚拟磁盘当中,重新启动虚拟机可以看到启动菜单
- 虚拟磁盘映射:关闭虚拟机,编辑虚拟机设置,选择磁盘实用工具,选择映射,在弹出的对话框中选择去掉以只读模式打开,确定后可以在windows中查看到虚拟磁盘的盘符,可以通过普通的拷贝方式将文件放入到虚拟磁盘当中。
7.下载vxWorks6.9 bsp for vmware12.0
复制一份pentium4的bsp,在config.h中添加如下宏定义(或undef修改为define)
-
#define INCLUDE_PC_CONSOLE
-
#define INCLUDE_DRV_STORAGE_AHCI
-
#define INCLUDE_DRV_STORAGE_PIIX
-
#define INCLUDE_GEI825XX_VXB_END
-
#define DRV_NVRAM_FILE "/ata0:1/nvram.txt"
-
# define NV_RAM_SIZE (0x1000)
8.新建bootloader工程,编译生成bootrom
9.workbench中选择project ->open vxWorks6.9 shell ->选择bootrom生成的文件夹,
运行 objcopypentium -O binary --gap-fill=0 bootrom bootrom.sys命令,生成bootrom.sys
objcopypentium -O binary --gap-fill=0 bootrom bootrom.sys
10 bootrom.sys拷贝到虚拟机虚拟磁盘下,重启虚拟机后可以看到能够进入到VxWorks的bootrom启动界面。
11.根据config.h,新建vxWorks镜像并添加相应组件,编译完成内核后,vxWorks放入虚拟硬盘中,可以通过硬盘启动vxWorks
12 bootrom启动参数修改为硬盘启动
13.如果硬盘启动故障的话,需要将编辑虚拟机设置中光盘驱动器,软盘驱动器都删除,将硬盘挂载到IDE0:0(根据安装虚拟机情况修改)