Cleaned up Sim02's mess. Can look at previous commits to figure out what is going on.

+- simulator.c/h
This commit is contained in:
Charles Descamps 2024-02-22 05:31:32 -07:00
parent e76f2971de
commit 5a747ab1dd
2 changed files with 14 additions and 84 deletions

View file

@ -56,10 +56,6 @@ Device Input/Device: none
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: ???
@ -71,28 +67,19 @@ Device Input/Device: none
Device Output/Device: none
Dependencies: ???
*/
// 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 initializes the process control block ll.
// need a function called fillProcessList
// this fills the linked list of PCBs,
// loads the first instruction after app start
// and ...
// reads through the opcode struct to fill out the linked list of PCBs
// need a function called destroyProcessList
// deallocated the ll of PCBs recursively, frees the rest of the struct.
// have a function to change the state of the process?
// have it take in the process struct, switch it's state and report that it
// has switched FROM a state TO a different state.
/*
Name: addProcess
Process: allocates the memory for the pcb, grabs the data from the created PCB,
dumps the data so that the node can be linked correctly.
Function Input/Parameters: source PCB (ProcessControlBlock)
Function Output/Parameters: none
Function Output/Returned: filled PCB (ProcessControlBlock *)
Device Input/Device: none
Device Output/Device: none
Dependencies: malloc, sizeof, ???
*/
ProcessControlBlock *addProcess(const ProcessControlBlock source);
/*
Name: createProcessList