Run Turbo C++ in Freedos

ε祈祈猫儿з 提交于 2020-01-26 04:01:10

问题


I want to run Turbo C++ in FreeDos. I used to run it in DosBox but now I decided to test the FreeDos in my desktop PC.

But every time I try run it the cursor blinks and nothing happens (after I enter the command and press enter) , the prompt does not return( C:> ) and I have to restart my system by pressing the power button. My question is:

  1. How can I actually run it? Does it require extra drivers or files?

  2. If it cannot be run, Do you any other C++ IDE? Maybe your own IDE?

P.S. I have installed FreeDos using the freedos option of Rufus.


回答1:


FreeDOS is not MS-DOS so incompatibilities are to be expected. However I did not come into contact with FreeDOS but here are some hints (from MS-DOS so they should more or less apply to FreeDOS as well).

  1. Without himem.sys you have no high memory

    so you got just 640 KByte instead of 1 MByte for everything. That is not much as some programs requires even 540 KByte...

  2. without Emm386.exe or QEMM386 you got no XMS memory

    If my memory serves well than also the DPMI drivers will not work which turbo needs.

  3. without proper autoexec.bat and config sys nothing works

    you do not have paths, device drivers (mouse,CDROM,etc.), and sets (like sound card). If you do not know what to put in them copy them from DOSBOX (minus the DOSBOX mount lines). No paths usually also means no command.com so you got no shell so no commands would work

  4. what file system you use?

    I would not go beond FAT16 for older DOS. Use FAT32 only for newer MS-DOS versions (from win98). Do not use NTFS or EXT even if you got drivers those caused problems all the time...

  5. Computer speed

    many DOS programs where based on Borlands CRT library. That caused a lot of problems later on as computers speed-up. If I remember correctly there was this runtime error 200 caused by it. To remedy such programs you can do 2 things. Patch or recompile the CRT lib in them (there are some fixes out there) or go to BIOS and turn off CPU CACHEs (L1,L2..). That will turn your modern computer into really fast 386 That should still pass the CRT init. Otherwise the timing is off and programs crash/hangs etc ... The DOSBOX emulator is designed to run programs at the original speeds instead of as fast as possible speed, so no further adjustment should be necessary if using that.

  6. Memory

    The old DOS can not handle more than 64 MByte and some programs have problems even with that. The safest way is to limit the available memory to 32 MByte. I usually did it using RAMDISC and or SMARTDRIVE buffers so only 32 MByte of memory is left for the DOS programs. (You can use the mem command to see what is your status if you see negative numbers you are crossing barriers and need to increase usage of SMARTDRIVE or RAMDISK).

    Do not forget to save the SMARTDRIVE buffers time to time and before exit to avoid loss of data if reset or crash/hang/freeze occur... It is a good idea to use Volcov commander (or Norton commander) with predefined menu for such operations. You can even associate file extentions with viewers editors and IDEs with it. So if you execute asm or cpp it got compiled or opened in your prefered IDE end so on...

Here example of autoexec.bat and config.sys (taken from my ancient MS-DOS rescue disc):

Autoexec.bat

@echo off
PROMPT $P$G
PATH e:\rescue;e:\rescue\dos98;e:\rescue\vcnew;e:\rescue\pack;e:\rescue\views
e:
cd rescue
SET TEMP=e:\rescue\temp
SET BLASTER=A220 I5 D1 H5 P330 E620 T6
SET SOUND=e:\rescue\SB16
SET MIDI=SYNTH:1 MAP:E MODE:0
e:\rescue\SB16\DIAGNOSE /S
e:\rescue\SB16\AWEUTIL /S
e:\rescue\SB16\MIXERSET /P /Q

goto %config%
:a
:b
:c
:d
:e

lh gmouse
LH vc

Config.sys

;devicehigh=e:\rescue\dos98\interlnk.exe
shell e:\rescue\dos98\command.com e:\rescue\dos98 /P
lastdrive=M
files=50
buffers=8
stacks=0,0
DOS=HIGH,UMB

[menu]
menuitem=a,QEMM
menuitem=b,EMM EMS
menuitem=c,EMM NOEMS
menuitem=d,STANDART
menuitem=e,RAMDISK 32MB
menudefault=d,1

[a]
device=e:\rescue\dos98\qemm386.sys RAM BE:N
[b]
device=e:\rescue\dos98\himem.sys 
devicehigh=e:\rescue\dos98\emm386.exe rammax
[c]
device=e:\rescue\dos98\himem.sys
devicehigh=e:\rescue\dos98\emm386.exe noems
[d]
device=e:\rescue\dos98\himem.sys
[e]
device=e:\rescue\dos98\himem.sys
devicehigh=e:\rescue\dos98\ramdrive.sys 32767 /e

It has boot menu where you can select what configuration you want. Just change the drive letters and paths. Beware :a,:b,... and [a],[b],... are not drive letters those are menu entries.

shell is the command.com location. the gmouse is mouse driver (not part of DOS you need to download it), vc is Volcov commander filemanager (you do not really need it and also it is not part of DOS but having it really is a good idea.) You can ignore the SB16 and sound blaster settings as it is high unlikely you got the same sound card or even fully SB compatible without any emulation/driver present.

e:\rescue\dos98\ is location of my MS-DOS commands so replace it with your location.

The cd command changes directory, and lh loads into high memory instead of base memory to preserve Base memory.

How ever if I where you to avoid compatibility problems I would try to obtain MS-DOS 6.22.

So my bet is you got any combination of all the issues mentioned rendering your OS inoperable.



来源:https://stackoverflow.com/questions/46505817/run-turbo-c-in-freedos

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!