MP3 1.0
This is the Doxygen document for ECE391 MP3.
Loading...
Searching...
No Matches
Functions
pcb.c File Reference

Implementations for pcb (process control block) More...

#include "pcb.h"
#include "file_descriptor.h"
#include "paging.h"

Functions

void initPCBArray ()
 Initialize the PCB(process control block) array. More...
 
int32_t addProcess (int32_t terminalID, int32_t parentID, int32_t savedESP, int32_t savedEBP)
 Add a process to the pcb array. More...
 
int32_t removeProcess (int32_t pid)
 Remove a process from the PCB array. More...
 

Detailed Description

Implementations for pcb (process control block)

Author
Group 8
Version
1.0
Date
2023-03-25

Function Documentation

◆ addProcess()

int32_t addProcess ( int32_t  terminalID,
int32_t  parentID,
int32_t  savedESP,
int32_t  savedEBP 
)

Add a process to the pcb array.

Parameters
terminalIDTerminal ID for the parent or current active process.
parentIDThe parent process's index into the PCB array.
savedESPThe contents of ESP of the parent process that got interrupted.
savedEBPThe contents of EBP of the parent process that got interrupted.
Returns
Pid number on success.
-1 on failure.

◆ initPCBArray()

void initPCBArray ( )

Initialize the PCB(process control block) array.

◆ removeProcess()

int32_t removeProcess ( int32_t  pid)

Remove a process from the PCB array.

Parameters
pidThe process's index in the PCB array that should be removed.
Returns
0 on success.
-1 on failure.