isn't working on my VM for some reason. will try on other devices.

This commit is contained in:
Charles Descamps 2024-04-21 16:12:29 -07:00
parent a7506f82c8
commit 2c2f2cf848
5 changed files with 616 additions and 93 deletions

View file

@ -17,6 +17,32 @@ bool accessMemory(ProcessControlBlock *singlePCB, int offset, int size)
return true;
}
/*
Name: addLog
Process: allocates the memory for the log, ...
Function Input/Parameters: source log (logFile)
Function Output/Parameters: none
Function Output/Returned: filled PCB (logFile *)
Device Input/Device: none
Device Output/Device: none
Dependencies: malloc, sizeof, ???
*/
logFile *addLog(const logFile source)
{
// declare a pointer to working node
logFile *workingNode;
// make some space that the pointer is pointing to
workingNode = malloc(sizeof(logFile));
// make some space for the string data
// workingNode->stringData = malloc(sizeof(source.stringData));
// get each value from the source, and set their values
copyString(workingNode->stringData, source.stringData);
// make sure to set the next pointer to NULL!
workingNode->nextPtr = NULL;
// return workingNode
return workingNode;
}
/*
Name: addProcess
Process: allocates the memory for the pcb, grabs the data from the created PCB,
@ -77,6 +103,27 @@ bool allocMemory(ProcessControlBlock *singlePCB, int offset, int size, int array
return true;
}
/*
Name: createFileLogList
Process: initializes the logging file struct
Function Input/Parameters: none
Function Output/Parameters: none
Function Output/Returned: head pointer to the logfile struct
Device Input/Device: none
Device Output/Device: none
Dependencies: malloc, sizeof, ???
*/
logFileLL *createFileLogList()
{
// allocate and create the logFileLL using malloc and size of
logFileLL *headBlock;
headBlock = malloc(sizeof(logFileLL));
// set the head pointer to NULL
headBlock->headPtr = NULL;
// return headBlock
return headBlock;
}
/*
Name: createProcessList
Process: reads through the opcode struct to fill out the linked list of PCBs
@ -122,6 +169,26 @@ bool deallocMemory(ProcessControlBlock *singlePCB, int arraySize)
return true;
}
/*
Name: destroyFileLogList
Process: deallocates memory used for the linked list struct
Function Input/Parameters: head pointer to linked list (logFileLL *)
Function Output/Parameters: none
Function Output/Returned: NULL
Device Input/Device: none
Device Output/Device: none
Dependencies: free, destroyFileLogHelper, ???
*/
logFileLL *destroyFileLogList(logFileLL *linkedListPtr)
{
// call the first destroyFileLogHelper
destroyFileLogHelper(linkedListPtr->headPtr);
// free the rest of the struct
free(linkedListPtr);
// return null
return NULL;
}
/*
Name: destroyProcessList
Process: deallocates memory used for the linked list struct
@ -142,6 +209,30 @@ ProcessControlBlockLL *destroyProcessList(ProcessControlBlockLL *linkedListPtr)
return NULL;
}
/*
Name: destroyFileLogHelper
Process: recursively clears the logfile linked list struct, freeing the struct
Function Input/Parameters: head pointer to logfile list (logFile *)
Function Output/Parameters: none
Function Output/Returned: NULL
Device Input/Device: none
Device Output/Device: none
Dependencies: free, destroyFileLogHelper(recursively), ???
*/
logFile *destroyFileLogHelper(logFile *nodePtr)
{
// check to see if the pointer is NOT null
if (nodePtr != NULL)
{
// if not null, move to the next pointer (recurse)
nodePtr->nextPtr = destroyFileLogHelper(nodePtr->nextPtr);
}
// free the 'parent' node
free(nodePtr);
// return null
return NULL;
}
/*
Name: destroyProcessListHelper
Process: recursively clears the PCB linked list struct, freeing the struct
@ -384,48 +475,65 @@ Device Input/Device: none
Device Output/Device: none
Dependencies: fprintf, ???
*/
void logOutput(ConfigDataType *configPtr, char *logStr, bool isEnd)
logFileLL *logOutput(ConfigDataType *configPtr, char *logStr, bool isEnd, logFileLL *logPtr)
{
if(configPtr->logToCode == LOGTO_BOTH_CODE)
logFile toLog;
logFile *logStrPtr;
logFile *wkgLogPtr;
logFile *prevWkgLogPtr;
wkgLogPtr = logPtr->headPtr;
// close the file, if at the end.
if (isEnd)
{
//
if (configPtr->logToCode == LOGTO_FILE_CODE)
{
//
printf("\nSimulator has output to the file '%s'.\n", configPtr->logToFileName);
}
FILE *fileWritePtr;
fileWritePtr = fopen(configPtr->logToFileName, "w+");
fileWritePtr = fopen(configPtr->logToFileName, "w");
if (fileWritePtr != NULL)
{
fprintf(fileWritePtr, "%s", logStr);
fprintf(stdout, "%s", logStr);
while (wkgLogPtr != NULL)
{
fprintf(fileWritePtr, "%s", wkgLogPtr->stringData);
wkgLogPtr = wkgLogPtr->nextPtr;
}
}
// no return, void
// close the file, if at the end.
if (isEnd)
{
fclose(fileWritePtr);
}
// fclose(fileWritePtr);
}
else if(configPtr->logToCode == LOGTO_FILE_CODE)
{
//
printf("\nSimulator will output to a file.\n");
FILE *fileWritePtr;
fileWritePtr = fopen(configPtr->logToFileName, "w+");
if (fileWritePtr != NULL)
{
fprintf(fileWritePtr, "%s", logStr);
}
// no return, void
// close the file, if at the end.
if (isEnd)
{
fclose(fileWritePtr);
}
// fclose(fileWritePtr);
fclose(fileWritePtr);
}
else
{
fprintf(stdout, "%s", logStr);
// need to add the string to the end of the LL.
if(configPtr->logToCode == LOGTO_BOTH_CODE || configPtr->logToCode == LOGTO_FILE_CODE)
{
//
copyString(toLog.stringData, logStr);
toLog.nextPtr = NULL;
while (wkgLogPtr != NULL)
{
prevWkgLogPtr = wkgLogPtr;
wkgLogPtr = wkgLogPtr->nextPtr;
}
if (logPtr->headPtr == NULL)
{
logPtr->headPtr = addLog(toLog);
}
if (wkgLogPtr == NULL)
{
logStrPtr = addLog(toLog);
// prevWkgLogPtr->nextPtr = addLog(toLog);
// prevWkgLogPtr->nextPtr = logStrPtr;
wkgLogPtr = logStrPtr;
}
}
if (configPtr->logToCode == LOGTO_BOTH_CODE || configPtr->logToCode == LOGTO_MONITOR_CODE)
{
//
fprintf(stdout, "%s", logStr);
}
}
return logPtr;
}
/*
@ -636,8 +744,8 @@ Device Input/Device: none
Device Output/Device: none
Dependencies: pthreads, sprintf, logOutput, ???
*/
void runCPU(char *command, char *argument, int intArg, ConfigDataType *configPtr,
int processId, ProcessControlBlock *singlePCB, ConfigDataCodes schedMethod)
void runCPU(char *command, char *argument, int intArg, ConfigDataType *configPtr, int processId,
ProcessControlBlock *singlePCB, ConfigDataCodes schedMethod, logFileLL *logList)
{
double timeDigits;
char timeStringy[MAX_STR_LEN];
@ -655,13 +763,13 @@ void runCPU(char *command, char *argument, int intArg, ConfigDataType *configPtr
cpuTime = intArg * configPtr->procCycleRate;
timeDigits = accessTimer(LAP_TIMER, timeStringy);
sprintf(cpuOutput, "%f, Process: %d, %s %s operation start\n", timeDigits, processId, command, argument);
logOutput(configPtr, cpuOutput, false);
logOutput(configPtr, cpuOutput, false, logList);
// run timer for intArg * procCycleRate
pthread_create(&cpuThread, NULL, runTimer, (void *)cpuTimePtr);
pthread_join(cpuThread, NULL);
timeDigits = accessTimer(LAP_TIMER, timeStringy);
sprintf(cpuOutput, "%f, Process: %d, %s %s operation end\n", timeDigits, processId, command, argument);
logOutput(configPtr, cpuOutput, false);
logOutput(configPtr, cpuOutput, false, logList);
// pthread_exit(NULL);
break;
@ -669,13 +777,13 @@ void runCPU(char *command, char *argument, int intArg, ConfigDataType *configPtr
cpuTime = intArg * configPtr->procCycleRate;
timeDigits = accessTimer(LAP_TIMER, timeStringy);
sprintf(cpuOutput, "%f, Process: %d, %s %s operation start\n", timeDigits, processId, command, argument);
logOutput(configPtr, cpuOutput, false);
logOutput(configPtr, cpuOutput, false, logList);
// run timer for intArg * procCycleRate
pthread_create(&cpuThread, NULL, runTimer, (void *)cpuTimePtr);
pthread_join(cpuThread, NULL);
timeDigits = accessTimer(LAP_TIMER, timeStringy);
sprintf(cpuOutput, "%f, Process: %d, %s %s operation end\n", timeDigits, processId, command, argument);
logOutput(configPtr, cpuOutput, false);
logOutput(configPtr, cpuOutput, false, logList);
break;
default:
@ -694,8 +802,8 @@ Device Input/Device: none
Device Output/Device: none
Dependencies: pthreads, sprintf, logOutput, ???
*/
void runIO(char *command, char *argument, int intArg, ConfigDataType *configPtr,
int processId, ProcessControlBlock *singlePCB, ConfigDataCodes schedMethod)
void runIO(char *command, char *argument, int intArg, ConfigDataType *configPtr, int processId,
ProcessControlBlock *singlePCB, ConfigDataCodes schedMethod, logFileLL *logList)
{
double timeDigits;
char timeStringy[MAX_STR_LEN];
@ -710,12 +818,12 @@ void runIO(char *command, char *argument, int intArg, ConfigDataType *configPtr,
ioTime = intArg * configPtr->ioCycleRate;
timeDigits = accessTimer(LAP_TIMER, timeStringy);
sprintf(ioOutput, "%f, Process: %d, %s %s operation start\n", timeDigits, processId, command, argument);
logOutput(configPtr, ioOutput, false);
logOutput(configPtr, ioOutput, false, logList);
pthread_create(&ioThread, NULL, runTimer, (void *)ioTimePtr);
pthread_join(ioThread, NULL);
timeDigits = accessTimer(LAP_TIMER, timeStringy);
sprintf(ioOutput, "%f, Process: %d, %s %s operation end\n", timeDigits, processId, command, argument);
logOutput(configPtr, ioOutput, false);
logOutput(configPtr, ioOutput, false, logList);
break;
case PREEMPTIVE_CODE:
@ -724,11 +832,11 @@ void runIO(char *command, char *argument, int intArg, ConfigDataType *configPtr,
ioTime = intArg * configPtr->ioCycleRate;
timeDigits = accessTimer(LAP_TIMER, timeStringy);
sprintf(ioOutput, "%f, Process: %d, %s %s operation start\n", timeDigits, processId, command, argument);
logOutput(configPtr, ioOutput, false);
logOutput(configPtr, ioOutput, false, logList);
pthread_create(&ioThread, NULL, runTimer, (void *)ioTimePtr);
timeDigits = accessTimer(LAP_TIMER, timeStringy);
sprintf(ioOutput, "%f, Process: %d, %s %s operation end\n", timeDigits, processId, command, argument);
logOutput(configPtr, ioOutput, false);
logOutput(configPtr, ioOutput, false, logList);
// pthread_join(ioThread, NULL); // not sure if this will be needed...
// pthread_exit(NULL); // this may be needed if pthread_join doesn't produce expected results.
// call the interruptManager here, with the IO Return code.
@ -751,8 +859,8 @@ Device Input/Device: none
Device Output/Device: none
Dependencies: accessTimer, compareString, runCPU, runIO, ???
*/
void runProcess(ProcessControlBlock *singlePCB, ConfigDataType *configPtr, ProcessControlBlockLL *pcbList,
ConfigDataCodes schedMethod)
void runProcess(ProcessControlBlock *singlePCB, ConfigDataType *configPtr, ProcessControlBlockLL *pcbList,
ConfigDataCodes schedMethod, logFileLL *logList)
{
double timeDigits;
// run over the entire process, running the CPU when a CPU cycle comes up
@ -781,13 +889,13 @@ void runProcess(ProcessControlBlock *singlePCB, ConfigDataType *configPtr, Proce
{
// run the CPU for the required amount of time.
runCPU(workingMeta->command, workingMeta->strArg1, workingMeta->intArg2, configPtr, singlePCB->uniquePid,
singlePCB, schedMethod);
singlePCB, schedMethod, logList);
}
if(compareString(command, "dev") == EQUIV)
{
// run IO operations for the required amount of time.
runIO(workingMeta->command, workingMeta->strArg1, workingMeta->intArg2, configPtr, singlePCB->uniquePid,
singlePCB, schedMethod);
singlePCB, schedMethod, logList);
}
if(compareString(command, "mem") == EQUIV)
{
@ -797,7 +905,7 @@ void runProcess(ProcessControlBlock *singlePCB, ConfigDataType *configPtr, Proce
timeDigits = accessTimer(LAP_TIMER, timeStringy);
sprintf(processOutput, "%f, Process: %d, %s %s request (%d, %d)\n", timeDigits,
singlePCB->uniquePid, command, argument, intArg, intArgTwo);
logOutput(configPtr, processOutput, false);
logOutput(configPtr, processOutput, false, logList);
// run the memory manager in allocate mode
memManagerSuccess = memManager(pcbList, MEMORY_ALLOCATE, intArg, intArgTwo, configPtr, singlePCB);
if(!memManagerSuccess)
@ -806,7 +914,7 @@ void runProcess(ProcessControlBlock *singlePCB, ConfigDataType *configPtr, Proce
timeDigits = accessTimer(LAP_TIMER, timeStringy);
sprintf(processOutput, "%f, Process: %d, failed %s %s request (%d, %d)\n", timeDigits,
singlePCB->uniquePid, command, argument, intArg, intArgTwo);
logOutput(configPtr, processOutput, false);
logOutput(configPtr, processOutput, false, logList);
}
}
else if(compareString(argument, "access") == EQUIV)
@ -814,7 +922,7 @@ void runProcess(ProcessControlBlock *singlePCB, ConfigDataType *configPtr, Proce
timeDigits = accessTimer(LAP_TIMER, timeStringy);
sprintf(processOutput, "%f, Process: %d, %s %s request (%d, %d)\n", timeDigits,
singlePCB->uniquePid, command, argument, intArg, intArgTwo);
logOutput(configPtr, processOutput, false);
logOutput(configPtr, processOutput, false, logList);
// run the memory manager in access mode
memManagerSuccess = memManager(pcbList, MEMORY_ACCESS, intArg, intArgTwo, configPtr, singlePCB);
if (!memManagerSuccess)
@ -823,7 +931,7 @@ void runProcess(ProcessControlBlock *singlePCB, ConfigDataType *configPtr, Proce
timeDigits = accessTimer(LAP_TIMER, timeStringy);
sprintf(processOutput, "%f, Process: %d, failed %s %s request (%d, %d)\n", timeDigits,
singlePCB->uniquePid, command, argument, intArg, intArgTwo);
logOutput(configPtr, processOutput, false);
logOutput(configPtr, processOutput, false, logList);
}
}
}
@ -850,14 +958,14 @@ void runProcess(ProcessControlBlock *singlePCB, ConfigDataType *configPtr, Proce
//
timeDigits = accessTimer(LAP_TIMER, timeStringy);
sprintf(processOutput, "\n%f, OS: Process %d ended\n", timeDigits, singlePCB->uniquePid);
logOutput(configPtr, processOutput, false);
logOutput(configPtr, processOutput, false, logList);
}
else
{
//
timeDigits = accessTimer(LAP_TIMER, timeStringy);
sprintf(processOutput, "\n%f, OS: Segmentation Fault, Process %d ended\n", timeDigits, singlePCB->uniquePid);
logOutput(configPtr, processOutput, false);
logOutput(configPtr, processOutput, false, logList);
}
// deallocate the memory for the process
memManager(pcbList, MEMORY_DEALLOCATE, intArg, intArgTwo, configPtr, singlePCB);
@ -883,6 +991,7 @@ void runSim(ConfigDataType *configPtr, OpCodeType *metaDataMstrPtr)
// need a variable for headPointer to point
ProcessControlBlockLL *pcbList;
ProcessControlBlock *pcbPtr;
logFileLL *loggingList;
// string variable for nextCode, temp unused
// char *nextCode;
// string variable for the timer stuff
@ -895,6 +1004,16 @@ void runSim(ConfigDataType *configPtr, OpCodeType *metaDataMstrPtr)
int memoryOffset = 0;
int memorySize = 1;
// create the file list with createFileLogList, store the pointed to address
loggingList = createFileLogList();
// check to see if in file mode, and print, 'Sim will output to file'
if (configPtr->logToCode == LOGTO_FILE_CODE)
{
//
printf("Simulator will output to a file. (Please be patient...)\n");
}
if (schedulingMethod == CPU_SCHED_FCFS_P_CODE ||
schedulingMethod == CPU_SCHED_RR_P_CODE ||
schedulingMethod == CPU_SCHED_SRTF_P_CODE)
@ -912,7 +1031,7 @@ void runSim(ConfigDataType *configPtr, OpCodeType *metaDataMstrPtr)
// Operating System start timer goes here, log it.
timeDigits = accessTimer(LAP_TIMER, timeStringy);
sprintf(simulatorOutput, "%f, OS: Simulator start\n", timeDigits);
logOutput(configPtr, simulatorOutput, false);
logOutput(configPtr, simulatorOutput, false, loggingList);
// int variable for process to run
int currentPid;
// create the process list with createProcessList, store the pointed to address
@ -941,7 +1060,7 @@ void runSim(ConfigDataType *configPtr, OpCodeType *metaDataMstrPtr)
int *processTimeLeftPtr = &processTimeLeft;
// set the current process id to the first scheduled process
currentPid = scheduleProcess(pcbList, configPtr);
currentPid = scheduleProcess(pcbList, configPtr, loggingList);
// initialize memory with the memManager
memManager(pcbList, MEMORY_INITIALIZE, memoryOffset, memorySize, configPtr, pcbList->headPtr);
@ -961,10 +1080,10 @@ void runSim(ConfigDataType *configPtr, OpCodeType *metaDataMstrPtr)
timeDigits = accessTimer(LAP_TIMER, timeStringy);
sprintf(simulatorOutput, "%f, OS: Process %d set to RUNNING state from READY state\n\n", timeDigits,
pcbPtr->uniquePid);
logOutput(configPtr, simulatorOutput, false);
logOutput(configPtr, simulatorOutput, false, loggingList);
pthread_t runThread;
pthread_create(&runThread, NULL, runTimer, (void *)processTimeLeftPtr);
runProcess(pcbPtr, configPtr, pcbList, schedulingMethod);
runProcess(pcbPtr, configPtr, pcbList, schedulingMethod, loggingList);
switch (schedulingMethod)
{
case NON_PREEMPTIVE_CODE:
@ -972,7 +1091,7 @@ void runSim(ConfigDataType *configPtr, OpCodeType *metaDataMstrPtr)
timeDigits = accessTimer(LAP_TIMER, timeStringy);
sprintf(simulatorOutput, "%f, OS: Process %d set to TERMINATED state from RUNNING state\n\n", timeDigits,
pcbPtr->uniquePid);
logOutput(configPtr, simulatorOutput, false);
logOutput(configPtr, simulatorOutput, false, loggingList);
// this assumes that the processes finish executing all the way though.
pcbPtr->process_state = PROCESS_STATE_TERMINATED;
break;
@ -987,7 +1106,7 @@ void runSim(ConfigDataType *configPtr, OpCodeType *metaDataMstrPtr)
processTimeLeftPtr = &processTimeLeft;
pcbPtr = pcbPtr->nextPtr;
}
currentPid = scheduleProcess(pcbList, configPtr);
currentPid = scheduleProcess(pcbList, configPtr, loggingList);
pcbPtr = pcbList->headPtr;
}
pthread_join(cpuThread, NULL);
@ -995,14 +1114,13 @@ void runSim(ConfigDataType *configPtr, OpCodeType *metaDataMstrPtr)
memManager(pcbList, MEMORY_CLEAR, memoryOffset, memorySize, configPtr, pcbList->headPtr);
timeDigits = accessTimer(LAP_TIMER, timeStringy);
sprintf(simulatorOutput, "%f, OS: System Stop\n", timeDigits);
logOutput(configPtr, simulatorOutput, false);
logOutput(configPtr, simulatorOutput, false, loggingList);
timeDigits = accessTimer(LAP_TIMER, timeStringy);
sprintf(simulatorOutput, "%f, OS: Simulation End\n", timeDigits);
logOutput(configPtr, simulatorOutput, true);
logOutput(configPtr, simulatorOutput, true, loggingList);
// deallocate the process list with destroyProcessList
destroyProcessList(pcbList);
// once complete, log the output to FILE if required
logOutput(configPtr, "", true);
destroyFileLogList(loggingList);
// pthread_exit(NULL); // this line seems to make the program execution stop short... no warning either
// void function, no return.
}
@ -1018,7 +1136,7 @@ Device Input/Device: none
Device Output/Device: none
Dependencies: sprintf, logOutput, ???
*/
int scheduleProcess(ProcessControlBlockLL *headPointer, ConfigDataType *configPtr)
int scheduleProcess(ProcessControlBlockLL *headPointer, ConfigDataType *configPtr, logFileLL *logList)
{
double timeDigits;
ProcessControlBlock *wkgPtr;
@ -1063,7 +1181,7 @@ int scheduleProcess(ProcessControlBlockLL *headPointer, ConfigDataType *configPt
timeDigits = accessTimer(LAP_TIMER, timeStringy);
sprintf(loggingStr, "%f, OS: Process %d set to READY state from NEW state\n", timeDigits,
wkgPtr->uniquePid);
logOutput(configPtr, loggingStr, false);
logOutput(configPtr, loggingStr, false, logList);
}
// move to the next pointer
wkgPtr = wkgPtr->nextPtr;
@ -1080,7 +1198,7 @@ int scheduleProcess(ProcessControlBlockLL *headPointer, ConfigDataType *configPt
timeDigits = accessTimer(LAP_TIMER, timeStringy);
sprintf(loggingStr, "%f, OS: Process %d selected with %.0f ms remaining\n", timeDigits,
wkgPtr->uniquePid, wkgPtr->timeLeft);
logOutput(configPtr, loggingStr, false);
logOutput(configPtr, loggingStr, false, logList);
returnPid = wkgPtr->uniquePid;
}
// move to next pointer
@ -1105,7 +1223,7 @@ int scheduleProcess(ProcessControlBlockLL *headPointer, ConfigDataType *configPt
timeDigits = accessTimer(LAP_TIMER, timeStringy);
sprintf(loggingStr, "%f, OS: Process %d set to READY state from NEW state\n", timeDigits,
wkgPtr->uniquePid);
logOutput(configPtr, loggingStr, false);
logOutput(configPtr, loggingStr, false, logList);
}
// move to the next pointer
wkgPtr = wkgPtr->nextPtr;
@ -1124,7 +1242,7 @@ int scheduleProcess(ProcessControlBlockLL *headPointer, ConfigDataType *configPt
timeDigits = accessTimer(LAP_TIMER, timeStringy);
sprintf(loggingStr, "%f, OS: Process %d selected with %.0f ms remaining\n", timeDigits,
wkgPtr->uniquePid, wkgPtr->timeLeft);
logOutput(configPtr, loggingStr, false);
logOutput(configPtr, loggingStr, false, logList);
returnPid = wkgPtr->uniquePid;
}
// move to next pointer
@ -1156,7 +1274,7 @@ int scheduleProcess(ProcessControlBlockLL *headPointer, ConfigDataType *configPt
timeDigits = accessTimer(LAP_TIMER, timeStringy);
sprintf(loggingStr, "%f, OS: Process %d set to READY state from NEW state\n", timeDigits,
wkgPtr->uniquePid);
logOutput(configPtr, loggingStr, false);
logOutput(configPtr, loggingStr, false, logList);
}
// move to the next pointer
wkgPtr = wkgPtr->nextPtr;
@ -1209,7 +1327,7 @@ int scheduleProcess(ProcessControlBlockLL *headPointer, ConfigDataType *configPt
timeDigits = accessTimer(LAP_TIMER, timeStringy);
sprintf(loggingStr, "%f, OS: Process %d selected with %.0f ms remaining\n", timeDigits,
shortestJobProcNum, (double)shortestJob);
logOutput(configPtr, loggingStr, false);
logOutput(configPtr, loggingStr, false, logList);
}
returnPid = shortestJobProcNum;
break;
@ -1228,7 +1346,7 @@ int scheduleProcess(ProcessControlBlockLL *headPointer, ConfigDataType *configPt
timeDigits = accessTimer(LAP_TIMER, timeStringy);
sprintf(loggingStr, "%f, OS: Process %d set to READY state from NEW state\n", timeDigits,
wkgPtr->uniquePid);
logOutput(configPtr, loggingStr, false);
logOutput(configPtr, loggingStr, false, logList);
}
// move to the next pointer
wkgPtr = wkgPtr->nextPtr;
@ -1283,7 +1401,7 @@ int scheduleProcess(ProcessControlBlockLL *headPointer, ConfigDataType *configPt
timeDigits = accessTimer(LAP_TIMER, timeStringy);
sprintf(loggingStr, "%f, OS: Process %d selected with %.0f ms remaining\n", timeDigits,
shortestJobProcNum, (double)shortestJob);
logOutput(configPtr, loggingStr, false);
logOutput(configPtr, loggingStr, false, logList);
}
returnPid = shortestJobProcNum;
break;