Subject: 4.3BSD/Ultrix binary emulation
To: None <port-vax@NetBSD.org>
From: A. Wik <aw@aw.gs>
List: port-vax
Date: 03/01/2006 21:38:31
Has anyone tried running 4.3BSD or Ultrix 4.5 binaries
on NetBSD/vax 1.5.x?  Any known problems?

Although the COMPAT option for 4.3BSD is enabled in my
kernel, all binaries I've tested so far have output some
garbage and exited.  The results were identical to a
preceding attempt with Ultrix compatibility, which
according to kernel config file comments cannot co-exist
with the 4.3 compat option).

As for the executables, the file(1) utility suggests:
  # file bin/date
  bin/date: 386 demand paged pure executable not stripped

Manual inspection does not confirm such findings.  For
example, /bin/sync (chosen for its small size) contains
the VAX instruction for a 4.3BSD sync(2) system call -
CHMK 36 - and then immediately checks the carry flag -
with BCS (== BLSSU) to determine whether it failed.

Abbreviated output of objdump(1) follows:

# objdump -b binary -m vax -D sync

sync:     file format binary

No symbols in "sync".
Disassembly of section .data:

00000000 <.data>:
       0:	0b 01 00 00 		crc	$1, $0, $0, $0
       4:	00 
       5:	04          		ret
       6:	00          		halt
       7:	00          		halt
       8:	00          		halt
       9:	04          		ret
       a:	00          		halt
       b:	00          		halt
       c:	00          		halt
       d:	00          		halt
       e:	00          		halt
       f:	00          		halt
      10:	f0 00 00 00 		insv	$0, $0, $0, $0
      14:	00 
...
     470:	00          		halt
     471:	00          		halt
     472:	bc 24       		chmk	$36
     474:	1f f2       		blssu	0x468
     476:	04          		ret