|
Post by whathim on Nov 22, 2021 14:53:24 GMT 1
I use and rely on my own DOS text editor which has been running fine for years on my Windows XP laptop and my Windows 7 32-bit desktop under NTVDM (i.e., no vDos, DosBox etc.). Just recently the Windows 7 machine died and I got a Windows 10 64-bit replacement. I’m desperate to get my test editor working on this new machine.
I’ve installed vDos 2021.05.01, copied the editor files into vDos C: (i.e., C:\vDos\) and tried running the editor via its launching batch file as instructed in FAQs.pdf. The batch file runs but the editor (Open.exe) aborts straightaway. Here’s what I see (with ECHO ON):
C:\>CALL C:\OPENV\OPEN.EXE /C c:\windows\system32\cmd.exe /50 %1 %2 %3 %4
ERROR. EMS memory not available. The error message comes from the editor. Here is the editor source code that generates the message:
IF NOT FRE(-11) > 500 * %Kbyte THEN 'Currently we need 384 Kbyte EMS
CALL SoundAlert
PRINT "ERROR. EMS memory not available."
END
END IF The editor is compiled in PowerBASIC for DOS. The documentation for the inbuilt FRE function (with argument -11) says, “Returns the number of unallocated bytes of EMS memory”. It seems the FRE function is not seeing enough EMS (in fact, I’ve since confirmed it sees zero) but when I use the MEM command from vDos I see plenty of EMS:
C:\>mem
Free memory (KB's):
633 Conventional
96 Upper
16384 XMS
16384 EMS I recompiled my text editor program with the above described use of the FRE(-11) function commented out and again ran it under vDos. This time it gave a runtime error which I traced to the following statement:
DIM VIRTUAL SAT%(1: %FATmax) 'The Swap Allocation Table The PowerBASIC documentation for “DIM VIRTUAL” says, “Virtual arrays are stored in EMS memory…”. It later says, “An EMS driver such as EMM386.exe or QEMM.sys must be loaded…”.
Why is it that my program apparently cannot see any EMS memory? Do I need an EMS driver with vDos - am I missing some configuration option? Is there an incompatibility between PowerBasic code and vDos? I would really appreciate some help with this as I seriously do wish to get my editor program running.
|
|
|
Post by Jos on Nov 22, 2021 15:40:59 GMT 1
Not related to the error, but what’s with the CALL command? That’s only functional starting a batch file.
Do you know what EMS version PowerBASIC expects/requires? vDos supports version 3.2, 4.0 is mainly for DOS multitasking environments. For instance XyWrite4 tests for 4.0, but only uses 3.2 functions.
Jos
|
|
|
Post by whathim on Nov 22, 2021 16:08:04 GMT 1
Thanks for getting back to me so promptly.
“…what’s with the CALL command?” – good question. It’s a long time since I visited the batch file that runs my editor. As I said in my post, it’s been running fine for years.
I don’t know what EMS version PowerBASIC expects. I can enquire on the PowerBASIC Forum but that will, of course, take some time.
|
|
|
Post by Jos on Nov 22, 2021 16:11:31 GMT 1
Eventually post your editor program, I'll then have a look...
Jos
|
|
|
Post by whathim on Nov 24, 2021 16:46:47 GMT 1
I’ve failed to get a definitive answer to what EMS version PowerBASIC expects. However, I’ve written a small PowerBASIC test program that does simply, PRINT "EMS.Init% = "; EMS.Init%
PRINT "EMS.Version$ = "; EMS.Version$ …where EMS.Init% and EMS.Version$ are PowerBASIC conversions of the corresponding functions here Using EMS in QuickBASIC: Part 1Run from Windows XP 32-bit (i.e., NTVDM), I get: EMS.Init% = -1
EMS.Version$ = 4.0
Run from Windows 10 64-bit under vDos, I get: EMS.Init% = -1
EMS.Version$ = 3.2 Not exactly conclusive, but I’d say it’s likely PowerBasic expects EMS version 4.0. Does this mean that there is no hope my text editor can run under vDos? I’ve never doubted it would be a challenge. For instance, whilst my text editor, Open.ex, can be run as a standalone program, it is routinely run as a TSR in conjunction with another program, Execom.exe. In operation the two executables swap in and out of memory (swapping to EMS or disk) as required. I’ve attached a folder containing both programs, Open.exe and Execom.exe, and associated support files. I’ve also attached the batch file I’ve been using to launch the editor (with installation of a separate TSR, unrelated to the current problem, commented out) - you will of course need to edit the path to the Open.exe to suit your setup. Also attached is a MSWord document with screenshots of the desktop shortcut I’ve been using for the editor, in case this offers any further clues. I really do appreciate you having a look at this. It will be marvellous if we can get it running satisfactorily.
|
|
|
Post by Jos on Nov 24, 2021 17:58:02 GMT 1
PowerBASIC indeed uses EMS 4.0 functions, vDos doesn’t provide for. You can first run the EMSMAGIC in autoexec.txt by EMSMAGIC /NOXMS /FORCEEMS. Mind it emulates EMS 4.0 by swapping pages in and out of XMS memory, so it degrades the DOS program performance a bit. Jos Attachments:EMSMAGIC.COM (12.71 KB)
|
|
|
Post by whathim on Nov 24, 2021 18:36:40 GMT 1
Ok, we’ve got a bit further – the editor runs. First question: How do I expand the vDos window so that it matches the editor, which is in 50-line mode? Attachments:
|
|
|
Post by whathim on Nov 24, 2021 18:40:10 GMT 1
See also images attached to previous post. Next thing I have to trace is why I’m getting “Unable to swap to EMS memory” when I attempt to “SHELL” out from the editor. Will get back to you.
|
|
|
Post by emendelson on Nov 24, 2021 18:44:17 GMT 1
To the question: how to increase the screen size to 50 lines...
Answer: Read config.txt, somewhere around line 55. The file contains a lot of very useful information.
|
|
|
Post by whathim on Nov 25, 2021 15:13:15 GMT 1
“TEXT = 50x80” in the config.txt file worked fine – many thanks. I tried again to get the editor program to SHELL but with the same failure. It looks like vDos doesn’t support PowerBASIC’s popup programming. Specifically, the offending statement is: POPUP SLEEP USING EMS, SwapSwap$ This statement is generating a (trapped) run-time error 5, which the PowerBASIC documentation says is: “Illegal function call: This is a catch-all error related to passing an inappropriate argument to some statement or function.” The value of SwapSwap$, “C:\OPENV\OPEN1.$$$”, makes perfect sense in the context of my vDos setup. So, it looks like the run-time error 5 is coming from a deeper level within the POPUP statement. I really don’t know where to go from here.
|
|
|
Post by Jos on Nov 25, 2021 17:10:58 GMT 1
Does the directory C:\OPENV actually exist in vDos?
I guess your vDos C: matches Windows C:\OPENV, so C:\OPENV resolves to Windows C:\OPENV\OPENV.
Jos
|
|
|
Post by whathim on Nov 25, 2021 17:28:17 GMT 1
I have vDos.exe installed in Windows’ C:\vDos\ and I have my editor, Open.exe, in Windows’ C:\vDos\OpenV\
So, as I understand it, my vDos C: matches Windows’ C:\vDos\, so C:\OpenV\ resolves to Windows’ C:\vDos\OpenV
Double check: From vDos command prompt:
C:\>DIR Volume in drive C is C_DRIVE Volume Serial Number is 104C:0A77
Directory of C:\
AUTOEX~1 TXT 887 29/02/20 12:55 AUTOEXEC BAK 25 24/11/21 17:14 AUTOEXEC TXT 125 24/11/21 20:20 CONFIG TXT 3491 24/11/21 20:16 C_895 TXT 1389 30/04/21 9:36 DPTEST <DIR> 15/11/21 16:22 EMSMAGIC COM 13020 24/11/21 17:13 FAQS PDF 76037 26/04/21 12:52 NEWMIC~1 DOC 0 15/11/21 16:23 OPENV <DIR> 24/11/21 21:13 OPENV BAT 15 25/11/21 13:25 OPENV STA 437 25/11/21 16:24 PRINTING PDF 51476 26/04/21 12:51 README PDF 20177 26/04/21 12:48 SHORT~1 DOC 0 15/11/21 16:23 VDOS EXE 620280 29/05/21 12:14 VTESTS <DIR> 23/11/21 20:07 14 file(s) 787359 bytes
|
|
|
Post by Jos on Nov 26, 2021 0:40:46 GMT 1
I had a copy of PB 3.5, and entered these two lines: Run gave: Only End execution did something, brought back the PB IDE. Though no idea if this is what you're looking for... Jos
|
|
|
Post by whathim on Nov 26, 2021 14:38:38 GMT 1
Jos
I don’t use the PowerBASIC IDE, never have, never intend to. I only ever use their command-line compiler (PBC.exe). I don’t really understand why you mention the IDE. Surely it is irrelevant to what we are trying to do.
Let me attempt to reiterate and/or clarify where I’m coming from.
I have this editor program. It was started, as a project, way back in 1991 and was in constant development over several years, the last major update being in 2009. During this period the editor was in daily use by several engineers in my workplace and I received constant feedback on issues that needed resolving and on features that were needed.
During its long period of use and update, the editor gained a reputation for never loosing data. I think I’m justified in claiming the editor is a mature program. It is certainly not something that is in the process of being hacked together in the present.
So, we come to the present and attempts to get the editor running on Windows 64-bit. I don’t think it is unreasonable to hope that vDos would be capable of enabling this as, to repeat, the editor is a mature program. It also happens to be written in the “PowerBASIC for DOS” language, which I would argue is a reputable source, so there is a wider issue here of whether vDos can support PowerBASIC for DOS programs in general.
I would have thought the fact that I still have the source code of the editor and can potentially recompile the editor with any changes or diagnostics we see fit would be a big plus in helping to extend the versatility of vDos (and potentially improving my editor). I can also write/compile any small test programs you request that might help track down incompatibilities between PowerBASIC compiled code and vDos (again, the wider picture).
Keith
|
|
|
Post by Jos on Nov 26, 2021 16:26:43 GMT 1
You came with the POPUP SLEEP USING EMS, SwapSwap$ statement not functioning. Since I had the PB IDE of another PB user, I added the SwapSwap$ = "C:\OPENV\OPEN1.$$$" to test that. It seemed to function, showing a number of options. But I’m not sure what it is supposed to do.
I don’t have PBX, instead compiled with the IDE. The resulting executable only displays Error 5 at pgm-ctr: 300. Next I tried to run the program in NTVDM, that gave the exact same result. I will be missing something…
Seemingly not that many PB program users still around. There are some posts and I had two email conversations mentioning PB, though not your TSR problem.
Jos
|
|