Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Why can't linux run dos programs?

So, what I would like to know is why can't DOS programs be run under linux?

I understand that Windows executables rely on libraries and things like that, but I was wondering if there is a fundamental reason that DOS EXEs can't be run.

Thanks

Update:

For those who keep saying 'Because Linux isn't windows' I know that. I'm talking about DOS executables, which came before windows. Nothing to do with Windows.

For those who say 'Because Linux isn't programmed to' I know that. What I want to know is if there is some reason that Linux can not run exe files, or if it is just a matter of no one has added that functionality.

Also, I realize that you can get DOS and Windows programs to run using thins like Wine, and Dosbox and other programs, but I am wondering why Linux can't just run an EXE without having to use what is essentialy an emulator. (And yes I know that Wine isn't actually an emulator)

Thanks

6 Answers

Relevance
  • 8 years ago
    Favorite Answer

    Because it is an entirely different KIND of OS. It is Unix-based (as are the BSD family, whose FreeBSD is used in Mac OS X (which is therefore also part of the family), Sun Solaris, BeOS/Haiku (to a degree), etc.), so it's derived from a system that was developed back in 1969 (and because of it, its family is very stable and well-documented, while not at all obsolete thanks to frequent releases and bugfixes, at least that's the case with Linux, Mac OS, and the *BSDs (thanks to a completely different philosophy of programming)). Unix is also the birthplace of C, the programming language. Linux hails back to 1991, 4 years before the first usable (but still crappy) Windows was released - back then, Windows was treated as a necessary evil and in fact was even a poor system for gaming thanks to hieroglyphic or nonexistent DirectX. True, you'd have to use a hex editor to install it back then, but those versions of Linux began with a 0. Linux and Windows are entirely different in construction and are a world apart. When Linus Torvalds wrote it, he didn't want a Windows clone - he wanted a kernel which could carry a home-friendly Unix-like OS (he liked MINIX very much, but he didn't have the type of computer right for it). And incorporating Windows code as part of a distro (Linux is just the kernel (a part of the OS that handles memory sharing and multitasking), a distribution is a complete system with programs, like Ubuntu or Fedora) is out of the question, as Microsoft does not give its source out - if it did, everybody would compile and fix Windows himself. And finally, since the early nineties, many Windows programs, beginning with Notepad, ending with Dishonored and Deus Ex: Human Revolution, can be run through Wine, which is a collection of libraries that substitute the ones Windows programs call out to (programmer-speak for "attempt to use") - at the base, an open-source clone of Windows. As Windows hasn't changed much since NT - they just added new apps and graphical shells - Wine remains very up-to-date.

    Therefore, thanks to Wine, Linux, Mac OS X and Free BSD can into space/run DOS+Graphical Shell (what Windows really is) games and programs.

    EDIT : Oh, there's a reason for it not being programmed in. Keep in mind that Linux is supposed to be a small kernel, not overloaded with things like compatibility layers.

    And RMS would shoot himself if he found out Linux (which he hates because people don't pronounce it "Ghnoo plus Linux") included an easy way to gain the freedom to run proprietary software.

    Which are needed because...

    You don't have Windows libraries on Linux, as you already said. They are incompatible because Windows libs often call out to the registry, etc. and are differently written, making porting useless, except for maybe generic libraries, like stdio in C, etc.

    On top of that, the systems delimit lines (of code) differently - pure Unix, BSD, and Linux appends a Line Feed character to the end of every line, Mac uses the ancient Carriage Return, and Windows uses both - so if you recompiled the source code, it would be useless, especially with languages that don't use semicolons as forced End-Of-Line. Nowadays the preferred newline character can be selected in an editor, but how are you going to convert the source code of a Win32 program, most of which are proprietary? That would require decompilation, and if the author found out about an unauthorized port, he'd sue your sorry behind. So no DOS for anyone, except maybe a "hello world" program whose author unfortunately selected Line Feed in his editor and can be chmod +x'ed.

  • 8 years ago

    THE API and ABI are different.

    They are so different and DOS execuables are so old that emulating them is the easiest thing to do.

    In addition adding the DOS ABI into the kernel would be difficult and make changes and improvements very difficult, in return for very little gain.

  • Neerp
    Lv 7
    8 years ago

    The short answer is that they CAN be run under linux.

    www.dosbox.com

    You will be amazed at how many old DOS programs run just fine using DosBox under Linux.

  • 8 years ago

    Because DOS is something that window's runs. .exe files are command's that the window's OS parses through. And that language is built into the Operating system. Linux is'nt window's, and the .exe file "language" is'nt built into the OS.

    It's like if you take a guitar and try to make it sound like a violin. It can be done, but you still get bonus points if you can do it because it's not easy.

  • How do you think about the answers? You can sign in to vote the answer.
  • 8 years ago

    Use Dosbox.

    Disk Operating System (a.k.a. Dirty Operating System) is mechanically designed different from UNIX and Linux.

  • 8 years ago

    BECAUSE IT IS NOT DOS

Still have questions? Get your answers by asking now.