Browse Source

Merge pull request #7 from eternalNight/master

Fix priority test and lab8 makefile along with some minor maintenances
main
chyyuu 9 years ago
parent
commit
701c7b9a9f
39 changed files with 51 additions and 17 deletions
  1. +2
    -0
      .dir-locals.el
  2. +2
    -0
      .gitignore
  3. +0
    -0
      labcodes/lab1/.projectile
  4. +0
    -0
      labcodes/lab2/.projectile
  5. +0
    -0
      labcodes/lab3/.projectile
  6. +0
    -0
      labcodes/lab4/.projectile
  7. +0
    -0
      labcodes/lab5/.projectile
  8. +3
    -0
      labcodes/lab5/Makefile
  9. +0
    -0
      labcodes/lab6/.projectile
  10. +3
    -0
      labcodes/lab6/Makefile
  11. +1
    -1
      labcodes/lab6/kern/schedule/sched.h
  12. +1
    -1
      labcodes/lab6/user/priority.c
  13. +0
    -0
      labcodes/lab7/.projectile
  14. +3
    -0
      labcodes/lab7/Makefile
  15. +1
    -1
      labcodes/lab7/kern/schedule/sched.c
  16. +1
    -1
      labcodes/lab7/kern/schedule/sched.h
  17. +2
    -2
      labcodes/lab7/user/priority.c
  18. +0
    -0
      labcodes/lab8/.projectile
  19. +6
    -0
      labcodes/lab8/Makefile
  20. +1
    -1
      labcodes/lab8/kern/schedule/sched.h
  21. +2
    -2
      labcodes/lab8/user/priority.c
  22. +0
    -0
      labcodes_answer/lab1_result/.projectile
  23. +0
    -0
      labcodes_answer/lab2_result/.projectile
  24. +0
    -0
      labcodes_answer/lab3_result/.projectile
  25. +0
    -0
      labcodes_answer/lab4_result/.projectile
  26. +0
    -0
      labcodes_answer/lab5_result/.projectile
  27. +3
    -0
      labcodes_answer/lab5_result/Makefile
  28. +0
    -0
      labcodes_answer/lab6_result/.projectile
  29. +3
    -0
      labcodes_answer/lab6_result/Makefile
  30. +1
    -1
      labcodes_answer/lab6_result/kern/schedule/sched.h
  31. +1
    -1
      labcodes_answer/lab6_result/user/priority.c
  32. +0
    -0
      labcodes_answer/lab7_result/.projectile
  33. +3
    -0
      labcodes_answer/lab7_result/Makefile
  34. +1
    -1
      labcodes_answer/lab7_result/kern/schedule/sched.c
  35. +2
    -2
      labcodes_answer/lab7_result/user/priority.c
  36. +0
    -0
      labcodes_answer/lab8_result/.projectile
  37. +6
    -0
      labcodes_answer/lab8_result/Makefile
  38. +1
    -1
      labcodes_answer/lab8_result/kern/schedule/sched.c
  39. +2
    -2
      labcodes_answer/lab8_result/user/priority.c

+ 2
- 0
.dir-locals.el View File

@ -0,0 +1,2 @@
((c-mode . ((indent-tabs-mode . nil)
(c-basic-offset . 4))))

+ 2
- 0
.gitignore View File

@ -18,3 +18,5 @@ a.out
*.log
*.exe
chytesting
disk0
*.orig

+ 0
- 0
labcodes/lab1/.projectile View File


+ 0
- 0
labcodes/lab2/.projectile View File


+ 0
- 0
labcodes/lab3/.projectile View File


+ 0
- 0
labcodes/lab4/.projectile View File


+ 0
- 0
labcodes/lab5/.projectile View File


+ 3
- 0
labcodes/lab5/Makefile View File

@ -294,6 +294,9 @@ MAKEOPTS := --quiet --no-print-directory
run-%: build-%
$(V)$(QEMU) -parallel stdio $(QEMUOPTS) -serial null
run-nox-%: build-%
$(V)$(QEMU) -serial mon:stdio $(QEMUOPTS) -nographic
build-%: touch
$(V)$(MAKE) $(MAKEOPTS) "DEFS+=-DTEST=$* -DTESTSTART=$(RUN_PREFIX)$*_out_start -DTESTSIZE=$(RUN_PREFIX)$*_out_size"

