Search code examples
.netoperating-systemportable-executable

Is there any other OS that use PE file or atleast a chance to use it in future?


Regardless of which compiler you use to compile the .NET language , the result is a managed module. A managed module is a standard Windows portable executable (PE) file that requires the CLR to execute. "In the future, other operating systems may use the PE file format as well."

has any other started supporting the use of PE file or atleast a chance to support it in future? Other than .NET does any other framework(J2EE,etc) produce PE? What are the counterparts to PE?


Solution

  • Notes

    If you really wanted to know which other platforms apart from Windows support .NET/managed executables, then your question is a bit to broad or a little misleading when asking about the PE format.

    The PE file format is basically just that, a file format. Currently it is being used two serve to primary purposes:

    1. The file format that (native) executables use on Windows 32bit and 64bit platforms.
    2. The file format that .NET (managed) executables use.

    The following list includes examples for both uses. More specifically, only Mono uses it as in the second case above (and not in the first). All others use it in the sense of the first case above (and not in the second).

    Why Microsoft choose the PE file format for .NET? Possibly, because they had all the infrastructure (loading, etc.) in place already, and only needed to bolt on something for .NET. For example, with .NET (on Windows) one doesn't have to use some sort of loader command to start the application, like java.exe -jar ... or python.exe ..., but can start and launch it as it were a native executable.

    Illustrated oversimplified, a .NET PE file only contains one reference to mscoree.dll which will then take on the loading and execution of the contained MSIL code as a managed application.

    Uses

    ReactOS should also use the PE format (and not just as a container for a .NET assembly), as it is supposed to be binary compatible with Microsoft Windows (NT).

    Update

    Actually, when you Google "pe file format" the first link that comes up is this Wikipedia article about the PE format. It has a section about uses of the file format, which basically contains the following:

    • ReactOS
    • BeOS R3 and SkyOS (historically; which have moved to ELF however)
    • MacOS X 10.5 (but not binary compatible with Windows)

    Not real Operating Systems in the true sense, but nevertheless:

    • Mono. One or two differences to the other uses should be noted here
      1. Mono (by default, on Linux you can register it as a non native binary) requires the application to be started using the mono command. So you could argue that in this case it is not really the OS that supports the PE format (much like it doesn't support PHP scripts or whatever). But this is a arguable and possibly irrelevant point indeed.
      2. It can only handle PE files "for .NET".
    • Emulators: Wine, HX DOS Extender

    Note that OS/2 (2.x and higher) does not use PE, even though historically it probably could have (given it's and NT's common history). It uses the linear executable file format.