Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×
Linux Software

Porting DOS Applications to Unix? 61

jgbustos asks: "I'm the manager of a small software development company. For the last five years we've been managing a communications network consisting of several thousand PC terminals which connects to an NT server over the phone lines. The terminals run a console application on a light DOS. Everything is fine so far. So what's the problem, then? We have a hard time finding parts to maintain the network. Our client says that he's willing to invest in hardware upgrades, but we should move to a Windows-like environment, however he doesn't want to pay for more than 4000 Windows licenses. What's the best alternative for porting our app to Linux/? Please bear in mind that the terminals are small PC's having 16MB RAM, less than 2GB HD, less than i586 CPU, and a 33k modem. Thanks in advance"
This discussion has been archived. No new comments can be posted.

Porting DOS Applications to Unix?

Comments Filter:
  • by kwerle ( 39371 ) <kurt@CircleW.org> on Thursday November 21, 2002 @08:23PM (#4727840) Homepage Journal
    What do you mean - they just want a GUI?

    In any case, I bet you could find a linux or BSD distro that runs small and runs a windowserver. Though you might just want to try and find a dedicated browser and go for a web solution. If the client can just dial up and PPP to you and fire up a browser, you don't even have to worry about distributing updates to your software - just updating the server.

    Really, more info about the problem domain would help...
    • No doubt. the lack of info in this question makes it impossible to give any meaningful answer whatsoever.

      That said, I ported a rather large DOS based app to Linux a few years ago. This was one that used light-pens, touch screen, several industrial control I/O boards, network card, modem, etc. There were only 2 big issues I had.

      First, I had to write custom drivers for the hardware. This really wasn't too hard actually, since I had already been directly accessing the hardware through an abstraction layer.

      Second was screen I/O. Again, since I wrote everything through an abstraction layer, it really wasn't that big of an issue.

      If I had NOT used abstraction, (hiding the details of the underlying hardware) it would have taken MUCH longer to port. The app was about 150K lines of code.
  • Ok (Score:2, Funny)

    I'm now going to shove my foot in my mouth. There. Couldn't you pretty much just recompile?
    • Re:Ok (Score:3, Insightful)

      by walt-sjc ( 145127 )
      Short answer: No.

      Longer answer:

      In DOS, you have full access to the hardware. This means that you read and write registers and I/O ports directly. Many DOS apps wrote directly to video memory for example. Most programmers did this for performance reasons, AND that it was easier.

      For example: Let's say you had a form onscreen to fill out. What you did was use a ASCII screen designer tool that allowed you to play with all the attributes, and dump the contents of that to a file. This file could be included with your app (in a header file) or loaded from disk at runtime. Of course there were many other ways of doing this.

      Since this guy uses a modem, he probably purchased one of the communication libraries that had x/y/zmodem, etc. and handled all the ideosyncracies of the 8250/16550 comm chips.

      You also had to play lots of tricks if you wanted to access memory above 640K - you needed to run something like a DOS extender (PharLap comes to mind.)

      So, no. It's not just a recompile. It's a port.
      • You musta missed the bit about me putting my foot in my mouth. I guess I got what I deserved.
        (I do know how DOS works)
      • heh, yeah those were the days - doing a memory map from file to 0xA000. Course, when you used protected memory you couldn't access 0xA000, and so used 0xA0000

        damn, i'm a geek
  • There are couple of tools for Linux that will run MS-DOS executables. One that comes to mind is dosexec. Although I've never had the need/desire to run MS-DOS programs under Linux so I can't tell you how well any of them work.
  • Eh...? (Score:2, Insightful)

    by stienman ( 51024 )
    What exactly was the reason, again, that you have to upgrade to either linux or windows?

    You're having a hard time finding 'parts'???

    Go to your local computer store. If you need a motherboard, get a motherboard. If you need a processor, get a processor. Etc, etc, etc.

    There are valid reasons to upgrade software, but hardware shouldn't be one of them.

    I do the computer side of a small video chain. Each store has a novell server, and multiple dos workstations. I'd like to put it all on linux so the interoffice communication can all be done via tcp/ip with the modems. There are other reasons. Unfortunately the software we're using requires IPX for the hardware key, so that's impossible in my situation.

    However, we're running 1.4GHz machines in some stores (ie, a $250 machine) as workstations with either a boot floppy or compactflash. There are no problems with running dos on these systems, except that we have to use DEVICE=HIMEM.SYS with the /EISA switch so it'll use upper memory on machines with more than 64MB of memory.

    So, tell us again why you can't find hardware for your current lite dos systems?

    -Adam
    • Agreed, Why upgrade SOFTWARE when you're having trouble finding PARTS
      like, seriously
      in regards to what appears to be your sig:
      Linux has a zero price and x preformance, where X is dependant on your applicaton of linux, hardware, etc.
      Windows has a X price and 0 preformance, where X is dependant on the vendor
      so
      Windows Price over Preformance: Error, Divide by 0
    • ... Unfortunately the software we're using requires IPX for the hardware key, so that's impossible in my situation.

      So linux doesn't support that?

      http://www.tldp.org/HOWTO/IPX-HOWTO.html
      • i was wondering why i've been using ipx-tools all this time myself...
      • So, what you're saying is that I could use my DOS IPX software and run it on a linux machine in an amulator box, and it would manage the IPX stuff for me?

        Furthermore, you're saying I could replace my novell server with linux, and use my hardware key which uses an NLM, which MARS does not support?

        -Adam
        • and I'm glad too. However, I'm saying its entirely possible that all the functionality you want is there.

          As to having IPX available to existing code within a dos emulator, probably not. Sorry. But if you can recreate the client in native code, you can talk to the server using the aforementioned guide.
  • If you have a terminal server, and export the display to every machine, that might work.
    You'll most definetly want to turn on compression.
    You'll have to try it to see if it is usuable tho over such a slow modem.

    As to porting the dos apps to it - depends on the dos app :P
  • DOSEMU (Score:3, Informative)

    by m0rph3us0 ( 549631 ) on Thursday November 21, 2002 @08:29PM (#4727891)
    I remember a program called DOSEMU for System V UNIXware. It worked well enough for me to run most DOS programs on my 386 running UNIXware. I would test the emulation layer first, and then look at making a custom linux image for the PC's. Something like Systemimager should work nicely for distributing the install.
    • For the Linux distro i would start with something small like Debian Slink w/ X 3.3.6, WindowMaker for the window manager and Mozilla for the communications applications. This should easily fit on to a 2GB drive.
      • Um, even the modern version of Deb will fit in 2G. Depends on what you install, which would be Minimal for porting a DOS app. You wouldn't need X at all.

        You REALLY don't want to use such an ancient version of debian for a new project.
  • hmmm (Score:5, Informative)

    by StandardDeviant ( 122674 ) on Thursday November 21, 2002 @08:35PM (#4727935) Homepage Journal
    So, do you want to port the app to a command-line form running on Linux on the current hardware? (0.02USD: ncurses, slackware) Or do you want to port the app to a GUI form running on Linux on newer hardware? (0.02USD: any number of toolkits, any number of distributions) Obviously as the second route is the greatest change, the variables are more numerous giving you a much wider of range of options to look at. I'm guessing your current programmers are C or Pascal folks? You might consider using GTK+ [gtk.org] (GUI Lib written in C, also has bindings [freepascal.org] for FreePascal [freepascal.org]). As far as a linux distro for the more open-ended situation goes, I'd have to say debian. The install can be a bit of a pain for the uninitiated, but it more than pays back that annoyance after install becuase with the very intelligent package management system you can do stuff like point the terminals at a central server to pull updates from (e.g. roll your app in to a .deb, have terms auto-update once a week using a cron job, makes deploying patches and security updates easy as pie). Debian will also work in fairly constrained hardware environments like slackware, but it tends to be a beefier install usually.
  • by adamy ( 78406 )
    Is there anything happening from the Terminals or are they just displaying information? Can you screen scrape your existing app, send it over the web, and then have all the wimpy boxes out there run Lynx/Lightweigh browser of your choice?
  • too many open ends (Score:4, Insightful)

    by ka9dgx ( 72702 ) on Thursday November 21, 2002 @08:38PM (#4727958) Homepage Journal
    #1. Where is the hardware that's falling apart? If it's a server... use GHOST and copy the image of the system to a new, better, faster machine, and be done with it.

    #2. What's the DOS app, do you have source? What does the DOS app do?

    #3. Why not just roll out replacement terminals as needed, instead of en-mass? You could probably use FreeDOS instead of MS-DOS, and set up a new machine ($200 walmart variety) to do exactly what you need.

  • try a windows emu like Wine (www.wine.org)
  • Porting (Score:3, Funny)

    by Brian_at_Work ( 590160 ) <brian_schwertfeger@@@dell...com> on Thursday November 21, 2002 @08:42PM (#4727973)
    Please... thats all we need is more DoS tools on Linux, so all the script kiddies can brag about how l33t they are...
    Make the code their own DoS tools, like we did back in my day... in machine code
  • Parts? (Score:3, Informative)

    by MrResistor ( 120588 ) <peterahoff.gmail@com> on Thursday November 21, 2002 @08:46PM (#4728004) Homepage
    I assume by that you mean DOS disks/licenses? DOS runs just fine on modern hardware.

    Anyway, there are alternatives to porting, such as using an emulator. DOSemu, DOSexec are names I've heard, or Wine would probably work too (but be a bit bulky). Or you could try FreeDOS, although modem drivers might be an issue.

    If you're hell-bent on porting, though, there are a lot of variables involved that you haven't supplied us with. What language is the app written in, for example? Was it written with portability in mind, or is it dependent on proprietary libraries? What does it do, and are any OSS projects that do the same thing? Without that information, no one is going to be able to give you a real answer. Maybe it will work with just a recompile (have you tried that yet?), or maybe it will be easier to start over from scratch. No one can tell without info!

    Why have there been so many "I want to port arbitrary software to Linux" questions with no accompanying details lately? How the hell is anybody supposed to answer these?

    • Re:Parts? (Score:2, Informative)

      Or you could try FreeDOS, although modem drivers might be an issue.

      FreeDOS is ABI and API compatibilty with DOS. You should be able to use the same modem drivers you're using now.

    • Re:Parts? (Score:4, Insightful)

      by JAZ ( 13084 ) on Thursday November 21, 2002 @09:23PM (#4728221)
      maybe it will be easier to start over from scratch

      as we're fond of saying on my on my architecture team when folks try to fix application problems with more hardware... "$$$ will buy a lot of developement."

      I guess in this case, "4000 windows licenses would buy a lot of nice OSS code." =]
    • Modem drivers? DOS apps never had a concept of modem drivers. Neither did any other OS on the planet until "winmodems" came out. Of course Winmodems don't work in plain dos either.
      • there was a time before the HAYES AT modem command set was the standard. There was also a time when internal modems weren't winmodems. And extra Serial ports came on a card.

        • Ahh yeah, your right. I even had an applecat 212 modem. Internal, no AT command set. Ran my own "board" on it with 6 floppy drives. Sigh. Those were the days. No spam, no AOL, usenet was still viable and you could receive a full feed with a 2400bps modem.

          Please mod my previous post as "-1 brainfart"

    • For some reason this sticks out in my mind. I remember reading somewhere that DOS itself will boot up and run on a modern computer but some apps won't run properly on anything above a pentium 90. I wish I could remember where I read that bit at. I think it was some rant about running windows 3.1/DOS on a modern computer and how fast it was compared to other operating system's GUIs but the article stated that some poorly written/designed DOS apps wouldn't run well because the computer was too fast and would sort of get ahead of itself and crash. maybe someone could coroborate that.
      • I can see some situations where that would be true, but it would not be the fault of DOS, other than the fact that it happened to be popular during the time when it was still practical to count clock cycles for operations. I use DOS on modern hardware regularly, with no issues, but I use a very narrow range of applications, some of which are even still maintained. Maybe there could be some problems with out of order execution, but I thought that OOO capable CPUs were supposed to be able to handle that gracefully.

  • Try dosemu or wine and see if they run under one of them. It may be possible to switch to Linux first then port the apps to Linux. Also you could try using QT or Java, then you would not have to worry about 4000 windows.
  • by dpilot ( 134227 ) on Thursday November 21, 2002 @10:19PM (#4728640) Homepage Journal
    with either new hardware + new Windows software or just new Linux software on the old hardware.

    If that's the choice, go with Windows + new hardware, and warn the client that the bill will rise as you finish the migration. The Linux option has been painted into a no-win situation because software-only can't solve a hardware problem. This is reminiscent of the old OS/2 days, when it was roundly criticized for not running well in 4MB, and then they'd go off and buy 16MB to run Windows.

    If you're serious about offering choices, prototype a Linux solution on one machine, so you can show the UI. A Windows prototype shouldn't be necessary, since everyone assumes it can be done. (I won't justify that assumption, but it's common.) Then put together a bill for both options with the full migration.

    Then let the customer decide, and pay.
  • You probably don't need/want to load even a thin X, so go direct.

    www.svgalib.org

  • no question (Score:1, Redundant)

    by (startx) ( 37027 )
    Alright, I'm lost. This is ask slashdot. Normally, people post questions here. You gave us your situation, and then thanked us for help in advance. You forgot one minor detail.....the question.
  • You should at least evaluate VMware workstation (free trial link: http://www.vmware.com/vmwarestore/newstore/wkst_ev al_login.jsp). You could move to Linux or Windows, run VMware, and run the app within a DOS virtual machine. Since you'd run the exact same app on (if you wish) the exact same version of DOS, you wouldn't have to worry about porting, compatibility, or hardware issues.
    --JRZ
  • Are you manipulating the hardware directly, or through interrupts? Is the software written in asm or something higher-level like C? If you wrote it in asm, and you made heavy use of the dos interrupt (and others) then you're going to spend a lot of time porting.

    OTOH, if you wrote it in C, most of it is going to port right over, except for where you're doing hardware access. Some of THAT will port over too but no matter what you're not going to get out of rewriting your display code, since I'm guessing you're doing direct video access regardless of what language it's written in.

    If you wrote it in C, you should have no problem provided you haven't forgotten how to write C. If it's written in assembler, you might be better off using it for a reference work and reimplementing it. In C :)

  • by PD ( 9577 ) <slashdotlinux@pdrap.org> on Thursday November 21, 2002 @11:46PM (#4729212) Homepage Journal
    We are porting specialists. We move anything to anything.

    www.sector7.com
  • FreeDOS, DR-DOS (Score:2, Informative)

    by wotevah ( 620758 )
    Try FreeDOS (www.freedos.org) or DR-DOS (www.drdos.net). They are drop-in (more or less) replacements for MS-DOS.
  • Ok I am going out on a limb and guessing that you do NOT have the source code for this application, and that the original developer (the only guy on the planet that would actually understand the source code if it was available, which it isn't) isn't available to help you with this project.

    If your client can't afford (doesn't want to pay for) seats of the operating system for new hardware, on top of the cost of 4,000 new systems, you absolutely positively cannot afford the cost of a custom developed solution that involves reverse engineering the DOS app and trying to code an identical app under *nix that still talks with your servers over IPX.

    Custom development runs $400 a day on the extremely cheap side (you find contractors that know what they are doing for $50 an hour) to $1600+ a day for consulting firms to provide you with their staff.

    Your best bet would be to find a bulk supplier of retired hardware - if you could get a truckload of 486 boxes with drivers and external modems (beware the WinModems) just buy them by the pound and use them with DOS and your apps.
  • by Anonymous Coward
    ...console application...

    Doesn't sound like it would be too hard to port.

    ...hardware upgrades...

    Upgrades for what? Tell me again what your problem is, and why exactly you need to invest in new hardware and/or new software?

    ...we should move to a Windows-like environment...

    OK, this sounds like the same clueless assholes whole replaced the $250 dumb terminals at the local library with $1250 Windows PCs. (The PCs perform the exact same function as the dumb terminals: card catalog lookups. Pentium CPU, 32 meg RAM, Win95 -- and the only app they run is a terminal program to connect with the mainframe in the back room.)

    Do you know about FreeDOS [freedos.org]?

    Do you know about Turbo Vision [sourceforge.net]? It makes nifty DOS or Linux apps that look and act like Windows [sourceforge.net] but run in text mode.

  • Telnet? (Score:3, Insightful)

    by skinfitz ( 564041 ) on Friday November 22, 2002 @03:33AM (#4730308) Journal
    The terminals run a console application on a light DOS. Everything is fine so far.

    A "console application" connecting to a server via DOS? I bet his "console application" is a telnet client!
    • A "console application" connecting to a server via DOS? I bet his "console application" is a telnet client

      The older it is, the lower the probability that it uses TCP/IP. There were and are plenty of other protocols that were in common use back in the day, especially for an application on slow hardware with a slow connection, which wouldn't cope with the overheads of TCP/IP.
  • umm freedos? (Score:3, Informative)

    by Hadlock ( 143607 ) on Friday November 22, 2002 @03:58AM (#4730364) Homepage Journal
    freedos [freedos.org] is free. it's about 3mb, with all the options installed, and runs on current hardware, and supports neat things like USB and (i think TCP/IP). then you don't need to port anything, and it runs on current hardware (or, at least my 5 year old amd k6-2 300, so probably anything that supports x86)

    if all you're doing is running a console app in dos, and your infrastructure is built around this, it seems far simpler to just go the way of freedos
  • So what's the problem, then? We have a hard time finding parts to maintain the network. Our client says that he's willing to invest in hardware upgrades, but we should move to a Windows-like environment, however he doesn't want to pay for more than 4000 Windows licenses.
    That sounds like two problems, not one.

    You, as system supplier, have some sort of maintainance issue with the current set-up, the nature of which is not described in detail, unfortunately, but I can understand that identifying the particular application on /. may not be the best way of endearing yourself to the rest of your company and its current client, especially if, as it sounds, it's a custom implementation for that client. Meanwhile, the client is saying that if the setup is going to have to be be changed anyway, then they want to take the opportunity to upgrade the application and make it... what? Just prettier for the sake of it, or a more common PC-like look and feel so that there is less sniping from their customers about it being primitive and out-of-date? Or do they want added functionality as well? Are the existing central servers sacrosanct, or can that part of the app be adjusted, too?

    I've got no concrete suggestions, but as this response indicates, I'd personally be inclined to sit down with the client and explore what they want and their reasons for it, and then, and only then, evaluate the approaches you collect.

  • It sounds like your setup would be a prime candidate for a *nix/*BSD (or anything that comes without an expensive license)... But if the hardware isn't old-enough, you'll be looking at quite a few winmodems in that pool of 4000 clients or was this considered when buying the client-h/w in the firstplace?
  • Mr. Bustos,

    With an environment that is this old, I would recommend, for both your sake as well as the client's, to look at a full Linux migration. This migration should be looked at from many angles in order to save money.

    First, are any of these remote PCs in a common location? If so, a single faster internet connection should be looked at. You could set up a small connection sharing/DSL network at the remote site(s). If enough connection consolidation can be done some money can be saved on a monthly basis. It will also cut down on the number of modems/phone lines to maintain. Even if you switch to a secure VPN over the Internet for each modem, the central computer only needs a single high-speed (DSL, cable modem, T1, etc.) network connection. This alone should save tens or hundreds of thousands of dollars per month on phone lines!

    Second, port the application to Linux. Linux is a robust platform that will be supported for many years. DOS is not. NT is not. Microsoft is barely even supporting NT at this point. If it is written in C/C++, all the better. It will be a quick conversion. If not, it's worth the effort.

    Third, If the client buys into the idea, look at replacing the PCs with newer hardware. I know that in the US (I'm assuming that the .es domain is not) that a decent PC with warranty can be had for less than a MS Windows XP license from Walmart.com. These new PCs will include Linux preloaded. (I recommend the Mandrake Linux loaded PC.)

    If he likes the idea, buy just a few PCs at first. Get the programming glitches worked out and the communications tested.

    Once the program/new environment is good to go, set up the new server and let some users try it beside their old setup for a week or two. Setup some basic training materials (maybe even a basic training class). Get the users trained on it while the PCs ship out but before rollout. THEN do the cutover.

    Your client should be pleased with both the switch as well as the future ability to use the platform for other things. Whether used in text mode or GUI mode, Linux is a powerhouse that is a good investment.

    Good luck.

    If you need some help, shoot me an email or post it here.

    Randy

    PS: If you're company is not yet adept at a Linux conversion/rollout. This kind of contract would be great to get your feet wet and grow that side of the business.
  • Uh...sorry if this is redundant, but what exactly are you doing with this, exactly? What sort of company? What software? Why do you need to upgrade? It sounds like you just are upgrading for the sake of upgrading (or because somebody wants to for the sake of upgrading). My suggestion: overhaul everything. New software, new servers, everything. And then have some cake.

A morsel of genuine history is a thing so rare as to be always valuable. -- Thomas Jefferson

Working...