Skip to content

Repository files navigation

K6INIT & FBTWEAK

(C) 2021 - 2026, Eric Voirin (oerg866)

image image image image


K6INIT is a driver for MS-DOS that lets you configure special features of AMD K5/K6/K6-2/2+/3/3+ processors, replacing tools like k6dos.sys and setk6.exe, and is similar to FASTVID on Pentium systems.

While K6INIT can run completely autonomously, it supports manual, detailed control over Memory Type Range Registers (including Write-Combine and Cachability modes), Write Allocate, Write Ordering, CPU Cache and Frequency Multiplier.

In contrast to other tools, K6INIT can be loaded from CONFIG.SYS, so it works even with an extended memory manager (such as EMM386) installed.

If called with the /auto parameter, K6INIT does the following:

  • Write Allocate for all system memory (auto detected)
  • Write Ordering mode to 1 (All except UC/WC) (K6-2 and higher)
  • Write Combining for Linear Frame Buffer(s) exposed by VESA BIOS or prefetchable memory regions from PCI/AGP graphics cards directly (auto detected) (K6-2 (CXT) and higher)
  • L1 Cache to Enabled
  • L2 Cache to Enabled (K6-2+/K6-III/K6-III+ only)
  • Data Prefetch to Enabled (K6-2 and higher)

This can be altered and overridden with many command line parameters.

K6INIT runs on AMD K5 chips or later, but K5, K6 and K6-2 (pre-CXT) only have basic functionality. More in-depth configuration options are available with K6-2 (CXT) and later.

FBTWEAK

FBTWEAK is a decoupling of the K6INIT chipset tweaks module into a separate program to allow the user to perform chipset-specific frame buffer acceleration tweaks on Socket 5 / 7 systems without a K6 series CPU.

For more information, check the FBTWEAK documentation.

K6INIT Features

  • Detect CPU type automatically

  • Detect total available system memory (Using E820 and E801 methods)

  • Detect 15-16M Memory hole automatically

  • Give precise control over Memory Type Range Registers (MTRRs) including Write-Combine and Uncacheable modes. (K6-2 (CXT) and higher)

  • Set MTRR to enable Write combining for PCI/AGP BAR Frame Buffers automatically (K6-2 (CXT) and higher)

  • Set MTRR to enable Write combining for Linear Frame Buffers (LFBs) automatically (requires graphics card with VESA BIOS extensions) (K6-2 (CXT) and higher)

  • Enable chipset-internal Frame Buffer write cycle acceleration (EXPERIMENTAL!!!!)

    Supported chipsets:

    • ALi Aladdin III, IV, V
    • SiS 5571, 5581, 5591, 5597
    • SiS 530, 540
  • Set Write allocate for system memory

  • Set Write Order mode (K6-2 and higher)

  • Set Frequency Multiplier (K6-2+/III+ only)

  • Enable/Disable L1 Cache

  • Enable/Disable L2 Cache (K6-2+/K6-III/K6-III+ only)

  • Enable/Disable Data Prefetch (K6-2 and higher)

  • List all PCI/AGP device Base Address Regions (BARs)

Supported Processors

CPU Type Family Model Stepping
AMD K5 w/ Write Allocate 5 0..3 4..F
AMD K6 5 6 / 7 Any
AMD K6-2 5 8 0..7
AMD K6-2 (CXT Core) 5 8 8..F
AMD K6-III 5 9 Any
AMD K6-2+ / AMD K6-III+ 5 D Any

System Requirements

  • Supported AMD K5/6 family CPU (see above)
  • Microsoft MS-DOS 5.0 (or compatible) or higher
    • Microsoft Windows 95/98 support
    • FreeDOS support
    • IBM PC DOS 7.x/2000 support
    • Other systems such as DR-DOS untested, but should work, your mileage may wary when loading it from CONFIG.SYS though.

Running the Driver

Usage (config.sys): DEVICE=K6INIT.EXE <parameters>

Usage (command line): K6INIT.EXE <parameters>

All parameters are case-inensitive. Parameters other than /auto should only be used by knowledgeable users.

Command Line Parameters

K6INIT offers several command-line options to configure and manage memory settings, CPU features, and other system parameters. Below is a detailed explanation of each parameter.

/?

Description: Prints this list of parameters.


/status

Description: Displays the current program status.


/quiet

Description: Reduce text output, only print warnings/errors


/auto

Description: Fully automated setup. It is equivalent to /pci /lfb /wa:0 /wo:1 /l1:1 /l2:1 /prefetch:1

