Specifiche phase 2 2016/17

From Sistemi Operativi
Revision as of 13:56, 30 March 2017 by Renzo (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

<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, 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 * </verbatim>