<s>
binfmt_misc	O
(	O
Miscellaneous	O
Binary	O
Format	O
)	O
is	O
a	O
capability	O
of	O
the	O
Linux	B-Operating_System
kernel	I-Operating_System
which	O
allows	O
arbitrary	O
executable	B-Application
file	I-Application
formats	I-Application
to	O
be	O
recognized	O
and	O
passed	O
to	O
certain	O
user	B-Operating_System
space	I-Operating_System
applications	O
,	O
such	O
as	O
emulators	B-Application
and	O
virtual	B-Architecture
machines	I-Architecture
.	O
</s>
<s>
It	O
is	O
one	O
of	O
a	O
number	O
of	O
binary	O
format	O
handlers	O
in	O
the	O
kernel	B-Operating_System
that	O
are	O
involved	O
in	O
preparing	O
a	O
user-space	B-Operating_System
program	O
to	O
run	O
.	O
</s>
<s>
The	O
executable	B-Application
formats	O
are	O
registered	O
through	O
the	O
special	O
purpose	O
file	O
system	O
binfmt_misc	O
file-system	O
interface	O
(	O
usually	O
mounted	O
under	O
part	O
of	O
/proc	B-Application
)	O
.	O
</s>
<s>
This	O
is	O
either	O
done	O
directly	O
by	O
sending	O
special	O
sequences	O
to	O
the	O
register	O
procfs	B-Application
file	O
or	O
using	O
a	O
wrapper	O
like	O
Debian-based	O
distributions	O
binfmt-support	O
package	O
or	O
systemd	B-Application
's	O
systemd-binfmt.service	O
.	O
</s>
<s>
The	O
register	O
file	O
contains	O
lines	O
which	O
define	O
executable	B-Application
types	O
to	O
be	O
handled	O
.	O
</s>
<s>
If	O
it	O
is	O
E	O
,	O
the	O
executable	B-Application
file	I-Application
format	I-Application
is	O
identified	O
by	O
its	O
filename	O
extension	O
:	O
magic	O
is	O
the	O
file	O
extension	O
to	O
be	O
associated	O
with	O
the	O
binary	O
format	O
;	O
offset	O
and	O
mask	O
are	O
ignored	O
.	O
</s>
<s>
F	O
to	O
make	O
the	O
kernel	B-Operating_System
open	O
the	O
binary	O
at	O
configuration	O
time	O
instead	O
of	O
lazily	O
at	O
startup	O
time	O
,	O
so	O
that	O
it	O
is	O
available	O
inside	O
other	O
mount	O
namespaces	O
and	O
chroots	O
as	O
well	O
.	O
</s>
<s>
Each	O
format	O
has	O
a	O
corresponding	O
file	O
entry	O
in	O
the	O
/proc/sys/fs/binfmt_misc	O
directory	O
which	O
can	O
be	O
read	O
to	O
get	O
information	O
about	O
a	O
given	O
file	O
format	O
.	O
</s>
<s>
binfmt_misc	O
allows	O
Java	B-Language
programs	O
to	O
be	O
passed	O
directly	O
to	O
the	O
Java	B-Language
virtual	I-Language
machine	I-Language
.	O
</s>
<s>
Another	O
common	O
usage	O
is	O
to	O
execute	O
PE	O
executables	B-Application
(	O
compiled	O
for	O
MS-DOS	B-Application
or	O
Microsoft	B-Application
Windows	I-Application
)	O
through	O
Wine	B-Application
.	O
</s>
<s>
For	O
example	O
,	O
the	O
following	O
line	O
will	O
run	O
DOS	O
and	O
Windows	O
EXE	O
files	O
(	O
identified	O
by	O
the	O
"	O
MZ	O
"	O
type	O
code	O
)	O
using	O
Wine	B-Application
:	O
</s>
<s>
:DOSWin:M::MZ::/usr/bin/wine	O
:	O
</s>
<s>
To	O
run	O
EXE	O
(	O
.NET	O
)	O
files	O
with	O
Mono	B-Application
:	O
</s>
<s>
:CLR:M::MZ::/usr/bin/mono	O
:	O
</s>
<s>
binfmt_misc	O
can	O
also	O
be	O
combined	O
with	O
QEMU	B-Application
or	O
Box86	B-Application
to	O
execute	O
programs	O
for	O
other	O
processor	O
architectures	O
as	O
if	O
they	O
were	O
native	O
binaries	O
.	O
</s>
