Binfmt misc

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).

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:

* name is the name of the new binary format.
* type is either E or M. If it is E, then the executable file format is identified by its filename extension, offset and mask are ignored, and magic is the file extension to be associated with the binary format. If it is M, then the executable file format is identified by a magic number near the beginning of the file. magic is the magic number identifying the binary format and offset is the offset at which the magic number is found in the file. The mask is bitwise ANDed with the magic string from the file: the bits which are unset in the mask are ignored in the comparison to the magic.
* interpreter is a path to an executable. When a file using a binfmt_misc-registered executable format is executed, this program is run with the executable as an argument.

When an executable file format is registered, a file is created in the /proc/sys/fs/binfmt_misc directory. This file can be read later to get information about the file format.

Common usage

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

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:

See also

* Shebang (Unix)

References

* [http://git.kernel.org/gitweb.cgi?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/binfmt_misc.txt;hb=HEAD Documentation/binfmt_misc.txt] in the Linux kernel source tree

External links

* [http://www.tat.physik.uni-tuebingen.de/~rguenth/linux/binfmt_misc.html Project home page]


Wikimedia Foundation. 2010.

Игры ⚽ Нужно решить контрольную?

Look at other dictionaries:

  • Binfmt misc — ist eine Fähigkeit des Linux Kernels, beliebige ausführbare Dateien zu erkennen und einem bestimmen Programm im User Mode zu übergeben, wie beispielsweise einem Interpreter oder einem Programmstarter, der das Programm in den Arbeitsspeicher lädt …   Deutsch Wikipedia

  • 0xDEADBEEF — Dieser Artikel oder Abschnitt bedarf einer Überarbeitung. Näheres ist auf der Diskussionsseite angegeben. Hilf mit, ihn zu verbessern, und entferne anschließend diese Markierung. Eine Magische Zahl (engl. magic number) ist in der Programmierung… …   Deutsch Wikipedia

  • File — Aktuelle Version: 5.01 (30. April 2009) Betriebssystem: Multiplattform Kategorie: Remote Access Lizenz: GPL …   Deutsch Wikipedia

  • Hash-Bang — Die Shebang Zeichen – hash bang Bei unixoiden Betriebssystemen wird die Zeichenkombination #! am Anfang eines Skript Programms shebang oder auch Magic Line genannt. Die Markierung führt dazu, dass das folgende Kommando mitsamt aller angegeben… …   Deutsch Wikipedia

  • Hashbang — Die Shebang Zeichen – hash bang Bei unixoiden Betriebssystemen wird die Zeichenkombination #! am Anfang eines Skript Programms shebang oder auch Magic Line genannt. Die Markierung führt dazu, dass das folgende Kommando mitsamt aller angegeben… …   Deutsch Wikipedia

  • Magic-Byte — Dieser Artikel oder Abschnitt bedarf einer Überarbeitung. Näheres ist auf der Diskussionsseite angegeben. Hilf mit, ihn zu verbessern, und entferne anschließend diese Markierung. Eine Magische Zahl (engl. magic number) ist in der Programmierung… …   Deutsch Wikipedia

  • Magic Byte — Dieser Artikel oder Abschnitt bedarf einer Überarbeitung. Näheres ist auf der Diskussionsseite angegeben. Hilf mit, ihn zu verbessern, und entferne anschließend diese Markierung. Eine Magische Zahl (engl. magic number) ist in der Programmierung… …   Deutsch Wikipedia

  • Magic Line — Die Shebang Zeichen – hash bang Bei unixoiden Betriebssystemen wird die Zeichenkombination #! am Anfang eines Skript Programms shebang oder auch Magic Line genannt. Die Markierung führt dazu, dass das folgende Kommando mitsamt aller angegeben… …   Deutsch Wikipedia

  • Magische Zahl (Informatik) — Eine Magische Zahl (engl. magic number) ist in der Programmierung ein spezieller Wert, der für einen bestimmten Zweck, beispielsweise für die Kennzeichnung von Dateiformaten am Dateibeginn, genutzt wird. Magische Zahlen werden meistens aus… …   Deutsch Wikipedia

  • Shebang — Die Shebang Zeichen – hash bang Shebang (auch Magic Line) bezeichnet bei unixoiden Betriebssystemen die Zeichenkombination #! am Anfang eines Skriptprogramms. Die Markierung führt dazu, dass das folgende Kommando mitsamt allen angegebenen… …   Deutsch Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”