Savepoint available

This commit is contained in:
Charles Descamps 2024-03-18 16:40:32 -07:00
parent 67df0ceeaf
commit 6446272063
4 changed files with 17 additions and 4 deletions

View file

@ -1,4 +1,4 @@
0.000001, OS: Simulator start
0.000000, OS: Simulator start
READY state from NEW state
ate

Binary file not shown.

View file

@ -440,12 +440,23 @@ void memManager(ProcessControlBlockLL *pcbList, MEMORY_SIGNALS memCode, int offs
break;
case MEMORY_DEALLOCATE:
if (memDisplay)
{
//
printf("--------------------------------------------------\n");
printf("After memory deallocate\n");
printf("Deallocated memory chunk.\n");
printf("--------------------------------------------------\n");
}
break;
case MEMORY_CLEAR:
if (memDisplay)
{
//
printf("--------------------------------------------------\n");
printf("After memory clear\n");
printf("No memory configured");
printf("No memory configured\n");
printf("--------------------------------------------------\n");
}
break;
@ -590,7 +601,6 @@ void runSim(ConfigDataType *configPtr, OpCodeType *metaDataMstrPtr)
// Operating System start timer goes here, log it.
sprintf(simulatorOutput, "%f, OS: Simulator start\n", accessTimer(LAP_TIMER, timeStringy));
logOutput(configPtr, simulatorOutput, false);
// int variable for process to run
int currentPid;
// create the process list with createProcessList, store the pointed to address
@ -652,6 +662,8 @@ void runSim(ConfigDataType *configPtr, OpCodeType *metaDataMstrPtr)
pcbPtr = pcbList->headPtr;
}
pthread_join(cpuThread, NULL);
// deallocate all the memory for each process.
memManager(pcbList, MEMORY_CLEAR, memoryOffset, memorySize, configPtr);
sprintf(simulatorOutput, "%f, OS: System Stop\n", accessTimer(LAP_TIMER, timeStringy));
logOutput(configPtr, simulatorOutput, false);
sprintf(simulatorOutput, "%f, OS: Simulation End\n", accessTimer(LAP_TIMER, timeStringy));

View file

@ -21,6 +21,7 @@ typedef enum{
MEMORY_INITIALIZE = 0,
MEMORY_ACCESS,
MEMORY_ALLOCATE,
MEMORY_CLEAR,
MEMORY_DEALLOCATE
} MEMORY_SIGNALS;