diff --git a/ProgramGenerator_Project/proggen b/ProgramGenerator_Project/proggen old mode 100644 new mode 100755 index 3fa19e5..c7a845a Binary files a/ProgramGenerator_Project/proggen and b/ProgramGenerator_Project/proggen differ diff --git a/Sim02/sim02 b/Sim02/sim02 index 3e3186f..13fb927 100755 Binary files a/Sim02/sim02 and b/Sim02/sim02 differ diff --git a/Sim02/simulator.c b/Sim02/simulator.c index 96adc22..3e87544 100644 --- a/Sim02/simulator.c +++ b/Sim02/simulator.c @@ -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;