aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorBen Burwell <ben@benburwell.com>2015-04-01 20:06:27 -0400
committerBen Burwell <ben@benburwell.com>2015-04-01 20:06:27 -0400
commitc4ed6736d2e093ea7433328a552d53d3bcaff927 (patch)
treeca54ce36f7d10b414ae9e559a184141d49f63f7e /main.c
parent7b0995ea20afed2632893f8528ce9d57772d5498 (diff)
as of 2013-09-302013-09-30
Diffstat (limited to 'main.c')
-rw-r--r--main.c50
1 files changed, 48 insertions, 2 deletions
diff --git a/main.c b/main.c
index 76e9168..9bd8b55 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,3 @@
-
/* file: main.c
*
* This file contains the function main
@@ -9,12 +8,59 @@
#include <stdio.h>
#include "mpx.h"
+pcb * pcb_list;
+pcb * ready_queue;
+pcb * io_init_queue;
int main(void) {
- printf("... booting MPX\n\n");
/* Put initialization code here */
+ // allocate memory for PCBs
+ pcb pcb0;
+ pcb pcb1;
+ pcb pcb2;
+ pcb pcb3;
+ pcb pcb4;
+ pcb pcb5;
+ pcb pcb6;
+ pcb pcb7;
+ pcb pcb8;
+ pcb pcb9;
+ pcb pcb10;
+ pcb pcb11;
+
+ // 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;
+
+ printf("... booting MPX\n\n");
+
comhan(); /* Execute the command handler */
return 0;