No announcement yet.

EMS Freeze

  • Filter
  • Time
  • Show
Clear All
new posts

  • EMS Freeze

    I have a customer with a Toshibia Laptop.

    Using MS DOS 7.1, the EMM386 driver will load, and the fre-11 function
    validates that there is EMS available for our virtual arrays.

    However, any virtual arrays that we try to load data into, will
    freeze DOS.

    This little test program loads a string into an array, then prints DONE
    when the array is loaded.


    DIM VIRTUAL LB(0:1000000) AS STRING*12

    FOR X=0 TO 1000000
    What happens is this:

    The program displays DONE, but the system is now froze, and can not
    be reset by Ctrl+Alt+Del..only pwr/on/off will work.

    I tried this code on a few different machines, and it of-course works properly, but
    not for this Toshiba.

    From my customers Laptop:

    Windows Expanded Memory Driver Version 4.95
    Copyright 1988-1995 Microsoft Corp.

    Available expanded memory . . . . . . . . 32,76KB

    LIM/EMS version . . . . . . . . . . . . . 4.0
    Total expanded memory pages . . . . . . . 2,07
    Available expanded memory pages . . . . . 2,04
    Total handles . . . . . . . . . . . . . . 64
    Active handles . . . . . . . . . . . . . 1
    Page frame segment . . . . . . . . . . . E000 H

    Total upper memory available . . . . . . 0 KB
    Largest Upper Memory Block available . . 0 KB
    Upper memory starting address . . . . . . CF00 H

    EMM386 Active.

    Memory Type Total Used Free
    ---------------- -------- -------- --------
    Conventional 640K 122K 518K
    Upper 31K 20K 11K
    Reserved 0K 0K 0K
    Extended (XMS)* 457,633K 3,003K 454,630K
    ---------------- -------- -------- --------
    Total memory 458,304K 3,145K 455,159K

    Total under 1 MB 671K 142K 529K

    Total Expanded (EMS) 32M (33,947,648 bytes)
    Free Expanded (EMS)* 32M (33,554,432 bytes)

    * EMM386 is using XMS memory to simulate EMS memory as needed.
    Free EMS memory may change as free XMS memory changes.

    Largest executable program size 518K (530,224 bytes)
    Largest free upper memory block 8K (8,368 bytes)
    MS-DOS is resident in the high memory area.

    I have been using the fre-11 function in program, to send to customers to do a pre check
    to determine if there system is configured properly to use EMS.

    For this particular Toshiba, the Fre-11 function reports back:

    EMS Memory Available = 33,554,432

    I have tried several include/exclude ranges to try to obtain a contiguous
    64k page frame, and can not prevent the system from freezing after the array is loaded.

    Is there any test that will validate what page frames are available for EMM386?


    Tim Camarda


  • #2
    Since you didn't specify where you used Fre -11 at, have you
    used it after the "Print DONE" to see how much memory you have
    available after the data load?

    There are no atheists in a fox hole or the morning of a math test.
    If my flag offends you, I'll help you pack.


    • #3

      I used the Fre-11 in a seperate program to check availiable EMS.

      However, maybe I should include it after the array is loaded, after DONE
      is printed.



      • #4
        For sure you should be testing ERR after the DIM statement.

        If that DIM failed who knows what kind of weird stuff could happen.

        Sure, without an ON ERROR GOTO (also not a bad idea at least for this section of code), the program *should* fail at that point, but why not be sure?

        [This message has been edited by Michael Mattias (edited September 24, 2005).]
        Michael Mattias
        Tal Systems (retired)
        Port Washington WI USA
        [email protected]


        • #5
          Is "$ERROR ALL" correct syntax ? I can't remember fur sure nor can check now, but shouldn't it be "$ERROR ALL ON" or something like that ?

          When i was DIMing a VIRTUAL array while no EMS was available, IIRC i was getting an error (twohundredsomething) no matter what. Testing ERR should be needed only if something like "ON ERROR RESUME NEXT" was active.

          I'm going by memory (which is neither Expanded nor Extended and it often fails ) though.

          Davide Vecchi
          [email protected]


          • #6
            In an $ERROR directive, if ON/OFF are not specified then ON is assumed



            • #7
              I just tested with $ERROR ALL ON (Windows 2000): if i provide no EMS (playing with the PIF settings) the program gives an error on the DIM VIRTUAL. The error code is 202; then it terminates (since there is no ON ERROR GOTO).

              Davide Vecchi
              [email protected]


              • #8
                That's interesting -- there is no error 202 defined in the PB reference manual.

                PB/DOS 3.5 on Fedora Linux


                • #9
                  Thanks all for your suggestions.

                  The $ERROR ALL will work for conditions such as when there is not
                  sufficient EMS available while filling the array, and will produce an error code.

                  The problem with the Laptop is an issue with not enough space in the UMB.

                  However, EMM386,exe gives no error message, but most likely is overlapping while setting it self up in the UMB.
                  Also, fre-11 reports 32 megs of EMS.

                  In any case the solution is to set up the page frame manually.

                  Doing a UMB check, there appears to be only one range of locations available for EMM386.
                  But, this still causes an issue with EMM386.exe reporting this:
                  WARNING: Option ROM or RAM detected within page frame.

                  So, EMM386 is loading its page frames where part of the ROM is setting up.

                  It is a matter of tweaking and configuring the EMM386 driver, to load its page frames in an area of the UMB with no conflicts.

                  Thanks again.




                  • #10
                    that's interesting -- there is no error 202 defined in the pb reference manual.
                    i can't check now, however i think that when i got this error the first time i found a regular explaination, i'm not sure if on the docs or not.

                    a couple of threads that mention this error suggest that it's documented:

                    davide vecchi
                    [email protected]


                    • #11
                      From PB/DOS 3.5 help file, Contents/Error codes/page down a couple
                        Error 202: Expansion memory error
                        Not enough EMS memory was available to perform the operation.
                      Michael Mattias
                      Tal Systems (retired)
                      Port Washington WI USA
                      [email protected]


                      • #12
                        > From PB/DOS 3.5 help file, Contents/Error codes

                        Sho'nuff, she's there.

                        Still interesting that it's not in the book (neither the printed manual or the PDF version).

                        I guess the lesson to take away from this is that if something odd shows up that's not documented in the manual, check the help file for possible enlightenment instead.

                        PB/DOS 3.5 on Fedora Linux


                        • #13
                          EMS and XMS configuration were complicated by the loading of
                          device drivers that may require their own memory allocations,
                          possibly even more memory for buffers. Further, some
                          device drivers required more memory to set up initially,
                          and released some of the memory once that was done.

                          Most drivers give you a selection of alternative address ranges
                          that they can use, but DOS was not really designed to ensure that
                          there were no conflicts or overlaps. It could take hours to work
                          your way through the endless array of possible device loading
                          sequences and range options using the CONFIG.SYS and AUTOEXEC.BAT
                          files until you had a stable configuration.

                          One of the big conflict areas that came up late in the DOS
                          cycle was the emergence of new Video Cards and shared video
                          memory. Where what memory mapping occurred could be an issue
                          as well. Unfortunately, this often meant that you could not
                          assume that client machines were able to run programs that
                          were designed to rely on EMS and XMS memory, or even to use
                          a RAM Drive.

                          Old Navy Chief, Systems Engineer, Systems Analyst, now semi-retired