+ 0
- 0
labcodes/lab6/.projectile View File


+ 3
- 0
labcodes/lab6/Makefile View File

@ -294,6 +294,9 @@ MAKEOPTS := --quiet --no-print-directory
run-%: build-%
$(V)$(QEMU) -parallel stdio $(QEMUOPTS) -serial null
run-nox-%: build-%
$(V)$(QEMU) -serial mon:stdio $(QEMUOPTS) -nographic
build-%: touch
$(V)$(MAKE) $(MAKEOPTS) "DEFS+=-DTEST=$* -DTESTSTART=$(RUN_PREFIX)$*_out_start -DTESTSIZE=$(RUN_PREFIX)$*_out_size"

+ 1
- 1
labcodes/lab6/kern/schedule/sched.h View File

@ -5,7 +5,7 @@
#include <list.h>
#include <skew_heap.h>
#define MAX_TIME_SLICE 20
#define MAX_TIME_SLICE 5
struct proc_struct;

+ 1
- 1
labcodes/lab6/user/priority.c View File

@ -5,7 +5,7 @@
#define TOTAL 5
/* to get enough accuracy, MAX_TIME (the running time of each process) should >1000 mseconds. */
#define MAX_TIME 2000
#define MAX_TIME 1000
unsigned int acc[TOTAL];
int status[TOTAL];
int pids[TOTAL];

+ 0
- 0
labcodes/lab7/.projectile View File


+ 3
- 0
labcodes/lab7/Makefile View File

@ -294,6 +294,9 @@ MAKEOPTS := --quiet --no-print-directory
run-%: build-%
$(V)$(QEMU) -parallel stdio $(QEMUOPTS) -serial null
run-nox-%: build-%
$(V)$(QEMU) -serial mon:stdio $(QEMUOPTS) -nographic
build-%: touch
$(V)$(MAKE) $(MAKEOPTS) "DEFS+=-DTEST=$* -DTESTSTART=$(RUN_PREFIX)$*_out_start -DTESTSIZE=$(RUN_PREFIX)$*_out_size"

+ 1
- 1
labcodes/lab7/kern/schedule/sched.c View File

