Author Topic: Running 486-era software on modern hardware at the right speed  (Read 1373 times)

0 Members and 1 Guest are viewing this topic.

Offline ivan747

  • Super Contributor
  • ***
  • Posts: 2027
  • Country: us
We have a machine  that was bought around the year 2000. It came with an IBM PC/ValuePoint 433dx/s, with an i486 processor and PC-DOS. The original PC is still in use, but I am seriously concerned about its reliability. The PC runs software that came with the machine and talks to it over the serial port (it doesn’t seem like any weird low level stuff is happening).

Long story (short story below):
The first thing I thought about was making an image of the hard drive with Linux on a mid 2000’s machine (so that I have IDE, floppies and USB). Turns out that the last time someone attempted to do a backup on that hard drive it didn’t go well at all,  so we are hesitant to touch it. Fair enough, I’m not in the mood for risks.

So, instead found the original install floppies for the software. I made a live USB with Linux, found a 2008 machine with a floppy drive and began making images of all the floppies with ddrescue. It worked perfectly. Then I went to a modern computer and installed Virtualbox. I grabbed a copy of PC-DOS and installed that. Then I installed the software. But when I run it, I get “Runtime Error 200” when trying to execute some functions/programs. Info on the internet says it’s because of the way a library in TurboPascal 7 was programmed. It had to calibrate a delay routine, and this code breaks when ran at over 200MHz because of a division overflow. I need a way to run the software at a consistent speed, and to talk to the serial port.

Short story:
We have a 486 PC that is about to die, so we need to migrate to modern hardware. I need to run software that was made with TurboPascal 7, which came with a bug that causes a division overflow when it’s run at over 200Mhz. I cannot recompile the software because I don’t have the source (it came with the machine). It needs access to the serial port.

What are my options?
- Virtualbox: causes runtime error 200 (when the execution cap is set to 1% of the CPU, more code runs, but it’s inconsistent and 1% of 4GHz is not the same as 1% of 2GHz...).
- Patch the software: attempted to patch with PatchCRT but it didn’t work on all but one of the executables (there are 20+). The executables may be compressed. I haven’t tried that yet. I’m a bit worried about breaking the executables with the patch (the patch may introduce other issues).
- DOSbox: I saw that you can alter the amount of “cycles” the emulation but it’s not clear to me if this is independent of the host CPU frequency. If I set it at 3000 cycles on a 2GHz processor and then change to a 4GHz processors, will it go twice as fast inside DOS? Also, I’d rather run the software in PC-DOS if possible, to be as close as possible to the original. I don’t know how close DOSbox is to DOS for things that aren’t games.
- QEMU: I can’t seem to find a way to specify frequency or execution speed in absolute terms. I haven’t looked into serial.
- Specialized hardware: is there modern hardware that could handle this? It can be niche hardware, and I guess we could allocate up to a couple of grand on it but not much more than that. If someone makes a 486 system-on-board or something like that I think it would be a solid option, if it’s new stock. I don’t want to get out of a ’93 computer into a ‘98 computer.
- Regular hardware: is there a way to make a modern computer run in a legacy mode? 90’s PCs had a turbo button to slow them down, but that isn’t a thing anymore, is it? I am guessing the software would run under FreeDOS for maximum compatibility.

I think they all have the pros and cons... what do you think?  :-//
 

Offline ivan747

  • Super Contributor
  • ***
  • Posts: 2027
  • Country: us
Re: Running 486-era software on modern hardware at the right speed
« Reply #1 on: May 26, 2021, 02:29:28 am »
This looks promising


PC104 seems to be a motherboard / system-on-board standard that supports many legacy architectures. I also found a SoC called Vortex86. I’m going to look into it tomorrow. Let me know what you guys think. I think it would be cheaper if I found something like a Vortex86 micro ATX or mini ITX motherboard, because the PC104 is going to need a lot of custom stuff like chassis, power supply and adapters.
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 10019
  • Country: us
Re: Running 486-era software on modern hardware at the right speed
« Reply #2 on: May 26, 2021, 02:37:43 am »
One vague idea I can think of is that laptop systems in particular have a way of slowing down the processor to run cooler and save power. Could you find software that can directly set the processor speed on a modern system to make it run really slowly? I have an idea modern systems have power management abilities like this, since if the system is idle the processor really doesn't need to be doing anything, so it can slow down almost to a standstill.
I'm a ChemE--I know all about the flow of fluids.
 

Online BrokenYugo

  • Frequent Contributor
  • **
  • Posts: 384
  • Country: us
Re: Running 486-era software on modern hardware at the right speed
« Reply #3 on: May 26, 2021, 02:41:32 am »
The config file for dosbox claims if set to 3000 cycles it will run at 3 MIPs, presumably independent of host machine clock.
 
The following users thanked this post: ivan747

Offline retiredfeline

  • Frequent Contributor
  • **
  • Posts: 254
  • Country: au
Re: Running 486-era software on modern hardware at the right speed
« Reply #4 on: May 26, 2021, 03:00:08 am »
I had an inkling I'd read about this bug before and there's a patch for binaries. Maybe this will help? https://retrocomputing.stackexchange.com/questions/12111/why-did-ms-dos-applications-built-using-turbo-pascal-fail-to-start-with-a-divisi
 

Offline ivan747

  • Super Contributor
  • ***
  • Posts: 2027
  • Country: us
Re: Running 486-era software on modern hardware at the right speed
« Reply #5 on: May 26, 2021, 11:23:22 pm »
I had an inkling I'd read about this bug before and there's a patch for binaries. Maybe this will help? https://retrocomputing.stackexchange.com/questions/12111/why-did-ms-dos-applications-built-using-turbo-pascal-fail-to-start-with-a-divisi

