Started Memory operations on simulator

+- simulator.c
This commit is contained in:
Charles Descamps 2024-03-17 14:09:20 -07:00
parent ee95d19bfe
commit d5705e42a4
4 changed files with 97 additions and 1 deletions

View file

@ -17,6 +17,13 @@ typedef enum{
PROCESS_STATE_TERMINATED
} PROCESS_STATES;
typedef enum{
MEMORY_INITIALIZE = 0,
MEMORY_ACCESS,
MEMORY_ALLOCATE,
MEMORY_DEALLOCATE
} MEMORY_SIGNALS;
typedef struct ProcessControlBlockStruct
{
int uniquePid;
@ -37,6 +44,10 @@ typedef struct ProcessControlBlockStruct
// see how many are left.
// also need a time left state here?
double timeLeft;
// allocated memory array (stores the offsets)
int *allocatedMemOffsets;
// allocated memory array sizes (stores the sizes for each offset)
int *allocatedMemSizes;
// connect to the next process control block here
struct ProcessControlBlockStruct *nextPtr;
} ProcessControlBlock;