Skip to content
This repository has been archived by the owner on Sep 19, 2022. It is now read-only.

Commit

Permalink
fixed stuff:
Browse files Browse the repository at this point in the history
  • Loading branch information
specialfish9 committed Apr 12, 2022
1 parent cae6ade commit 0551140
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 32 deletions.
15 changes: 1 addition & 14 deletions config/term0.umps
Original file line number Diff line number Diff line change
@@ -1,14 +1 @@
Init passup vector...done!
Init data structures...done!
Loading interval timer...done!
Creating init process...done!
Starting init process...
[Scheduler]Chosing next process...
[Scheduler]Loading low priority process with PID 1
EXCEPTION HANDLER FIRED with code 8
Handling syscall 0
EXCEPTION HANDLER FIRED with code 8
Handling syscall -4
EXCEPTION HANDLER FIRED with code 8
Handling syscall -3
kernel panic()
p
14 changes: 6 additions & 8 deletions src/exceptions.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <umps3/umps/types.h>

extern pcb_t *act_proc;
extern size_tt sb_procs;

/**
Crea un nuovo processo come figlio del chiamante.
Expand Down Expand Up @@ -56,12 +57,9 @@ int handle_syscall(void)
arg2 = act_proc->p_s.reg_a2;
arg3 = act_proc->p_s.reg_a3;

//print1("Handling syscall ");
//print1_int(number);

kprint("NSYS");
kprint_int(number);
kprint("|");
kprint("NSYS");
kprint_int(number);
kprint("|");


switch (number) {
Expand Down Expand Up @@ -225,7 +223,7 @@ static void wait_for_clock(void)

kprint("\n---BLOCKING ACTIVE PROXESS ON ASL");
/*estraggo un processo dalla coda degli attivi*/
pcb_t *tmp = get_act_proc();
pcb_t *tmp = act_proc;

/*blocco il processo sul semaforo ricevuto come parametro*/
//tmp->p_semAdd = (int *)sem_it; /* TODO 4 yonas */
Expand Down Expand Up @@ -258,4 +256,4 @@ int passup_or_die(size_tt kind) {

/* never reached */
return 1;
}
}
9 changes: 3 additions & 6 deletions src/scheduler.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@
#include <umps3/umps/libumps.h>
#include <umps3/umps/types.h>

#define LOG(s) //print1("[Scheduler]" s)
#define LOG(s) kprint("S>" s)

pcb_t *act_proc;

size_tt procs_count;
size_tt sb_procs;
size_tt sb_procs;
static size_tt procs_count;
static struct list_head l_queue;
static struct list_head h_queue;
static unsigned int pid_count = 1;
Expand Down Expand Up @@ -166,5 +165,3 @@ inline pcb_t *rm_proc(pcb_t *const pcb, const unsigned int priority)
}
return NULL;
}

inline pcb_t *get_act_proc() { return act_proc; }
7 changes: 3 additions & 4 deletions src/scheduler.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

#include "pandos_types.h"

extern size_tt procs_count;
extern size_tt sb_procs;

extern pcb_t *act_proc;
extern size_tt sb_procs;

extern void init_scheduler(void);

Expand Down Expand Up @@ -55,7 +55,6 @@ extern pcb_t *dequeue_proc(const unsigned int priority);
* */
extern pcb_t *rm_proc(pcb_t *const pcb, const unsigned int priority);

/*restituisce il pcb processo attualmente attivo*/
extern pcb_t *get_act_proc(void);
extern void block_act_proc(int *const sem_addr);

#endif

0 comments on commit 0551140

Please sign in to comment.