binfmt misc

binfmt_misc is a capability of the Linux kernel which allows arbitrary executable file formats to be recognized and passed to certain user space applications, such as emulators and virtual machines.

The executable formats are registered through a special purpose file system interface (similar to /proc). Debian-based distributions provide the functionality through an extra binfmt-support package.[1]

Registration

The register file contains lines which define executable types to be handled. Each line is of the form:

:name:type:offset:magic:mask:interpreter:flags

Each format has a corresponding file entry in the /proc/sys/fs/binfmt_misc directory which can be read to get information about a given file format.

Common usage

binfmt_misc allows Java programs to be passed directly to the Java virtual machine.[2]

Another common usage is to execute PE executables (compiled for MS-DOS or Microsoft Windows) through Wine. For example, the following line will run DOS and Windows EXE files (identified by the "MZ" type code) using Wine:

:DOSWin:M::MZ::/usr/bin/wine:

To run EXE (.NET) files with Mono:[3][4]

:CLR:M::MZ::/usr/bin/mono:

See also

References

External links

This article is issued from Wikipedia - version of the 9/8/2016. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.