MP3 1.0
This is the Doxygen document for ECE391 MP3.
Loading...
Searching...
No Matches
pcb.h
Go to the documentation of this file.
1
10#ifndef PCB_H
11#define PCB_H
12
13#include "types.h"
14#include "sys_call.h" // For file descriptor type (fd_t)
15#include "file_descriptor.h"
16#include "keyboard.h"
17#include "scheduling.h"
18
19#define MAX_NUM_PROCESSES (6) // Now 6 for CP5
20#define PCB_IN_USE (1)
21#define PCB_NOT_IN_USE (0)
22#define MAX_NUM_FD_PER_PROCESS (8)
23
25{
26 int pid;
34 int inUse; // A bool flag to indicate the this PCB belongs to a valid currently running process
37
43
54int32_t addProcess(int32_t terminalID, int32_t parentID, int32_t savedESP, int32_t savedEBP);
55
64
69void initPCBArray();
70
76
77#endif // PCB_H
Header function for file_descriptor.c.
Header file for keyboard.c.
#define KEYBOARD_BUF_SIZE
Definition: keyboard.h:14
int32_t removeProcess(int32_t pid)
Remove a process from the PCB array.
Definition: pcb.c:89
int32_t volatile currPID
The current process that is being executed (index into pcbArray).
Definition: pcb.h:75
#define MAX_NUM_FD_PER_PROCESS
Definition: pcb.h:22
struct processControlBlockStruct pcb_t
void initPCBArray()
Initialize the PCB(process control block) array.
Definition: pcb.c:18
int32_t addProcess(int32_t terminalID, int32_t parentID, int32_t savedESP, int32_t savedEBP)
Add a process to the pcb array.
Definition: pcb.c:55
#define MAX_NUM_PROCESSES
Definition: pcb.h:19
pcb_t * pcbArray[MAX_NUM_PROCESSES]
PCB(process control block) array.
Definition: pcb.h:42
Header file for scheduling.c.
Definition: file_descriptor.h:49
Definition: pcb.h:25
int savedESP
Definition: pcb.h:29
int parentID
Definition: pcb.h:27
int savedEBP
Definition: pcb.h:30
fd_t fileDescriptor[MAX_NUM_FD_PER_PROCESS]
Definition: pcb.h:28
char arg[KEYBOARD_BUF_SIZE]
Definition: pcb.h:35
int terminalID
Definition: pcb.h:33
int schedulerEBP
Definition: pcb.h:32
int inUse
Definition: pcb.h:34
int schedulerESP
Definition: pcb.h:31
int pid
Definition: pcb.h:26
Header file for sys_call.c.
Defines to use the familiar explicitly-sized types in this OS.
int int32_t
Definition: types.h:18