From a98497b10909acac0d87f67dc031f2cbe3d62dbf Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Wed, 26 Jun 1991 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1991-06-26 --- pc/l.s | 30 ++++++++++++++++++++++-------- port/dev.c | 3 ++- port/sturp.c | 2 +- 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/pc/l.s b/pc/l.s index ed810fc3061792efbc161366877f43a4d0272a9c..678eb77d277a9aa6508c0bb33783fe29c4ef8ea0 100644 --- a/pc/l.s +++ b/pc/l.s @@ -1,25 +1,39 @@ #include "mem.h" +/* + * pointer to initial gdt (must be in first 64K of program) + */ GLOBL gdtptr(SB),$6 - DATA gdtptr+0(SB)/2, $(6*8) + DATA gdtptr+0(SB)/2, $(5*8) DATA gdtptr+2(SB)/4, $gdt(SB) +/* + * pointer to idt (must be in first 64K of program) + */ +GLOBL idtptr(SB),$6 + + DATA idtptr+0(SB)/2, $(6*8) + DATA idtptr+2(SB)/4, $idt(SB) + /* * boot processor */ TEXT start(SB),$0 CLI /* disable interrupts */ - MOVW $NULLSEL,IDTR /* force shutdown on error */ + + /* point CPU at the interrupt/trap table */ + LEAL idtptr(SB),AX +/* MOVL (AX),IDTR /**/ /* point data segment at low memory */ XORL AX,AX - MOVW AX,DS +/* MOVW AX,DS /**/ - /* load gdt address (valid after paging) */ + /* point CPU at the interrupt/trap table */ LEAL gdtptr(SB),AX - MOVL -KZERO(AX),GDTR +/* MOVL (AX),GDTR /**/ CALL main(SB) /* never returns */ @@ -132,12 +146,12 @@ TEXT invtrap(SB),$0 */ alltrap: - PUSHL DS +/* PUSHL DS /**/ PUSHAL MOVL $KDSEL, AX - MOVW AX, DS +/* MOVW AX, DS /**/ CALL trap(SB) POPAL - POPL DS +/* POPL DS /**/ ADDL $8,SP /* pop the trap and error codes */ IRETL diff --git a/port/dev.c b/port/dev.c index 1e79186c8d7697a3d4c97a4f78a3d2fd1d5122b7..a193f37f12c0e8c1ea303a4dc608df769e7159c8 100644 --- a/port/dev.c +++ b/port/dev.c @@ -127,7 +127,8 @@ devstat(Chan *c, char *db, Dirtab *tab, int ntab, Devgen *gen) convD2M(&dir, db); return; } - panic("devstat"); + print("devstat %c %lux\n", devchar[c->type], c->qid.path); + error(Enonexist); case 0: break; case 1: diff --git a/port/sturp.c b/port/sturp.c index 35e69162e7e0f45dc0508c4c7abb56f173736f31..ce6bde28e652814d1f46a919da7741c8deae27d3 100644 --- a/port/sturp.c +++ b/port/sturp.c @@ -11,7 +11,7 @@ enum { Nmask= 0x7, }; -#define DPRINT if(q->flag&QDEBUG)print +#define DPRINT if(q->flag&QDEBUG)kprint typedef struct Urp Urp;