From 8352b998019565946b8f5b3b8f72175c5076efec Mon Sep 17 00:00:00 2001 From: kaashoek Date: Thu, 22 Jun 2006 15:28:09 +0000 Subject: [PATCH] oops --- asm.h | 14 ++++++++++++++ main.c | 2 ++ 2 files changed, 16 insertions(+) create mode 100644 asm.h diff --git a/asm.h b/asm.h new file mode 100644 index 0000000..5986ec7 --- /dev/null +++ b/asm.h @@ -0,0 +1,14 @@ +#define SEG_NULL \ + .word 0, 0; \ + .byte 0, 0, 0, 0 +#define SEG(type,base,lim) \ + .word (((lim) >> 12) & 0xffff), ((base) & 0xffff); \ + .byte (((base) >> 16) & 0xff), (0x90 | (type)), \ + (0xC0 | (((lim) >> 28) & 0xf)), (((base) >> 24) & 0xff) + +#define STA_X 0x8 // Executable segment +#define STA_E 0x4 // Expand down (non-executable segments) +#define STA_C 0x4 // Conforming code segment (executable only) +#define STA_W 0x2 // Writeable (non-executable segments) +#define STA_R 0x2 // Readable (executable segments) +#define STA_A 0x1 // Accessed diff --git a/main.c b/main.c index 0a43b85..5b17297 100644 --- a/main.c +++ b/main.c @@ -34,6 +34,8 @@ main() tinit(); // traps and interrupts pic_init(); + while (1); + // create fake process zero p = &proc[0]; curproc = p;