Fixed the simulator to get every subprocess except for the first in each process...
+- simulator.c
This commit is contained in:
parent
20a6731ee2
commit
a4f9cd88fa
2 changed files with 6 additions and 5 deletions
BIN
Sim02/sim02
BIN
Sim02/sim02
Binary file not shown.
|
|
@ -134,6 +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;
|
||||
// set another working pointer to the first part of the PCB list
|
||||
wkgPCBPtr = headPointer->headPtr;
|
||||
|
||||
|
|
@ -146,10 +147,10 @@ ProcessControlBlockLL *fillProcessList(ConfigDataType *configPtr, OpCodeType *me
|
|||
//integerArgumentTwo = wkgMetaPtr->intArg3;
|
||||
|
||||
// loop through the process list, until you hit a sys end.
|
||||
while(wkgMetaPtr->nextNode != NULL && !(compareString(argument, "end") == EQUIV && compareString(command, "sys") == EQUIV))
|
||||
while(wkgMetaPtr != NULL && !(compareString(argument, "end") == EQUIV && compareString(command, "sys") == EQUIV))
|
||||
{
|
||||
integerArgumentOne = wkgMetaPtr->intArg2;
|
||||
// printf("%s command, %s argument, %d\n", command, argument, integerArgumentOne);
|
||||
printf("%s command, %s argument, %d\n", command, argument, integerArgumentOne);
|
||||
// if app start,
|
||||
if (compareString(command, "app") && compareString(argument, "start"))
|
||||
{
|
||||
|
|
@ -160,6 +161,7 @@ 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)
|
||||
|
|
@ -193,8 +195,8 @@ ProcessControlBlockLL *fillProcessList(ConfigDataType *configPtr, OpCodeType *me
|
|||
currentPCB.totalCycles = ioCycleCount + cpuCycleCount;
|
||||
|
||||
// currentPCB must have the starting instruction from wkgInsPtr
|
||||
currentPCB.nextOpCode = wkgInsPtr->nextNode;
|
||||
|
||||
// currentPCB.nextOpCode = wkgInsPtr->nextNode;
|
||||
wkgInsPtr = wkgMetaPtr;
|
||||
|
||||
// set the time left from (ioCycles * ioCycleRate) + (cpuCycles * procCyclesRate)
|
||||
// this gets the number of ms in the process.
|
||||
|
|
@ -224,7 +226,6 @@ ProcessControlBlockLL *fillProcessList(ConfigDataType *configPtr, OpCodeType *me
|
|||
command = wkgMetaPtr->command;
|
||||
argument = wkgMetaPtr->strArg1;
|
||||
inOutArg = wkgMetaPtr->inOutArg;
|
||||
wkgInsPtr = wkgMetaPtr;
|
||||
|
||||
}
|
||||
// return headPointer
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue