			db Version 1.0
		Copyright (c) 1988, Bruce Evans

This software may be copied and redistributed provided you don't try to
make money off it and this sentence is included and remains effective.

This is the debugger (db) I have been writing and using for the last
year on various Minix programs, mostly the kernel. It has worked with
a PC, an AT and a 386 running both DOS and Minix, and a 188 running a
(non-PC) BIOS.

It is written to be almost independent of the system it is running on.
This rules out all i/o through the file system and makes it impractical
to debug at source level. Symbol tables for the system files can be
loaded at boot time.

There are a couple of things here which may be useful outside of db.
getline() is a line editor, far better than the one in the shell
(really the kernel). parsecode() is a PC scan code converter which was
originally supposed to be faster and simpler than the one in the console
driver (by being table driven). Unfortunately, making it _correct_ led
to lots of complications (the escape sequences for the AT keyboard are
awful). puti() is a disassembler which handles 8087 and 80386 as well
as 8086 code. It is based on the one in adb for Minix posted by Don
Dugger. It is much smaller than dis88.

There is some support for 386 protected mode, not all included. db
itself only works in real mode.

Although db is almost independent of Minix, a number of system files
need to be changed for best performance and safety.

kernel/console.c: This needs a hot key to call db. F10 is used. To let
db use the debugging routines already in the kernel, the putc routine
is vectorized. The usual console putc routine cannot be trusted and
would print on the wrong screen. A worse problem is saving and restoring
the video state. This is done, for text mode only, at the expense of
putting information functions into console.c (CGA/EGA hardware won't say).
A better way would be to move all debugging stuff, such as in dmp.c and
panics, into db. The console driver could be built on top of db to
save space.

kernel/const.h and lib/IBM_PC/head.s: The initial stack given to FS was
too small. It was too small for separate I&D even without db!

kernel/makefile: Call the new one makefile.db. Note that the db directory
has to be made separately. I don't know a good way to do this in the
makefile.

kernel/main.c: This needs to call db at panics and other critical points.
It also initializes the breakpoint interrupt. This merely avoids getting
a trap message from the kernel since all traps are terminated with a call
to db.

kernel/mpx88.s: The save()/restart() code had to be rewritten because it
was non-reentrant and couldn't be traced (it points the stack in the
proc table :-(). The stack instructions are faster but the code was so
tangled up that more straightforward code is both shorter and faster,
especially on AT's where instruction timings are bunched closer.

tools/bootblok.s: The relocation of the boot block failed for images
larger than 192K.

tools/build.c: This is enhanced to load symbol tables. I have 3 different
ways to boot and the one through build is the least preferred (others
are too large and/or messy to post here). So I converted build.c by
adding pieces of another program. It seems OK but hasn't been used much.
It is a difficult program to modify because of too much duplicated code.
This build.c also has #ifdef's to handle 16 bit Xenix headers.
