Add a generic file in xv6 makefile

拜拜、爱过 提交于 2019-12-24 10:39:54

问题


I'm currently studying the xv6 OS. I found out here how to add a system call by modifying the MAKEFILE file. My question is: how do we add simple text files or any other kind of file to be seen in the xv6 system once it boots?


回答1:


README file in Xv6 is a generic file too. Searching for occurrences of README in the MakeFile and adding your required file will be sufficient.

Suppose new.txt is the file you want to add.

Parts of the MakeFile to be changed are:

1)

fs.img: mkfs README new.txt $(UPROGS)
./mkfs fs.img README new.txt $(UPROGS)

2)

PRINT = runoff.list runoff.spec README new.txt toc.hdr toc.ftr $(FILES)

3)

EXTRA=\
mkfs.c ulib.c user.h cat.c echo.c forktest.c grep.c kill.c\
ln.c ls.c mkdir.c rm.c stressfs.c usertests.c wc.c zombie.c\
printf.c umalloc.c\
README new.txt dot-bochsrc *.pl toc.* runoff runoff1 runoff.list\
.gdbinit.tmpl gdbutil\



回答2:


Like Sravani suggested, I added my "new.txt" adjecent to all occurences of README. I got the error:

make: No rule to make target `sample.txt', needed by `fs.img'.  Stop.

Then I removed the file type, i.e ".txt". Works well now!



来源:https://stackoverflow.com/questions/47250441/add-a-generic-file-in-xv6-makefile

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!