Browse Source

update codes for os course-YAO-class, fall, 2013

main
chyyuu 11 years ago
parent
commit
1851498df5
47 changed files with 50 additions and 34 deletions
  1. +4
    -0
      code/autobuild.sh
  2. +41
    -0
      code/autotest.sh
  3. +1
    -1
      code/lab1/tools/function.mk
  4. +0
    -5
      code/lab4/kern/mm/kmalloc.c
  5. +0
    -4
      code/lab4/tools/grade.sh
  6. +0
    -5
      code/lab5/kern/mm/kmalloc.c
  7. +0
    -1
      code/lab5/tools/grade.sh
  8. +0
    -5
      code/lab6/kern/mm/kmalloc.c
  9. +0
    -1
      code/lab6/tools/grade.sh
  10. +0
    -5
      code/lab7/kern/mm/kmalloc.c
  11. +0
    -1
      code/lab7/tools/grade.sh
  12. +0
    -0
      code/lab8/kern/fs/devs/dev.c
  13. +0
    -0
      code/lab8/kern/fs/devs/dev.h
  14. +0
    -0
      code/lab8/kern/fs/devs/dev_disk0.c
  15. +0
    -0
      code/lab8/kern/fs/devs/dev_stdin.c
  16. +0
    -0
      code/lab8/kern/fs/devs/dev_stdout.c
  17. +0
    -0
      code/lab8/kern/fs/file.c
  18. +0
    -0
      code/lab8/kern/fs/file.h
  19. +0
    -0
      code/lab8/kern/fs/fs.c
  20. +0
    -0
      code/lab8/kern/fs/fs.h
  21. +0
    -0
      code/lab8/kern/fs/iobuf.c
  22. +0
    -0
      code/lab8/kern/fs/iobuf.h
  23. +0
    -0
      code/lab8/kern/fs/sfs/bitmap.c
  24. +0
    -0
      code/lab8/kern/fs/sfs/bitmap.h
  25. +0
    -0
      code/lab8/kern/fs/sfs/sfs.c
  26. +0
    -0
      code/lab8/kern/fs/sfs/sfs.h
  27. +0
    -0
      code/lab8/kern/fs/sfs/sfs_fs.c
  28. +0
    -0
      code/lab8/kern/fs/sfs/sfs_inode.c
  29. +0
    -0
      code/lab8/kern/fs/sfs/sfs_io.c
  30. +0
    -0
      code/lab8/kern/fs/sfs/sfs_lock.c
  31. +0
    -0
      code/lab8/kern/fs/swap/swapfs.c
  32. +0
    -0
      code/lab8/kern/fs/swap/swapfs.h
  33. +0
    -0
      code/lab8/kern/fs/sysfile.c
  34. +0
    -0
      code/lab8/kern/fs/sysfile.h
  35. +0
    -0
      code/lab8/kern/fs/vfs/inode.c
  36. +0
    -0
      code/lab8/kern/fs/vfs/inode.h
  37. +0
    -0
      code/lab8/kern/fs/vfs/vfs.c
  38. +0
    -0
      code/lab8/kern/fs/vfs/vfs.h
  39. +0
    -0
      code/lab8/kern/fs/vfs/vfsdev.c
  40. +0
    -0
      code/lab8/kern/fs/vfs/vfsfile.c
  41. +0
    -0
      code/lab8/kern/fs/vfs/vfslookup.c
  42. +0
    -0
      code/lab8/kern/fs/vfs/vfspath.c
  43. +0
    -5
      code/lab8/kern/mm/kmalloc.c
  44. +0
    -0
      code/lab8/libs/dirent.h
  45. +4
    -1
      code/lab8/tools/grade.sh
  46. +0
    -0
      code/lab8/user/ls.c
  47. +0
    -0
      code/lab8/user/sh.c

+ 4
- 0
code/autobuild.sh View File

@ -0,0 +1,4 @@
#!/bin/bash
# Nothing to be done here
exit 0

+ 41
- 0
code/autotest.sh View File

