Difference between revisions of "Specifiche phase 2 2016/17"

From Sistemi Operativi
Jump to navigation Jump to search
(Created page with "<verbatim> ==System call== === send === int send(struct tcb_t *dest, uintptr_t msg) a0 = 1, a1 = dest. a2 = msg === recv === struct tcb_t *recv(struct tcb_t *src, uintp...")
 
m
Line 1: Line 1:
<verbatim>
+
<pre>
 
==System call==
 
==System call==
 
=== send ===
 
=== send ===
Line 34: Line 34:
 
GET_PROCESS N, struct tcb_t * -> struct pcb_t *
 
GET_PROCESS N, struct tcb_t * -> struct pcb_t *
 
GET_THREAD N+1 -> struct tcb_t *
 
GET_THREAD N+1 -> struct tcb_t *
</verbatim>
+
</pre>

Revision as of 13:57, 30 March 2017

==System call==
=== send ===
  int send(struct tcb_t *dest, uintptr_t msg)
  a0 = 1, a1 = dest. a2 = msg 
=== recv ===
  struct tcb_t *recv(struct tcb_t *src, uintptr_t *pmsg)
  a0 = 2, a1 = src, a2 = *pmsg

NB: system call 1 e 2 possono essere chiamate solo in kernel mode
system call 0 e' errore
system call non 1 o 2 vengono trasformate in messaggi al thread definito tramite SETSYSMGR se esiste altrimenti msg SETPGMMGR se esiste
altrimenti TERMINATE_THREAD

==servizi della SSI==

(solo da kernel mode)
CREATE_PROCESS  1, state_t -> struct tcb_t *
CREATE_THREAD 2,  state_t -> struct tcb_*
TERMINATE_PROCESS 3
TERMINATE_THREAD 4
(se e' l'ultimo thread diventa come TERMINATE_PROCESS)
SETPGMMGR 5, struct tcb_t *
SETTLBMGR 6, struct tcb_t *
SETSYSMGR 7, struct tcb_t *
(una volta sola per processo, TERMINATE_PROCESS alla seconda chiamata).
sender tcb_t che ha causato la trap, msg codifica della trap.
GETCPUTIME 8 -> time
(tempo relativo al proc)
WAIT_FOR_CLOCK 9
WAIT_FOR_IO 10 DEVICE_REG_ADDR, COMMAND -> status


GET_PROCESS N, struct tcb_t * -> struct pcb_t *
GET_THREAD N+1 -> struct tcb_t *