PDA

View Full Version : Old-school programming on new hardware



mbbrutman
May 24th, 2010, 03:28 PM
(I figure that somebody will find this helpful.)

My code development system was a genuine 386-40 clone machine running DOS 5 and Turbo C++ 3.0. Running on the real hardware with an original 84 key AT keyboard has its charms, but might not be as productive as it could be. I think that my Windows XP box with four CPU cores can probably give me some benefit here. :-)

Recently I decided to explore alternatives running on my new hardware. Here is what I came up with:


Open Watcom C/C++. (Substitute the compiler of your choice here - they probably all work.)
DOSBox: Gives me enough DOS to run the compiler and apps and easy filesystem sharing with the host OS (Windows XP)
Cygwin: Gives me Xterms, VI, and other tools that are useful for programming and mimic my normal programming environment at work.


With this combination I can have multiple source code windows, documentation, and the emulated DOS machine up and visible at the same time. It's not the integrated IDE that Turbo C++ 3.0 had, but I've got far more screen real-estate now and the compiles are far faster.

I was a little concerned about how close to real DOS DOSBox is, but after using it a bit I'm not too concerned anymore. If DOSBox can correctly run Open Watcom and all of the games that it is designed for, then it can handle anything I'm throwing at it. I had originally started with VMWare Player and real IBM DOS 6.3 but that was a pain to share files with and the screen options were too limited. (It would only use a 640x480 window in text mode, because that is all that VGA has. VirtualBox has the same problem. I could have run Windows in the virtual machines to get a better video driver, but that seemed like overkill.)

Cygwin is optional - you can use whatever text editor you like. The key point is that a modern OS will give you multiple windows and a choice, which is nice.

I'm going to keep the 386-40 forever, because some things you still need real hardware for. But for development, I think the new setup is going to be pretty good. There is already a lot less time being spent looking up docs - now everything is on the same screen.

Chuck(G)
May 24th, 2010, 04:23 PM
So, I can run my OS/2 2.1 toolchain on a modern system?

mbbrutman
May 24th, 2010, 05:18 PM
Not sure .. but I know it's not going to work in DOSbox.

Have you looked at VMWare or VirtualBox?

Chuck(G)
May 24th, 2010, 06:15 PM
Yes, the problem is that OS/2 2.x is pretty limited as to hardware support. I keep a 486 box around for that eventuality. You can never have too many 9different) computers!

krebizfan
May 24th, 2010, 08:38 PM
Virtual PC 2004 or 2007 will run OS/2 and OS/2 drivers for the simulated S3 card exist. As far as I know, none of the other virtualizers will run 32 bit OS/2 at all. I was happily surprised when I managed to get OS/2 Warp 3 running on a late Pentium III. Not exactly modern but there was a considerable gap between release of Warp 3 and the specific Pentium III.

For testing of software intended to run on older hardware, I use Bochs. It is the only emulator I can get slow enough, down to 486 levels.

PrintStar
May 25th, 2010, 07:12 AM
I was a little concerned about how close to real DOS DOSBox is, but after using it a bit I'm not too concerned anymore. If DOSBox can correctly run Open Watcom and all of the games that it is designed for, then it can handle anything I'm throwing at it.

Why exactly are you running Open Watcom under DOS? Just wondering since it isn't strictly necessary. You can run Open Watcom natively under Windows and simply have the compiler target DOS. I've never run Open Watcom under DOS personally. That way I can use the barely adequate Open Watcom IDE under Windows to manage the project, and I don't have to upscale and downscale DOSBox's speed emulation to make the compiler run faster.

Every Open Watcom host system can compile for every Open Watcom target. For example, I've regularly targeted 16-bit DOS running the compiler on Windows XP, and I'm currently working on a project which builds a win32 application using Open Watcom running under Debian GNU/Linux (natively - no emulation). You can build OS/2 apps on Windows, DOS apps on Linux, Netware apps on OS/2, etc.

Open Watcom is a hoot.