@ -49,7 +49,7 @@ sched_init(void) {
sched_class = &default_sched_class;
rq = &__rq;
rq->max_time_slice = 20;
rq->max_time_slice = 5;
sched_class->init(rq);
cprintf("sched class: %s\n", sched_class->name);

+ 1
- 1
labcodes/lab7/kern/schedule/sched.h View File

@ -5,7 +5,7 @@
#include <list.h>
#include <skew_heap.h>
#define MAX_TIME_SLICE 20
#define MAX_TIME_SLICE 5
struct proc_struct;

+ 2
- 2
labcodes/lab7/user/priority.c View File

@ -5,7 +5,7 @@
#define TOTAL 5
/* to get enough accuracy, MAX_TIME (the running time of each process) should >1000 mseconds. */
#define MAX_TIME 2000
#define MAX_TIME 1000
#define SLEEP_TIME 400
unsigned int acc[TOTAL];
int status[TOTAL];
@ -39,7 +39,7 @@ main(void) {
spin_delay();
++ acc[i];
if(acc[i]%4000==0) {
if((time=gettime_msec())>MAX_TIME) {
if((time=gettime_msec())>MAX_TIME+SLEEP_TIME) {
cprintf("child pid %d, acc %d, time %d\n",getpid(),acc[i],time);
exit(acc[i]);
}

+ 0
- 0
labcodes/lab8/.projectile View File


+ 6
- 0
labcodes/lab8/Makefile View File

@ -273,6 +273,9 @@ $(foreach p,$(USER_BINS),$(eval $(call fscopy,$(p),$(SFSROOT)$(SLASH))))
$(SFSROOT):
if [ ! -d "$(SFSROOT)" ]; then mkdir $(SFSROOT); fi
$(SFSROOT):
$(V)$(MKDIR) $@
$(SFSIMG): $(SFSROOT) $(SFSBINS) | $(call totarget,mksfs)
$(V)dd if=/dev/zero of=$@ bs=1M count=128
@$(call totarget,mksfs) $@ $(SFSROOT)
@ -340,6 +343,9 @@ run-%: build-%
sh-%: script-%
$(V)$(QEMU) -parallel stdio $(QEMUOPTS) -serial null
run-nox-%: build-%
$(V)$(QEMU) -serial mon:stdio $(QEMUOPTS) -nographic
build-%: touch
$(V)$(MAKE) $(MAKEOPTS) "DEFS+=-DTEST=$*"

+ 1
- 1
labcodes/lab8/kern/schedule/sched.h View File

@ -5,7 +5,7 @@
#include <list.h>
#include <skew_heap.h>
#define MAX_TIME_SLICE 20
#define MAX_TIME_SLICE 5
struct proc_struct;

+ 2
- 2
labcodes/lab8/user/priority.c View File

@ -5,7 +5,7 @@
#define TOTAL 5
/* to get enough accuracy, MAX_TIME (the running time of each process) should >1000 mseconds. */
#define MAX_TIME 2000
#define MAX_TIME 1000
#define SLEEP_TIME 400
unsigned int acc[TOTAL];
int status[TOTAL];
@ -39,7 +39,7 @@ main(void) {
spin_delay();
++ acc[i];
if(acc[i]%4000==0) {
if((time=gettime_msec())>MAX_TIME) {
if((time=gettime_msec())>SLEEP_TIME+MAX_TIME) {
cprintf("child pid %d, acc %d, time %d\n",getpid(),acc[i],time);
exit(acc[i]);
}

+ 0
- 0
labcodes_answer/lab1_result/.projectile View File


+ 0
- 0
labcodes_answer/lab2_result/.projectile View File


+ 0
- 0
labcodes_answer/lab3_result/.projectile View File


+ 0
- 0
labcodes_answer/lab4_result/.projectile View File


+ 0
- 0
labcodes_answer/lab5_result/.projectile View File


+ 3
- 0
labcodes_answer/lab5_result/Makefile View File

@ -285,6 +285,9 @@ MAKEOPTS := --quiet --no-print-directory
run-%: build-%
$(V)$(QEMU) -parallel stdio $(QEMUOPTS) -serial null
run-nox-%: build-%
$(V)$(QEMU) -serial mon:stdio $(QEMUOPTS) -nographic
build-%: touch
$(V)$(MAKE) $(MAKEOPTS) "DEFS+=-DTEST=$* -DTESTSTART=$(RUN_PREFIX)$*_out_start -DTESTSIZE=$(RUN_PREFIX)$*_out_size"

+ 0
- 0
labcodes_answer/lab6_result/.projectile View File


+ 3
- 0
labcodes_answer/lab6_result/Makefile View File

@ -285,6 +285,9 @@ MAKEOPTS := --quiet --no-print-directory
run-%: build-%
$(V)$(QEMU) -parallel stdio $(QEMUOPTS) -serial null
run-nox-%: build-%
$(V)$(QEMU) -serial mon:stdio $(QEMUOPTS) -nographic
build-%: touch
$(V)$(MAKE) $(MAKEOPTS) "DEFS+=-DTEST=$* -DTESTSTART=$(RUN_PREFIX)$*_out_start -DTESTSIZE=$(RUN_PREFIX)$*_out_size"

+ 1
- 1
labcodes_answer/lab6_result/kern/schedule/sched.h View File

@ -5,7 +5,7 @@
#include <list.h>
#include <skew_heap.h>
#define MAX_TIME_SLICE 20
#define MAX_TIME_SLICE 5
struct proc_struct;

+ 1
- 1
labcodes_answer/lab6_result/user/priority.c View File

@ -5,7 +5,7 @@
#define TOTAL 5
/* to get enough accuracy, MAX_TIME (the running time of each process) should >1000 mseconds. */
#define MAX_TIME 2000
#define MAX_TIME 1000
unsigned int acc[TOTAL];
int status[TOTAL];
int pids[TOTAL];

+ 0
- 0
labcodes_answer/lab7_result/.projectile View File


+ 3
- 0
labcodes_answer/lab7_result/Makefile View File

@ -285,6 +285,9 @@ MAKEOPTS := --quiet --no-print-directory
run-%: build-%
$(V)$(QEMU) -parallel stdio $(QEMUOPTS) -serial null
run-nox-%: build-%
$(V)$(QEMU) -serial mon:stdio $(QEMUOPTS) -nographic
build-%: touch
$(V)$(MAKE) $(MAKEOPTS) "DEFS+=-DTEST=$* -DTESTSTART=$(RUN_PREFIX)$*_out_start -DTESTSIZE=$(RUN_PREFIX)$*_out_size"

+ 1
- 1
labcodes_answer/lab7_result/kern/schedule/sched.c View File

@ -48,7 +48,7 @@ sched_init(void) {
sched_class = &default_sched_class;
rq = &__rq;
rq->max_time_slice = 20;
rq->max_time_slice = 5;
sched_class->init(rq);
cprintf("sched class: %s\n", sched_class->name);

+ 2
- 2
labcodes_answer/lab7_result/user/priority.c View File

@ -5,7 +5,7 @@
#define TOTAL 5
/* to get enough accuracy, MAX_TIME (the running time of each process) should >1000 mseconds. */
#define MAX_TIME 2000
#define MAX_TIME 1000
#define SLEEP_TIME 400
unsigned int acc[TOTAL];
int status[TOTAL];
@ -39,7 +39,7 @@ main(void) {
spin_delay();
++ acc[i];
if(acc[i]%4000==0) {
if((time=gettime_msec())>MAX_TIME) {
if((time=gettime_msec())>MAX_TIME+SLEEP_TIME) {
cprintf("child pid %d, acc %d, time %d\n",getpid(),acc[i],time);
exit(acc[i]);
}

+ 0
- 0
labcodes_answer/lab8_result/.projectile View File


+ 6
- 0
labcodes_answer/lab8_result/Makefile View File

@ -261,6 +261,9 @@ endef
$(foreach p,$(USER_BINS),$(eval $(call fscopy,$(p),$(SFSROOT)$(SLASH))))
$(SFSROOT):
$(V)$(MKDIR) $@
$(SFSIMG): $(SFSROOT) $(SFSBINS) | $(call totarget,mksfs)
$(V)dd if=/dev/zero of=$@ bs=1M count=128
@$(call totarget,mksfs) $@ $(SFSROOT)
@ -332,6 +335,9 @@ run-%: build-%
sh-%: script-%
$(V)$(QEMU) -parallel stdio $(QEMUOPTS) -serial null
run-nox-%: build-%
$(V)$(QEMU) -serial mon:stdio $(QEMUOPTS) -nographic
build-%: touch
$(V)$(MAKE) $(MAKEOPTS) "DEFS+=-DTEST=$*"

+ 1
- 1
labcodes_answer/lab8_result/kern/schedule/sched.c View File

@ -48,7 +48,7 @@ sched_init(void) {
sched_class = &default_sched_class;
rq = &__rq;
rq->max_time_slice = 20;
rq->max_time_slice = 5;
sched_class->init(rq);
cprintf("sched class: %s\n", sched_class->name);

+ 2
- 2
labcodes_answer/lab8_result/user/priority.c View File

@ -5,7 +5,7 @@
#define TOTAL 5
/* to get enough accuracy, MAX_TIME (the running time of each process) should >1000 mseconds. */
#define MAX_TIME 2000
#define MAX_TIME 1000
#define SLEEP_TIME 400
unsigned int acc[TOTAL];
int status[TOTAL];
@ -39,7 +39,7 @@ main(void) {
spin_delay();
++ acc[i];
if(acc[i]%4000==0) {
if((time=gettime_msec())>MAX_TIME) {
if((time=gettime_msec())>SLEEP_TIME+MAX_TIME) {
cprintf("child pid %d, acc %d, time %d\n",getpid(),acc[i],time);
exit(acc[i]);
}

Loading…
Cancel
Save