# Lab1 report
## [练习1]
[练习1.1] 操作系统镜像文件 tos.img 是如何1步1步生成的?(需要比较详细地解释 Makefile 中
每条相干命令和命令参数的含义,和说明命令致使的结果)
bin/tos.img
| 生成tos.img的相干代码为
| (TOSIMG):(kernel) (bootblock)|(V)dd if=/dev/zero of=@count=10000|(V)dd if=(bootblock)of=@ conv=notrunc
| (V)ddif=(kernel) of=@seek=1conv=notrunc||为了生成tos.img,首先需要生成bootblock、kernel||>bin/bootblock||生成bootblock的相关代码为||(bootblock): (calltoobj,(bootfiles)) | (calltotarget,sign)||@echo+ld@
| | (V)(LD) (LDFLAGS)−N−estart−Ttext0x7C00^ \
| | -o (calltoobj,bootblock)||@(OBJDUMP) -S (callobjfile,bootblock)> ||(call asmfile,bootblock)
| | @(OBJCOPY)−S−Obinary(call objfile,bootblock) \
| | (calloutfile,bootblock)||@(call totarget,sign) (calloutfile,bootblock)(bootblock)
| |
| | 为了生成bootblock,首先需要生成bootasm.o、bootmain.o、sign
| |
| |> obj/boot/bootasm.o, obj/boot/bootmain.o
| | | 生成bootasm.o,bootmain.o的相干makefile代码为
| | | bootfiles = (calllistfcc,boot)|||(foreach f,(bootfiles),(call cc_compile,(f),
------分隔线----------------------------
------分隔线----------------------------