听说测试机上跑不过彻查了一遍MakeFile...
Lab3以及之后swapimg是用dd命令创建的
Linux和OS X系统的dd命令的bs=之后的大小写有不同, 所以OS X会看到bs illegal numeric value
如果直接强行改选项会导致测试机上编译错误, 下面是一个quick fix:
MakeFile中加上:
# Fix osx and linux different dd
UNAME := $(shell uname)
ifeq ($(UNAME), Darwin)
BS_SIZE := 1m
else
BS_SIZE := 1M
endif
然后swapimg创建的部分修改为:
# create swap.img
SWAPIMG := $(call totarget,swap.img)
$(SWAPIMG):
$(V)dd if=/dev/zero of=$@ bs=$(BS_SIZE) count=128
$(call create_target,swap.img)
# -------------------------------------------------------------------