Parts of this procedure can be disabled with the following /skip parameters.


/skippci

Description: Skip PCI/AGP Frame Buffer Detection & MTRR Setup


/skiplfb

Description: Skip VESA Linear Frame Buffer Detection & MTRR Setup


/skipcpu

Description: Skip CPU internals setup (Cache, Prefetch)


/skipwawo

Description: Skip Write Allocate / Order setup

The above /skip parameters should be used with /auto preceding them.

/forcenonpf

Description: Use PCI/AGP FBs that are not marked prefetchable

Usually framebuffers in PCI/AGP devices are marked 'prefetchable'. By default, BARs that do not, are ignored.

Use this parameter to force their usage.


/chipset

Description: Apply chipset-specific tweaks

WARNING: Highly experimental feature!

Some chipsets support acceleration of frame buffer write cycles, which K6INIT can leverage. See above for supported chipsets.


/mtrr:offset,size,wc,uc

Description: Enables Write Combining for a specific memory range. Parameters:

  • offset: Linear offset (e.g., 0xE0000000)
  • size: Length in kilobytes (e.g., 8192)
  • wc: Write-combine flag (1 to enable, 0 to disable)
  • uc: Uncacheable flag (1 to enable, 0 to disable)

Notes:

  • The /mtrr option can be used twice.
  • Discards any MTRRs configured before running the program.

/mtrrclr

Description: Disables Memory Type Range Registers (MTRRs) entirely.

Notes:

  • Clears any existing MTRRs, including Write-Combined and Uncacheable regions.

/lfb

Description: Automatically finds and enables Write Combining for the Linear Frame Buffers (LFB).


/pci

Description: Automatically finds and enables Write Combining for Frame Buffers exposed by PCI / AGP graphics cards (experimental).


/vga

Description: Enables Write Combining for the VGA memory region (A0000-BFFFF).

Notes:

  • Warning: This option is potentially unsafe. Do not use this memory region for Upper Memory Blocks (UMBs).
  • Equivalent to: /wc:0xA0000,128,1,0

/wa:size

Description: Configures Write Allocate (WA) settings.

Arguments:

  • size: Memory size in kilobytes.

Notes:

  • Set this to 0 to disable Write Allocate.

/wahole:1/0

Description: Forces 15-16 MB memory hole skipping for Write Allocate

Notes:

  • K6INIT usually detects the memory hole by itself, but this option can be used to force it on or off.

/wo:mode

Description: Configures the Write Order Mode.

Arguments:

  • mode: A single digit representing the desired mode.
    • 0: All memory regions (Slow)
    • 1: All except uncacheable or write-combined regions (Fast)
    • 2: No memory regions (Fastest)

/multi:x.y

Description: Configures the CPU frequency multiplier.

Arguments:

  • x: Integral part of the multiplier.
  • y: Fractional part of the multiplier.

Notes:

  • Requires a K6-2+ or K6-III+ CPU.
  • Example usage: /multi:5.5

/l1:1/0

Description: Enables (1) or disables (0) the Level 1 cache.


/l2:1/0

Description: Enables (1) or disables (0) the Level 2 cache.

Notes:

  • Only K6-2+ and K6-III+ CPUs have an on-die L2 cache.

/prefetch:1/0

Description: Enables (1) or disables (0) Data Prefetching (DPE)


/listbars

Description: Lists all Base Address Regions (BARs) exposed by PCI/AGP devices in the system.


Building K6INIT

Required Build Environment

Building requires Microsoft C/C++ 7.00 or 8.00 (from MSVC 1.52). The latter allows building on modern windows systems, as the toolchain uses very early 32-Bit executables.

The MSC_Libs folder must be copied on top of that installation. It contains the late Geoff Chappell's libraries for writing device drivers in C, from his book "DOS Internals" - plus a fix for IBM PC DOS 7.xx.

Build command

cd <somewhere>\k6init
nmake

To make a build with a lot of verbose debug output, build it with DEBUG=1:

nmake DEBUG=1

License

Creative Commons Attribution-NonCommercial-ShareAlike 4.0 (CC BY-NC-SA 4.0)

K6INIT was built using the LIB866D DOS Real-Mode Software Development Library

About

AMD K6-2 (CXT) / K6-2+ / K6-3 / K6-3+ Write Allocate / Write Combine / Write Ordering / Frequency Multiplier / Cache Enable Initialization driver for MS-DOS

Topics

Resources

Stars

106 stars

Watchers

8 watching

Forks

Releases

Packages

Contributors

Languages