/********************************************************************** Project 2: Multiprogramming Part I SECTION 0102 By: Mohamed S. Aboutabl e-mail: aboutabl@cs.umd.edu File: proc.c Creadted on: 10/3/1992 Contents: User Processes to be run concurrently 1. init() : Initial process, creates other ones & terminates 2..4 process_a() , _b() , and _c() are three examplar processes that are to be run concurently 5. wait() : busy wait for a key to be pressed **********************************************************************/ #include "cmsc412.h" #include "keyboard.h" #define NULL 0 #define DELAY 5000 int Process_a ( int , char ** ) ; int Process_b ( int , char ** ) ; int Process_c ( int , char ** ) ; int Process_d ( int , char ** ) ; int Process_e ( int , char ** ) ; void Wait(void) ; /*-------------------------------------------------------------------*/ int Init( int argc , char ** argv ) { int i , /* loop index */ scr_sem,/* sid of screen semaphore */ id , /* ID of child process */ count ; /* child process's argc */ char * argument[10] ; /* pointer to a maximum of 10 arguments */ scr_sem = Create_semaphore ( "screen" , 1 ) ; P ( scr_sem ) ; Cprintf ("\n*************This is the init procedure*********\n"); Cprintf ("I have %2d arguments. They are \n" , argc ); for ( i=0 ; i