Merge pull request #7 from eternalNight/master
Fix priority test and lab8 makefile along with some minor maintenances
This commit is contained in:
commit
701c7b9a9f
2
.dir-locals.el
Normal file
2
.dir-locals.el
Normal file
@ -0,0 +1,2 @@
|
||||
((c-mode . ((indent-tabs-mode . nil)
|
||||
(c-basic-offset . 4))))
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -18,3 +18,5 @@ a.out
|
||||
*.log
|
||||
*.exe
|
||||
chytesting
|
||||
disk0
|
||||
*.orig
|
||||
|
0
labcodes/lab1/.projectile
Normal file
0
labcodes/lab1/.projectile
Normal file
0
labcodes/lab2/.projectile
Normal file
0
labcodes/lab2/.projectile
Normal file
0
labcodes/lab3/.projectile
Normal file
0
labcodes/lab3/.projectile
Normal file
0
labcodes/lab4/.projectile
Normal file
0
labcodes/lab4/.projectile
Normal file
0
labcodes/lab5/.projectile
Normal file
0
labcodes/lab5/.projectile
Normal 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
labcodes/lab6/.projectile
Normal file
0
labcodes/lab6/.projectile
Normal 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"
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include <list.h>
|
||||
#include <skew_heap.h>
|
||||
|
||||
#define MAX_TIME_SLICE 20
|
||||
#define MAX_TIME_SLICE 5
|
||||
|
||||
struct proc_struct;
|
||||
|
||||
|
@ -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
labcodes/lab7/.projectile
Normal file
0
labcodes/lab7/.projectile
Normal 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"
|
||||
|
||||
|
@ -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);
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include <list.h>
|
||||
#include <skew_heap.h>
|
||||
|
||||
#define MAX_TIME_SLICE 20
|
||||
#define MAX_TIME_SLICE 5
|
||||
|
||||
struct proc_struct;
|
||||
|
||||
|
@ -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
labcodes/lab8/.projectile
Normal file
0
labcodes/lab8/.projectile
Normal 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=$*"
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include <list.h>
|
||||
#include <skew_heap.h>
|
||||
|
||||
#define MAX_TIME_SLICE 20
|
||||
#define MAX_TIME_SLICE 5
|
||||
|
||||
struct proc_struct;
|
||||
|
||||
|
@ -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
labcodes_answer/lab1_result/.projectile
Normal file
0
labcodes_answer/lab1_result/.projectile
Normal file
0
labcodes_answer/lab2_result/.projectile
Normal file
0
labcodes_answer/lab2_result/.projectile
Normal file
0
labcodes_answer/lab3_result/.projectile
Normal file
0
labcodes_answer/lab3_result/.projectile
Normal file
0
labcodes_answer/lab4_result/.projectile
Normal file
0
labcodes_answer/lab4_result/.projectile
Normal file
0
labcodes_answer/lab5_result/.projectile
Normal file
0
labcodes_answer/lab5_result/.projectile
Normal 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
labcodes_answer/lab6_result/.projectile
Normal file
0
labcodes_answer/lab6_result/.projectile
Normal 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"
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include <list.h>
|
||||
#include <skew_heap.h>
|
||||
|
||||
#define MAX_TIME_SLICE 20
|
||||
#define MAX_TIME_SLICE 5
|
||||
|
||||
struct proc_struct;
|
||||
|
||||
|
@ -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
labcodes_answer/lab7_result/.projectile
Normal file
0
labcodes_answer/lab7_result/.projectile
Normal 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"
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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
labcodes_answer/lab8_result/.projectile
Normal file
0
labcodes_answer/lab8_result/.projectile
Normal 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=$*"
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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…
Reference in New Issue
Block a user