kdb (for sam; untested); misc.
authorMike Karels <karels@ucbvax.Berkeley.EDU>
Sun, 22 Feb 1987 03:19:16 +0000 (19:19 -0800)
committerMike Karels <karels@ucbvax.Berkeley.EDU>
Sun, 22 Feb 1987 03:19:16 +0000 (19:19 -0800)
SCCS-vsn: sys/vax/vax/cons.c 7.2
SCCS-vsn: sys/vax/vax/locore.s 7.3
SCCS-vsn: sys/vax/vax/machdep.c 7.3
SCCS-vsn: sys/vax/vax/scb.s 7.2
SCCS-vsn: sys/vax/vax/swapgeneric.c 7.2
SCCS-vsn: sys/vax/vax/trap.c 7.2
SCCS-vsn: sys/vax/include/trap.h 7.2

usr/src/sys/vax/include/trap.h
usr/src/sys/vax/vax/cons.c
usr/src/sys/vax/vax/locore.s
usr/src/sys/vax/vax/machdep.c
usr/src/sys/vax/vax/scb.s
usr/src/sys/vax/vax/swapgeneric.c
usr/src/sys/vax/vax/trap.c

index 463087c..07b0c3a 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)trap.h      7.1 (Berkeley) %G%
+ *     @(#)trap.h      7.2 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -26,3 +26,4 @@
 #define        T_COMPATFLT     11              /* compatibility mode fault */
 #define        T_PAGEFLT       12              /* page fault */
 #define        T_TABLEFLT      13              /* page table fault */
 #define        T_COMPATFLT     11              /* compatibility mode fault */
 #define        T_PAGEFLT       12              /* page fault */
 #define        T_TABLEFLT      13              /* page table fault */
+#define        T_KDBTRAP       14              /* kernel debugger trap */
index 73362f7..3771dbb 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)cons.c      7.1 (Berkeley) %G%
+ *     @(#)cons.c      7.2 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
 #include "cons.h"
 #include "mtpr.h"
 
 #include "cons.h"
 #include "mtpr.h"
 
+/*
+ * On some machines (e.g. MicroVAX), a secondary console
+ * such as a display may supercede the standard serial console.
+ * On such machines, consops will be set to point to the cdevsw
+ * entry for the secondary console, and the standard console device
+ * (minor number 0) will be redirected.  Other minor numbers still
+ * refer to the standard console serial line.
+ *
+ * Also, console output may be redirected to another tty
+ * (e.g. a window); if so, constty will point to the current
+ * virtual console.
+ */
+struct cdevsw *consops = 0;
+struct tty *constty = 0;
 struct tty cons;
 int    cnstart();
 int    ttrstrt();
 struct tty cons;
 int    cnstart();
 int    ttrstrt();
@@ -34,6 +48,8 @@ cnopen(dev, flag)
 {
        register struct tty *tp = &cons;
 
 {
        register struct tty *tp = &cons;
 
+       if (consops && minor(dev) == 0)
+               return ((*consops->d_open)(dev, flag));
        tp->t_oproc = cnstart;
        if ((tp->t_state&TS_ISOPEN) == 0) {
                ttychars(tp);
        tp->t_oproc = cnstart;
        if ((tp->t_state&TS_ISOPEN) == 0) {
                ttychars(tp);
@@ -53,6 +69,8 @@ cnclose(dev)
 {
        register struct tty *tp = &cons;
 
 {
        register struct tty *tp = &cons;
 
+       if (consops && minor(dev) == 0)
+               return ((*consops->d_close)(dev));
        (*linesw[tp->t_line].l_close)(tp);
        ttyclose(tp);
 }
        (*linesw[tp->t_line].l_close)(tp);
        ttyclose(tp);
 }
@@ -64,6 +82,8 @@ cnread(dev, uio)
 {
        register struct tty *tp = &cons;
 
 {
        register struct tty *tp = &cons;
 
+       if (consops && minor(dev) == 0)
+               return ((*consops->d_read)(dev, uio));
        return ((*linesw[tp->t_line].l_read)(tp, uio));
 }
 
        return ((*linesw[tp->t_line].l_read)(tp, uio));
 }
 
@@ -74,9 +94,16 @@ cnwrite(dev, uio)
 {
        register struct tty *tp = &cons;
 
 {
        register struct tty *tp = &cons;
 
+       if (minor(dev) == 0) {
+               if (constty)
+                       tp = constty;
+               else if (consops)
+                       return ((*consops->d_write)(dev, uio));
+       }
        return ((*linesw[tp->t_line].l_write)(tp, uio));
 }
 
        return ((*linesw[tp->t_line].l_write)(tp, uio));
 }
 
+static int cnpolling = 0;
 /*
  * Got a level-20 receive interrupt -
  * the LSI wants to give us a character.
 /*
  * Got a level-20 receive interrupt -
  * the LSI wants to give us a character.
@@ -89,6 +116,8 @@ cnrint(dev)
        register int c;
        register struct tty *tp;
 
        register int c;
        register struct tty *tp;
 
+       if (cnpolling)
+               return;
        c = mfpr(RXDB);
        if (c&RXDB_ID) {
 #if VAX780
        c = mfpr(RXDB);
        if (c&RXDB_ID) {
 #if VAX780
@@ -98,6 +127,9 @@ cnrint(dev)
                return;
        }
        tp = &cons;
                return;
        }
        tp = &cons;
+#ifdef KDB
+       if (!kdbrintr(c, tp))
+#endif
        (*linesw[tp->t_line].l_rint)(c, tp);
 }
 
        (*linesw[tp->t_line].l_rint)(c, tp);
 }
 
@@ -109,6 +141,8 @@ cnioctl(dev, cmd, addr, flag)
        register struct tty *tp = &cons;
        int error;
  
        register struct tty *tp = &cons;
        int error;
  
+       if (consops && minor(dev) == 0)
+               return ((*consops->d_ioctl)(dev, cmd, addr, flag));
        error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, addr);
        if (error >= 0)
                return (error);
        error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, addr);
        if (error >= 0)
                return (error);
@@ -165,17 +199,18 @@ cnstart(tp)
        if (tp->t_outq.c_cc == 0)
                goto out;
        if (consdone == 0)
        if (tp->t_outq.c_cc == 0)
                goto out;
        if (consdone == 0)
-               return;
-       c = getc(&tp->t_outq);
-       if (tp->t_flags&(RAW|LITOUT))
-               mtpr(TXDB, c&0xff);
-       else if (c <= 0177)
-               mtpr(TXDB, (c | (partab[c]&0200))&0xff);
-       else {
-               timeout(ttrstrt, (caddr_t)tp, (c&0177));
-               tp->t_state |= TS_TIMEOUT;
                goto out;
                goto out;
+       c = getc(&tp->t_outq) & 0xff;
+       if ((tp->t_flags & (RAW|LITOUT)) == 0) {
+               if (c <= 0177)
+                       c |= (partab[c] & 0200);
+               else {
+                       timeout(ttrstrt, (caddr_t)tp, (c&0177));
+                       tp->t_state |= TS_TIMEOUT;
+                       goto out;
+               }
        }
        }
+       mtpr(TXDB, c);
        consdone = 0;
        tp->t_state |= TS_BUSY;
 out:
        consdone = 0;
        tp->t_state |= TS_BUSY;
 out:
@@ -210,3 +245,31 @@ cnputc(c)
        cnputc(0);
        mtpr(TXCS, s);
 }
        cnputc(0);
        mtpr(TXCS, s);
 }
+
+#if defined(KDB) || defined(GENERIC)
+/*
+ * Get character from console.
+ */
+cngetc()
+{
+       register int c, s;
+
+       s = splhigh();
+       while (c == 0 ||
+           (mfpr(RXCS)&RXCS_DONE) == 0 || (c = mfpr(RXDB)&0177) < 0)
+               ;
+       if (c == '\r')
+               c = '\n';
+       (void) splx(s);
+       return (c);
+}
+#endif
+
+#ifdef KDB
+cnpoll(onoff)
+       int onoff;
+{
+
+       cnpolling = onoff;
+}
+#endif
index b79b016..a9b93e0 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)locore.s    7.2 (Berkeley) %G%
+ *     @(#)locore.s    7.3 (Berkeley) %G%
  */
 
 #include "psl.h"
  */
 
 #include "psl.h"
@@ -32,6 +32,7 @@
        .set    MCKVEC,4        # offset into scb of machine check vector
        .set    NBPG,512
        .set    PGSHIFT,9
        .set    MCKVEC,4        # offset into scb of machine check vector
        .set    NBPG,512
        .set    PGSHIFT,9
+       .set    SYSTEM,0x80000000       # virtual address of system start
 
        .set    NISP,3          # number of interrupt stack pages
 
 
        .set    NISP,3          # number of interrupt stack pages
 
@@ -599,6 +600,8 @@ SCBVEC(bptflt):
        pushl $0; TRAP(BPTFLT)
 SCBVEC(compatflt):
        TRAP(COMPATFLT);
        pushl $0; TRAP(BPTFLT)
 SCBVEC(compatflt):
        TRAP(COMPATFLT);
+SCBVEC(kdbintr):
+       pushl $0; TRAP(KDBTRAP);
 SCBVEC(tracep):
        pushl $0; TRAP(TRCTRAP)
 SCBVEC(arithtrap):
 SCBVEC(tracep):
        pushl $0; TRAP(TRCTRAP)
 SCBVEC(arithtrap):
@@ -791,9 +794,18 @@ start:
 1:
 #endif
 /* clear memory from kernel bss and pages for proc 0 u. and page table */
 1:
 #endif
 /* clear memory from kernel bss and pages for proc 0 u. and page table */
-       movab   _edata,r6
-       movab   _end,r5
-       bbcc    $31,r5,0f; 0:
+       movab   _edata,r6; bicl2 $SYSTEM,r6
+       movab   _end,r5; bicl2 $SYSTEM,r5
+#ifdef KDB
+       subl2   $4,r5
+1:     clrl    (r6); acbl r5,$4,r6,1b          # clear just bss
+       addl2   $4,r5
+       bbc     $6,r11,0f                       # check RB_KDB
+       bicl3   $SYSTEM,r9,r5                   # skip symbol & string tables
+       bicl3   $SYSTEM,r9,r6
+#endif
+0:     bisl3   $SYSTEM,r5,r9                   # convert to virtual address
+       addl2   $NBPG-1,r9                      # roundup to next page
        addl2   $(UPAGES*NBPG)+NBPG+NBPG,r5
 1:     clrq    (r6); acbl r5,$8,r6,1b
 /* trap() and syscall() save r0-r11 in the entry mask (per ../h/reg.h) */
        addl2   $(UPAGES*NBPG)+NBPG+NBPG,r5
 1:     clrq    (r6); acbl r5,$8,r6,1b
 /* trap() and syscall() save r0-r11 in the entry mask (per ../h/reg.h) */
@@ -813,7 +825,7 @@ start:
        movab   _etext+NBPG-1,r1; bbcc $31,r1,0f; 0: ashl $-PGSHIFT,r1,r1
 1:     bisl3   $PG_V|PG_URKR,r2,_Sysmap[r2]; aoblss r1,r2,1b
 /* make kernel data, bss, read-write */
        movab   _etext+NBPG-1,r1; bbcc $31,r1,0f; 0: ashl $-PGSHIFT,r1,r1
 1:     bisl3   $PG_V|PG_URKR,r2,_Sysmap[r2]; aoblss r1,r2,1b
 /* make kernel data, bss, read-write */
-       movab   _end+NBPG-1,r1; bbcc $31,r1,0f; 0:; ashl $-PGSHIFT,r1,r1
+       bicl3   $SYSTEM,r9,r1; ashl $-PGSHIFT,r1,r1
 1:     bisl3   $PG_V|PG_KW,r2,_Sysmap[r2]; aoblss r1,r2,1b
 /* now go to mapped mode */
        mtpr    $0,$TBIA; mtpr $1,$MAPEN; jmp *$0f; 0:
 1:     bisl3   $PG_V|PG_KW,r2,_Sysmap[r2]; aoblss r1,r2,1b
 /* now go to mapped mode */
        mtpr    $0,$TBIA; mtpr $1,$MAPEN; jmp *$0f; 0:
@@ -822,10 +834,9 @@ start:
        movl    _maxmem,_physmem
        movl    _maxmem,_freemem
 /* setup context for proc[0] == Scheduler */
        movl    _maxmem,_physmem
        movl    _maxmem,_freemem
 /* setup context for proc[0] == Scheduler */
-       movab   _end+NBPG-1,r6
+       bicl3   $SYSTEM,r9,r6
        bicl2   $NBPG-1,r6              # make page boundary
 /* setup page table for proc[0] */
        bicl2   $NBPG-1,r6              # make page boundary
 /* setup page table for proc[0] */
-       bbcc    $31,r6,0f; 0:
        ashl    $-PGSHIFT,r6,r3                 # r3 = btoc(r6)
        bisl3   $PG_V|PG_KW,r3,_Usrptmap        # init first upt entry
        incl    r3
        ashl    $-PGSHIFT,r6,r3                 # r3 = btoc(r6)
        bisl3   $PG_V|PG_KW,r3,_Usrptmap        # init first upt entry
        incl    r3
@@ -859,6 +870,7 @@ start:
        mfpr    $P1BR,PCB_P1BR(r1)
        mfpr    $P1LR,PCB_P1LR(r1)
        movl    $CLSIZE,PCB_SZPT(r1)            # init u.u_pcb.pcb_szpt
        mfpr    $P1BR,PCB_P1BR(r1)
        mfpr    $P1LR,PCB_P1LR(r1)
        movl    $CLSIZE,PCB_SZPT(r1)            # init u.u_pcb.pcb_szpt
+       movl    r9,PCB_R9(r1)                   # r9 obtained from boot
        movl    r10,PCB_R10(r1)
        movl    r11,PCB_R11(r1)
        movab   1f,PCB_PC(r1)                   # initial pc
        movl    r10,PCB_R10(r1)
        movl    r11,PCB_R11(r1)
        movab   1f,PCB_PC(r1)                   # initial pc
@@ -875,8 +887,10 @@ start:
        movl    r10,_bootdev
 /* save reboot flags in global _boothowto */
        movl    r11,_boothowto
        movl    r10,_bootdev
 /* save reboot flags in global _boothowto */
        movl    r11,_boothowto
+/* save end of symbol & string table in global _bootesym */
+       subl3   $NBPG-1,r9,_bootesym
 /* calculate firstaddr, and call main() */
 /* calculate firstaddr, and call main() */
-       movab   _end+NBPG-1,r0; bbcc $31,r0,0f; 0:; ashl $-PGSHIFT,r0,-(sp)
+       bicl3   $SYSTEM,r9,r0; ashl $-PGSHIFT,r0,-(sp)
        addl2   $UPAGES+1,(sp); calls $1,_main
 /* proc[1] == /etc/init now running here; run icode */
        pushl   $PSL_CURMOD|PSL_PRVMOD; pushl $0; rei
        addl2   $UPAGES+1,(sp); calls $1,_main
 /* proc[1] == /etc/init now running here; run icode */
        pushl   $PSL_CURMOD|PSL_PRVMOD; pushl $0; rei
@@ -1290,6 +1304,46 @@ ENTRY(savectx, 0)
        clrl    r0
        ret
 
        clrl    r0
        ret
 
+#ifdef KDB
+/*
+ * C library -- reset, setexit
+ *
+ *     reset(x)
+ * will generate a "return" from
+ * the last call to
+ *     setexit()
+ * by restoring r6 - r12, ap, fp
+ * and doing a return.
+ * The returned value is x; on the original
+ * call the returned value is 0.
+ */
+ENTRY(setexit)
+       movab   setsav,r0
+       movq    r6,(r0)+
+       movq    r8,(r0)+
+       movq    r10,(r0)+
+       movq    8(fp),(r0)+             # ap, fp
+       movab   4(ap),(r0)+             # sp
+       movl    16(fp),(r0)             # pc
+       clrl    r0
+       ret
+
+ENTRY(reset)
+       movl    4(ap),r0        # returned value
+       movab   setsav,r1
+       movq    (r1)+,r6
+       movq    (r1)+,r8
+       movq    (r1)+,r10
+       movq    (r1)+,r12
+       movl    (r1)+,sp
+       jmp     *(r1)
+
+       .data
+       .align  2
+setsav:        .space  10*4
+       .text
+#endif
+
        .globl  _whichqs
        .globl  _qs
        .globl  _cnt
        .globl  _whichqs
        .globl  _qs
        .globl  _cnt
@@ -1315,7 +1369,7 @@ ENTRY(savectx, 0)
  * Call should be made at splclock(), and p->p_stat should be SRUN
  */
        .align  1
  * Call should be made at splclock(), and p->p_stat should be SRUN
  */
        .align  1
- JSBENTRY(Setrq, R0)
+JSBENTRY(Setrq, R0)
        tstl    P_RLINK(r0)             ## firewall: p->p_rlink must be 0
        beql    set1                    ##
        pushab  set3                    ##
        tstl    P_RLINK(r0)             ## firewall: p->p_rlink must be 0
        beql    set1                    ##
        pushab  set3                    ##
@@ -1337,7 +1391,7 @@ set3:     .asciz  "setrq"
  * Call should be made at splclock().
  */
        .align  1
  * Call should be made at splclock().
  */
        .align  1
- JSBENTRY(Remrq, R0)
+JSBENTRY(Remrq, R0)
        movzbl  P_PRI(r0),r1
        ashl    $-2,r1,r1
        bbsc    r1,_whichqs,rem1
        movzbl  P_PRI(r0),r1
        ashl    $-2,r1,r1
        bbsc    r1,_whichqs,rem1
@@ -1363,7 +1417,6 @@ rem3:     .asciz  "remrq"
 _masterpaddr:
        .long   0
 
 _masterpaddr:
        .long   0
 
-       .set    ASTLVL_NONE,4
        .text
 sw0:   .asciz  "swtch"
 
        .text
 sw0:   .asciz  "swtch"
 
@@ -1374,9 +1427,10 @@ sw0:     .asciz  "swtch"
        .globl  Idle
 Idle: idle:
        mtpr    $0,$IPL                 # must allow interrupts here
        .globl  Idle
 Idle: idle:
        mtpr    $0,$IPL                 # must allow interrupts here
+1:
        tstl    _whichqs                # look for non-empty queue
        bneq    sw1
        tstl    _whichqs                # look for non-empty queue
        bneq    sw1
-       brb     idle
+       brb     1b
 
 badsw: pushab  sw0
        calls   $1,_panic
 
 badsw: pushab  sw0
        calls   $1,_panic
@@ -1392,13 +1446,13 @@ JSBENTRY(Swtch, 0)
 sw1:   ffs     $0,$32,_whichqs,r0      # look for non-empty queue
        beql    idle                    # if none, idle
        mtpr    $0x18,$IPL              # lock out all so _whichqs==_qs
 sw1:   ffs     $0,$32,_whichqs,r0      # look for non-empty queue
        beql    idle                    # if none, idle
        mtpr    $0x18,$IPL              # lock out all so _whichqs==_qs
-       bbcc    r0,_whichqs,sw1         # proc moved via lbolt interrupt
+       bbcc    r0,_whichqs,sw1         # proc moved via interrupt
        movaq   _qs[r0],r1
        remque  *(r1),r2                # r2 = p = highest pri process
        bvs     badsw                   # make sure something was there
        movaq   _qs[r0],r1
        remque  *(r1),r2                # r2 = p = highest pri process
        bvs     badsw                   # make sure something was there
-sw2:   beql    sw3
+       beql    sw2
        insv    $1,r0,$1,_whichqs       # still more procs in this queue
        insv    $1,r0,$1,_whichqs       # still more procs in this queue
-sw3:
+sw2:
        clrl    _noproc
        clrl    _runrun
        tstl    P_WCHAN(r2)             ## firewalls
        clrl    _noproc
        clrl    _runrun
        tstl    P_WCHAN(r2)             ## firewalls
index 22c5e44..3fcfa57 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)machdep.c   7.2 (Berkeley) %G%
+ *     @(#)machdep.c   7.3 (Berkeley) %G%
  */
 
 #include "reg.h"
  */
 
 #include "reg.h"
@@ -95,6 +95,10 @@ startup(firstaddr)
        if (!qvcons_init())
                printf("qvss not initialized\n");
 #endif
        if (!qvcons_init())
                printf("qvss not initialized\n");
 #endif
+#endif
+
+#ifdef KDB
+       kdb_init();
 #endif
        /*
         * Good {morning,afternoon,evening,night}.
 #endif
        /*
         * Good {morning,afternoon,evening,night}.
@@ -259,6 +263,12 @@ startup(firstaddr)
         */
        initcpu();
 
         */
        initcpu();
 
+       /*
+        * Set up buffers, so they can be used to read disk labels.
+        */
+       bhinit();
+       binit();
+
        /*
         * Configure the system.
         */
        /*
         * Configure the system.
         */
@@ -865,10 +875,20 @@ dumpsys()
 {
 
        rpb.rp_flag = 1;
 {
 
        rpb.rp_flag = 1;
+       if (dumpdev == NODEV)
+               return;
 #ifdef notdef
        if ((minor(dumpdev)&07) != 1)
                return;
 #endif
 #ifdef notdef
        if ((minor(dumpdev)&07) != 1)
                return;
 #endif
+       /*
+        * For dumps during autoconfiguration,
+        * if dump device has already configured...
+        */
+       if (dumplo == 0 && bdevsw[major(dumpdev)].d_psize)
+               dumplo = (*bdevsw[major(dumpdev)].d_psize)(dumpdev) - physmem;
+       if (dumplo < 0)
+               dumplo = 0;
        dumpsize = physmem;
        printf("\ndumping to dev %x, offset %d\n", dumpdev, dumplo);
        printf("dump ");
        dumpsize = physmem;
        printf("\ndumping to dev %x, offset %d\n", dumpdev, dumplo);
        printf("dump ");
index 20aeff3..7dcecd7 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)scb.s       7.1 (Berkeley) %G%
+ *     @(#)scb.s       7.2 (Berkeley) %G%
  */
 
 #include "uba.h"
  */
 
 #include "uba.h"
@@ -34,7 +34,7 @@ _scb: .globl  _scb
 /* 080 */      STRAY;          STRAY;          KS(astflt);     STRAY;
 /* 090 */      STRAY;          STRAY;          STRAY;          STRAY;
 /* 0a0 */      IS(softclock);  STRAY;          STRAY;          STRAY;
 /* 080 */      STRAY;          STRAY;          KS(astflt);     STRAY;
 /* 090 */      STRAY;          STRAY;          STRAY;          STRAY;
 /* 0a0 */      IS(softclock);  STRAY;          STRAY;          STRAY;
-/* 0b0 */      IS(netintr);    STRAY;          STRAY;          STRAY;
+/* 0b0 */      IS(netintr);    STRAY;          STRAY;          IS(kdbintr);
 /* 0c0 */      IS(hardclock);  STRAY;          KS(emulate);    KS(emulateFPD);
 /* 0d0 */      STRAY;          STRAY;          STRAY;          STRAY;
 /* 0e0 */      STRAY;          STRAY;          STRAY;          STRAY;
 /* 0c0 */      IS(hardclock);  STRAY;          KS(emulate);    KS(emulateFPD);
 /* 0d0 */      STRAY;          STRAY;          STRAY;          STRAY;
 /* 0e0 */      STRAY;          STRAY;          STRAY;          STRAY;
index e9fe02f..34c809e 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)swapgeneric.c       7.1 (Berkeley) %G%
+ *     @(#)swapgeneric.c       7.2 (Berkeley) %G%
  */
 
 #include "mba.h"
  */
 
 #include "mba.h"
@@ -129,19 +129,6 @@ doswap:
                rootdev = dumpdev;
 }
 
                rootdev = dumpdev;
 }
 
-getchar()
-{
-       register c;
-
-       while ((mfpr(RXCS)&RXCS_DONE) == 0)
-               ;
-       c = mfpr(RXDB)&0177;
-       if (c == '\r')
-               c = '\n';
-       cnputc(c);
-       return (c);
-}
-
 gets(cp)
        char *cp;
 {
 gets(cp)
        char *cp;
 {
@@ -150,7 +137,7 @@ gets(cp)
 
        lp = cp;
        for (;;) {
 
        lp = cp;
        for (;;) {
-               c = getchar() & 0177;
+               cnputc(c = cngetc());
                switch (c) {
                case '\n':
                case '\r':
                switch (c) {
                case '\n':
                case '\r':
index 7abc47a..98985ac 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)trap.c      7.1 (Berkeley) %G%
+ *     @(#)trap.c      7.2 (Berkeley) %G%
  */
 
 #include "psl.h"
  */
 
 #include "psl.h"
@@ -44,12 +44,11 @@ char        *trap_type[] = {
        "Protection fault",
        "Trace trap",
        "Compatibility mode trap",
        "Protection fault",
        "Trace trap",
        "Compatibility mode trap",
-#ifdef notdef
        "Page fault",
        "Page table fault",
        "Page fault",
        "Page table fault",
-#endif
+       "Kernel debugger trap",
 };
 };
-#define        TRAP_TYPES      (sizeof trap_type / sizeof trap_type[0])
+int    TRAP_TYPES = (sizeof trap_type / sizeof trap_type[0]);
 
 /*
  * Called from the trap handler when a processor trap occurs.
 
 /*
  * Called from the trap handler when a processor trap occurs.
@@ -73,6 +72,10 @@ trap(sp, type, code, pc, psl)
        switch (type) {
 
        default:
        switch (type) {
 
        default:
+#ifdef KDB
+               if (kdb_trap(&psl))
+                       return;
+#endif
                printf("trap type %d, code = %x, pc = %x\n", type, code, pc);
                type &= ~USER;
                if ((unsigned)type < TRAP_TYPES)
                printf("trap type %d, code = %x, pc = %x\n", type, code, pc);
                type &= ~USER;
                if ((unsigned)type < TRAP_TYPES)