mbbrutman
May 25th, 2010, 07:19 AM
My initial thought was to keep the environment basically the same as on the original machine. But you are right - I can use the cross compile feature, and only revert back to running it in DOSBox if I think there is a difference caused by the cross-compilation. The only think I'm missing at the moment is the ability to use the barely functional IDE to run the debugger.

I run DOSBox at full speed so I don't have the speed upscale/downscale issue.

Have you noticed any problems with cross compiling, or does it "just work"?


-Mike

mark66j
May 25th, 2010, 07:59 AM
Yes, the problem is that OS/2 2.x is pretty limited as to hardware support. I keep a 486 box around for that eventuality. You can never have too many 9different) computers!

Seems I've read that there's a setting that can be modified in VMWare to get OS/2 to run, but it might only work for Warp 3 or above. I was able to install eCommStation in Parallels (on an Intel Mach) but it seems to trap on something fairly quickly.

Chuck(G)
May 25th, 2010, 08:15 AM
Virtual PC 2004 or 2007 will run OS/2 and OS/2 drivers for the simulated S3 card exist. As far as I know, none of the other virtualizers will run 32 bit OS/2 at all. I was happily surprised when I managed to get OS/2 Warp 3 running on a late Pentium III. Not exactly modern but there was a considerable gap between release of Warp 3 and the specific Pentium III.

For testing of software intended to run on older hardware, I use Bochs. It is the only emulator I can get slow enough, down to 486 levels.

OS/2 2.1 is 16 bit.

mbbrutman
May 25th, 2010, 08:18 AM
I'd double check that ... The OS/2 2.x series was 32 bit, and would not run on an 80286 processor because of that.

OS/2 2.11 was the first OS/2 that I used. I'm pretty sure it is 32 bit.

mark66j
May 25th, 2010, 08:52 AM
I'd double check that ... The OS/2 2.x series was 32 bit, and would not run on an 80286 processor because of that.

OS/2 2.11 was the first OS/2 that I used. I'm pretty sure it is 32 bit.

I am pretty sure OS/2 2.11 did have 32 bit code in it and required 386 and above. (There was quite a bit of 16-bit code that remained as well, however). It's been reported that Microsoft originally wanted to only support the 386 with OS/2 but that IBM insisted on support for some of its older hardware in the 1.x series.

Chuck(G)
May 25th, 2010, 09:18 AM
I am pretty sure OS/2 2.11 did have 32 bit code in it and required 386 and above. (There was quite a bit of 16-bit code that remained as well, however). It's been reported that Microsoft originally wanted to only support the 386 with OS/2 but that IBM insisted on support for some of its older hardware in the 1.x series.

