.\" $OpenBSD: compat_hpux.8,v 1.10 2007/05/31 19:19:58 jmc Exp $ .\" $NetBSD: compat_hpux.8,v 1.2 2001/12/16 23:47:19 wiz Exp $ .\" from: compat_linux.8,v 1.23 2001/10/07 10:12:05 mbw Exp .\" .\" Copyright (c) 1995 Frank van der Linden .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed for the NetBSD Project .\" by Frank van der Linden .\" 4. The name of the author may not be used to endorse or promote products .\" derived from this software without specific prior written permission .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .Dd $Mdocdate: May 31 2007 $ .Dt COMPAT_HPUX 8 .Os .Sh NAME .Nm compat_hpux .Nd setup for running HP-UX binaries under emulation .Sh DESCRIPTION .Ox 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. .Pp The HP-UX compatibility feature is active for kernels compiled with the .Nm COMPAT_HPUX and .Nm COMPAT_M68K4K options and the kern.emul.hpux .Xr sysctl 8 enabled. The .Nm COMPAT_M68K4K option is only required for m68k platforms. HP-UX for m68k uses 4 KB page sizes, and .Ox for all m68k platforms now uses 8 KB page sizes. .Pp A lot of programs are dynamically linked. This means that the HP-UX shared libraries that the programs depend on are also needed. Additionally, a "shadow root" directory for HP-UX binaries on the .Ox system will have to be created. This directory is named .Pa /emul/hpux . Any file operations done by HP-UX programs run under .Ox will look in this directory first. So, if a HP-UX program opens, for example, .Pa /etc/passwd , .Ox will first try to open .Pa /emul/hpux/etc/passwd , and if that does not exist open the .Sq real .Pa /etc/passwd file. It is recommended that HP-UX packages that include configuration files, etc., be installed under .Pa /emul/hpux , to avoid naming conflicts with possible .Ox counterparts. Shared libraries should also be installed in the shadow tree. .Pp 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 .Ox system. After a while, there will be a sufficient set of HP-UX shared libraries on the system to be able to run newly imported HP-UX binaries without any extra work. .Ss 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 .Ox system to perform the necessary installation steps). .Bl -enum .It 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), although 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 .Ox system. .Pp Use .Xr tar 1 , or a similar utility, to collect the following files: .Pp .Bl -item -compact .It All files in the .Pa /usr/lib directory ending in .Li ".sl" . There should be about 46 files and two soft links. .It All files in the .Pa /lib directory ending in .Li ".sl" . There should be 5 files. .El .Pp Copy these files to the .Ox system, and extract them into .Pa /emul/hpux . The following files should be present: .Bd -unfilled -offset indent /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 .Ed .Pp And a whole bunch of files in .Pa /emul/hpux/usr/lib . Overall, HP-UX 9.10 has about 10 MB of shared libraries that will need to be copied to the .Ox system. .It 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 .Pa /emul/hpux . For example, on the .Ox system, mount it as: .Pp .Dl $ mount -t nfs hpux-host.test.net:/ /emul/hpux .Pp Note that, in this case, the HP-UX emulation will use the configuration files from the HP-UX system .Po .Pa /etc/passwd , for example, .Pc and that might not be desirable. .El .Sh SEE ALSO .Xr options 4 , .Xr config 8 .Sh BUGS It might not be possible to run the X server on multiple framebuffers, even though both the X server and .Ox support them.