ast@cs.vu.nl (Andy Tanenbaum) (04/13/90)
echo x - etc/gettydefs sed '/^X/s///' > etc/gettydefs << '/' X# X# MINIX version 1.5 /etc/gettydefs X# X X1200# SANE B1200# SANE B1200# Login: #1200 X X2400# SANE B2400# SANE B2400# Login: #4800 X X4800# SANE B4800# SANE B4800# Login: #9600 X X9600# SANE B9600# SANE B9600# Login: #300 X X300# SANE B300# SANE B300# Login: #1200 X XETHER# SANE B115200# SANE B115200# Ethernet Login: #ETHER X XCONSOLE# SANE B115200# SANE B115200#Console Login: #CONSOLE / echo x - etc/rc sed '/^X/s///' > etc/rc << '/' X# This file performs various system initializations. X X# Initialize files. X>/etc/mtab # create file to log mounts X>/etc/utmp # /etc/utmp keeps track of logins X X# Mount the floppy disk. X/bin/getlf "Please insert /usr diskette in drive 0. Then hit ENTER." X/etc/mount /dev/fd0 /usr # mount the floppy disk X X# More initialization (cannot be done until /usr is mounted). X>/usr/adm/wtmp # accounting information X/usr/bin/printroot >>/etc/mtab # /etc/mtab keeps track of mounts X X# Try to read the hardware real-time clock, if there is one, to set the date X/usr/bin/date `/usr/bin/readclock` </dev/tty X X# Initialize the first RS232 line to 1200 baud. X/usr/bin/stty 1200 </dev/tty1 X X#Display the message of the day and start update. Xcat /etc/message X/etc/update & / echo x - command/dis88/README sed '/^X/s///' > command/dis88/README << '/' X dis88 X Beta Release X 87/09/01 X --- X G. M. HARDING X POB 4142 X Santa Clara CA 95054-0142 X X X "Dis88" is a symbolic disassembler for the Intel 8088 CPU, X designed to run under the PC/IX operating system on an IBM XT X or fully-compatible clone. Its output is in the format of, and X is completely compatible with, the PC/IX assembler, "as". The X program is copyrighted by its author, but may be copied and re- X distributed freely provided that complete source code, with all X copyright notices, accompanies any distribution. This provision X also applies to any modifications you may make. You are urged X to comment such changes, giving, as a miminum, your name and X complete address. X X This release of the program is a beta release, which means X that it has been extensively, but not exhaustively, tested. X User comments, recommendations, and bug fixes are welcome. The X principal features of the current release are: X X (a) The ability to disassemble any file in PC/IX object X format, making full use of symbol and relocation information if X it is present, regardless of whether the file is executable or X linkable, and regardless of whether it has continuous or split X I/D space; X X (b) Automatic generation of synthetic labels when no sym- X bol table is available; and X X (c) Optional output of address and object-code informa- X tion as assembler comment text. X X Limitations of the current release are: X X (a) Numeric co-processor (i.e., 8087) mnemonics are not X supported. Instructions for the co-processor are disassembled X as CPU escape sequences, or as interrupts, depending on how X they were assembled in the first place. This limitation will be X addressed in a future release. X X (b) Symbolic references within the object file's data X segment are not supported. Thus, for example, if a data segment X location is initialized to point to a text segment address, no X reference to a text segment symbol will be detected. This limi- X tation is likely to remain in future releases, because object X code does not, in most cases, contain sufficient information to X allow meaningful interpretation of pure data. (Note, however, X that symbolic references to the data segment from within the X text segment are always supported.) X X As a final caveat, be aware that the PC/IX assembler does X not recognize the "esc" mnemonic, even though it refers to a X completely valid CPU operation which is documented in all the X Intel literature. Thus, the corresponding opcodes (0xd8 through X 0xdf) are disassembled as .byte directives. For reference, how- X ever, the syntactically-correct "esc" instruction is output as X a comment. X X To build the disassembler program, transfer all the source X files, together with the Makefile, to a suitable (preferably X empty) PC/IX directory. Then, simply type "make". X X To use dis88, place it in a directory which appears in X your $PATH list. It may then be invoked by name from whatever X directory you happen to be in. As a minimum, the program must X be invoked with one command-line argument: the name of the ob- X ject file to be disassembled. (Dis88 will complain if the file X specified is not an object file.) Optionally, you may specify X an output file; stdout is the default. One command-line switch X is available: "-o", which makes the program display addresses X and object code along with its mnemonic disassembly. X X The "-o" option is useful primarily for verifying the cor- X rectness of the program's output. In particular, it may be used X to check the accuracy of local relative jump opcodes. These X jumps often target local labels, which are lost at assembly X time; thus, the disassembly may contain cryptic instructions X like "jnz .+39". As a user convenience, all relative jump and X call opcodes are output with a comment which identifies the X physical target address. X X By convention, the release level of the program as a whole X is the SID of the file disrel.c, and this SID string appears in X each disassembly. Release 2.1 of the program is the first beta X release to be distributed on Usenet. X X X.TH dis88 1 LOCAL X.SH "NAME" Xdis88 \- 8088 symbolic disassembler X.SH "SYNOPSIS" X\fBdis88\fP [ -o ] ifile [ ofile ] X.SH "DESCRIPTION" XDis88 reads ifile, which must be in PC/IX a.out format. XIt interprets the binary opcodes and data locations, and Xwrites corresponding assembler source code to stdout, or Xto ofile if specified. The program's output is in the Xformat of, and fully compatible with, the PC/IX assembler, Xas(1). If a symbol table is present in ifile, labels and Xreferences will be symbolic in the output. If the input Xfile lacks a symbol table, the fact will be noted, and the Xdisassembly will proceed, with the disassembler generating Xsynthetic labels as needed. If the input file has split XI/D space, or if it is executable, the disassembler will Xmake all necessary adjustments in address-reference calculations. X.PP XIf the "-o" option appears, object code will be included Xin comments during disassembly of the text segment. This Xfeature is used primarily for debugging the disassembler Xitself, but may provide information of passing interest Xto users. X.PP XThe program always outputs the current machine address Xbefore disassembling an opcode. If a symbol table is Xpresent, this address is output as an assembler comment; Xotherwise, it is incorporated into the synthetic label Xwhich is generated internally. Since relative jumps, Xespecially short ones, may target unlabelled locations, Xthe program always outputs the physical target address Xas a comment, to assist the user in following the code. X.PP XThe text segment of an object file is always padded to Xan even machine address. In addition, if the file has Xsplit I/D space, the text segment will be padded to a Xparagraph boundary (i.e., an address divisible by 16). XAs a result of this padding, the disassembler may produce Xa few spurious, but harmless, instructions at the Xend of the text segment. X.PP XDisassembly of the data segment is a difficult matter. XThe information to which initialized data refers cannot Xbe inferred from context, except in the special case Xof an external data or address reference, which will be Xreflected in the relocation table. Internal data and Xaddress references will already be resolved in the object file, Xand cannot be recreated. Therefore, the data Xsegment is disassembled as a byte stream, with long Xstretches of null data represented by an appropriate X".zerow" pseudo-op. This limitation notwithstanding, Xlabels (as opposed to symbolic references) are always Xoutput at appropriate points within the data segment. X.PP XIf disassembly of the data segment is difficult, disassembly of the Xbss segment is quite easy, because uninitialized data is all Xzero by definition. No data Xis output in the bss segment, but symbolic labels are Xoutput as appropriate. X.PP XFor each opcode which takes an operand, a particular Xsymbol type (text, data, or bss) is appropriate. This Xtidy correspondence is complicated somewhat, however, Xby the existence of assembler symbolic constants and Xsegment override opcodes. Therefore, the disassembler's Xsymbol lookup routine attempts to apply a certain amount Xof intelligence when it is asked to find a symbol. If Xit cannot match on a symbol of the preferred type, it Xmay return a symbol of some other type, depending on Xpreassigned (and somewhat arbitrary) rankings within Xeach type. Finally, if all else fails, it returns a Xstring containing the address sought as a hex constant; Xthis behavior allows calling routines to use the output Xof the lookup function regardless of the success of its Xsearch. X.PP XIt is worth noting, at this point, that the symbol lookup Xroutine operates linearly, and has not been optimized in Xany way. Execution time is thus likely to increase Xgeometrically with input file size. The disassembler is Xinternally limited to 1500 symbol table entries and 1500 Xrelocation table entries; while these limits are generous X(/unix, itself, has fewer than 800 symbols), they are not Xguaranteed to be adequate in all cases. If the symbol Xtable or the relocation table overflows, the disassembly Xaborts. X.PP XFinally, users should be aware of a bug in the assembler, Xwhich causes it not to parse the "esc" mnemonic, even Xthough "esc" is a completely legitimate opcode which is Xdocumented in all the Intel literature. To accommodate Xthis deficiency, the disassembler translates opcodes of Xthe "esc" family to .byte directives, but notes the Xcorrect mnemonic in a comment for reference. X.PP XIn all cases, it should be possible to submit the output Xof the disassembler program to the assembler, and assemble Xit without error. In most cases, the resulting object Xcode will be identical to the original; in any event, it Xwill be functionally equivalent. X.SH "SEE ALSO" Xadb(1), as(1), cc(1), ld(1). X.br X"Assembler Reference Manual" in the PC/IX Programmer's XGuide. X.SH "DIAGNOSTICS" X"can't access input file" if the input file cannot be Xfound, opened, or read. X.sp X"can't open output file" if the output file cannot be Xcreated. X.sp X"warning: host/cpu clash" if the program is run on a Xmachine with a different CPU. X.sp X"input file not in object format" if the magic number Xdoes not correspond to that of a PC/IX object file. X.sp X"not an 8086/8088 object file" if the CPU ID of the Xfile header is incorrect. X.sp X"reloc table overflow" if there are more than 1500 Xentries in the relocation table. X.sp X"symbol table overflow" if there are more than 1500 Xentries in the symbol table. X.sp X"lseek error" if the input file is corrupted (should Xnever happen). X.sp X"warning: no symbols" if the symbol table is missing. X.sp X"can't reopen input file" if the input file is removed Xor altered during program execution (should never happen). X.SH "BUGS" XNumeric co-processor (i.e., 8087) mnemonics are not currently supported. XInstructions for the co-processor are Xdisassembled as CPU escape sequences, or as interrupts, Xdepending on how they were assembled in the first place. X.sp XDespite the program's best efforts, a symbol retrieved Xfrom the symbol table may sometimes be different from Xthe symbol used in the original assembly. X.sp XThe disassembler's internal tables are of fixed size, Xand the program aborts if they overflow. /