目录
-
使用多级启动bootloader的原因:
Bootrom中如果要包含以太网、AHCI硬盘、U盘、U键盘的支持,则会导致bootrom文件大于ROM_SIZE =0x00090000。导致无法生成bootrom。
而基于此VxWorks6.9提供多级启动方式( multi-stage boot),在该启动方式下需要生成第一级启动vxStage1Boot.bin(后改名为bootrom.sys),第二级启动vxWorks_romCompress.bin(后修改为bootapp.sys),第三级启动则为vxWorks本身。
下面第二章节部分主要描述多级启动制作过程。
-
多级启动制作过程
- 在Workbench下新建VIP的工程,选择PROFILE_BOOTAPP_BASIC的profile。如下所示:
- 在新建的VIP中,加入INCLUDE_PC_CONSOLE,如下所示:
- 修改DEFAULT_BOOTLINE为项目所需要的启动方式,如下所示:
- 为了支持AHCI模式硬盘启动,添加INLCUDE_DRV_STORAGE_AHCI组件,如下所示:
- 为了支持boot阶段的文件系统,添加INCLUDE_BOOT_FILESYSTEMS组件,如下所示:
- 加入USB键盘和U盘的支持,包含如下组件:
INCLUDE_USB
INCLUDE_UBS_INTI
INCLUDE_EHCI
INCLUDE_EHCI_INTI
INCLUDE_USB_KEYBOARD
INCLUDE_USB_KEYBOARD_INTI
INCLUDE_USB_KEYBOARD_BOOTSHELL_ATTACH
INCLUDE_USB_MS_BULKONLY
INCLUDE_USB_MS_BULKONLY_INIT
如下所示:
- 为了支持NVRAM存储启动参数,需要在组件中包含INCLUDE_SYS_WARM_AHCI组件,并设置BOOTROM_DIR为“/ata4:1”(这里主板上的SATA接口在bios中识别为port4接口上的设备,因此为/ata4),如下所示:
- 将“Components”更换为“Bundles”,需要在组件中包含BUNDLE_MSB_WARM_REBOOT组件,如下图所示:
- 将工程属性下“Variable”中ROM_SIZE修改为00200000,ROM_TEXT_ADRS修改为00408000,如下图所示:
- 设置该VIP工程的Set Active Build Spec为default_romCompress。如下所示:
- 选中该工程,并点击鼠标右键,选择New->Build Target。如下所示:
- 新建的Build Target名称命名为vxStage1Boot.bin,如下所示:
- 点击“Finish”之后在该工程下出现新的build 选项为vxStage1Boot.bin,如下所示:
- 分别选中vxStage1Boot.bin和vxWorks.bin,点击鼠标右键选择Build Target。如下所示:
- 编译完成之后,在该工程 default_romCompress目录下分别生成vxStage1Boot.bin和vxWorks_romCompress.bin。将vxStage1Boot.bin更名为bootrom.sys,将vxWorks_romCompress.bin更名为bootapp.sys。至此生成多级启动的2个文件。如下所示:
- 将bootrom.sys和bootapp.sys拷贝至做好的启动盘,就可以完成多级启动。