Permalink
Browse files

lab5

  • Loading branch information...
1 parent b825df1 commit 816b5662e22a427c0960a4ef0b1ee72cb6ac6e1a Silas Boyd-Wickizer committed Nov 3, 2009
Showing with 3,702 additions and 29 deletions.
  1. +3 −2 GNUmakefile
  2. +2 −2 conf/lab.mk
  3. +58 −0 fs/Makefrag
  4. +613 −0 fs/fs.c
  5. +38 −0 fs/fs.h
  6. +492 −0 fs/fsformat.c
  7. +111 −0 fs/ide.c
  8. +4 −0 fs/motd
  9. +2 −0 fs/newmotd
  10. +342 −0 fs/serv.c
  11. +79 −0 fs/test.c
  12. +99 −0 grade-lab5.sh
  13. +98 −0 inc/args.h
  14. +9 −1 inc/error.h
  15. +60 −0 inc/fd.h
  16. +104 −0 inc/fs.h
  17. +36 −0 inc/lib.h
  18. +4 −14 kern/Makefrag
  19. +5 −2 kern/env.c
  20. +9 −3 kern/init.c
  21. +0 −4 kern/syscall.c
  22. +7 −0 lib/Makefrag
  23. +9 −0 lib/entry.S
  24. +1 −0 lib/exit.c
  25. +321 −0 lib/fd.c
  26. +203 −0 lib/file.c
  27. +81 −0 lib/fprintf.c
  28. +112 −0 lib/fsipc.c
  29. +14 −0 lib/pageref.c
  30. +6 −0 lib/printfmt.c
  31. +7 −1 lib/readline.c
  32. +279 −0 lib/spawn.c
  33. +36 −0 user/cat.c
  34. +21 −0 user/echo.c
  35. +27 −0 user/icode.c
  36. +46 −0 user/init.c
  37. +27 −0 user/initsh.c
  38. +88 −0 user/ls.c
  39. +35 −0 user/lsfd.c
  40. +47 −0 user/num.c
  41. +76 −0 user/primespipe.c
  42. +51 −0 user/testfsipc.c
  43. +40 −0 user/writemotd.c
View
@@ -127,10 +127,11 @@ include boot/Makefrag
include kern/Makefrag
include lib/Makefrag
include user/Makefrag
+include fs/Makefrag
-IMAGES = $(OBJDIR)/kern/kernel.img
-QEMUOPTS = -hda $(OBJDIR)/kern/kernel.img -serial mon:stdio
+IMAGES = $(OBJDIR)/kern/kernel.img $(OBJDIR)/fs/fs.img
+QEMUOPTS = -hda $(OBJDIR)/kern/kernel.img -hdb $(OBJDIR)/fs/fs.img -serial mon:stdio
.gdbinit: .gdbinit.tmpl
sed "s/localhost:1234/localhost:$(GDBPORT)/" < $^ > $@
View
@@ -1,2 +1,2 @@
-LAB=4
-PACKAGEDATE=Wed Oct 7 18:43:11 EDT 2009
+LAB=5
+PACKAGEDATE=Tue Nov 3 13:41:56 EST 2009
View
@@ -0,0 +1,58 @@
+
+OBJDIRS += fs
+
+FSOFILES := $(OBJDIR)/fs/ide.o \
+ $(OBJDIR)/fs/fs.o \
+ $(OBJDIR)/fs/serv.o \
+ $(OBJDIR)/fs/test.o \
+
+USERAPPS := $(OBJDIR)/user/cat \
+ $(OBJDIR)/user/echo \
+ $(OBJDIR)/user/init \
+ $(OBJDIR)/user/ls \
+ $(OBJDIR)/user/lsfd \
+ $(OBJDIR)/user/num \
+ $(OBJDIR)/user/forktree \
+ $(OBJDIR)/user/primes
+
+FSIMGTXTFILES := fs/newmotd \
+ fs/motd
+
+
+
+FSIMGFILES := $(FSIMGTXTFILES) $(USERAPPS)
+
+$(OBJDIR)/fs/%.o: fs/%.c fs/fs.h inc/lib.h
+ @echo + cc[USER] $<
+ @mkdir -p $(@D)
+ $(V)$(CC) -nostdinc $(USER_CFLAGS) -c -o $@ $<
+
+$(OBJDIR)/fs/fs: $(FSOFILES) $(OBJDIR)/lib/entry.o $(OBJDIR)/lib/libjos.a user/user.ld
+ @echo + ld $@
+ $(V)mkdir -p $(@D)
+ $(V)$(LD) -o $@ $(ULDFLAGS) $(LDFLAGS) -nostdlib \
+ $(OBJDIR)/lib/entry.o $(FSOFILES) \
+ -L$(OBJDIR)/lib -ljos $(GCC_LIB)
+ $(V)$(OBJDUMP) -S $@ >$@.asm
+
+# How to build the file system image
+$(OBJDIR)/fs/fsformat: fs/fsformat.c
+ @echo + mk $(OBJDIR)/fs/fsformat
+ $(V)mkdir -p $(@D)
+ $(V)gcc $(USER_CFLAGS) -o $(OBJDIR)/fs/fsformat fs/fsformat.c
+
+$(OBJDIR)/fs/clean-fs.img: $(OBJDIR)/fs/fsformat $(FSIMGFILES)
+ @echo + mk $(OBJDIR)/fs/clean-fs.img
+ $(V)mkdir -p $(@D)
+ $(V)$(OBJDIR)/fs/fsformat $(OBJDIR)/fs/clean-fs.img 1024 $(FSIMGFILES)
+
+$(OBJDIR)/fs/fs.img: $(OBJDIR)/fs/clean-fs.img
+ @echo + cp $(OBJDIR)/fs/clean-fs.img $@
+ $(V)cp $(OBJDIR)/fs/clean-fs.img $@
+
+all: $(OBJDIR)/fs/fs.img
+
+#all: $(addsuffix .sym, $(USERAPPS))
+
+#all: $(addsuffix .asm, $(USERAPPS))
+
Oops, something went wrong.

0 comments on commit 816b566

Please sign in to comment.