EMM386 and EXCEPTION ERRORS

 

EMM386 provides access to the upper memory area to load programs and device drivers into upper memory blocks (UMBs) and can use extended memory to simulate expanded memory. This device driver must be loaded by a <DEVICE> command in your CONFIG.SYS file and can be used only on computers with an 80386 or higher processor. No version of DOS dBASE needs EMM386, on the other hand the inclusion of EMM386 in the environment should not be a problem. Most EMM386 problems can be corrected with proper configuration.

Errors with dBASE and EMM386 are usually because dBASE's memory manager is in conflict with other devices, or cannot access needed memory used by another device. The most common error is an Exception error. Exception errors are unusual or invalid conditions associated with the execution of a particular instruction by the processor. The processor signals the memory manager that an error has occurred and the memory manager then reports this error to the user.

For example the 80386 recognizes 16 different exceptions:

 

Number Description
0 Divide error
1 Debugger interrupt
2 Nonmaskable interrupt
3 Breakpoint
4 Overflow interrupt
5 Array boundary violation
6 Invalid opcode
7 Coprocessor not available
8 Double fault
9 Coprocessor segment overrun
10 Invalid task state segment
11 Segment not present
12 Stack exception
13 General protection violation
14 Page fault
16 Coprocessor error

To trouble shoot test with a clean boot:

*- CONFIG.SYS *- AUTOEXEC.BAT
FILES=99 PATH=c:\dbase
BUFFERS=15 PROMPT $P$G

*** and only other _essential_ files such as disk drivers and compression utilities. Remove all other drivers to eliminate other possible conflicts. NOTE: Sometimes the order in which you load device drivers makes the difference.

Test. Now add just EMM386, test again.

If the problem disappears when EMM386 or any other memory manager is not loaded; you can isolate the problems by removing each switch for EMM386.EXE one by one and rebooting to isolate the problem further.

Another method is to edit the CONFIG.SYS file as follows:

device=c:\dos\emm386.exe x=a000-f7ff nohi noems novcpi nomovexbda notr

If the problem disappears after loading EMM386.EXE as specified above, EMM386.EXE itself is not the source of the problem and proper configuration should get you around the problem. See the following Microsoft document for further details,

Title: Troubleshooting MS-DOS 6.x and EMM386.EXE
Document Number: Q98768      Publ Date: 26-APR-1994

Title: Exception Errors with EMM386.SYS / EMM386.EXE
Document Number: Q52195      Publ Date: 18-APR-1994

Available on Compuserve, GO MSKB (Microsoft Knowledgebase).

If you continue to receive EXCEPTION errors with EMM386 configure as above, verify if the error occurs on other machines. If it doesn't, note the differences between the machines.

  • a potential issue is the computer's BIOS. You can use the dBASE utility dBINFO/h to reveal information about the BIOS. BIOS dated prior to 1990 might be suspect. Contact the computer manufacturer to find out if there are any known problems or updates with that version of the BIOS.
  • The system may have faulty RAM chips or may require a special machine switch for HIMEM.SYS.
  • Some CMOS settings may need to be disabled. Consult the computer manufacturer for information regarding CMOS settings.
  • Exception errors can also be caused by a corrupt file. Try removing all dBASE files, run CHKDSK to make sure you have no disk errors and reinstall with the _clean_ boot as above. Test again with this clean boot.

Other factors:

*1
Virtual memory can be related to memory problems or protection faults. Trouble reading from or writing to the hard drive caused by a lack of disk space, for example, may prevent virtual memory from operating correctly. Configure the file to a non-compressed drive if the virtual memory using a compressed drive. See,

Lib 10: QTEMP.FAQ Configuring dBASE temporary files

Correct any disk errors. Disk diagnostic tools such as Norton Disk Doctor or PC TOOLS should be considered before CHKDSK /F, since their error checking and recovery routines are more comprehensive.

*2
Try configuring your computer to NOT use expanded memory. dBASE won't use it and many other program can be configured to use extended memory instead of expanded memory. Or load devices into conventional memory instead of upper memory. This will sometimes cure conflicts.

*3
>>> I receive an exception error from within Windows when Compiling in dBASE 5 for DOS <<<

The Compiler is a 32 bit program and the linker is a 16 bit program. At a DOS level you can run both a 16 and 32 bit program back to back without a problem. But if you are within Windows and start a DOS session you can only run one type of session a 16 or 32 bit. Windows will not allow memory mode switching. So the way to Compile within Windows is to open two DOS sessions and Link in one and Compile in the other.

