Intel P6 / AMD K7 MTRRs management IOCtl PDD ver.0.05a

Copyright 1999-2000 January June / Yotogi-Hime / Beliefia Productions.


0. Table of Contents



1. Welcome

P6K7MTRR.sys is a simple interface physical device driver(PDD) that can manage Memory Type Range Registers(MTRRs) of Intel P6* / AMD K7** series processors. Programmer can query/modify any MTRR settings via DosDevIOCtl() API, from non-Ring0 privileges.
A sample executable, VFBWC.exe, using P6K7MTRR.sys, sets MTRR write-combining strategy to video frame buffer aperture. It can often improve graphic performance, especially DIVE.

* P6 includes PentiumPro, PentiumII, Celeron and PentiumIII.
** K7 includes Athlon and Duron.

1.1. Copyright and Disclaimer

  1. 'THIS SOFTWARE (P6K7MTRR.SYS AND ITS SOURCES) AND WHOLE SET OF DOCUMENTS' (CALLED 'THE PRODUCT') ARE ENTIRELY COPYRIGHTED BY TAKAYUKI 'JANUARY JUNE' SUWA/BELIEFIA PRODUCTIONS, AUTHOR/HOLDER OF THE PRODUCT.
  2. THE PRODUCT IS STILL UNDER DEVELOPMENT AT THE DISTRIBUTION AND MAY BE OCCURED ANY MODIFICATION/DELETION OF APPEARANCE/FUNCTION OR TERMINATION OF DEVELOPMENT/SERVICE IN FUTURE WITHOUT NOTICE.
  3. THE PRODUCT IS PROVIDED 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  4. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DAMAGES, WHETHER IN CONTRACT OR TORT (INCLUDED NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE PRODUCT, EVEN THOUGH SUCH HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF ANY DAMAGE.
We are regarded you agree disclaimer above at first installation of P6K7MTRR.SYS. If you disagree above, you must discard all files of the product.

1.2. System Requirements

This software will be functioned in environment such as:

1.3. Contact Author

Email to Takayuki 'January June' Suwa:

1.4. Revision History



2. How to use


2.1. Driver Installation

  1. Unzip archive to where you desire. (e.g. C:\P6K7MTRR)
  2. Add
    DEVICE=d:\path\P6K7MTRR.sys
    line to your CONFIG.SYS. (d and path must be replaced with actual installation drive/path)
  3. Restart your system. If installation successfully, you will see:
    P6K7MTRR.sys  Intel P6 / AMD K7 MTRRs management IOCtl PDD  ver.0.05a
    Copyright 1999-2000 January June / ûΘë╛òP(Yotogi-Hime) / Beliefia Productions.
    Intel P6 MTRR feature is found. The driver has been installed.
    or
    P6K7MTRR.sys  Intel P6 / AMD K7 MTRRs management IOCtl PDD  ver.0.05a
    Copyright 1999-2000 January June / ûΘë╛òP(Yotogi-Hime) / Beliefia Productions.
    AMD K7 MTRR feature is found. The driver has been installed.

2.2. How to apply write-combining to video frame buffer aperture

  1. Run VFBWC.exe from PM-aware environment. You will see such as:
    VFBWC.exe  Video Frame Buffer to Write-Combining for P6K7MTRR.sys  ver.0.04
    Copyright 1999-2000 January June / ûΘë╛òP(Yotogi-Hime) / Beliefia Productions.
     
    video frame buffer aperture PhysAddr : 0x48000000
    video frame buffer aperture Size     : 0x00200000
    setting validity                     : valid
    A0000-BFFFF fixed range (VGA region) : as-is
     
    To apply this setting, rerun VFBWC.exe with -a option.
    In this example, video frame buffer aperture PhysAddr/Size detected is 0x48000000/0x00200000.
  2. If detection seems true, rerun VFBWC.exe with -a option.
    If seems false, add correct PhysAddr and Size in hexadecimal such as:
    VFBWC 0x48000000 0x200000 -a
    You will see:
    Setting has been applied.
  3. To apply automatically in startup sequence, add
    CALL=d:\path\VFBWC.exe PhysAddr Size -a
    line to your CONFIG.SYS. (d and path must be replaced with actual installation drive/path)
    PhysAddr and Size also must be specified, because autodetection cannot be used in pre-PM environment.
    And for laptop/notebook machines,
    RUN=d:\path\VFBWC.exe PhysAddr Size -a -d
    to reapply automatically after APM suspend resuming.
  4. Run VFBWC.exe with -?, and you will see usage summary and other options:
    usage:
      VFBWC.exe  [-options]  [{PhysAddr}  {Size} (in hex.)]
        PhysAddr/Size is not specified, VFBWC.exe will try to detect physical
        address/size of video frame buffer aperture.
        (requires Presentation Manager activity and DIVE feature)
    options:
      -1  rounds Size up to 1MB unit
      -a  applies setting to MTTRs actually with specified/detected range
      -b  rings beep when apply setting
      -d  goes into daemon mode, re-apply automatically after APM suspend resuming
      -i  turns to invalid for variable MTRRs / UC for fixed A0000-BFFFF MTRR
            rather than valid/WC
      -v  with -a, also applies WC to fixed A0000-BFFFF MTRR (VGA region)
      -?  displays this message


3. P6K7MTRR.sys device IOCtl reference


3.1. Constants and Structures

All constants and structures needed for development are defined in P6K7MTRR.h. See also.

3.2. Precautions and Limitations


3.3. DosDevIOCtl() interface


3.3.1. P6K7MTRR_SETMTRR2DEFAULT (40h)

Category:
IOCTL_P6K7MTRR (c4h)
Function:
P6K7MTRR_SETMTRR2DEFAULT (40h)
Desctiption:
Set all MTRR settings to default
Parameter Packet Format:
None. This pointer should be NULL.
Data Packet Format:
None. This pointer should be NULL.
Returns:
NO_ERROR
Success.
ERROR_INVALID_PARAMETER
Not supported.
Remarks:
In this function, 'default' is set of all MTRR settings at initialization of P6K7MTRR.sys in startup sequence.

3.3.2. P6K7MTRR_SETMTRRDEFTYPE (41h)

Category:
IOCTL_P6K7MTRR (c4h)
Function:
P6K7MTRR_SETMTRRDEFTYPE (41h)
Desctiption:
Set MTRR default type
Parameter Packet Format:
None. This pointer should be NULL.
Data Packet Format:
P6K7MTRRDEFTYPEDATA. See also P6K7MTRR.h.
Returns:
NO_ERROR
Success.
ERROR_INVALID_PARAMETER
Wrong default memory type is specified.
Remarks:
MTRR enabled flag cannot be 0, because of restriction of P6K7MTRR.sys.

3.3.3. P6K7MTRR_SETMTRRFIXEDRANGE (42h)

Category:
IOCTL_P6K7MTRR (c4h)
Function:
P6K7MTRR_SETMTRRFIXEDRANGE (42h)
Desctiption:
Set MTRR fixed ranges
Parameter Packet Format:
None. This pointer should be NULL.
Data Packet Format:
P6K7MTRRFIXEDRANGEDATA. See also P6K7MTRR.h.
Returns:
NO_ERROR
Success.
ERROR_INVALID_PARAMETER
Wrong memory types are specified.
Remarks:
None.

3.3.4. P6K7MTRR_SETMTRRVARIABLERANGE (43h)

Category:
IOCTL_P6K7MTRR (c4h)
Function:
P6K7MTRR_SETMTRRVARIABLERANGE (43h)
Desctiption:
Set MTRR variable range
Parameter Packet Format:
P6K7MTRRVARIABLERANGEPARM. See also P6K7MTRR.h.
Data Packet Format:
P6K7MTRRVARIABLERANGEDATA. See also P6K7MTRR.h.
Returns:
NO_ERROR
Success.
ERROR_INVALID_PARAMETER
Either wrong index or memory type is specified (or both).
Remarks:
None.

3.3.5. P6K7MTRR_QRYMTRRCAP (60h)

Category:
IOCTL_P6K7MTRR (c4h)
Function:
P6K7MTRR_QRYMTRRCAP (60h)
Desctiption:
Query MTRR capabilities
Parameter Packet Format:
None. This pointer should be NULL.
Data Packet Format:
P6K7MTRRCAPDATA. See also P6K7MTRR.h.
Returns:
NO_ERROR
Success.
Remarks:
None.

3.3.6. P6K7MTRR_QRYMTRRDEFTYPE (61h)

Category:
IOCTL_P6K7MTRR (c4h)
Function:
P6K7MTRR_QRYMTRRDEFTYPE (61h)
Desctiption:
Query MTRR default type
Parameter Packet Format:
None. This pointer should be NULL.
Data Packet Format:
P6K7MTRRDEFTYPEDATA. See also P6K7MTRR.h.
Returns:
NO_ERROR
Success.
Remarks:
None.

3.3.7. P6K7MTRR_QRYMTRRFIXEDRANGE (62h)

Category:
IOCTL_P6K7MTRR (c4h)
Function:
P6K7MTRR_QRYMTRRFIXEDRANGE (62h)
Desctiption:
Query MTRR fixed ranges
Parameter Packet Format:
None. This pointer should be NULL.
Data Packet Format:
P6K7MTRRFIXEDRANGEDATA. See also P6K7MTRR.h.
Returns:
NO_ERROR
Success.
Remarks:
None.

3.3.8. P6K7MTRR_QRYMTRRVARIABLERANGE (63h)

Category:
IOCTL_P6K7MTRR (c4h)
Function:
P6K7MTRR_QRYMTRRVARIABLERANGE (63h)
Desctiption:
Set MTRR variable range
Parameter Packet Format:
P6K7MTRRVARIABLERANGEPARM. See also P6K7MTRR.h.
Data Packet Format:
P6K7MTRRVARIABLERANGEDATA. See also P6K7MTRR.h.
Returns:
NO_ERROR
Success.
ERROR_INVALID_PARAMETER
Wrong index is specified.
Remarks:
None.


4. Troubleshooting

  1. A. P6K7MTRR.sys cannot be installed on my machine...
    Q. CPU of your machine is not Intel P6 nor AMD K7 :)
  2. A. VFBWC autodetection is not functioned...
    Q. This feature requires PM activity and DIVE feature. Please check whether MMPM/2 is installed.


5. Credits

Development
Programming
Takayuki 'January June' Suwa / Beliefia Productions
Documentation
Takayuki 'January June' Suwa / Beliefia Productions
Special thanks to
Masaharu 'Densuke' Nagata
He allowed me to replicate WARP4 Developer's Toolkit UNDER LEGAL LICENSE. Thanks a lot.


Copyright 1999-2000 January June / Yotogi-Hime / Beliefia Productions. All rights reserved.
Copyrighted works(images, musics, programs, and so on), trademarks and servicemarks in this document are owned by their respective owners.

[This document is HTML3.2(Wilbur)-compliant.]