1 .\" $NetBSD: compat_svr4.8,v 1.24 2003/05/14 07:28:01 wiz Exp $
3 .\" Copyright (c) 1996 Christos Zoulas
4 .\" All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
15 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 .\" Stolen from compat_linux.8,v 1.2 1995/10/16 20:17:59 fvdl
33 .Nd setup procedure for running SVR4/iBCS2 binaries
35 .Nd setup procedure for running 32-bit SVR4/iBCS2 binaries
38 supports running SVR4/iBCS2 binaries. This code has been tested on
39 i386 (with binaries from SCO OpenServer and XENIX), m68k (with binaries from
41 and sparc (with binaries from Solaris) systems. Most programs should work,
42 but not ones that use or depend on:
44 .Bl -item -compact -offset indent
46 kernel internal data structures
52 the ticotsord loopback RPC mechanism (NIS uses this)
54 sound and video interfaces
56 threads (ttsession uses threads)
58 the streams administrative driver
61 The SVR4 compatibility feature is active
62 for kernels compiled with the
65 Since support for ELF executables is included
66 only if the kernel is compiled with the
70 options enabled, kernels which include
72 should also typically include
74 (for 32-bit ELF support)
77 (for 64-bit ELF support).
79 Another compatibility feature is
81 which allows the execution of 32-bit SVR4 binaries on a machine
82 with a 64-bit kernel. This requires
88 It is configured the same way as
96 can be made to point to
99 operating system donating the libraries has support for both 32-bit
102 Execution of 32-bit SVR4 binaries on a machine with a 32-bit kernel uses
107 Most SVR4 programs are dynamically linked. This means that you will
108 also need the shared libraries that the program depends on and the
109 runtime linker. Also, you will need to create a
111 directory for SVR4 binaries on your
113 system. This directory
116 Any file operations done by SVR4 programs run under
118 will look in this directory first. So, if a SVR4
119 program opens, for example,
124 .Pa /emul/svr4/etc/passwd ,
125 and if that does not exist open the
128 file. It is recommended that you install
129 SVR4 packages that include configuration files, etc under
131 to avoid naming conflicts with possible
134 libraries should also be installed in the shadow tree.
136 The simplest way to set up your system for SVR4 binaries is:
139 Make the necessary directories:
141 .Bl -tag -width 123 -compact -offset indent
142 .It (me@netbsd) mkdir -p /emul/svr4/{dev,etc}
144 .It (me@netbsd) mkdir -p /emul/svr4/usr/{bin,lib,ucblib}
146 .It (me@netbsd) mkdir -p /emul/svr4/usr/openwin/{bin,lib}
148 .It (me@netbsd) mkdir -p /emul/svr4/usr/dt/{bin,lib}
152 Copy files from an svr4 system:
154 .Bl -tag -width 123 -compact -offset indent
155 .It (me@svr4) cd /usr/lib
157 .It (me@svr4) tar -cf -\ . | \e
159 .It rsh netbsd 'cd /emul/svr4/usr/lib \*[Am]\*[Am] tar -xpf -'
163 .Bl -tag -width 123 -compact -offset indent
164 .It (me@svr4) cd /usr/ucblib
166 .It (me@svr4) tar -cf -\ . | \e
168 .It rsh netbsd 'cd /emul/svr4/usr/ucblib \*[Am]\*[Am] tar -xpf -'
172 If you are running openwindows:
174 .Bl -tag -width 123 -compact -offset indent
175 .It (me@svr4) cd /usr/openwin/lib
177 .It (me@svr4) tar -cf -\ . | \e
179 .It rsh netbsd 'cd /emul/svr4/usr/openwin/lib \*[Am]\*[Am] tar -xpf -'
181 .It (me@svr4) cd /usr/dt/lib
183 .It (me@svr4) tar -cf -\ . | \e
185 .It rsh netbsd 'cd /emul/svr4/usr/dt/lib \*[Am]\*[Am] tar -xpf -'
189 You will also probably need the timezone files from your Solaris
190 system, otherwise emulated binaries will run on UTC time.
192 .Bl -tag -width 123 -compact -offset indent
193 .It (me@netbsd) mkdir -p /emul/svr4/usr/share/lib/zoneinfo
195 .It (me@netbsd) mkdir -p /emul/svr4/etc/default
197 .It (me@svr4) cd /usr/share/lib/zoneinfo
199 .It (me@solaris) tar -cf - . | \e
201 .It rsh netbsd 'cd /emul/svr4/usr/share/lib/zoneinfo \*[Am]\*[Am]
205 .It (me@netbsd) echo TZ=US/Pacific \*[Gt] /emul/svr4/etc/default/init
209 Set up the configuration files and devices:
211 .Bl -tag -width 123 -compact -offset indent
212 .It (me@netbsd) cd /usr/share/examples/emul/svr4/etc
214 .It (me@netbsd) cp netconfig nsswitch.conf /emul/svr4/etc
216 .It (me@netbsd) cp SVR4_MAKEDEV /emul/svr4/dev
218 .It (me@netbsd) cd /emul/svr4/dev \*[Am]\*[Am] sh SVR4_MAKEDEV all
221 As the major number allocated for emulation of SVR4 devices may vary between
223 platforms, the SVR4_MAKEDEV script uses the
225 command to determine the architecture the devices nodes are being created for;
226 this can be overridden by setting the
228 environment variable accordingly.
231 An alternative method is to mount a whole SVR4 partition in
233 and then override with other mounts
238 Many system calls are still not emulated. The streams emulation is
239 incomplete (socketpair does not work yet).
241 Most SVR4 executables can not handle directory offset cookies \*[Gt] 32
242 bits. More recent ones, compiled for large file support (Solaris 2.6
243 and up) can. With older programs, you will see the message
244 .Dq svr4_getdents: dir offset too large for emulated program"
245 when this happens. Currently,
246 this can only happen on NFS mounted filesystems, mounted from servers
247 that return offsets with information in the upper 32 bits. These errors
248 should rarely happen, but can be avoided by mounting this filesystem with
249 offset translation enabled. See the
257 will also have the desired effect, but is less preferable.