MTRRLFBE.EXE v1.3 (freeware)
RayeR's Homepage -> Programming
http://rayer.ic.cz/programm/programe.htm



INTRO
=====

MTRR-WC enabler for VESA LFB.
On a query I wrote this small program which allows you to set MTRR mode
independently for VGA (A0000h) area and LFB area (address of LFB is
autodetected).
If you will set W-C mode, you may gain performance of your existing programs
which displays graphics through VESA VBE.
On my machine: Celeron Tualatin 1466, intel BX chipset, SVGA GeForce MX440 I
have got transfer rate (RAM->VRAM) gain eg. in 800 x 600 / 32 LFB mode from 62
MB/s to 315 MB/s.
BTW the whole thing about MTRRLFBE had started this way: I was programming
some graphics routines for my DOS program and I did some benchmarks to find
the fastest algorithm. But sometimes happened that program had been executed
e.g. 5-times faster than usually. But it had nothing to do with my code.
Everything was faster. Then I tracked that this effect happen when I reboot to
DOS from Win98 without performing full restart. This led me to idea that
nVidia drivers or Windows setup something that makes copying of framebuffer
much faster. Then I googled a lot and discovered some intel document
describing setting of MTRRs and its impact to graphics performance. Then it
would be quite easy to implement it to my mtgfx library and as a stand alone
utility...

Intel document [PDF]:
http://download.intel.com/design/PentiumII/applnots/24442201.pdf



COMMAND LINE SWITCHES
=====================

This program will run properly ONLY from native/real/true/pure DOS/MS-DOS
mode:
- MS-DOS 5.00, 6.xx, 7.xx (MS Windows 95/98), 8.00 (MS Windows ME):
To learn how to ACTIVATE and USE the native/real/true/pure MS-DOS mode in:
* Windows 95/OSR2/98: read these topics from MYTIPS95.TXT, part of W95-11D
(freeware):
http://www.mdgx.com/95.htm
"2 DOS OR NOT 2 DOS":
http://www.mdgx.com/last3.htm#DOS2DOS
"MS-DOS PROMPT":
http://www.mdgx.com/lastweek.htm#MSDOSPROMPT
"DOS NOW!":
http://www.mdgx.com/newtip1.htm#DOS
"RETURN TO DOS".
* Windows ME: see "A MUST for ALL Windows ME users running DOS based programs
+ games:" at the bottom of the "Windows DOS Box Tips" chapter further below:
http://www.mdgx.com/newtip23.htm#WDBT
- Real mode DOSes [free(ware)]: FreeDOS, DR-DOS, IBM PC-DOS:
http://www.mdgx.com/dos.htm#DSS

MTRRLFBE will NOT enable LFB/VGA/WC from within Windows NTx OSes (NT, 2000,
XP, 2003, Vista, 2008, 7), even if executed from a DOS console!

Run MTRRLFBE by itself (no parameters) from any DOS box/console/prompt/window
(even from within Windows 3.1x/9x/NTx) to view its stats + command line
switches:

MTRRLFBE

Example:

MTRR-WC enabler for VESA LFB 1.3 (C) 2005-2011 by Martin Rehak; rayer@seznam.cz
Compiled by GCC 4.5.2 at 23:25:26, Mar 10 2011
Host machine CPU vendor: GenuineIntel, ID: 6FBh

SYNTAX: MTRRLFBE area mode
area: "VGA" or "LFB" (address range to apply mode change) or
	"USER:base_address:size" (base_address is a hexa-number, size is in kB)
mode: "UC" - UnCached, "WP" - Write-Protected, "WT" - Write-Through,
mode: "WB" - Write-Back, "WC" - Write-Combining

Then run desired command(s) with parameters only from native/real/true/pure
DOS/MS-DOS mode to enable individual/combined features.

Examples:

How to enable LFB WC (Linear Frame Buffer Write Combining):

MTRRLFBE LFB WC

How to enable VGA WC (Banked VGA Write Combining):

MTRRLFBE VGA WC

You can add line(s) above to your AUTOEXEC.BAT file (found in C:\ root).
Edit your AUTOEXEC.BAT using EDIT in DOS or Notepad in Windows.
Backup original file first.
Reboot when done for MTRRLFBE changes to take effect.

MTRRLFBE does not occupy any memory.

You can test the performance of your CPU/chipset/GPU with or without MTRRLFBE
by running VESATEST.EXE (native DOS or Win3.x/9x DOS box) or VESATSTW.EXE
(Win32 DOS console) [149 KB, freeware]:
http://rayer.ic.cz/programm/vesatest.zip
VESATSTW.EXE requires SDL.DLL (free GPL):
http://www.libsdl.org/
in the same directory/folder for proper operation.
More info:
http://rayer.ic.cz/programm/programe.htm#VESATEST



UPDATES
=======

Version 1.1:
8.1.2007 = since version 1.1 allows you to set user address range for
specified mode via following command line parameter USER:base_address:size_kB.

Version 1.3:
10.3.2011 = In version 1.3 I completely rewrote MSR setting routines so now it
can run under old memory manager emm386.exe and Windows 9x.



IMPORTANT
=========

MTRRLFBE is (starting with version 1.3) COMPATIBLE with Microsoft EMM386.EXE
and most (but not tested) other 3rd party upper/expanded/extended memory
managers: Quarterdeck QEMM386.SYS, Helix NetRoom RM386.EXE, Lineo (Caldera)
DR-DOS EMM386.EXE, Qualitas 386MAX.SYS etc.
In case you would like to use some of these memory managers, please see
MEMORY.TXT, part of W95-11D (freeware):
http://www.mdgx.com/95.htm
In case you would like to use UMBPCI.SYS, please see the UMBPCI Guide:
http://www.mdgx.com/umb.htm
