LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This 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


Reply
  Search this Thread
Old 07-10-2012, 01:15 PM   #1
earlfox
LQ Newbie
 
Registered: Jul 2012
Posts: 15

Rep: Reputation: Disabled
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?

Thanks for any suggestions

Last edited by earlfox; 07-10-2012 at 01:17 PM.
 
Old 07-10-2012, 01:28 PM   #2
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
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.
 
Old 07-10-2012, 01:39 PM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by earlfox View Post
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?
No. FreeBSD and Linux share the ELF executable format...DOS does not. DOS programs run natively on DOS...Linux on Linux, etc. You have already discovered emulation, and you have also discovered the limitations of it. If you want to move forward, and use more than 16 bits of a computer, get into GPU's, etc., then you will have to bite the bullet and port your code from DOS to Linux. There are several things that can help you:
http://asm.sourceforge.net/resources.html
https://taufanlubis.wordpress.com/20...uage-in-linux/
http://www.computerhope.com/forum/in...topic=117210.0

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.
 
Old 07-10-2012, 01:42 PM   #4
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
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.

Last edited by TobiSGD; 07-10-2012 at 01:44 PM.
 
Old 07-10-2012, 02:04 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,982

Rep: Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625
If he is that good on assembly then have him fork the work to MenuetOS.

I'd try dosbox or as above run 10,000 virtual machines with some version of dos on it.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Are there any RPGs that run natively in Linux? (Specifically, Ubuntu) LinuxRedHatKnight Linux - Games 14 07-03-2010 01:08 PM
Laptops that run Linux Natively rorymacneill09 Linux - Laptop and Netbook 4 04-15-2007 11:25 AM
Can linux natively run software that uses drm yet? mikepj Linux - General 1 04-01-2007 11:09 AM
to run dos programs --> dosbox, wine, or...? efm Linux - Newbie 2 05-26-2005 03:20 AM
WINE: does ir run DOS programs? kopikat Linux - Software 3 02-17-2005 02:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 02:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration