-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpcb.h
More file actions
36 lines (31 loc) · 937 Bytes
/
Copy pathpcb.h
File metadata and controls
36 lines (31 loc) · 937 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef PCB_H
#define PCB_H
#include <stdbool.h>
/*
* Struct: PCB
* --------------------
* pid: process(task) id
* PC: program counter, stores the index of line that the task is executing
* start: the first line in shell memory that belongs to this task
* end: the last line in shell memory that belongs to this task
* job_length_score: for EXEC AGING use only, stores the job length score
*/
typedef struct PCB{
int pid;
int PC;
bool priority;
int numberOfFramesExecuted;
int numberOfLinesExecuted;
int instructionsExecuted;
int numOfInstructions;
int jobLengthScore;
int numOfFrames;
int pageTableSize;
bool interruptFlag;
bool (*incrementPC)(struct PCB *pcb);
int* pageTable; //This has to be at the bottom
char backingStoreName[256];
} PCB;
int generatePID();
PCB* makePCB(int* allocatedFrames, int numOfInstructions, int pid, char backingStoreName[256]);
#endif