Is there a way to run DOS programs natively on Linux?
Linux - Virtualization and CloudThis forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Is there a way to run DOS programs natively on Linux?
Hello
My uncle is TASM coder, he writes programs for DOS (he didn't switched his platform yet, because its hard to learn ASM for the other operating system).
Right now he wrote some program for DOS/ASM which uses low memory (only 1MB), but which needs huge performance, because our programs on ASM processing huge capacity of information and requires a lots of CPU-performance. We're also planning to use GPU processors but it will take like eternity for that to happen.
The best solution of course would be porting his program into Linux, but according to his words it will take a year to do that, and he still don't know if Linux is good for his software.
We need to use 100% of CPU performance, but all we have right now is thousands of our computers on Linux (we can't change the OS on them, we're running mostly Ubuntu).
We tried to use DOSEMU DOS-emulator, and found out that uncle's DOS program working extremely slow on it (like only 10% of real CPU's performance).
So according to our problems I've got two questions which probably will help to solve our question:
- When I was reading handbook for FreeBSD I kinda saw something like modules which lets run Linux program on FreeBSD, and I also believe that Linux have some modules to run some BSD programs. Is there the same modules exists for running some DOS programs on Linux natively?
- The core program of my uncle consists around 5 thousands lines of code on ASM, so as I understand its a lots of work for porting this ASM codes on Linux, right? What if we will hire some Linux ASM programmer, how do you think, how long it will take to him to handle this task? Maybe there's easy way to port the program? Including that the author of the program is my uncle (is it that hard task?) Or maybe there's some easier ways to accomplish this task?
http://linux.die.net/man/1/dos2unix might be something to look at, its a file converter but I do not know if it would work on the ASM code. I'm not really a programmer but my dev/app guys use it frequently to integrate dos packages.
Hello
My uncle is TASM coder, he writes programs for DOS (he didn't switched his platform yet, because its hard to learn ASM for the other operating system).
Right now he wrote some program for DOS/ASM which uses low memory (only 1MB), but which needs huge performance, because our programs on ASM processing huge capacity of information and requires a lots of CPU-performance. We're also planning to use GPU processors but it will take like eternity for that to happen.
The best solution of course would be porting his program into Linux, but according to his words it will take a year to do that, and he still don't know if Linux is good for his software.
We need to use 100% of CPU performance, but all we have right now is thousands of our computers on Linux (we can't change the OS on them, we're running mostly Ubuntu). We tried to use DOSEMU DOS-emulator, and found out that uncle's DOS program working extremely slow on it (like only 10% of real CPU's performance).
So according to our problems I've got two questions which probably will help to solve our question:
- When I was reading handbook for FreeBSD I kinda saw something like modules which lets run Linux program on FreeBSD, and I also believe that Linux have some modules to run some BSD programs. Is there the same modules exists for running some DOS programs on Linux natively?
There are also commercial products/companies out there that perform such conversions, but I've not used any of them, so I can't recommend any of them.
Quote:
- The core program of my uncle consists around 5 thousands lines of code on ASM, so as I understand its a lots of work for porting this ASM codes on Linux, right? What if we will hire some Linux ASM programmer, how do you think, how long it will take to him to handle this task? Maybe there's easy way to port the program? Including that the author of the program is my uncle (is it that hard task?) Or maybe there's some easier ways to accomplish this task?
There is no way to answer that question. One programmer may be able to do it in a week...another may take six months, who can tell? Depends on the skill level, workload, and what parts of the program you want ported over, and the changes needed to do it. Things may be easier to implement in Linux...from one of the pages linked to above:
In DOS mostly you use interrupt int 21h, int 10h and int 16h. In Linux, everything is handled by kernel with int 80h.
Linux is a 32-bit protected mode operating system, so you have to use extended 32-bit registers, such as EAX, EBX, ECX and so on. In 16-bit register, you still use AX, BX,CX etc …. registers.
In 32-bit programming, you don’t have to think about segments at all because it runs in the flat memory model.
dos2unix is for converting text-files, not code.
The most performant way to use those program on Linux would be to set up virtual machines with DOS installed, I would think. But keep in mind that it currently is not possible to have a direct access to the physical video card using VMs, you only have access to virtual video cards.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.