| @@ -1,120 +1,193 @@ | | | @@ -1,120 +1,193 @@ |
1 | .\" $NetBSD: compat_bsdos.8,v 1.4 2020/08/29 21:42:25 uwe Exp $ | | 1 | .\" $NetBSD: compat_bsdos.8,v 1.5 2020/09/01 01:15:28 uwe Exp $ |
2 | .\" | | 2 | .\" |
3 | .\" Copyright (c) 2020 The NetBSD Foundation, Inc. | | 3 | .\" Copyright (c) 2020 The NetBSD Foundation, Inc. |
4 | .\" All rights reserved. | | 4 | .\" All rights reserved. |
5 | .\" | | 5 | .\" |
6 | .\" This code is derived from software contributed to The NetBSD Foundation | | 6 | .\" This code is derived from software contributed to The NetBSD Foundation |
7 | .\" by Dan Plassche. | | 7 | .\" by Dan Plassche. |
8 | .\" | | 8 | .\" |
9 | .\" Redistribution and use in source and binary forms, with or without | | 9 | .\" Redistribution and use in source and binary forms, with or without |
10 | .\" modification, are permitted provided that the following conditions | | 10 | .\" modification, are permitted provided that the following conditions |
11 | .\" are met: | | 11 | .\" are met: |
12 | .\" 1. Redistributions of source code must retain the above copyright | | 12 | .\" 1. Redistributions of source code must retain the above copyright |
13 | .\" notice, this list of conditions and the following disclaimer. | | 13 | .\" notice, this list of conditions and the following disclaimer. |
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | | 14 | .\" 2. Redistributions in binary form must reproduce the above copyright |
15 | .\" notice, this list of conditions and the following disclaimer in the | | 15 | .\" notice, this list of conditions and the following disclaimer in the |
16 | .\" documentation and/or other materials provided with the distribution. | | 16 | .\" documentation and/or other materials provided with the distribution. |
17 | .\" | | 17 | .\" |
18 | .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | | 18 | .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS |
19 | .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | | 19 | .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
20 | .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | | 20 | .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
21 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | | 21 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS |
22 | .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 22 | .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
23 | .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 23 | .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
24 | .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 24 | .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
25 | .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 25 | .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
26 | .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 26 | .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
27 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 27 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
28 | .\" POSSIBILITY OF SUCH DAMAGE. | | 28 | .\" POSSIBILITY OF SUCH DAMAGE. |
29 | .\" | | 29 | .\" |
30 | .Dd August 27, 2020 | | 30 | .Dd August 27, 2020 |
31 | .Dt COMPAT_BSDOS 8 | | 31 | .Dt COMPAT_BSDOS 8 |
32 | .Os | | 32 | .Os |
33 | .Sh NAME | | 33 | .Sh NAME |
34 | .Nm compat_bsdos | | 34 | .Nm compat_bsdos |
35 | .Nd binary compatibility for BSDi releases | | 35 | .Nd binary compatibility for BSDi releases |
36 | .Sh DESCRIPTION | | 36 | .Sh DESCRIPTION |
37 | The | | 37 | The |
38 | .Dv COMPAT_NOMID | | 38 | .Dv COMPAT_NOMID |
39 | kernel option includes compatibility with | | 39 | kernel option includes compatibility with |
40 | .Tn BSDi Ns No \ 1. Ns Em \^x Ns \|\(en\|3. Ns Em \^x | | 40 | .Tn BSDi Ns No \ 1. Ns Em \^x Ns \|\(en\|3. Ns Em \^x |
41 | .Xr a.out 5 | | 41 | .Xr a.out 5 |
42 | binaries on | | 42 | binaries on |
43 | .Nx Ns Tn /i386 | | 43 | .Nx Ns Tn /i386 |
44 | and | | 44 | and |
45 | .Nx Ns Tn /amd64 . | | 45 | .Nx Ns Tn /amd64 . |
46 | The option is enabled by default in the | | 46 | The option is enabled by default in the |
47 | .Li GENERIC | | 47 | .Li GENERIC |
48 | kernel on i386, | | 48 | kernel on i386, |
49 | but needs to be set along with | | 49 | but needs to be set along with |
50 | .Dv EXEC_AOUT | | 50 | .Dv EXEC_AOUT |
51 | on amd64. | | 51 | on amd64. |
52 | .Pp | | 52 | .Pp |
53 | Null memory protection must be disabled with the | | 53 | Null memory protection must be disabled with the |
54 | .Xr sysctl 7 | | 54 | .Xr sysctl 7 |
55 | option | | 55 | option |
56 | .Va vm.user_va0_disable | | 56 | .Va vm.user_va0_disable |
57 | set to | | 57 | set to |
58 | .Li 0 | | 58 | .Li 0 |
59 | for the binaries to run successfully. | | 59 | for the binaries to run successfully. |
60 | .Pp | | 60 | .Pp |
61 | .Bsx 2.0+ | | 61 | .Bsx |
62 | binaries also require an | | 62 | binaries may be placed under |
| | | 63 | .Pa /emul |
| | | 64 | directory to match the location of other |
| | | 65 | non-native executables |
| | | 66 | on |
| | | 67 | .Nx , |
| | | 68 | but the compatibility environment |
| | | 69 | does not automatically lookup libraries |
| | | 70 | under |
| | | 71 | .Pa /emul/bsdos |
| | | 72 | as happens with the shared |
| | | 73 | libraries |
| | | 74 | for |
| | | 75 | .Nx 1.0\|\(en\|1.5 |
| | | 76 | .Xr a.out 5 |
| | | 77 | binaries under |
| | | 78 | .Pa /emul/aout . |
| | | 79 | .Pp |
| | | 80 | .Tn BSD/386 Ns No \ 1.0\|\(en\|1.1 |
| | | 81 | uses static binaries that do not |
| | | 82 | dynamically load libraries at runtime. |
| | | 83 | .Pp |
| | | 84 | .Bsx 2.0 |
| | | 85 | introduced |
| | | 86 | .Dq "static shared libraries" |
| | | 87 | as the default for standard binaries. |
| | | 88 | The shared libraries are compiled from |
| | | 89 | .Pa /lib |
| | | 90 | and |
| | | 91 | .Pa /usr/lib |
| | | 92 | to a custom format under |
| | | 93 | .Pa /shlib . |
| | | 94 | BSDi libraries |
| | | 95 | under |
| | | 96 | .Pa /shlib |
| | | 97 | are not in the standard |
| | | 98 | .Xr ar 5 |
| | | 99 | format and cannot be loaded by |
63 | .Xr ldconfig 8 | | 100 | .Xr ldconfig 8 |
64 | configuration or a symbolic link | | 101 | on |
65 | pointing to the | | 102 | .Nx . |
66 | .Pa /emul/bsdos/shlib | | 103 | In order for BSDi executables to |
67 | directory to run outside of a chroot. | | 104 | access the binary objects at the |
| | | 105 | hardcoded |
| | | 106 | .Pa /shlib |
| | | 107 | path, |
| | | 108 | the user may setup a |
| | | 109 | symbolic link from |
| | | 110 | .Pa /shlib |
| | | 111 | to |
| | | 112 | .Pa /emul/bsdos/shlib . |
| | | 113 | .\" or run a shell under a |
| | | 114 | .\" .Ic chroot |
| | | 115 | .\" with the command |
| | | 116 | .\" .Ic chroot "/emul/bsdos/shlib /bin/sh" . |
| | | 117 | .\" One could rebuild the BSDi userland |
| | | 118 | .\" from source using |
| | | 119 | .\" .Pa /emul/bsdos/lib |
| | | 120 | .\" and |
| | | 121 | .\" .Pa /emul/bsdos/usr/lib . |
| | | 122 | .\" Then adding |
| | | 123 | .\" .Pa /emul/bsdos/lib |
| | | 124 | .\" and |
| | | 125 | .\" .Pa /emul/bsdos/usr/lib |
| | | 126 | .\" to |
| | | 127 | .\" .Pa /etc/ld.so.conf |
| | | 128 | .\" and running |
| | | 129 | .\" .Ic ldconfig |
| | | 130 | .\" to regenerate |
| | | 131 | .\" .Pa /var/run/ld.so.hints |
| | | 132 | .\" for a new hybrid setup. |
68 | .Pp | | 133 | .Pp |
69 | .Bsx 4.0 | | 134 | .Bsx 4.0 |
70 | switched to an ELF binary executable format | | 135 | switched to an ELF binary executable format |
71 | that does not run under the | | 136 | that does not run under the |
72 | compatibility layers currently available on | | 137 | compatibility layers currently available on |
73 | .Nx . | | 138 | .Nx . |
74 | .Sh SEE ALSO | | 139 | .Sh SEE ALSO |
75 | .Xr options 4 , | | 140 | .Xr options 4 , |
76 | .Xr a.out 5 , | | 141 | .Xr a.out 5 , |
77 | .Xr elf 5 , | | 142 | .Xr elf 5 , |
78 | .Xr sysctl 7 , | | 143 | .Xr sysctl 7 , |
79 | .Xr compat_netbsd32 8 , | | 144 | .Xr compat_netbsd32 8 , |
80 | .Xr ldconfig 8 | | 145 | .Xr ldconfig 8 |
81 | .Sh HISTORY | | 146 | .Sh HISTORY |
82 | .Tn BSD/386 Ns No \ 1.0\|\(en\|1.1 | | 147 | .Tn BSD/386 Ns No \ 1.0\|\(en\|1.1 |
83 | was derived from | | 148 | was derived from |
84 | .Bx 4.3 Tn Reno | | 149 | .Bx 4.3 Tn Reno |
85 | code in the | | 150 | code in the |
86 | .Tn Net/2 | | 151 | .Tn Net/2 |
87 | release. | | 152 | release. |
88 | .Pp | | 153 | .Pp |
89 | .Bsx 2.0 | | 154 | .Bsx 2.0 |
90 | was based on | | 155 | was based on |
91 | .Bx 4.4 Tn Lite , | | 156 | .Bx 4.4 Tn Lite , |
92 | but introduced new static shared libraries | | 157 | but added the new static shared library |
93 | compiled into binary objects under | | 158 | format as the runtime default for executables. |
94 | .Pa /shlib . | | | |
95 | The build system included the | | 159 | The build system included the |
96 | .Li shlicc | | 160 | .Li shlicc |
97 | command with the | | 161 | command with the |
98 | .Fl Bstatic | | 162 | .Fl Bstatic |
99 | flag that allowed reverting to the standard | | 163 | flag that allowed reverting to the standard |
100 | library archive format. | | 164 | library archive format that remained available |
| | | 165 | under |
| | | 166 | .Pa /lib |
| | | 167 | and |
| | | 168 | .Pa /usr/lib . |
| | | 169 | .Pp |
| | | 170 | .Nx 1.0 |
| | | 171 | added shared libraries using the standard |
| | | 172 | .Xr ar 5 |
| | | 173 | archive format. |
101 | .Pp | | 174 | .Pp |
102 | .Ox 2.2\|\(en\|4.7 | | 175 | .Ox 2.2\|\(en\|4.7 |
103 | included a different compatibility implementation | | 176 | included a different compatibility implementation |
104 | under the | | 177 | under the |
105 | .Dv COMPAT_BSDOS | | 178 | .Dv COMPAT_BSDOS |
106 | kernel option. | | 179 | kernel option. |
107 | .Sh BUGS | | 180 | .Sh BUGS |
108 | .Bsx | | 181 | .Bsx |
109 | compatibility was broken on | | 182 | compatibility was broken on |
110 | .Nx 5\|\(en\|6 | | 183 | .Nx 5\|\(en\|6 . |
111 | .Pp | | 184 | .Pp |
112 | .Bsx 3.0 | | 185 | .Bsx 3.0 |
113 | added | | 186 | added |
114 | .Tn SPARC | | 187 | .Tn SPARC |
115 | support, but the binaries are incorrectly recognized as | | 188 | support, but the binaries are incorrectly recognized as |
116 | .Tn SunOS | | 189 | .Tn SunOS |
117 | executables and fail on | | 190 | executables and fail on |
118 | .Nx Ns Tn /sparc | | 191 | .Nx Ns Tn /sparc |
119 | and | | 192 | and |
120 | .Nx Ns Tn /sparc64 . | | 193 | .Nx Ns Tn /sparc64 . |