COMPAT_HPUX(8)          OpenBSD System Manager's Manual         COMPAT_HPUX(8)

NAME
     compat_hpux - setup for running HP-UX binaries under emulation

DESCRIPTION
     OpenBSD supports running HP-UX binaries.  This applies to m68k (such as
     hp300) and hppa systems.  Most programs should work, such as Matlab 4.2c
     on m68k platforms.  Programs that will not work are fairly uncommon, and
     often involve very low level hardware access, such as the X11 server on
     hppa machines.

     The HP-UX compatibility feature is active for kernels compiled with the
     COMPAT_HPUX and COMPAT_M68K4K options and the kern.emul.hpux sysctl(8)
     enabled.  The COMPAT_M68K4K option is only required for m68k platforms.
     HP-UX for m68k uses 4 KB page sizes, and OpenBSD for all m68k platforms
     now uses 8 KB page sizes.

     A lot of programs are dynamically linked.  This means that the HP-UX
     shared libraries that the programs depend on are also needed.  Addition-
     ally, a "shadow root" directory for HP-UX binaries on the OpenBSD system
     will have to be created.  This directory is named /emul/hpux.  Any file
     operations done by HP-UX programs run under OpenBSD will look in this di-
     rectory first.  So, if a HP-UX program opens, for example, /etc/passwd,
     OpenBSD will first try to open /emul/hpux/etc/passwd, and if that does
     not exist open the `real' /etc/passwd file.  It is recommended that HP-UX
     packages that include configuration files, etc., be installed under
     /emul/hpux, to avoid naming conflicts with possible OpenBSD counterparts.
     Shared libraries should also be installed in the shadow tree.

     Generally, it will only be necessary to look for the shared libraries
     that HP-UX binaries depend on the first few times that HP-UX programs are
     installed on the OpenBSD system.  After a while, there will be a suffi-
     cient set of HP-UX shared libraries on the system to be able to run newly
     imported HP-UX binaries without any extra work.

   Setting up shared libraries
     How to get to know which shared libraries HP-UX binaries need, and where
     to get them?  Basically, there are 2 possibilities.  (When following
     these instructions, root privileges are required on the OpenBSD system to
     perform the necessary installation steps).

     1.   Access to an HP-UX system: These instructions apply to HP-UX 9.10
          (the latest version of HP-UX available for m68k-based systems), al-
          though the instructions should be similar for earlier versions of
          HP-UX.  By far, the easiest method is to copy the essential files
          locally to the OpenBSD system.

          Use tar(1), or a similar utility, to collect the following files:

          All files in the /usr/lib directory ending in .sl.  There should be
          about 46 files and two soft links.
          All files in the /lib directory ending in .sl.  There should be 5
          files.

          Copy these files to the OpenBSD system, and extract them into
          /emul/hpux.  The following files should be present:

                /emul/hpux/lib/dld.sl
                /emul/hpux/lib/libc.sl
                /emul/hpux/lib/libm.sl
                /emul/hpux/lib/libM.sl
                /emul/hpux/lib/libcurses.sl

          And a whole bunch of files in /emul/hpux/usr/lib.  Overall, HP-UX
          9.10 has about 10 MB of shared libraries that will need to be copied
          to the OpenBSD system.

     2.   Access to an HP-UX system with its entire root drive exported via
          NFS: In this case, simply mount the entire HP-UX system under
          /emul/hpux.  For example, on the OpenBSD system, mount it as:

                $ mount -t nfs hpux-host.test.net:/ /emul/hpux

          Note that, in this case, the HP-UX emulation will use the configura-
          tion files from the HP-UX system (/etc/passwd, for example,) and
          that might not be desirable.

SEE ALSO
     options(4), config(8)

BUGS
     It might not be possible to run the X server on multiple framebuffers,
     even though both the X server and OpenBSD support them.

OpenBSD 4.7                      May 31, 2007                                2