*4
>>> When do I need to exclude a memory range with EMM386. If I have a conflict does this mean dBASE is using it? <<<

Yes but the problem more precisely is that some other device is also using it. By excluding it, you are mapping memory, and dBASE's virtual memory manager reads this map at start up and knows not to use it.

Many network cards make use of the CC00-CFFF range so this may be a range to exclude. For other ranges the documentation for the add-on cards used in the system should indicate the range of memory that is being used. If the hardware documentation is not available or does not give the required information, you can use the Microsoft Diagnostic Utility (MSD) to identify the memory regions.

*5
Problem: dBASE Reboots the Computer at Start-up:
The version of EMM386 shipped with DOS 6.x in some cases behaves differently than the version shipped with DOS 5.x or Windows 3.1. ( dBASE IV v2.0 was certified with DOS 5, since this is what was shipping at that time ).

  1. 1) If this is a compiled EXE, ATTRIB or FLAG the EXE READ ONLY ATTRIB +R <filename>.EXE
  2. 2) This has been know to occur if the Windows 3.1 version of EMM386.EXE is loaded and the AUTO keyword used.

    DEVICE=C:\WINDOWS\EMM386 AUTO

    dBASE IV v2.0 functions properly once the AUTO keyword is removed. AUTO mode enables expanded-memory support and upper memory block support only when a program calls for it.

    WORKAROUND: Don't use the "AUTO" option, instead set aside need expanded memory with MEMORY switch ( see next section ), or if the "AUTO" option is a must test with a different version of EMM386. (Both Windows and DOS ship with EMM386.EXE. If using DOS 6.0 try testing with a latter DOS version ).

*6
If EMM386 is providing emulated EMS support, there can be a problem in some cases where dBASE IV v2.0 may pull memory only from the EMS pool of memory and ignore the XMS or extended pool. dBASE will not have enough memory to start in this case.

WORKAROUND:

SET DOS16M environmental variable in the AUTOEXEC.BAT file or before starting dBASE to a value greater than the size of the EMS pool.

SET DOS16M=:<a value greater than 
            the size of the EMS pool> 

For example if you have the following line:

DEVICE=EMM386.EXE 2048 

[ DEVICE=EMM386.EXE <memory> <memory> - Specifies the maximum amount of extended memory that you want EMM386 to provide as EMS/VCPI memory. ]

SET DOS16M=:3072 

Or, the memory parameter on the DEVICE=EMM386.EXE may be removed. For example, there is a line similar to the following in config.sys

DEVICE=EMM386.EXE 2048 

remove the number '2048'.

Now run the PMINFO.EXE stats utility and look at the 3rd line of stats under the extended memory column. This value is the amount of extended memory v2.0 is able to use. Once the 3rd line of stats indicates that at least 1024K of extended memory is available to DOS/16M program, v2.0 should then begin to run.

For more information on SET DOS16M see
Lib 10: QDOS16.FAQ - SET DOS16M environmental variable

*7
Most memory managers including EMM386, QEMM and dBASE's will return information when an exception error occurs. This includes:

class of exception
location
error code
register dump

In most cases this information is of limited help to the average user. If you wish/need to pursue the above information further see the following Quarterdeck help file ( GO QUARTERDECK ).

ID:13 QEMM-386: Exception #13 Explained
Quarterdeck Technical Note #142            Filename: EXCEPT13.TEC

Subject: Detailed explanation of QEMM-386's Exception #12 and Exception #13 messages, why they are reported, and steps to identify their causes.

Whether or not you have QEMM, this is an EXCELLENT discussion on the information returned from exception errors!

*8
For additional information see the following files here on Compuserve:

GO MSKB ( Microsoft Knowledge Base )

Title: Exception Errors with EMM386.SYS / EMM386.EXE
Document Number: Q52195                       Publ Date: 18-APR-1994

If you are using QEMM see above mentioned Quarterdeck file in number 7 and,

GO QUARTERDECK

ID:X3 Troubleshooting Exception #6, #12, and #13 Errors
Quarterdeck Technical Note #232              Filename: EX13FLOW.TEC

Subject: Detailed explanation and troubleshooting procedures for Exception #6, #12, and #13 error messages and system lockups.


[Home] [FAQ Index]