aboutsummaryrefslogtreecommitdiff
path: root/main.c
blob: c6d567f320999ca750f7ad9ac9217ff5e936e978 (plain)
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
56
57
58
59
60
61
62
63
64
65
/*  file:  main.c
 *
 *  This file contains the function main
 *  for the MPX Operating System - this is where
 *  the program's execution begins
 */

#include <stdio.h>
#include "mpx.h"

pcb * pcb_list;
pcb * ready_queue;
pcb * io_init_queue;

pcb pcb0;
pcb pcb1;
pcb pcb2;
pcb pcb3;
pcb pcb4;
pcb pcb5;
pcb pcb6;
pcb pcb7;
pcb pcb8;
pcb pcb9;
pcb pcb10;
pcb pcb11;

int main(void) {
	printf("Booting MPX... \n");
	/* Put initialization code here */

	// create the chain
	pcb0.chain  = &pcb1;
	pcb1.chain  = &pcb2;
	pcb2.chain  = &pcb3;
	pcb3.chain  = &pcb4;
	pcb4.chain  = &pcb5;
	pcb5.chain  = &pcb6;
	pcb6.chain  = &pcb7;
	pcb7.chain  = &pcb8;
	pcb8.chain  = &pcb9;
	pcb9.chain  = &pcb10;
	pcb10.chain = &pcb11;
	pcb11.chain = NULL;

	build_pcb(&pcb0, "        ", FREE, -1, -1, 0);
	build_pcb(&pcb1, "        ", FREE, -1, -1, 0);
	build_pcb(&pcb2, "        ", FREE, -1, -1, 0);
	build_pcb(&pcb3, "        ", FREE, -1, -1, 0);
	build_pcb(&pcb4, "        ", FREE, -1, -1, 0);
	build_pcb(&pcb5, "        ", FREE, -1, -1, 0);
	build_pcb(&pcb6, "        ", FREE, -1, -1, 0);
	build_pcb(&pcb7, "        ", FREE, -1, -1, 0);
	build_pcb(&pcb8, "        ", FREE, -1, -1, 0);
	build_pcb(&pcb9, "        ", FREE, -1, -1, 0);
	build_pcb(&pcb10, "        ", FREE, -1, -1, 0);
	build_pcb(&pcb11, "        ", FREE, -1, -1, 0);

	pcb_list = &pcb0;

	comhan();    /* Execute the command handler */

	return 0;
}