@ -0,0 +1,41 @@
#!/bin/bash
BASE_COMMIT=95a80f598fc57c60aed3737c60ee437d94eb8540
LABS=`git diff $BASE_COMMIT --stat | grep -o "lab[0-9]" | uniq`
if [ "$LABS" = "" ]; then
echo "No solutions provided. Skip this time."
exit 0
fi
failed=0
pwd=`pwd`
summary=$pwd/.score_summary
echo -n > $summary
for lab in $LABS; do
pushd $lab > /dev/null
if ! make grade > .score 2>&1; then
failed=`echo $lab | grep -o [0-9]`
fi
score=`egrep -o "Score: [0-9]+/[0-9]+" .score`
echo "$lab $score" >> $summary
make clean > /dev/null
popd > /dev/null
done
echo "Labs with changes detected: " $LABS
echo
echo "============================== Summary =============================="
cat $summary
rm $summary
echo
for lab in $LABS; do
echo "================================ $lab ==============================="
cat $lab/.score
rm $lab/.score
done
exit $failed

+ 1
- 1
code/lab1/tools/function.mk View File

@ -70,7 +70,7 @@ endef
# finish all
define do_finish_all
ALLDEPS = $$(ALLOBJS:.o=.d)
$$(sort $$(dir $$(ALLOBJS)) $(BINDIR) $(OBJDIR)):
$$(sort $$(dir $$(ALLOBJS)) $(BINDIR)$(SLASH) $(OBJDIR)$(SLASH)):
@$(MKDIR) $$@
endef

+ 0
- 5
code/lab4/kern/mm/kmalloc.c View File

@ -186,14 +186,9 @@ static void slob_free(void *block, int size)
void check_slob(void) {
cprintf("check_slob() success\n");
}
void
slob_init(void) {
cprintf("use SLOB allocator\n");
check_slob();
}
inline void

+ 0
- 4
code/lab4/tools/grade.sh View File

@ -332,10 +332,6 @@ quick_check 'check page table' \
' |-- PTE(000e0) faf00000-fafe0000 000e0000 urw' \
' |-- PTE(00001) fafeb000-fafec000 00001000 -rw'
pts=10
quick_check 'check slob' \
'check_slob() succeeded!'
pts=25
quick_check 'check vmm' \
'check_vma_struct() succeeded!' \

+ 0
- 5
code/lab5/kern/mm/kmalloc.c View File

@ -186,14 +186,9 @@ static void slob_free(void *block, int size)
void check_slob(void) {
cprintf("check_slob() success\n");
}
void
slob_init(void) {
cprintf("use SLOB allocator\n");
check_slob();
}
inline void

+ 0
- 1
code/lab5/tools/grade.sh View File

