-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkernel.h
More file actions
55 lines (47 loc) · 1019 Bytes
/
kernel.h
File metadata and controls
55 lines (47 loc) · 1019 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include <stdbool.h>
struct free_pages {
int count;
struct physical_frame *head;
};
struct physical_frame {
struct physical_frame *next;
};
// typedef struct child child;
typedef struct queue queue;
typedef struct pcb pcb;
struct pcb {
int pid;
SavedContext ctx;
struct pte *page_table0;
int delay_offset;
struct pcb *parent;
struct pcb *next;
struct pcb *nextChild;
void *brk;
void *min_sp;
queue *statusQ;
int status;
queue *childrenQ;
bool waiting;
int numToRead;
};
struct queue {
pcb *head;
pcb *tail;
int count;
};
typedef struct line {
char *init_ptr;
char *content;
int len;
struct line *next;
} line;
typedef struct term {
queue readQ;
queue writeQ;
line *read_data;
line *write_data;
} term;
int LoadProgram(char *name, char **args, ExceptionInfo *info, struct pte *region0, struct free_pages free_pages, pcb *newPCB);
void freePage(struct pte* newPte, void *vir_addr);
int getFreePage();