Started outlining the CS480 Simulator 2 project, analyzed a testfile, and added SimTimer stuff
++ simtimer.c/h ++ testfile-dnw.mdf +- simulator.c/h -- Sim01 Grading
This commit is contained in:
parent
460705a9e1
commit
93904cb2f3
6 changed files with 415 additions and 3 deletions
|
|
@ -4,6 +4,7 @@
|
|||
#include "StandardConstants.h"
|
||||
#include "configops.h"
|
||||
#include "metadataops.h"
|
||||
#include "simtimer.h"
|
||||
|
||||
// data structures
|
||||
|
||||
|
|
@ -19,7 +20,17 @@ typedef struct ProcessControlBlockStruct
|
|||
{
|
||||
int uniquePid;
|
||||
PROCESS_STATES process_state;
|
||||
//
|
||||
// need a process start ptr for where the process starts.
|
||||
// this will be a mini loop within the master loop that goes until it
|
||||
// hits the app end command.
|
||||
// it may hold the next opcode, since you don't need to traverse backward
|
||||
// have an IO cycle count here
|
||||
// have a CPU cycle count here
|
||||
// maybe have a total cycle count here
|
||||
// time left could be calculated from these.
|
||||
// potentially could change the cycles or have a 'left' variable to
|
||||
// see how many are left.
|
||||
// also need a time left state here?
|
||||
} ProcessControlBlock;
|
||||
|
||||
/*
|
||||
|
|
@ -33,6 +44,9 @@ Device Output/Device: none
|
|||
Dependencies: ???
|
||||
*/
|
||||
// need a function (or functions) to handle FILE I/O?
|
||||
// runSim function will have a FILE *
|
||||
// will have a function that gets the FILE * and
|
||||
// adds whatever operation occurred
|
||||
|
||||
/*
|
||||
Name: ???
|
||||
|
|
@ -44,7 +58,20 @@ Device Input/Device: none
|
|||
Device Output/Device: none
|
||||
Dependencies: ???
|
||||
*/
|
||||
// need a function to ???
|
||||
// need a function for the global/local timer (given??? may need to just import)
|
||||
|
||||
// need a function for scheduler/dispatcher
|
||||
// this could use a switch statement to tell which scheduling method to choose from.
|
||||
// Sim02 only requires FCFS working atm.
|
||||
|
||||
// need a function called createProcessList
|
||||
// this makes a linked list of PCBs, loads the first instruction after app start
|
||||
// and ...
|
||||
|
||||
// need a function called destroyProcessList
|
||||
// deallocated the ll of PCBs recursively, frees the rest of the struct.
|
||||
|
||||
//
|
||||
|
||||
/*
|
||||
Name: runSim
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue