summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorrtm <rtm>2006-06-16 20:29:25 +0000
committerrtm <rtm>2006-06-16 20:29:25 +0000
commitae6e8aa730fa410118c0532938d4a9e62b08bbe8 (patch)
tree8341e238d7b725a2aeec1476bc0f46c46b5c90e8 /main.c
parentbe0a7eacdab4443199ed0ed4379a84edc7c98fd6 (diff)
downloadxv6-labs-ae6e8aa730fa410118c0532938d4a9e62b08bbe8.tar.gz
xv6-labs-ae6e8aa730fa410118c0532938d4a9e62b08bbe8.tar.bz2
xv6-labs-ae6e8aa730fa410118c0532938d4a9e62b08bbe8.zip
checkpoint
Diffstat (limited to 'main.c')
-rw-r--r--main.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/main.c b/main.c
index 43c8c02..2f3b00e 100644
--- a/main.c
+++ b/main.c
@@ -9,6 +9,8 @@
extern char edata[], end[];
+char buf[512];
+
int
main()
{
@@ -18,16 +20,11 @@ main()
// 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");
kinit(); // physical memory allocator
tinit(); // traps and interrupts
+ pic_init();
// create fake process zero
p = &proc[0];
@@ -46,6 +43,16 @@ main()
p->ppid = 0;
setupsegs(p);
+ // turn on interrupts
+ write_eflags(read_eflags() | FL_IF);
+ irq_setmask_8259A(0);
+
+#if 1
+ ide_read(0, buf, 1);
+ cprintf("sec0.0 %x\n", buf[0] & 0xff);
+#endif
+
+#if 0
p = newproc();
i = 0;
@@ -73,6 +80,7 @@ main()
p->mem[i++] = T_SYSCALL;
p->tf->tf_eip = 0;
p->tf->tf_esp = p->sz;
+#endif
swtch();