原创 mkboot批处理命令解读

2006-11-1 23:41 4868 4 4 分类: MCU/ 嵌入式

下面是做bootrom时的批处理命令,其实一般这个步骤不会出错,但是解释一下会更有利于对bootrom启动的理解:(本人用的bootrom_uncmp)


@echo off
if "%1" == "" goto usage  参数一盘符一般选a:
if "%2" == "" goto usage  做bootrom的源文件


vxsys %1  在第零扇区写入机器代码引导bootrom,这段代码决定了bootrom必须连续
if errorlevel 1 goto sysfail
if exist %1bootrom.sys del %1bootrom.sys


rem Check files with known names
rem Customers using unique file names should make modifications below.
if "%2" == "bootrom.dat"         goto omf
if "%2" == "bootrom"             goto omf
if "%2" == "bootrom_uncmp"       goto omf
if "%2" == "vxWorks_rom"         goto omf
if "%2" == "bootrom.bin"         goto binext
if "%2" == "bootrom_uncmp.bin"   goto binext
if "%2" == "vxWorks_rom.bin"     goto binext


echo Warning, Unrecognized file name %2. Assuming .bin extension.


:binext
copy %2 %1bootrom.sys
if errorlevel 1 goto copyfail
goto chkdsk


:omf
objcopypentium -O binary --gap-fill="0" %2 %1bootrom.sys  生成bootrom,最好软盘时空盘,否则可能造成不连续。也可以在其他盘(如CF卡)下做。
if errorlevel 1 goto omffail


:chkdsk  检查文件是否连续
echo System tranferred.  Checking %1BOOTROM.SYS is contiguous
echo chkdsk %1bootrom.sys
chkdsk %1bootrom.sys
goto end


:omffail 出现错误
echo Failed to objcopy %2 to %1BOOTROM.SYS!
goto usage


:sysfail
echo Failed to install boot sector on drive %1!
goto usage


:copyfail
echo Failed to copy %2 to %1BOOTROM.SYS!


:usage
echo Usage: mkboot drive: bootfile (e.g. mkboot a: bootrom.bin)
echo Installs VxWorks boot sector on drive, and copies over bootfile
echo as boot image BOOTROM.SYS. If the bootrom file is named bootrom.dat
echo as documented in older literature, then the file is assumed to be
echo an object module and is converted to binary before copied.
echo Note: BOOTROM.SYS must be contiguous or the boot will fail.  This can
echo be verified with CHKDSK.


:end

文章评论0条评论)

登录后参与讨论
相关推荐阅读
shenyandetongxing_551209819 2010-02-25 21:34
MyEclipse 建立第一个工程
1.打开MyEclipse--新建个工程File--New--Project--WebProject 2.在ProjectName中输入hello--Finish 3.然后为工程添加struts框架,...
shenyandetongxing_551209819 2010-02-06 22:42
人力资源管理软件(技术储备)
JAVA的SSH开发框架Struts、Spring、Hibernate在各层的作用1、Struts 负责 web层ActionFormBean 接收网页中表单提交的数据,然后通过Action 进行处理...
shenyandetongxing_551209819 2010-02-06 02:51
个人资源管理软件(需求)
先提提需求吧,这是重中之重,这不是简单就能完成的,需要不断的修改和完善。既然是个人资源管理就要首先搞清楚个人资源包括哪些部分:1  人脉资源,也就是我们常说的关系,人是社会型动物就不可能生活在真空里,...
shenyandetongxing_551209819 2010-02-06 02:33
HR软件设计开始(关注个人资源管理与分析)
最近对HR很感兴趣,上网搜了一下,HR的软件也不少,其中风头正劲的用友公司做的挺多,但是看了看都是针对企业级的。但自己平常的工作和进步帮助不大。想整一个关于人力资源、人际关系进行总结、分析的软件,让自...
shenyandetongxing_551209819 2010-02-06 02:30
对HR和B/S模式的东西感兴趣
最近对HR很感兴趣,上网搜了一下,HR的软件也不少,其中风头正劲的用友公司做的挺多,但是看了看都是针对企业级的。但自己平常的工作和进步帮助不大。想整一个关于人力资源、人际关系进行总结、分析的软件,让自...
shenyandetongxing_551209819 2008-10-01 16:18
由于工作原因,改行!!
已经好久没有上我的博客了,还有很多朋友支持我,很欣慰:)现在由于工作原因很长一段时间内将挥泪告别嵌入式。现在如果有做PKI或PMI的跟我一起交流啊:)...
我要评论
0
4
1
2
3
4
5
6
7
8
9
0
关闭 热点推荐上一条 /4 下一条