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

This commit is contained in:
chyyuu 2013-09-17 10:34:45 +08:00
parent 54410feba2
commit 1851498df5
47 changed files with 50 additions and 34 deletions

4
code/autobuild.sh Executable file
View File

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

41
code/autotest.sh Executable file
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

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

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

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!' \

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

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!' \

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

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!' \

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

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
code/lab8/kern/fs/devs/dev.c Executable file → Normal file
View File

0
code/lab8/kern/fs/devs/dev.h Executable file → Normal file
View File

0
code/lab8/kern/fs/devs/dev_disk0.c Executable file → Normal file
View File

0
code/lab8/kern/fs/devs/dev_stdin.c Executable file → Normal file
View File

0
code/lab8/kern/fs/devs/dev_stdout.c Executable file → Normal file
View File

0
code/lab8/kern/fs/file.c Executable file → Normal file
View File

0
code/lab8/kern/fs/file.h Executable file → Normal file
View File

0
code/lab8/kern/fs/fs.c Executable file → Normal file
View File

0
code/lab8/kern/fs/fs.h Executable file → Normal file
View File

0
code/lab8/kern/fs/iobuf.c Executable file → Normal file
View File

0
code/lab8/kern/fs/iobuf.h Executable file → Normal file
View File

0
code/lab8/kern/fs/sfs/bitmap.c Executable file → Normal file
View File

0
code/lab8/kern/fs/sfs/bitmap.h Executable file → Normal file
View File

0
code/lab8/kern/fs/sfs/sfs.c Executable file → Normal file
View File

0
code/lab8/kern/fs/sfs/sfs.h Executable file → Normal file
View File

0
code/lab8/kern/fs/sfs/sfs_fs.c Executable file → Normal file
View File

0
code/lab8/kern/fs/sfs/sfs_inode.c Executable file → Normal file
View File

0
code/lab8/kern/fs/sfs/sfs_io.c Executable file → Normal file
View File

0
code/lab8/kern/fs/sfs/sfs_lock.c Executable file → Normal file
View File

0
code/lab8/kern/fs/swap/swapfs.c Executable file → Normal file
View File

0
code/lab8/kern/fs/swap/swapfs.h Executable file → Normal file
View File

0
code/lab8/kern/fs/sysfile.c Executable file → Normal file
View File

0
code/lab8/kern/fs/sysfile.h Executable file → Normal file
View File

0
code/lab8/kern/fs/vfs/inode.c Executable file → Normal file
View File

0
code/lab8/kern/fs/vfs/inode.h Executable file → Normal file
View File

0
code/lab8/kern/fs/vfs/vfs.c Executable file → Normal file
View File

0
code/lab8/kern/fs/vfs/vfs.h Executable file → Normal file
View File

0
code/lab8/kern/fs/vfs/vfsdev.c Executable file → Normal file
View File

0
code/lab8/kern/fs/vfs/vfsfile.c Executable file → Normal file
View File

0
code/lab8/kern/fs/vfs/vfslookup.c Executable file → Normal file
View File

0
code/lab8/kern/fs/vfs/vfspath.c Executable file → Normal file
View File

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
code/lab8/libs/dirent.h Executable file → Normal file
View File

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
code/lab8/user/ls.c Executable file → Normal file
View File

0
code/lab8/user/sh.c Executable file → Normal file
View File