aboutsummaryrefslogtreecommitdiff
path: root/sys_sppt.c
diff options
context:
space:
mode:
authorBen Burwell <ben@benburwell.com>2015-04-01 20:26:26 -0400
committerBen Burwell <ben@benburwell.com>2015-04-01 20:26:26 -0400
commite282a861d5868868940b449681f2ee5da3e439e8 (patch)
treedc1fb0b3708d717e6c3695fffc77d5df7a0934a8 /sys_sppt.c
parente781fb26fdd422ea72c3a0eeba817e4faa5f663b (diff)
as of 2013-10-292013-10-29
Diffstat (limited to 'sys_sppt.c')
-rw-r--r--sys_sppt.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/sys_sppt.c b/sys_sppt.c
index be03d7d..80ae62d 100644
--- a/sys_sppt.c
+++ b/sys_sppt.c
@@ -24,7 +24,7 @@ void interrupt (*vect60)(); /* Storage for DOS int 60h */
void sys_init()
{
- /* set up interrupt vector for MPX sys_calls */
+ /* set up interrupt vector for MPX sys_calls */
vect60 = getvect(0x60);
setvect(0x60,&sys_call);
@@ -42,13 +42,15 @@ void sys_exit()
void interrupt dispatch()
{
- /* your dispatcher code */
- if (ready_queue == NULL) {
- sys_exit();
+ /* MOD 4 dispatch */
+ do {
+ cop = cop -> next;
+ } while (cop != NULL && cop->suspend == SUSPENDED);
+
+ if (cop == NULL) {
+ _SP = sp_save;
} else {
- cop = ready_queue; // make the front of the queue the running process
- remove_pcb(&ready_queue, cop);
- _SP = cop->stack_ptr;
+ _SP = cop -> stack_ptr;
}
}
@@ -75,8 +77,8 @@ void interrupt sys_call()
cop->parm_add = parm_add;
// find out if the process wants to die... and kill it
- if(parm_add->op_number != EXIT_CODE) {
- insert_pcb(&ready_queue, cop, 0);
+ if (parm_add->op_number == EXIT_CODE) {
+ cop->suspend = SUSPENDED;
}
dispatch();