Solution to FreeBasic for DOS compiler crashing under Windows Ten 32 Bit

DOS specific questions.
Post Reply
Moguera
Posts: 11
Joined: Nov 13, 2010 18:48

Solution to FreeBasic for DOS compiler crashing under Windows Ten 32 Bit

Post by Moguera »

I installed 32 bit Windows 10 in my latest computer, because I still run two DOS programs under Windows. Under past versions of Windows, I’ve had no problems compiling FreeBasic programs using FreeBasic for DOS V. 0.24.0.

However, when I tried compiling a program using FreeBasic for DOS V. 0.24.0 under Windows 10, it crashed and brought the CMD window down with it.. I tried running it in various compatibility modes, but that failed to eliminate the problem.

I downloaded V. 1.07.1 for DOS, and tried it, but got an error message “Aborting due to runtime error 12 ("segmentation violation" signal)”. I tried one suggestion I found on the Internet, but it failed to eliminate the problem. I also tried running it in various compatibility modes, but that also failed

I copied the program to an XP machine and the program compiled without any problem. I tried the executable and it worked as it should.

Since I may not always have access to an XP machine, I tried compiling that FreeBasic program using V. 0.24.0 of FreeBasic in a DOSBox Megabuild 6 window. The program compiled without errors and the executable ran as expected.
exagonx
Posts: 314
Joined: Mar 20, 2009 17:03
Location: Italy
Contact:

Re: Solution to FreeBasic for DOS compiler crashing under Windows Ten 32 Bit

Post by exagonx »

Moguera wrote: Jul 06, 2020 21:04 I installed 32 bit Windows 10 in my latest computer, because I still run two DOS programs under Windows.
FreeBASIC for DOS compiles codes to operate in 16-bit, in Windows NT systems no 16-bit code is executed but only 32-bit, to consider that the Windows NT CMD is not DOS, the software compiled for this platform operate in 32-bit.

The software you own where you run it under Windows 10 32bit is Windows 32 software, to run DOS software under Windows NT you need an emulator like VMWare, VirtualBOX, etc.

However, you cannot use FreeBASIC for DOS under Windows NT.



PS Windows NT has always operated at 32bit with the following versions 3, 4, 2k, xp, vista, seven, 8, 10, 11
Windows 95, 98, Me instead have the basic 16-bit system
angros47
Posts: 2321
Joined: Jun 21, 2005 19:04

Re: Solution to FreeBasic for DOS compiler crashing under Windows Ten 32 Bit

Post by angros47 »

I used Free basic for DOS under Windows XP for years, and it worked with no issues. Also, Free basic for DOS doesn't emit 16 bit code, it emits 32 bit code (in fact, to run it under pure DOS an extender like cwsdpmi is needed)
exagonx
Posts: 314
Joined: Mar 20, 2009 17:03
Location: Italy
Contact:

Re: Solution to FreeBasic for DOS compiler crashing under Windows Ten 32 Bit

Post by exagonx »

angros47 wrote: Mar 20, 2022 7:30 I used Free basic for DOS under Windows XP for years, and it worked with no issues. Also, Free basic for DOS doesn't emit 16 bit code, it emits 32 bit code (in fact, to run it under pure DOS an extender like cwsdpmi is needed)
Forgive my ignorance but CWSDPMI is not used to index the protected extended memory so you can load software without interfering with the real data of the operating system?
I tried to run a compiled software on MSDOS 6.22 on windows xp but it gives me non windows software error
angros47
Posts: 2321
Joined: Jun 21, 2005 19:04

Re: Solution to FreeBasic for DOS compiler crashing under Windows Ten 32 Bit

Post by angros47 »

Since the 80386, the CPU was able to work in real mode (16 bit, used for retro compatibility), 32 bit protected mode (that gave access to the whole memory), and virtual mode (a mode to run 16 bit code without leaving protected mode). The idea was to be able to boot the system with an old DOS floppy (to keep retrocompatibility), and to develop a new OS that worked in protected mode and was able to run several DOS applications at once (that system was supposed to be OS/2, but in the end the technology was used for Windows).

To be able to use some of the advantages of protected mode from DOS, memory managers (like QEMM386 or EMM386) were developed: they set the computer in protected mode (to be able to access all the memory), loaded the drivers and the TSR in that memory, and then ran the DOS in virtual mode: that was perfect... but had a little issue: what if a DOS program needed to use 32 bit code? In real mode, the DOS code could have just switched to protected mode, but in virtual mode, this was not an option, so the program had to call the memory manager (that was already running in protected mode), and ask it to do the work: for that reason, a standard interface (that would have allowed DOS program to work in the same way under pure DOS, under Windows, under OS/2, under DesqView and under Linux (with DOSEMU) was defined: that interface was called DPMI

Under Windows, OS/2, DesqView and Linux, that interface is provided by the host system; under pure DOS, you need to use an extender to implement it (like CWSDPMI)


I have a pc with Windows XP (32 bit) and it can run DOS application (it can run even QBASIC). Perhaps you have Windows XP 64 bit? In case, you might need to install DosBox
exagonx
Posts: 314
Joined: Mar 20, 2009 17:03
Location: Italy
Contact:

Re: Solution to FreeBasic for DOS compiler crashing under Windows Ten 32 Bit

Post by exagonx »

angros47 wrote: Mar 20, 2022 16:56 Since the 80386...
Thank you for explanation, and you are right, I used Windows 2000 professional 64bit on HP Itanium 64bit, and all pc with 32 bit CPU are with Linux after 2004 all OS I have installed was 64bit here explain why all DOS program doesnt work.
caseih
Posts: 2157
Joined: Feb 26, 2007 5:32

Re: Solution to FreeBasic for DOS compiler crashing under Windows Ten 32 Bit

Post by caseih »

Itanium 64-bit wasn't even x86 compatible, to say nothing of running MS-DOS! Of course it wouldn't run MS-DOS programs. Wouldn't run most Windows programs either!

For what it's worth none of my MS-DOS programs (either 16-bit or 32-bit) run under Windows 10 Pro 64-bit.
Post Reply