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?
Asked
Active
Viewed 3,589 times
2 Answers
4
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\

Sravani Manukonda
- 92
- 1
- 7
-
1This solution works perfectly. Also remember to invoke >>>make clean before >>>make – Nicolò Gasparini Nov 16 '17 at 20:44
0
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!
-
I want to add a file that intensionally has no type suffix, but *then* I get the same error you've mentioned. Any ideas? – GalAbra Mar 18 '19 at 12:29
-