summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
fix some trap bugs
Diffstat (limited to 'main.c')
-rw-r--r--main.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/main.c b/main.c
index 7c3677e..3c75389 100644
--- a/main.c
+++ b/main.c
@@ -5,12 +5,20 @@
#include "defs.h"
#include "x86.h"
-char junk1[20000];
-char junk2[20000] = { 1 };
+extern char edata[], end[];
main()
{
struct proc *p;
+
+ // clear BSS
+ memset(edata, 0, end - edata);
+
+ // partially initizialize PIC
+ outb(0x20+1, 0xFF); // IO_PIC1
+ outb(0xA0+1, 0xFF); // IO_PIC2
+ outb(0x20, 0x11);
+ outb(0x20+1, 32);
cprintf("\nxV6\n\n");