1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
|
.\" $OpenBSD: compat_hpux.8,v 1.2 2002/05/22 08:46:05 mpech 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 November 29, 2001
.Dt COMPAT_HPUX 8
.Os
.Sh NAME
.Nm compat_hpux
.Nd setup procedure for running HP-UX binaries
.Sh DESCRIPTION
.Ox
supports running HP-UX binaries.
This applies only to m68k systems (such as hp300 systems).
Most programs should work, such as Matlab 4.2c and the HP-UX X11R5 server.
Programs that will not work are fairly uncommon, and often involve very low
level hardware access.
.Pp
The HP-UX compatibility feature is active
for kernels compiled with the
.Dv COMPAT_HPUX
and
.Dv COMPAT_M68K4K
options enabled.
HP-UX for m68k uses 4 KB page sizes, and
.Ox
for all m68k platforms now use 8 KB page sizes.
.Pp
A lot of programs are dynamically linked.
This means that you will need the HP-UX shared libraries that the program
depends on.
Also, you will need to create a
.Dq shadow root
directory for HP-UX binaries on your
.Ox
system.
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 you install hpux packages that include configuration
files, etc, under
.Pa /emul/hpux ,
to avoid naming conflicts with possible
.Ox
counterparts.
Shared libraries should also be installed in the shadow tree.
.Pp
Generally, you will need to look for the shared libraries that HP-UX
binaries depend on only the first few times that you install a HP-UX
program on your
.Ox
system.
After a while, you will have a sufficient set of HP-UX shared libraries on your
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: you
will need to be root on your
.Ox
system to do the necessary installation steps).
.Bl -enum
.It
You must have login 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 your
.Ox
system.
.Pp
Use tar, or a similar utility to collect the following files:
.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
Now, you need to copy these files to your
.Ox
system, and extract them into
.Pa /emul/hpux ,
for example, you should end up with the following files:
.Bl -item -compact
.It
.Pa /emul/hpux/lib/dld.sl
.It
.Pa /emul/hpux/lib/libc.sl
.It
.Pa /emul/hpux/lib/libm.sl
.It
.Pa /emul/hpux/lib/libM.sl
.It
.Pa /emul/hpux/lib/libcurses.sl
.It
And a whole bunch of files in
.Pa /emul/hpux/usr/lib .
.El
Overall, HP-UX 9.10 has about 10 MB of shared libraries that you will have
ended up copying to your system.
.It
You have access to an HP-UX system with its entire root drive exported via NFS.
In this case, you simply mount the entire HP-UX system under
.Pa /emul/hpux .
For example, on your
.Ox
system, you might mount it as:
.Dl mount -t nfs hpux-host.test.net:/ /emul/hpux
Note that, in this case, the HP-UX emulation will use the configuration files
from the HP-UX system
.Pq Pa /etc/passwd , for example
and this might not be what you want.
.El
.Ss Setting up X11R5
Although the
.Ox
based X11R5 server is the preferred way to run X on your system, you might
want to run the HP-UX X11R5 server instead.
To do so, you will need to grab a few additional files:
.Bl -item -compact
.It
.Pa /usr/bin/X11/X
.It
.Pa /usr/lib/grmd
.It
The shared libraries in
.Pa /usr/lib/X11R5
.It
.Pa /usr/lib/Motif1.2/libXm.sl
.It
All the subdirectories and files in
.Pa /usr/lib/X11/fonts
.It
All the files in
.Pa /usr/lib/X11/nls/Xhp
.It
All the files in
.Pa /usr/lib/X11/extensions
.It
.Pa /usr/lib/X11/XHPKeymaps
.It
.Pa /usr/lib/X11/XHPmodmap
.It
.Pa /usr/lib/X11/XPCmodmap
.It
.Pa /usr/lib/X11/XKeysymDB
.It
.Pa /usr/lib/X11/Xconsoles
.It
.Pa /usr/lib/X11/X0screens
.It
.Pa /usr/lib/X11/X0devices
.It
.Pa /usr/lib/X11/X0pointerkeys
.It
.Pa /usr/lib/X11/rgb.txt
.It
.Pa /usr/lib/X11/rgb.dir
.It
.Pa /usr/lib/X11/rgb.pag
.El
.Pp
You'll also need to perform a few configuration steps:
.Bl -enum
.It
Get and extract the
.Pa xbase.tgz
set for your version of
.Ox
to provide the X11R6 clients you'll be using with your new X server.
.It
Create the following directory for the X server to deposit its socket files
in:
.Dl mkdir -p /usr/spool/sockets/X11
.Dl chmod 777 /usr/spool/sockets/X11
.It
Add the following lines to your
.Pa /etc/rc.local
to create the necessary directories for the X server to deposit its files in,
when your system boots:
.Dl mkdir /tmp/.X11-unix
.Dl chmod 777 /tmp/.X11-unix
.Dl ln -s /usr/spool/sockets/X11/0 /tmp/.X11-unix/X0
.It
You may also want to link your X server to a more convenient location, such as:
.Dl ln -s /emul/hpux/usr/bin/X /usr/X11R6/bin/X
.El
.Sh SEE ALSO
.Xr options 4 ,
.Xr config 8
.Sh BUGS
You may not be able to run the X server on multiple framebuffers, even though
both the X server and
.Ox
support them.
|