Compare commits

...

2 commits

Author SHA1 Message Date
37aa8c3b81 Merge branch 'main' of https://git.cdezselfhosted.pw/cdez/CS480-Projects 2024-04-21 10:30:18 -07:00
d5705e42a4 Started Memory operations on simulator
+- simulator.c
2024-03-17 14:09:20 -07:00
2 changed files with 40 additions and 0 deletions

Binary file not shown.

View file

@ -780,6 +780,46 @@ bool memManager(ProcessControlBlockLL *pcbList, MEMORY_SIGNALS memCode, int offs
return subFunctionSuccess;
}
/*
Name: memManager
Process: checks to make sure an allocate will be successful,
makes sure that an access will not segfault (or return segfault if it does),
and initializes memory and deallocates memory
Function Input/Parameters: PCBList (ProcessControlBlockLL *), memory code (MEMORY_SIGNALS),
offset (int), size (int), configuration data (ConfigDataType *)
Function Output/Parameters: none
Function Output/Returned: none?
Device Input/Device: none
Device Output/Device: none
Dependencies: ???
*/
void memManager(ProcessControlBlockLL *pcbList, MEMORY_SIGNALS memCode, int offset, int size, ConfigDataType *configPtr)
{
// switch case for each memory code
switch (memCode)
{
case MEMORY_INITIALIZE:
/* code */
break;
case MEMORY_ALLOCATE:
/* code */
break;
case MEMORY_ACCESS:
/* code */
break;
case MEMORY_DEALLOCATE:
/* code */
break;
default:
break;
}
// no return, void (temp)
}
/*
Name: runCPU
Process: runs the CPU operations for however long it takes