From: cat AT animal DOT u-net DOT com Subject: Running DJGPP binaries on Ramdisk Organization: none Newsgroups: comp.os.msdos.djgpp NNTP-Posting-Host: host1.lowtech.org X-Original-NNTP-Posting-Host: host1.lowtech.org Message-ID: <39d4ad49$1@news.gemsoft.net> Date: 29 Sep 2000 15:55:05 GMT X-Trace: 29 Sep 2000 15:55:05 GMT, host1.lowtech.org Lines: 91 X-Complaints-To: abuse AT gemsoft DOT net To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com DJGPP AND RAMDISK I mentioned problems with running DJGPP binaries in a previous post. Recently I got a more recent version of dpmi (CSDPMI4B.ZIP) from a simtelnet mirror site at src.docs.ic.ac.uk. The system seems to work fine for very small (well 87K isn't so much really) binaries which do not use any exotic features. To test I run on a 4Mb ramdrive although a 24-32Mb virtual disk will be no problem with modern day out of the box multi-media systems. "config.sys" device=a:\himem.sys device=a:\ramdrive.sys 4096 512 256 /e "autoexec.bat" rem protect root directory of d: in case of second hd mkdir d:\d4 d: cd \d4 copy a:command.com set comspec=d:\d4\command.com copy a:cwsdpmi copy a:hello.exe hello "hello.c" main() { printf("Hello World!\n"); } All of this works really fine. Hello.exe finds cwsdpmi in the current directory and prints out the greeting message. I also tested with a slightly more complicated program, pi.c which was taken from the maths.faq. "pi.c" int a=10000,b,c=2800,d,e,f[2801],g;main(){for(;b-c;)f[b++]=a/5; for(;d=0,g=c*2;c-=14,printf("%.4d",e+d/a),e=d%a)for(b=c;d+=f[b]*a, f[b]=d%--g,d/=g--,--b;d*=b);} This one goes on and prints out 800 digits of pi in a blink. Now let's try my own maths program: d4x.exe which can compute Bernouilli numbers, solve Pell's equation, generate RSA encryption keys and read and write tar archives inter alia. This program is about 200K after being stripped and it would be nice to get it running on the ram disk. It's got bit mapped graphics so the equations can be presented in a weird fonts if rquired. The command line is something like d4x test.afn x=ada#tab_b50 and it should print a sequence of lines like 1/1,-1/2,1/6,,-1/30,,1/42,,-1/30,,5/66,,-691/2730 etc. going on for hundreds and hundreds of digits. But what do I get ? Just a very cryptic message. D:\D4>d4x test.afn x=ada#tab_b50 OMPT=: cannot open cryptic error message. Because the binaries hello.exe and pi.exe work happily enough there must be something wrong with my program. The same code works well enough on windows and hard disk based DOS, and the same script with slightly modified C works on the Linux console and also on several of the Linux X-windows terminal emulators. The next thing is to try and find out just how well some other programs like the ramdisk. Could I superzip the DJGPP onto a single floppy, decompress to ramdrive and compile an application such as a multi-tasking windows manager ? That would be great ! The FAQ says there is a little program called go32-v2.exe which will report dpmi resources. I tried running this. D:\D4>go32-v2 OMPT=: cannot open Yes. It's the same error message. Luckily I got the CSDPMI source so at least I could grep all of the source files for bits of the message. Nothing to do with the dpmi server. Tony Goddard http://www.d4maths.co.uk