Fix simulator 2 a little more, but still not entirely functional.

This commit is contained in:
Charles Descamps 2024-03-10 19:39:57 -07:00
parent a4f9cd88fa
commit 60cc817296
3 changed files with 4 additions and 2 deletions

View file

@ -134,7 +134,7 @@ ProcessControlBlockLL *fillProcessList(ConfigDataType *configPtr, OpCodeType *me
// set the working pointer to the first part of the metadata pointer
wkgMetaPtr = metadataPtr;
wkgInsPtr = metadataPtr;
currentPCB.nextOpCode = wkgMetaPtr;
// currentPCB.nextOpCode = wkgMetaPtr;
// set another working pointer to the first part of the PCB list
wkgPCBPtr = headPointer->headPtr;
@ -149,6 +149,7 @@ ProcessControlBlockLL *fillProcessList(ConfigDataType *configPtr, OpCodeType *me
// loop through the process list, until you hit a sys end.
while(wkgMetaPtr != NULL && !(compareString(argument, "end") == EQUIV && compareString(command, "sys") == EQUIV))
{
currentPCB.nextOpCode = wkgInsPtr->nextNode;
integerArgumentOne = wkgMetaPtr->intArg2;
printf("%s command, %s argument, %d\n", command, argument, integerArgumentOne);
// if app start,
@ -161,7 +162,6 @@ ProcessControlBlockLL *fillProcessList(ConfigDataType *configPtr, OpCodeType *me
currentPCB.process_state = PROCESS_STATE_NEW;
// set the nextOpCode as a pointer to the first place metadataPtr started
// currentPCB.nextOpCode = wkgMetaPtr->nextNode; // broken?
currentPCB.nextOpCode = wkgInsPtr->nextNode;
}
// count number of io cycles
if(compareString(command, "dev") == EQUIV)
@ -375,11 +375,13 @@ void runProcess(ProcessControlBlock *singlePCB, ConfigDataType *configPtr)
if (compareString(command, "cpu") == EQUIV && compareString(argument, "process") == EQUIV)
{
//
// printf("CPU RUNS\n");
runCPU(workingMeta->command, workingMeta->strArg1, workingMeta->intArg2, configPtr, singlePCB->uniquePid);
}
if(compareString(command, "dev") == EQUIV)
{
//
// printf("IO RUNS\n");
runIO(workingMeta->command, workingMeta->strArg1, workingMeta->intArg2, configPtr, singlePCB->uniquePid);
}
command = workingMeta->command;