Requires C compiler for 64-bit version of Windows 7 to compile DOS target

I am trying to find a solution that allows me to compile C code into a DOS executable from a 64-bit version of Windows 7. I recently upgraded from XP 32-bit to 64-bit Win7, and now my Borland C ++ 5.0 compiler will not work. I get an error when it tries to call tlink.exe 16-bit. I am trying to avoid using another computer with XP, but this should be my action if I can not understand something more.

My goal is the built-in x86 working with FreeDOS. As far as I would like to upgrade to Linux, I cannot afford the time it takes to upgrade. Besides the learning curve that never uses Linux, most of my code is DOS dependent and needs to be rewritten.

I hope there will be window settings that I can only change, but my research so far has made me think that I need a more radical change in my process. I sniffed Turbo C 2.01, DJGPP, DOSbox ... not too confidently going down any of these alleys without any external input.

+5
source share
3 answers

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

+3
source

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

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

You can try to create a virtual machine with MSDOS on it, but you will need to find a way to install MSDOS 6.22 on the virtual machine. On the Microsoft support site, they have links to a bootable ISO file for MSDOS 6.22. I still have the original floppy disks and start with those that are on the old floppy disk system. It is a bit inconvenient to import / export files to / from a virtual machine.

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

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 on this with the "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 
+3
source

As for the compiler, Open Watcom seems to me the best choice in your situation. FrameworkPascal (written in the old version of Watcom) provides a 32-bit extender. Regarding the creation of FreeDOS virtual machines, get the tools from Microsoft SysInteral. These include a tool that creates VHD. After running FreeDOS in a virtual machine, you can just SYS VHD and run it anywhere. There are many ready-to-run ISO images for FreeDOS, it is worth mentioning Seagate Seatools for DOS, which is distributed with the FreeDOS kernel.

The best (but not only) solution to run everything that is probably XPMode in Windows 7 Pro. It launches Windows XP 32, which of course provides 100 percent transparent compatibility through its NTVDM with DOS-16-bit real mode, 16-bit protected (Windows 3.1) and DOS 32-bit extender. By the way, NTVDM is a feature that can be activated on Windows 10 Pro, but it is not yet clear what exactly can be done with it there.

XPMode is a free downnload from Microsoft that installs a free version of the 32-bit version of Windows XP on a virtual machine in Windows 7 Pro with a fully split buffer for cutting / copying, USB, drives, screen and network card (web access), It can Switch between window and full screen. XPMode installation is automated (after activating Windows 7 Pro VM). Microsoft provides various downloadable patches that update the registry to activate the virtual machine. There is a hot fix downloadable MS application that needs to be run in order to install on AMD Bulldozer architecture. XPMode sleeping on its desktop and virtual hard drives makes it a much more productive environment than a hardware system.

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

+2
source

Source: https://habr.com/ru/post/1210618/


All Articles