From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fdd80,2ade646f0ea93629 X-Google-Attributes: gidfdd80,public X-Google-Thread: 1164f8,a9f1c8b26ac59275 X-Google-Attributes: gid1164f8,public From: John Holden Subject: Re: Running RT/RSTS code under UNIX (Re: Threaded code on the PDP-11 (Re: Is RISC dead? (was: Re: K7's FP performance inches past P-III's))) Date: 1999/06/04 Message-ID: <37571AED.41C6@psych.usyd.edu.au>#1/1 X-Deja-AN: 485504863 Content-Transfer-Encoding: 7bit References: <7j2n2b$63i$1@davinci.thp.univie.ac.at> <7j3ekv$clr@web.nmti.com> <7j3ke0$fkd@web.nmti.com> Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@news.usyd.edu.au X-Trace: metro.ucc.usyd.edu.au 928455406 18545 129.78.83.6 (4 Jun 1999 00:16:46 GMT) Organization: University of Sydney, Australia Mime-Version: 1.0 NNTP-Posting-Date: 4 Jun 1999 00:16:46 GMT Newsgroups: comp.sys.dec,alt.sys.pdp11 Peter da Silva wrote: > It helped that the PDP-11 had 2 TRAP instructions (TRAP and IOT), and UNIX > used one while RSTS and RT used the other. > > -- Um... almost. The pdp-11 had four software trap instructions, EMT, TRAP, IOT and BPT. Both EMT and TRAP allowed you to encode 8 bits of data in the low byte of the instruction. The trap handler could use it to decode functions etc. The IOT instruction didn't allow any embeded data. The BPT (break point trap) was used by debuggers such as ODT. Also, the T (trace bit) in the processor status word would generate an interrupt to the BPT vector at the end of each instruction. When I migrated by department from RT-11 to Unix, I wrote a complete emulation package that would run RT-11 binaries under Edition 7 Unix on my pdp-11 (written in C except for trap/interrupt handlers). Both RT-11 and Unix used the EMT instruction for system calls. Fortunately, standard Unix library calls used indirect versions of the system calls that allow me to differentiate between a Unix and RT-11 EMT trap call with a small code change in the kernel. Needless to say, references to the I/O page weren't allowed, but most standard RT-11 programs ran with no problems. For RT-11 guru's, I noticed that even V5 binarys such at the MACRO assembler used V1 system calls (some undocumented!). I still have the code somewhere! regards John