There was a dispute, I decided to ask the audience (:

In general, it is theoretically possible to create an OS whose executable files will be .exe .deb, etc. and they will be correctly interpreted and appropriately workable?

It turns out something like "Cross-platform OS", an oxymoron direct (:

  • Great question !!! - avp
  • Not a cross-platform OS, but a multi-platform OS - cy6erGn0m
  • theoretically everything is possible - even a perpetual motion machine. The reality is more harsh and unfriendly to romantics :) By and large, all the wasps I know have programs that process files depending on the extension. therefore, it is likely to create an axis, hang some handler on the executable files .exe, for others it is the same, although none of these formats can be native to this axis. - jmu

3 answers 3

There is wine and its various derivatives, which somehow allow to run Windows applications on the Nix. Something similar is for poppies. And on Windows, there are ways to run Linux applications. So not only theoretically, but practically already something similar exists, although very far from perfect.

ADDENDA: deb is not an executable file, but an installation package for Linux Debian and its derivatives (for example, Ubuntu).

  • I think the TC didn’t mean it a little: wine creates an environment inside the environment, as far as I can tell (it stupidly creates a windows folder in its directory), the author (IMHO) wonders if it is possible to create an axis capable of working correctly with different file systems. Correct if wrong. As for me, the question is quite interesting. - Ozim
  • > executable files from the question. About file systems not a word. Under Windows there is CoLinux and for example andLinux based on it. - insolor
  • What do you mean by the term "file system"? - skegg
  • one
    (Offtopic) “Addenda” is a plural, the only thing is “addendum.” Add: Damn, I didn’t look at the date. Necromancers lured. - drdaeman

Of course available. But there will be a lot of difficulties on the way and you will have to do a lot of extra work. This would be very inefficient in terms of developer resources. Creating a truly complete OS requires quite large resources and a lot of time, testing, etc. Make two operating systems in one will require even more effort and patience.

But theoretically all this is possible. Nothing prevents to implement different system API at the same time, to support several models of organizing files, different abstractions, to implement X, etc. At the kernel level, you will also have to implement two types of API at once so that the drivers in the kernel can work and not interfere with each other. On the other hand, there is a possibility that there will still be restrictions at the kernel level associated with different architectures. However, at the application level, I think it is possible, more than. Things like wine prove it is possible. Only it will be very painful.

    Maybe yes.

    Those. subsystems like wine, cygwin, interix exist, it is also possible to twist the loader (+ connect the corresponding shared libraries), although in practice there will be a lot of hemorrhoids.

    More interesting is another continuation of the topic. Cross-platform standalown module (of course, I mean machine codes, and therefore we are talking about the same processor architecture).

    Perhaps such a thing will need a mini installer (changing magic and if the file format for the OS loader is required) depending on the OS. The idea is that the function at the entry point determines (on the fly itself) the current environment and “adjusts” to it. Obviously, the development system (linker and libraries) must "have knowledge" of possible target operating systems.

    IMHO the idea is interesting, but he did not move further than theoretical reflections. In practice, interpreters like python, perl are widely used ...

    • This will require support from the OS. And on the part of the generated code, you will need a lot of dancing with a tambourine. But this, of course, is possible. But why so hard? Isn't it easier to use regular virtual machines? (that everyone does). <br /> PS: A few years ago, a friend with freepascal (or from somewhere) suggested that the OS analyze machine code and replace function calls inside the binary so that it can be run on some system X. - cy6erGn0m
    • She ... you did not understand the idea. It is that the OS does not touch . Accordingly, with VM, we do not bother either. Ideally, I stuck the flash drive, clicked on the file, the program "Hi!" she said. A lot of dancing (just scared to take). - avp
    • And you do not do that. If the OS is not touched, then the Windows will not read and even try to run ELF. If you only make a few loaders, and pull the shared binary separately .. but then you get a bunch of executable files. In no other way I can not imagine this. - cy6erGn0m
    • one
      I have WinXP installed andLinux. If elf is in the shared folder, then in this folder, you can run the Linux terminal or file manager, and from them you can already run elf and the program will say "Hi!" :) It makes no sense to create wasps from scratch in which exe and elf will be launched, I do not see, especially since there is already a possibility to do this under existing wasps. - insolor
    • Yes, but this is a modification for the OS, which must be installed specifically in advance. - cy6erGn0m