/* * task-1-29994705.h * * Alexander Occhipinti * Student ID: 29994705 * Created: 15 Oct 2020 * Modified: 15 Oct 2020 * * The header file for task-1-29994705.c * See task-1-29994705.c for documentation * */ #ifndef _TASK1_H #define _TASK1_H #define DEFAULT_INPUT_PATH "process-data.txt" // Default file path to read the process PCBs from before simulation #define RESULT_FILE_PATH "scheduler-result.txt" // Default file path for the results after simulation #define MAX_PATH_SIZE 256 #define MAX_NUM_PROCS 10 #define WAIT_PER_CYCLE 1 /* Special enumerated data type for process state */ typedef enum { UNENTERED, READY, RUNNING, EXIT } process_state_t; /* C data structure used as process control block. * The scheduler should create one instance * per running process in the system */ typedef struct { char process_name[11]; // a string that identifies the process /* Times measured in seconds */ int entryTime; // time process entered system int serviceTime; // the total CPU time required by the process int deadline; // The deadline of the process (for analysis) int remainingTime; // remaining service time until completion int timeStarted; // the time the process entered the RUNNING state int timeFinished; // the time the process entered the EXIT state (i.e. it completed) process_state_t state; // current process state (e.g. READY) } pcb_t; #endif