home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 5
/
ctrom5b.zip
/
ctrom5b
/
DOS
/
UTILITY
/
GEHEUGEN
/
UMBGWJ10
/
UMB.DOC
< prev
Wrap
Text File
|
1994-11-29
|
7KB
|
157 lines
UMB_GWJ.SYS - An Upper Memory Manager for MS-DOS
Version 1.0
UMB_GWJ.SYS allows you to register available memory above the 640KB boundary
but below the 1MB start of extended memory. Once this memory is registered
by UMM.SYS, it becomes available for use by MS-DOS applications, or by
MS-DOS itself.
Memory above the 640KB base memory boundary but below the High Memory Area
(HMA) and extended memory is called Upper Memory, and is grouped into one
or more Upper Memory Blocks (UMBs).
UMB can be provided on 386+ by memory managers such as EMM386.EXE
or QEMM386.SYS, which switch the processor into virtual 8086 mode and use
mapping capabilities of processor itself. This approach has this
advantage, that it is independent from the mainboard design, but also has
some disadvantages:
1) Switching into v8086 mode slows down your computer.
2) You cannot use td386.exe and tdh386.sys.
3) There are some programs which refuse to work in protected mode.
The approach of using available memory (usually SHADOW RAM) has the following
advantages:
1) Uses memory which normally would be left unused.
2) Does not allocate any memory (or maybe about 80 bytes on some
computers).
3) TD386.EXE can be used.
4) You are able to load TD386.SYS and HIMEM.SYS high.
This version is limited to HT-320 chipset, but if you know how to enable
SHADOW RAM for writing in your computer, you can easily adapt it.
Installation.
Driver UMB_GWJ.SYS is installed in CONFIG.SYS. It must be run before
HIMEM.SYS and every program you want to place in UMB. The program
parameters specify UMB areas which you want to make available, e.g.
UMB_GWJ.SYS c800-F800 FB00-FC00
means that regions from C800:0 inclusive to F800:0 exclusive
and FB00:0 inclusive to FC00:0 exclusive will be available.
In CONFIG.SYS you also must place the line
DOS = UMB
or
DOS = HIGH,UMB.
You must enable SHADOW RAM for the areas you wish to use or
disable memory remapping in CMOS SETUP. This is essential. If you do not
do so, you may observe that the same memory is visible under two addresses
- at the end of XMS and in UMB. This may lead to some unpredictable
behavior of your computer.
It may be also necessary to place an EMMexclude line in SYSTEM.INI
for the regions you are enabling if 386ENHANCED mode of Windows 3.1
is used.
This is the exemplary CONFIG.SYS contents:
DOS = HIGH, UMB
DEVICE = C:\UTIL\UMB_GWJ.SYS C800-F800
REM we load XMS manager to UMB
DEVICEHIGH = C:\UTIL\HIMEM.SYS
REM other programs we wish to install in UMB
DEVICEHIGH = ...
INSTALLHIGH = ...
Note, that in MS-DOS 6.x you can use "/L:" parameters.
How does it work.
1) UMB_GWJ is run during system initialization when CONFIG.SYS is
interpreted. It must be the first XMS server.
2) Program enables SHADOW RAM for writing and copies part of its code into
the first specified UMB. If this area is too small, error message is
written to the console and program exits. Otherwise 2Fh interrupt vector
is intercepted by the part resident in UMB. Part of the program resident
in low memory is removed by DOS.
3) After installation of every driver DOS checks, if XMS driver providing
UMB is installed. Resident portion of UMB_GWJ.SYS will return the positive
result of this test.
4) After returning all the block addresses driver releases interrupt 2F
and returns the information, that there are no more UMB available.
5) At this moment driver is no more needed, and because it hasn't
allocated any memory block, it will be overwritten by the first program
installed in UMB.
Notes:
1) When you define DEBUG during compilation, you may observe how the driver
is working.
2) At the beginning of the driver some space is reserved for DOS memory block
header.
3) Driver tries to detect lack of DOS=UMB line in CONFIG.SYS.
Unfortunately, it works only in DOS 5.0 due to the minor change in XMS
detection algorithm in newer versions of DOS.
4) EMM386.EXE can be used together with UMB_GWJ.SYS. It allows for
enabling and disabling EMS what is not possible, when EMM386 provides UMB.
If you load EMM386.EXE to UMB you must ensure, that EMS page frame is
above the EMM386.EXE program area. On my computer I found out, that the
first half of ROM-BIOS is unused, so I placed page frame at E800. It was
not possible explicitely, but I accomplished it using I and X options -
I have excluded areas used by UMB_GWJ and included E800-E7FF area.
Compilation:
TASM UMB_GWJ.ASM
TLINK /t UMB_GWJ, UMB_GWJ.SYS
Notes on porting to other chipsets.
1) You must change the SHADOW RAM enabling procedure. You may also use
external driver to do so loaded before UMB_GWJ.SYS.
2) On some computers unused SHADOW RAM area is remapped to extended
memory. Enabling it causes, that the same area of memory is visible at two
addresses or that the access to the final part of extended memory is
impossible. You must inform all the programs about it. It can be done by
intercepting 15h interrupt function regarding extended memory size and
modify word field at 45H of undocumented LL structure (pointer to this
structure is returned in ES:BX by int 21h function 52h). Exemplary
program to be loaded immediately after UMB_GWJ is included in this
package.
Notes on DMA usage.
On some computers DMA access to UMB obtained by SHADOW RAM enabling is not
possible. Even if it is possible in some cases errors may occur. It is
related to ISA bus construction. If in the same 128KB area that UMB blocks
there is 16 bit I\O device memory, it can happen, that 8 bit DMA transfer
will be treated by such a device as an access to its memory and I/O cycle
will be switched into 16 bit mode. So happens, if error occurs during
reading of unbuffered A0-A16 address lines. It causes, that every other
transferred byte is 255. Such errors may occur in areas A000-BFFF,
C000-DFFF and E000-FFFF.
There is video memory in first area and it is usually not used for UMB.
In second area Video BIOS is mapped. We may switch it into 8-bit mode
or disable it. I know how to do it for Trident cards. When you disable
BIOS it may be necessary to always use hard reboot instead of soft one.
Third area contains system BIOS. Because it is not located on the
extension card, it shouldn't cause problems.
WARNING!!
DMA errors or lack of DMA access may cause erroneous data writes to the
diskette if:
- SMARTDRV is used for diskette caching and it is located in UMB.
- DOS Transfer Buffer is moved to UMB
How to contact author.
Send a mail to Internet address
gwj@j-23.p.lodz.pl
Acknowledgements:
I would like to thank Kenneth Gober for his upper memory manager. It has given
me the stimulus to interest in memory optimizing.