/* file: sos.h * * SOS is the Simple Operating System for STM hardware * ***************************************************/ #ifndef H_SOS #define H_SOS #define NAMESIZE 32 /* maximum size of process name */ /**************************************************** * Global variables for SOS ****************************************************/ extern int maxinst, /* Maximum number of instructions */ procindex; /* Index of process */ extern char procname[NAMESIZE]; /* name of process */ /**************************************************** * parse_flags(argc, argv) * Extract the flags from the command line: base, debug, and maxinst. * The index of the STM filename in the command is returned as the value. ****************************************************/ extern int parse_flags(int argc, char * argv[]); /**************************************************** * Load the STML code into memory * It is assumed that STML files are correctly formatted; * therefore, this does no error checking * NOTE: You are allowed to change this function for project 1; * however, there is no need to do so. ****************************************************/ extern void load_stm(char filename[]); /* Set global flags, load the STM file, initialize the STM process */ extern void initialize(int argc, char* argv[]); /* Execute a trap */ extern void exec_trap(); /* sos version */ extern void SOSversion(); #endif // END of sos.h