Could be true, but I did a lot of 16-bit development on OS/2 2.1 I can still run 16-bit non-PM OS/2 executables under Windows XP (some of the API interfaces aren't quite right, but most are close enough). Haven't tried under 32-bit Win7, but I suspect they will work also.

PrintStar
May 25th, 2010, 09:33 AM
My initial thought was to keep the environment basically the same as on the original machine. But you are right - I can use the cross compile feature, and only revert back to running it in DOSBox if I think there is a difference caused by the cross-compilation. The only think I'm missing at the moment is the ability to use the barely functional IDE to run the debugger.

I run DOSBox at full speed so I don't have the speed upscale/downscale issue.

Have you noticed any problems with cross compiling, or does it "just work"?


I have never had a single problem with cross compiling with Open Watcom, especially considering any of the DOS work I did was targeting 16-bit DOS, which cannot host Open Watcom (running the compiler requires a 386 or maybe just EMS/XMS or something, doesn't matter). In addition, I can vouch for the GNU/Linux hosted compiler, which is able to produce perfect win32 executables. I would assume it works just as well for building DOS programs. That said, I often prefer to work outside the IDE, so your solution of running Open Watcom full speed within DOSBox sounds like a perfect solution.

I've never tried debugging with Open Watcom except using their Windowed Debugger, which only runs on Windows and OS/2. If you want to debug a DOS target through it, you're now talking about remote debugging, which I've never attempted. I've never used the command line debugger.

mark66j
May 25th, 2010, 10:45 AM
Could be true, but I did a lot of 16-bit development on OS/2 2.1 I can still run 16-bit non-PM OS/2 executables under Windows XP (some of the API interfaces aren't quite right, but most are close enough). Haven't tried under 32-bit Win7, but I suspect they will work also.

I think all versions of OS/2 supported 16-bit applications, even long after much of the OS code was 32 bit. (I think this is similar to the way you can still run 32-bit applications in 64-bit Windows and Mac OS X). Microsoft kept the 16-bit OS/2 code in Windows (as you mention) since they shared a license for it, and to allow migration to Windows NT. As I recall, they even added support for 16-bit PM applications at some point. I think they dropped the OS/2 subsystem in Windows 7 and the latest server versions, but I can't find anything to confirm this.

TheLazy1
May 25th, 2010, 01:40 PM
I thought open watcom was available for many other platforms, why run it under dosbox?
Unless those other ports cannot compile 16bit code...



// TODO: Look into that... later


Maybe what's really needed is a tiny x86 computer that can boot DOS from flash/rom and load and listen
for dos binaries over a network connection.

/me stops daydreaming

tezza
May 25th, 2010, 04:37 PM
Virtual PC 2004 or 2007 will run OS/2 and OS/2 drivers for the simulated S3 card exist. As far as I know, none of the other virtualizers will run 32 bit OS/2 at all. I was happily surprised when I managed to get OS/2 Warp 3 running on a late Pentium III. Not exactly modern but there was a considerable gap between release of Warp 3 and the specific Pentium III.

For testing of software intended to run on older hardware, I use Bochs. It is the only emulator I can get slow enough, down to 486 levels.

Yes, I have successfully installed OS/2 2.1 under Virtual PC 2007. Seems to work . However, not being a programmer, I can't comment on whether Virtual PC 2007 is a good MS-DOS programming environment for modern Windows operating systems. Some MS-DOS games I've tried don't work under Virtual PC 2007, but they do with DOS-BOX. I assume it's got something to do with direct calls to the (virtual) hardware.

Tez

MikeS
May 26th, 2010, 10:06 AM
I thought open watcom was available for many other platforms, why run it under dosbox?
Unless those other ports cannot compile 16bit code...



// TODO: Look into that... later


Maybe what's really needed is a tiny x86 computer that can boot DOS from flash/rom and load and listen
for dos binaries over a network connection.

/me stops daydreamingWhy is that needed here? And don't a number of different ones already exist?

TheLazy1
May 26th, 2010, 12:04 PM
Laziness I guess, having compact real hardware to test on which can be close by the main dev machine.

Raven
May 26th, 2010, 12:31 PM
I think all versions of OS/2 supported 16-bit applications, even long after much of the OS code was 32 bit. (I think this is similar to the way you can still run 32-bit applications in 64-bit Windows and Mac OS X). Microsoft kept the 16-bit OS/2 code in Windows (as you mention) since they shared a license for it, and to allow migration to Windows NT. As I recall, they even added support for 16-bit PM applications at some point. I think they dropped the OS/2 subsystem in Windows 7 and the latest server versions, but I can't find anything to confirm this.

The OS/2 Subsystem was killed off at XP/2K3 at the latest (possibly Win2k). I've seen the sources for NT4 and XP kernel.. However, you can transplant it back into any newer NT kernel, it's a pretty modular system (surprisingly) and the NT4 modules for FASTFAT and OS/2 Subsystem have been transplanted into an XP kernel by a friend of mine and they work, too.

saundby
June 6th, 2010, 01:00 AM
Laziness I guess, having compact real hardware to test on which can be close by the main dev machine.

You might be interested in the products at http://jkmicro.com/. Embedded x86 boards along the lines of older hardware. There's also the post-Z-80 boards from Ampro, and the PC/104 systems. Lots of places to get them, page through an issue of Cicuit Cellar. E.g., http://www.emacinc.com/sbc_pc.htm