1.出现的错误
之前的Makefile文件中的相关部分是笔者这样写的(其实就是抄的本书作者的代码,但是抄错了),具体的错误如下:
#编译工具
cc1=$(toolpath)cc1.exe -I$(incpath) -Os -Wall -quiet
#上面一行此前在“$(incpath)”和“-Os”之间没写空格,引发了一些问题,具体原因不明
#没写空格时,需要运行两次make run的命令才可以进入虚拟机,加了空格之后
#就没问题了,可以一次运行make run就进入虚拟机,并报错说stdio.h不存在之类的
gas2nask=$(toolpath)gas2nask.exe -a
obj2bim=$(toolpath)obj2bim.exe
bim2hrb=$(toolpath)bim2hrb.exe
2.Makefile写错的时候运行结果
要运行两次“make run”命令才能成功运行,不知道为什么是要运行这两次,具体原因不明,若有高人明白个中缘由,还请不吝赐教,具体的运行状况如下:
$>make run
$>..\z_tools\make.exe run
../z_tools/make.exe -r img
make.exe[1]: Entering directory `F:/TAOTIE_OS/tolset/TAOTIE_SourceCode'
../z_tools/make.exe -r TAOTIEos.img
make.exe[2]: Entering directory `F:/TAOTIE_OS/tolset/TAOTIE_SourceCode'
../z_tools/nask.exe ipl10.nas ipl10.bin ipl10.lst
../z_tools/nask.exe asmhead.nas asmhead.bin asmhead.lst
../z_tools/cc1.exe -I../z_tools/haribote/-Os -Wall -quiet -o bootpack.gas bootpack.c
bootpack.c:1:19: stdio.h: No such file or directory
bootpack.c: In function `HariMain':
bootpack.c:88: warning: implicit declaration of function `sprintf'
bootpack.c:78: warning: unused variable `hankaku'
bootpack.c:232:2: warning: no newline at end of file
make.exe[2]: *** [bootpack.gas] Error 1
make.exe[2]: Leaving directory `F:/TAOTIE_OS/tolset/TAOTIE_SourceCode'
make.exe[1]: *** [img] Error 2
make.exe[1]: Leaving directory `F:/TAOTIE_OS/tolset/TAOTIE_SourceCode'
..\z_tools\make.exe: *** [run] Error 2
$>make run
$>..\z_tools\make.exe run
../z_tools/make.exe -r img
make.exe[1]: Entering directory `F:/TAOTIE_OS/tolset/TAOTIE_SourceCode'
../z_tools/make.exe -r TAOTIEos.img
make.exe[2]: Entering directory `F:/TAOTIE_OS/tolset/TAOTIE_SourceCode'
../z_tools/gas2nask.exe -a bootpack.gas bootpack.nas
../z_tools/nask.exe bootpack.nas bootpack.obj bootpack.lst
../z_tools/nask.exe naskfunc.nas naskfunc.obj naskfunc.lst
../z_tools/makefont.exe hankaku.txt hankaku.bin
../z_tools/bin2obj.exe hankaku.bin hankaku.obj _hankaku
../z_tools/obj2bim.exe @../z_tools/haribote/haribote.rul out:bootpack.bim stack:3136k map:bootpack.map \
bootpack.obj naskfunc.obj hankaku.obj
../z_tools/bim2hrb.exe bootpack.bim bootpack.hrb 0
copy /B asmhead.bin+bootpack.hrb TAOTIEos.sys
asmhead.bin
bootpack.hrb
已复制 1 个文件。
../z_tools/edimg.exe imgin:../z_tools/fdimg0at.tek \
wbinimg src:ipl10.bin len:512 from:0 to:0\
copy from:TAOTIEos.sys to:@:\
imgout:TAOTIEos.img
make.exe[2]: Leaving directory `F:/TAOTIE_OS/tolset/TAOTIE_SourceCode'
make.exe[1]: Leaving directory `F:/TAOTIE_OS/tolset/TAOTIE_SourceCode'
copy TAOTIEos.img ..\z_tools\qemu\fdimage0.bin
已复制 1 个文件。
../z_tools/make.exe -r -C ../z_tools/qemu
make.exe[1]: Entering directory `F:/TAOTIE_OS/tolset/z_tools/qemu'
qemu-win.bat
$...\tolset\z_tools\qemu>qemu.exe -L . -m 32 -localtime -std-vga -fda fdimage0.bin
make.exe[1]: Leaving directory `F:/TAOTIE_OS/tolset/z_tools/qemu'\
画下划线的地方是报的错误,从上面的运行看,需要两次make run命令,修改之后就是正常的了。