Announcement

Collapse
No announcement yet.

My PB for DOS program cannot see EMS memory in vDos

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • My PB for DOS program cannot see EMS memory in vDos

    I use and rely on my own text editor compiled with PowerBASIC for DOS 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 and I’ve been trying to get the editor to run on this new machine under vDos.

    So far, I’ve not had much success. The editor started but aborted straight away at this code.

    Code:
    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 PB FRE(-11) function call is returning zero even though I have confirmed that vDos is offering around 16MB EMS:

    C:\>mem
    Free memory (KB's):
    633 Conventional
    96 Upper
    16384 XMS
    16384 EMS

    I then re-compiled with above test for EMS commented out. This time the editor gave a run-time error:

    Error 202 at pgm-ctr: 70785

    I traced this to:

    Code:
    DIM VIRTUAL SAT%(1: %FATmax) 'The Swap Allocation Table
    Apparently, my PB program cannot see any EMS memory? I’ve enquired on the vDos Forum and been asked what EMS version PowerBASIC expects; vDos supports version 3.2. Does anyone know what version of EMS PowerBASIC for DOS expects?

  • #2
    This articale might come in handy...if you may use &h21 Interrupts with 'vDOS'

    https://www.phatcode.net/articles.php?id=155

    Looks like they are looking for a certain device driver (DEVICE=xxxx in CONFIG.SYS)

    Michael Mattias
    Tal Systems (retired)
    Port Washington WI USA
    [email protected]
    http://www.talsystems.com

    Comment


    • #3
      Originally posted by Keith Waters View Post
      Apparently, my PB program cannot see any EMS memory? I’ve enquired on the vDos Forum and been asked what EMS version PowerBASIC expects; vDos supports version 3.2. Does anyone know what version of EMS PowerBASIC for DOS expects?
      I moved on from vDos to DosBox-X, which provides better compatibility with DOS applications, including PowerBASIC for DOS.

      However, TSRs written with PowerBASIC for DOS do not work in DosBox-X.

      There are many EMS settings for DosBox-X, so EMS memory can be fine tuned.

      The November 1, 2021 release (DOSBox-X 0.83.19) has added EMSMAGIC.COM an an alternative EMS Manager.

      Will your text editor, compiled with PowerBASIC for DOS, work with DosBox-X? You will have to give it a try.

      Joe

      Comment


      • #4
        Have you tried NTVDMx64?
        https://forum.powerbasic.com/forum/u...ons#post794521

        Comment


        • #5
          I’ve written a small PowerBASIC test program that does simply,

          Code:
          PRINT "EMS.Init% = "; EMS.Init%
          PRINT "EMS.Version$ = "; EMS.Version$
          …where EMS.Init% and EMS.Version$ are PowerBASIC conversions of the corresponding functions in the article that Michael kindly referenced.

          Run 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

          However, TSRs written with PowerBASIC for DOS do not work in DosBox-X.
          DosBox-X was on my horizon but it's sad to hear it doesn’t support TSR. My editor uses PB’s excellent support for POPUP programming.

          Have you tried NTVDMx64?
          I was aware of NTVDMx64 but I’ve heard that it uses an unconventional means of loading. I’m not sure what that means exactly but it makes me a bit wary. Actually, NTVDMx64 is listed on the vDos website as a vDos alternative. Here’s what they say:

          “For the fearless who fancy to (double)click a DOS program directly in Windows Explorer. Opposite to NTVDM running natively, it also emulates a DOS machine. Mind, installing NTVDMx64 is rather complicated and can mess up your Windows system.”

          The current status is that vDos offered to “have a look” at my editor program. The ball is back in their court for the time being.

          Comment


          • #6
            Another MS-DOS emulator that I use is MSDOS Player.

            I ran your test code, and under msdos player, it returned;
            Code:
            C:\DATA\PB\EDITOR>test.exe
            EMS.Init% = 0
            EMS.Version$ =
            Mind you, as with DosBox-X, many EMS options can be tweaked with MSDOS Player.

            MSDOS Player also allows one to create a 64-bit .EXE from the 16-bit .EXE, eliminating the need to call the 16-bit .EXE via the MSDOS Player. That is, the 64-bit .EXE is a wrapper for the MSDOS Player, and the 16-bit .EXE combined.

            Ref: http://takeda-toshiya.my.coocan.jp/msdos/index.html
            (Source code and binaries).

            Joe

            Comment


            • #7
              I’d not come across MSDOS Player – looks interesting, thanks.

              Current status is that I have the editor running in vDos with the help of EMS Magic to provide the needed EMS 4.0 support. However, the editor makes use of PB’s popup support when running exterior programs, such as compilers. I’m getting a failure, thus:

              Click image for larger version

Name:	Snap05.png
Views:	134
Size:	9.0 KB
ID:	812482

              … that is coming from a (trapped) run-time error 5 originating in:
              Code:
              POPUP SLEEP USING EMS, SwapSwap$
              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.

              Has anyone had success with PB TSR’s under any of these various DOS emulators?

              Comment


              • #8
                [QUOTE=Keith Waters;n812481

                Has anyone had success with PB TSR’s under any of these various DOS emulators?
                [/QUOTE]

                Here's a thread that I had with the developer of vDosPlus (and presently develops for DosBox-X) in regards to PB-DOS TSRs.

                This was back in 2017, and no solution as yet.

                Joe

                Comment


                • #9
                  I've posted an issue on the DosBox-X issues page in regards to PB TSR's not working in DosBox-X.

                  Joe


                  Comment


                  • #10
                    Response from Wengier the same as from before.

                    Not sure if Adam Drake would be willing to spend the time to find out why this is happening, but it doesn't hurt to ask.

                    Joe


                    Comment


                    • #11
                      FWIW, I created a TSR using QuickBASIC 4.5, and PDQ from Crescent Software, and had no problems with the generated TSR under DosBox-X.

                      Joe

                      Comment


                      • #12
                        This is strange. The latest response I have from vDos is also mentioning the PB IDE. I’ve replied to say it is irrelevant to the issue and to (subtly I hope) encourage an effort (from both sides) to resolve the incompatibility between PB DOS compiled code and vDos.

                        Comment


                        • #13
                          Link from the vDOS Forum in regards to the PB-DOS TSR Issue.

                          I did send an email to [email protected], so hoping that Adam Drake may be able to assist.

                          Joe

                          Comment


                          • #14
                            Excellent Joe. I’ve just sent a minimalist PB TSR to the vDos forum that runs perfectly in a Command Prompt on my Win XP but fails under vDos on Win 10 (64-bit).

                            Comment


                            • #15
                              Keith Waters I read the response from Jos on his vDos forum.

                              Wengier was able to get POPUP.EXE working when he booted to MS-DOS inside DosBox-X.

                              Joe

                              Comment


                              • #16
                                I booted MS-DOS 6.22 in an Oracle VM, and POPUP.EXE works as it should;

                                Click image for larger version

Name:	vm.png
Views:	66
Size:	18.8 KB
ID:	812573

                                Joe

                                Comment


                                • #17
                                  I think a summary of the situation regarding PowerBASIC popup programming, in the light of Jos’ findings is:

                                  PowerBASIC POPUP SLEEP, POPUP STUFF, and detection of TSR activation hot-keys, are known to work under NTVDM on an actual (as opposed to virtual) machine. However, POPUP SLEEP cannot work in DOS emulator, vDos. Even if it did work, PB’s detection of the hot-key press for a TSR would fail. POPUP STUFF also cannot work in vDos. POPUP SLEEP also fails under NTVDM on one virtual machine tested.

                                  This is a pity, because otherwise my editor was running very nicely and fast in a windowed environment under vDos. Copy/paste between the editor and windows programs was also working nicely. There was a problem with the directory listings not “seeing” folder names but I’m sure that could have been sorted.

                                  I’ve read what Wengier says about Popup.exe [successfully?] staying in memory under DOSBox-X when booted into MS-DOS. DOSBox-X was number two on my list of candidates – perhaps now is the time to investigate it.

                                  I still miss my deceased Windows 7 (32-bit) machine. It was a nice UI, better than Windows 10, and as I’ve lamented before, ran all my PB-Dos programs faultlessly and with full access to the Windows directory structure. I’m not sure if any of the various emulators and virtual machines allow this – I’m of the impression they all setup a virtual root folder. I’m seriously tempted to setup a machine running Windows 7 (32-bit) dedicated to those activities that involve running my legacy PB-DOS programs – I believe I still have the Win 7 Pro CD that came with the old machine.

                                  Comment


                                  • #18
                                    Dare I suggest you at least start thinking about thanking your editor for many years of faithful service, giving it a gold watch and allowing it to retire to Florida in dignity?
                                    Michael Mattias
                                    Tal Systems (retired)
                                    Port Washington WI USA
                                    [email protected]
                                    http://www.talsystems.com

                                    Comment


                                    • #19
                                      Keith, I cant vouch for any individual article, but it looks like doing this would solve your problem... https://www.google.com/search?q=Wind...e+to+Windows+7
                                      "Not my circus, not my monkeys."

                                      Comment


                                      • #20
                                        Eric, I think the problem regarding the PowerBASIC popup stuff is a 64-bit versus 32-bit problem. That is, 64-bit Windows (be it 11, 10, 8 or 7) does not support DOS codes via NTVDM. My nostalgia for Windows 7 UI is really a separate issue and is not to say that I would want to abandon my forced move to Windows 10 (64-bit). I want to “move with the times” regarding most activities like word processing, emails, browsing Internet, etc. and there are a few things I actually like in Win 10. For instance, the new “ribbon” interface, in MS Word makes more sense to me than the old menu/toolbar approach.

                                        An incidentally, that’s why Michael is right about ultimately retiring my PB DOS editor to Florida.

                                        Comment

                                        Working...
                                        X