@ -338,7 +338,6 @@ default_check() {
'PDE(001) fac00000-fb000000 00400000 -rw' \
' |-- PTE(000e0) faf00000-fafe0000 000e0000 urw' \
' |-- PTE(00001) fafeb000-fafec000 00001000 -rw' \
'check_slob() succeeded!' \
'check_vma_struct() succeeded!' \
'page fault at 0x00000100: K/W [no page found].' \
'check_pgfault() succeeded!' \

+ 0
- 5
code/lab6/kern/mm/kmalloc.c View File

@ -186,14 +186,9 @@ static void slob_free(void *block, int size)
void check_slob(void) {
cprintf("check_slob() success\n");
}
void
slob_init(void) {
cprintf("use SLOB allocator\n");
check_slob();
}
inline void

+ 0
- 1
code/lab6/tools/grade.sh View File

@ -338,7 +338,6 @@ default_check() {
'PDE(001) fac00000-fb000000 00400000 -rw' \
' |-- PTE(000e0) faf00000-fafe0000 000e0000 urw' \
' |-- PTE(00001) fafeb000-fafec000 00001000 -rw' \
'check_slob() succeeded!' \
'check_vma_struct() succeeded!' \
'page fault at 0x00000100: K/W [no page found].' \
'check_pgfault() succeeded!' \

+ 0
- 5
code/lab7/kern/mm/kmalloc.c View File

@ -186,14 +186,9 @@ static void slob_free(void *block, int size)
void check_slob(void) {
cprintf("check_slob() success\n");
}
void
slob_init(void) {
cprintf("use SLOB allocator\n");
check_slob();
}
inline void

+ 0
- 1
code/lab7/tools/grade.sh View File

@ -338,7 +338,6 @@ default_check() {
'PDE(001) fac00000-fb000000 00400000 -rw' \
' |-- PTE(000e0) faf00000-fafe0000 000e0000 urw' \
' |-- PTE(00001) fafeb000-fafec000 00001000 -rw' \
'check_slob() succeeded!' \
'check_vma_struct() succeeded!' \
'page fault at 0x00000100: K/W [no page found].' \
'check_pgfault() succeeded!' \

+ 0
- 0
code/lab8/kern/fs/devs/dev.c View File


+ 0
- 0
code/lab8/kern/fs/devs/dev.h View File


+ 0
- 0
code/lab8/kern/fs/devs/dev_disk0.c View File


+ 0
- 0
code/lab8/kern/fs/devs/dev_stdin.c View File


+ 0
- 0
code/lab8/kern/fs/devs/dev_stdout.c View File


+ 0
- 0
code/lab8/kern/fs/file.c View File


+ 0
- 0
code/lab8/kern/fs/file.h View File


+ 0
- 0
code/lab8/kern/fs/fs.c View File


+ 0
- 0
code/lab8/kern/fs/fs.h View File


+ 0
- 0
code/lab8/kern/fs/iobuf.c View File


+ 0
- 0
code/lab8/kern/fs/iobuf.h View File


+ 0
- 0
code/lab8/kern/fs/sfs/bitmap.c View File


+ 0
- 0
code/lab8/kern/fs/sfs/bitmap.h View File


+ 0
- 0
code/lab8/kern/fs/sfs/sfs.c View File


+ 0
- 0
code/lab8/kern/fs/sfs/sfs.h View File


+ 0
- 0
code/lab8/kern/fs/sfs/sfs_fs.c View File


+ 0
- 0
code/lab8/kern/fs/sfs/sfs_inode.c View File


+ 0
- 0
code/lab8/kern/fs/sfs/sfs_io.c View File


+ 0
- 0
code/lab8/kern/fs/sfs/sfs_lock.c View File


+ 0
- 0
code/lab8/kern/fs/swap/swapfs.c View File


+ 0
- 0
code/lab8/kern/fs/swap/swapfs.h View File


+ 0
- 0
code/lab8/kern/fs/sysfile.c View File


+ 0
- 0
code/lab8/kern/fs/sysfile.h View File


+ 0
- 0
code/lab8/kern/fs/vfs/inode.c View File


+ 0
- 0
code/lab8/kern/fs/vfs/inode.h View File


+ 0
- 0
code/lab8/kern/fs/vfs/vfs.c View File


+ 0
- 0
code/lab8/kern/fs/vfs/vfs.h View File


+ 0
- 0
code/lab8/kern/fs/vfs/vfsdev.c View File


+ 0
- 0
code/lab8/kern/fs/vfs/vfsfile.c View File


+ 0
- 0
code/lab8/kern/fs/vfs/vfslookup.c View File


+ 0
- 0
code/lab8/kern/fs/vfs/vfspath.c View File


+ 0
- 5
code/lab8/kern/mm/kmalloc.c View File

@ -186,14 +186,9 @@ static void slob_free(void *block, int size)
void check_slob(void) {
cprintf("check_slob() success\n");
}
void
slob_init(void) {
cprintf("use SLOB allocator\n");
check_slob();
}
inline void

+ 0
- 0
code/lab8/libs/dirent.h View File


+ 4
- 1
code/lab8/tools/grade.sh View File

@ -314,11 +314,14 @@ quick_check() {
## kernel image
osimg=$(make_print ucoreimg)
## sfs image
sfsimg=$(make_print sfsimg)
## swap image
swapimg=$(make_print swapimg)
## set default qemu-options
qemuopts="-hda $osimg -drive file=$swapimg,media=disk,cache=writeback"
qemuopts="-hda $osimg -drive file=$swapimg,media=disk,cache=writeback -drive file=$sfsimg,media=disk,cache=writeback"
## set break-function, default is readline
brkfun=readline

+ 0
- 0
code/lab8/user/ls.c View File


+ 0
- 0
code/lab8/user/sh.c View File


Loading…
Cancel
Save