Need C compiler for Windows 7 64-bit, to compile to DOS target
Asked Answered
U

3

6

I'm trying to find a solution to allow me to compile C code to a DOS executable from Windows 7 64-bit. I recently updated from XP 32-bit to Win7 64-bit, and now my Borland C++ 5.0 compiler won't work. I get an error when it tries to call tlink.exe 16-bit. I'm trying to avoid bringing over another computer with XP but that will have to be my course of action if I can't figure something else out soon.

My target is an embedded x86 running FreeDOS. As much as I'd like to transition to Linux I can't afford the time that would transition would take. Aside from the learning curve of never having used Linux, much of my code is DOS-dependent and would have to be re-written.

I'm hoping there's a windows setting I can just change but my research so far leads me to believe I need a more drastic change to my process. I've sniffed around at Turbo C 2.01, DJGPP, DOSbox... not really too confident to go down any of those alleys without some outside input

Unpracticed answered 7/1, 2015 at 23:40 Comment(4)
how about running xp in a VM using virtualboxSharkey
16bit code will not run natively on 64bit windows (the 16bit subsystem is not present). I've had luck with DOSBox, and it's pretty easy to set up and get working.Ranjiv
I know this question is half a decade old, but I was curious if the target embedded system was running on a 386 class processor (or later) or was it an 8086/80186/80286 variant?Zina
Oh I just noticed a question from you a few months back that seems to be related and the answer to my question appears to be: 486/386DXZina
B
3

Run Virtual XP or VirtualBox and install Borland C++ inside. BTW, there is version 5.02 with some fixes (in case your version is exactly 5.0).

Bobstay answered 7/1, 2015 at 23:55 Comment(0)
S
3

If you can find an old Microsoft Compiler, like 16 bit C / C++ 1.52 (which is included on the 32 bit C / C++ 4.1 cd-rom), or C 8.00 or earlier, it runs using a dos extender or in a 32 bit dos console window.

Why can't you run the Borland compiler using FreeDOS?

You could try to create a virtual machine with MSDOS on it, but you'd have to find a way to install MSDOS 6.22 on the virtual machine. At Microsoft's support site, they have links to a bootable ISO file for MSDOS 6.22. I still have the original floppies and started with those on an old system that has a floppy drive. It's a bit awkward to import / export files to / from the virtual machine.

This is the config.sys that I use that seems to work with Win 7 virtual machine. I had to increase buffers, stacks, and files to avoid a stack overflow problem with this setup.

dos=high,umb
buffers=40,0
files=60
lastdrive=e
shell=c:\command.com c:\ /e:1024 /p
stacks=64,512
switches=/f
device=c:\dos\himem.sys /numhandles:64 /testmem:off
device:c:\dos\emm683.exe ram i=b100-b7ff i=c600-c7ff i=cc00-cfff i=e600-efff frame=d000 a=32 d=128 notr
devicehigh=c:vmadd\cdrom.sys /d:mscd001

This is the autoexec.bat that I use (smartdrv is a bit pointless in this case so I commented it out with "rem" prefix) .

c:\dos\emm386 auto
lh c:\dos\mscdex.exe /d:mscd001 /m:7
rem lh c:\dos\smartdrv.exe
lh c:\vmadd\mouse.com
set path=c:\dos
set blaster=a220 i5 d1 h5 p330 t6
prompt $p$g
Steep answered 7/1, 2015 at 23:51 Comment(0)
B
3

Run Virtual XP or VirtualBox and install Borland C++ inside. BTW, there is version 5.02 with some fixes (in case your version is exactly 5.0).

Bobstay answered 7/1, 2015 at 23:55 Comment(0)
A
2

As for a compiler, Open Watcom seems to me to be the best choice in your situation. FrameworkPascal (written in the old version of Watcom) provides a 32 bit extender. Regarding the creation of a FreeDOS virtual machines, pickup the tools from Microsoft SysInteral. They include a tool that create a VHD. Once you get a FreeDOS running in a VM you can simply SYS the VHD and start it anywhere. There are plenty ready to run ISO images for FreeDOS, one worth mentioning is Seagate Seatools for DOS which is being distributed with the FreeDOS kernel.

Your best (but not only) solution for running all that is probably XPMode on Windows 7 Pro. It runs Windows XP 32 which of course provide 100 percent transparent compatibility via its NTVDM with DOS 16 bit real mode, 16 bits protected (Windows 3.1), and DOS 32 bit extenders. NTVDM by the way is a feature that can be activated on Windows 10 Pro but it yet to be seen what exactly can be done with it there.

XPMode is a free downnload from Microsoft that installs a free version of Windows XP 32 bit in a virtual machine on Windows 7 Pro with full sharing of the cutpaste/copy buffer, USB, drives, screen and network card (web access). It can be toggled between a Window and full screen. The installation of XPMode is automated (after activation of the Windows 7 Pro VM). Microsoft provide various downloadable hot fixes that update the registry to activate the VM. There is an MS support downloadable hot fix that has to be run to allow the installation on the AMD Bulldozer architecture. XPMode hibernate its desktop and virtual hard drives making it a much more productive environment than a hardware based system.

With a little extra work Windows XP 32 bits can be installed on any virtual machine including Microsoft Virtual Machine on Windows XP 64 bits as well as Oracle Box and VMWare. XPMode however is probably the smoothest solution since some installations such as MS Virtual Machine for Windows XP 64 bits do not utilized the full physical display in full screen (only about 90 percent of it). If you install your browser and email in XPMode you can live in the full screen and forget about new versions of Windows.

Af answered 28/8, 2016 at 15:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.