I grabbed a copy of that patch, but I am yet to test it. I’ll let you guys know how it goes.

One vague idea I can think of is that laptop systems in particular have a way of slowing down the processor to run cooler and save power. Could you find software that can directly set the processor speed on a modern system to make it run really slowly? I have an idea modern systems have power management abilities like this, since if the system is idle the processor really doesn't need to be doing anything, so it can slow down almost to a standstill.

I haven’t tried it on hardware yet. I suspect I’d have to underclock the computer very severely. I don’t know if they go down to the 200MHz level. A processor like the Vortex86 might do it?

The config file for dosbox claims if set to 3000 cycles it will run at 3 MIPs, presumably independent of host machine clock.

It does seem independent, reading the documentation closely. This looks like a good option. We’ll see how well it handles the software.
 

Online NiHaoMike

  • Super Contributor
  • ***
  • Posts: 7473
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: Running 486-era software on modern hardware at the right speed
« Reply #6 on: May 28, 2021, 01:27:17 am »
Might this be one place where FPGA emulation would make sense?
Cryptocurrency has taught me to love math and at the same time be baffled by it.

Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
 

Offline ivan747

  • Super Contributor
  • ***
  • Posts: 2027
  • Country: us
Re: Running 486-era software on modern hardware at the right speed
« Reply #7 on: May 28, 2021, 02:37:48 am »
Might this be one place where FPGA emulation would make sense?

Turns out they already have ASICs for this
https://en.wikipedia.org/wiki/List_of_x86_manufacturers#x86-processors_for_embedded_designs_only
and also an FPGA implementation called ao486



Update:

I tried the patches, they didn’t work. Also tried “slowdown”, a DOS program that slows down the system artificially. Also didn’t work.

Then I tried DosBox. Turns out it has a boot command, so I can literally install and boot PC-DOS from it. Here’s how I did it:

Create a blank image file or download one. Mount it to letter C using the imgmount command.
Now, you have to install PC-DOS from five floppies. The trick is as follows,
Copy disk 1 and name it something like diskX.img
Mount diskX.img to letter A using imgmount.
On the DosBox prompt, type boot -l A. This will boot the first floppy.
Begin the install.
When the install asks for disk 2, you will copy disk2 to diskX. What I did is that I opened the Windows command prompt and did copy disk2.img diskX.img. Then you return to DosBox and tell the installer you inserted disk 2. (I’m amazed this works...)
Repeat until disk 5.
The installer will then shut down DosBox.
Start DosBox again.
Mount drive letter C again.
Boot from drive C by typing boot -l C
You should now be in PC-DOS.

To install any software, it’s more or less similar:
Mount the installer to letter A.
Start the installer
Don’t boot into PC-DOS, just run the installer directly from the DosBox prompt. Remember you can do the copying trick to swap disks. 

In my case, the installer assumed it should install into drive C, so I had no issues. DosBox is in drive Z, maybe some installers will install into there. In that case, I don’t know what you should do. When I tried to load A: from the PC-DOS file manager it gave me some errors (I also can’t format disks, it might have to do with the emulation). I didn’t try loading from the shell directly.

When the install is done, you can boot from letter C.

I now have the software running. No errors. It even emulates the PC speaker. I haven’t tested the serial port yet but I’m hopeful.

Last hint, the config file for DosBox has an auto exec section where you can add all your mount commands. I mount drive C and drive A automatically and also i boot from C. This is very neat. The program I’m running has a backup functionality that copies all profiles into a floppy. I could have a script on Windows that backs up drive A every time the file changes, and gives it a date and time.

Next steps: back up the current profiles from the physical machine into a floppy and make an image of that floppy.

Let’s hope the serial port works and the delays are accurate  :-/O
 
The following users thanked this post: SilverSolder, coromonadalix

Offline james_s

  • Super Contributor
  • ***
  • Posts: 16078
  • Country: us
Re: Running 486-era software on modern hardware at the right speed
« Reply #8 on: May 28, 2021, 05:02:58 am »
I've been using dosbox for years to run old software, it works great. It even works with the software to control my modded scanner radio, which was written for a PC/XT and interfaces via the serial port.
 

Offline PKTKS

  • Super Contributor
  • ***
  • Posts: 1234
  • Country: br
Re: Running 486-era software on modern hardware at the right speed
« Reply #9 on: May 28, 2021, 05:37:04 pm »
I had an inkling I'd read about this bug before and there's a patch for binaries. Maybe this will help? https://retrocomputing.stackexchange.com/questions/12111/why-did-ms-dos-applications-built-using-turbo-pascal-fail-to-start-with-a-divisi

*IF*  your are talking about the  "runtime error 200"
when running programs on a machine clocked faster
than 200M...

YES I confirm you that the tppatch  worked just fine
whenever I needed it wo the sources to recompile..

The BUG is caused by DIV instruction w/numbers
bigger than registry available and the patch changes
the Delay() routine to cope w/that bug..

Available on the NET or I can post the patcher here..

Paul
 

Online fzabkar

  • Super Contributor
  • ***
  • Posts: 1012
  • Country: au
Re: Running 486-era software on modern hardware at the right speed
« Reply #10 on: May 30, 2021, 01:24:35 am »
You can get a report of the physical state of the original HDD with SMARTUDM:

http://sysinfolab.com/download.htm

The tool is tiny enough to fit on a 360KB floppy diskette.
« Last Edit: May 30, 2021, 01:28:09 am by fzabkar »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf