xref: /freebsd/share/man/man4/linux.4 (revision f54d9519862f59dede0f289383cc367a7823388e)
1e6769554SRui Paulo.\" Copyright (c) 2000 Sheldon Hearn
2e6769554SRui Paulo.\" All rights reserved.
3e6769554SRui Paulo.\"
4e6769554SRui Paulo.\" Redistribution and use in source and binary forms, with or without
5e6769554SRui Paulo.\" modification, are permitted provided that the following conditions
6e6769554SRui Paulo.\" are met:
7e6769554SRui Paulo.\" 1. Redistributions of source code must retain the above copyright
8e6769554SRui Paulo.\"    notice, this list of conditions and the following disclaimer.
9e6769554SRui Paulo.\" 2. Redistributions in binary form must reproduce the above copyright
10e6769554SRui Paulo.\"    notice, this list of conditions and the following disclaimer in the
11e6769554SRui Paulo.\"    documentation and/or other materials provided with the distribution.
12e6769554SRui Paulo.\"
13e6769554SRui Paulo.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14e6769554SRui Paulo.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15e6769554SRui Paulo.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16e6769554SRui Paulo.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17e6769554SRui Paulo.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18e6769554SRui Paulo.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19e6769554SRui Paulo.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20e6769554SRui Paulo.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21e6769554SRui Paulo.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22e6769554SRui Paulo.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23e6769554SRui Paulo.\" SUCH DAMAGE.
24e6769554SRui Paulo.\"
25e6769554SRui Paulo.\" $FreeBSD$
26e6769554SRui Paulo.\"
27*f54d9519SEdward Tomasz Napierala.Dd November 13, 2019
28c383d55bSGavin Atkinson.Dt LINUX 4
29e6769554SRui Paulo.Os
30e6769554SRui Paulo.Sh NAME
31e6769554SRui Paulo.Nm linux
32e6769554SRui Paulo.Nd Linux ABI support
33e6769554SRui Paulo.Sh SYNOPSIS
3439eb4bc6SBernhard SchmidtTo compile support for this ABI into an i386 kernel
35e6769554SRui Pauloplace the following line in your
36e6769554SRui Paulokernel configuration file:
37e6769554SRui Paulo.Bd -ragged -offset indent
38e6769554SRui Paulo.Cd "options COMPAT_LINUX"
39e6769554SRui Paulo.Ed
40e6769554SRui Paulo.Pp
4139eb4bc6SBernhard Schmidtfor an amd64 kernel use:
4239eb4bc6SBernhard Schmidt.Bd -ragged -offset indent
4339eb4bc6SBernhard Schmidt.Cd "options COMPAT_LINUX32"
4439eb4bc6SBernhard Schmidt.Ed
4539eb4bc6SBernhard Schmidt.Pp
46e6769554SRui PauloAlternatively, to load the ABI as a
47e6769554SRui Paulomodule at boot time, place the following line in
48e6769554SRui Paulo.Xr loader.conf 5 :
49e6769554SRui Paulo.Bd -literal -offset indent
50e6769554SRui Paulolinux_load="YES"
51e6769554SRui Paulo.Ed
52e6769554SRui Paulo.Sh DESCRIPTION
53e6769554SRui PauloThe
54e6769554SRui Paulo.Nm
55*f54d9519SEdward Tomasz Napieralamodule provides limited Linux ABI (application binary interface) compatibility,
56*f54d9519SEdward Tomasz Napieralamaking it possible to run many unmodified Linux applications and libraries
57*f54d9519SEdward Tomasz Napieralawithout the need for virtualization or emulation.
58*f54d9519SEdward Tomasz NapieralaSome of the facilities provided are:
59e6769554SRui Paulo.Bl -bullet
60e6769554SRui Paulo.It
61e6769554SRui PauloAn image activator
62e6769554SRui Paulofor correctly branded
63e6769554SRui Paulo.Xr elf 5
64e6769554SRui Pauloexecutable images
65e6769554SRui Paulo.It
66e6769554SRui PauloSpecial signal handling for activated images
67e6769554SRui Paulo.It
68e6769554SRui PauloLinux to native system call translation
69*f54d9519SEdward Tomasz Napierala.It
70*f54d9519SEdward Tomasz NapieralaLinux-specific system calls
71e6769554SRui Paulo.El
72e6769554SRui Paulo.Pp
73*f54d9519SEdward Tomasz NapieralaNote that dynamically linked Linux executables
74*f54d9519SEdward Tomasz Napieralawill require a suitable environment in
75*f54d9519SEdward Tomasz Napierala.Pa /compat/linux .
76*f54d9519SEdward Tomasz NapieralaThis includes native Linux shared libraries, and Linux-specific virtual
77*f54d9519SEdward Tomasz Napieralafilesystems.
78*f54d9519SEdward Tomasz NapieralaTo set it up, install the
79*f54d9519SEdward Tomasz Napierala.Pa emulators/linux_base-c7
80*f54d9519SEdward Tomasz Napieralaport or the linux_base-c7
81*f54d9519SEdward Tomasz Napieralapackage, and add the following line to the
82*f54d9519SEdward Tomasz Napierala.Xr rc.conf 5
83*f54d9519SEdward Tomasz Napieralafile:
84e6769554SRui Paulo.Pp
85*f54d9519SEdward Tomasz Napierala.Dl linux_enable="YES"
86*f54d9519SEdward Tomasz Napierala.Pp
87*f54d9519SEdward Tomasz NapieralaTo avoid mounting Linux-specific filesystems at startup, also add the following
88*f54d9519SEdward Tomasz Napieralaline:
89*f54d9519SEdward Tomasz Napierala.Pp
90*f54d9519SEdward Tomasz Napierala.Dl linux_mounts_enable="NO"
91*f54d9519SEdward Tomasz Napierala.Sh SYSCTL VARIABLES
92*f54d9519SEdward Tomasz NapieralaThe following variables are available as both
93e6769554SRui Paulo.Xr sysctl 8
94*f54d9519SEdward Tomasz Napieralavariables and
95*f54d9519SEdward Tomasz Napierala.Xr loader 8
96*f54d9519SEdward Tomasz Napieralatunables:
97*f54d9519SEdward Tomasz Napierala.Bl -tag -width indent
98*f54d9519SEdward Tomasz Napierala.It Va compat.linux.osname
99e6769554SRui PauloLinux kernel operating system name.
100*f54d9519SEdward Tomasz Napierala.It Va compat.linux.osrelease
101e6769554SRui PauloLinux kernel operating system release.
102e6769554SRui PauloChanging this to something else is discouraged on non-development systems,
103e6769554SRui Paulobecause it may change the way Linux programs work.
104e6769554SRui PauloRecent versions of GNU libc are known to use different syscalls depending
105e6769554SRui Pauloon the value of this sysctl.
106*f54d9519SEdward Tomasz Napierala.It Va compat.linux.oss_version
107e6769554SRui PauloLinux Open Sound System version.
108e6769554SRui Paulo.Sh FILES
109*f54d9519SEdward Tomasz Napierala.Bl -tag -width /compat/linux/dev/shm -compact
110e6769554SRui Paulo.It Pa /compat/linux
111e6769554SRui Paulominimal Linux run-time environment
11277d3337cSDmitry Chagin.It Pa /compat/linux/dev/fd
113*f54d9519SEdward Tomasz Napieralafile-descriptor file system, see
114*f54d9519SEdward Tomasz Napierala.Xr fdescfs 5
115*f54d9519SEdward Tomasz Napierala.It Pa /compat/linux/dev/shm
116*f54d9519SEdward Tomasz Napieralain-memory file system, see
117*f54d9519SEdward Tomasz Napierala.Xr tmpfs 5
118e6769554SRui Paulo.It Pa /compat/linux/proc
119*f54d9519SEdward Tomasz NapieralaLinux process file system, see
120*f54d9519SEdward Tomasz Napierala.Xr linprocfs 5
121e6769554SRui Paulo.It Pa /compat/linux/sys
122*f54d9519SEdward Tomasz NapieralaLinux kernel objects file system, see
123*f54d9519SEdward Tomasz Napierala.Xr linsysfs 5
124e6769554SRui Paulo.El
125e6769554SRui Paulo.Sh SEE ALSO
126e6769554SRui Paulo.Xr brandelf 1 ,
127fd2ced61SEdward Tomasz Napierala.Xr pty 4 ,
128e6769554SRui Paulo.Xr elf 5 ,
12977d3337cSDmitry Chagin.Xr fdescfs 5 ,
130e6769554SRui Paulo.Xr linprocfs 5 ,
131*f54d9519SEdward Tomasz Napierala.Xr linsysfs 5 ,
132*f54d9519SEdward Tomasz Napierala.Xr tmpfs 5
133e6769554SRui Paulo.Sh HISTORY
134e6769554SRui PauloLinux ABI support first appeared in
135e6769554SRui Paulo.Fx 2.1 .
136*f54d9519SEdward Tomasz Napierala.Sh BUGS
137*f54d9519SEdward Tomasz NapieralaSupport for some of the Linux-specific system calls and system call arguments
138*f54d9519SEdward Tomasz Napieralais missing.
139