Skip to content

Guide:CPU settings in DOSBox‐X

Robert de Rooy edited this page Sep 10, 2022 · 30 revisions

CPU settings in DOSBox-X

Table of Contents

Overview

You can change the emulated CPU type in DOSBox-X either from the DOSBox-X config file (dosbox-x.conf by default), or from the DOSBox-X command line or the menu bar.

[cpu] config section

core

  • Default value: auto

  • Valid values: auto, dynamic, dynamic_x86, dynamic_nodhfpu, dynamic, dynamic_rec, normal, full, simple

CPU Core used in emulation.

If you experience compatibility problems, attempt to use the normal core.

  • core=auto - Will use the first core available in the following order: "dynamic_x86", "dynamic_rec", "normal".

  • core=dynamic - Will use "dynamic_x86" if available, otherwise "dynamic_rec".

  • core=dynamic_x86 Dynamic re-compiler optimized for x86 host CPUs.

  • core=dynamic_nodhfpu Dynamic re-compiler with host FPU support disabled. Do not use.

  • core=dynamic_rec - Dynamic re-compiler

  • core=normal - The program is interpreted instruction by instruction. This approach is a lot more CPU demanding than the dynamic cores but allows for a more fine-grained time emulation and is needed on platforms for which DOSBox-X doesn’t have a dynamic core.

  • core=full - Deprecated, do not use

  • core=simple - Basically the same as normal, but optimized for real-mode (older) games. In case a protected-mode game is started, it automatically switches back to normal core.

Note
Windows 95 or other pre-emptive multitasking OSes will not work with the dynamic_rec core.

fpu

  • Default value: true

  • Valid values: true, false, 8087, 287, 387, auto

Floating Point Unit (FPU). Also referred to as the x87, or Math Co-Processor.

  • fpu=true is the default for compatibility with config files for regular DOSBox. It will emulate a matching FPU type for the cputype= configured.

  • fpu=false disables FPU emulation, even on CPUs types that would normally always have an FPU.

  • fpu=auto will only enable FPU emulation if the emulated CPU is a 486 or later.

  • fpu=8087 will emulate a 8087 FPU, regardless of cputype= setting.

  • fpu=287 will emulate a 287 FPU, regardless of cputype= setting.

  • fpu=387 will emulate a 387 FPU, regardless of cputype= setting.

Note
When the 386 CPU first came out, there was no matching 387 FPU initially. And some system vendors (e.g. Compaq Deskpro 386), provided a socket which could take a 287 FPU instead.
Note
If cputype= is set to a 486 variation and FPU emulation is enabled, the CPUID instruction will report a 486DX, while if fpu=false, it will report a 486SX.
Note
On real systems, starting with the Pentium CPU generation, an FPU is always present. But DOSBox-X allows disabling of the FPU with any CPU type. Disabling the FPU could cause problems with software that expects an FPU to be present with these later CPU types.
Warning
The real FPUs have a 80bit precision. This is however not supported with Windows DOSBox-X builds compiled using the Microsoft Visual Studio (MSVS) compiler, which is limited to just 64bits precision. Very few DOS games used the FPU, but for those that do, this lesser precision can cause a variety of problems, from graphical glitches to crashes, to incorrect outcomes in DOS applications. If you’re running Windows as the host OS, you can either disable the FPU emulation, or if proper FPU emulation is important, use the MinGW builds.

segment limits

  • Default value: true

  • Valid values: true, false

Enforce checks for segment limits on 80286 and higher CPU types.

double fault

  • Default value: true

  • Valid values: true, false

Emulate double fault exception

processor serial number

  • Default value: <blank>

  • Valid values:

For Pentium III emulation, this sets the 96-bit Processor Serial Number returned by CPUID.

If not set, then emulation will act as if the PSN has been disabled by the BIOS. Enter as 4 sets of 16-bit hexadecimal digits XXXX-XXXX-XXXX-XXXX.

Note
The processor info and feature bits form the topmost 32 bits of the PSN and cannot be changed.

reset on triple fault

  • Default value: true

  • Valid values: true, false

Reset CPU on triple fault condition (failure to handle double fault)

always report double fault

  • Default value: false

  • Valid values: true, false

Always report (to the log file) double faults if set. Else, a double fault is reported only once. Set this option for debugging purposes.

always report triple fault

  • Default value: false

  • Valid values: true, false

Always report (to the log file) triple faults if set. Else, a triple fault is reported only once. Set this option for debugging purposes.

allow lmsw to exit protected mode

  • Default value: auto

  • Valid values: true, false, auto

Controls whether the processor will allow the guest to exit protected mode, back to real mode, using the 286 LMSW instruction (clear the PE bit).

report fdiv bug

  • Default value: false

  • Valid values: true, false

If set, the FDIV (Floating point division) bug will be reported when using the cputype=pentium setting.

Note
This only effects the reported CPU type using the CPUID instruction. It does not actually emulate the FDIV bug behaviour.

enable msr

  • Default value: true

  • Valid values: true, false

Allow RDMSR/WRMSR (Read and Write of model-specific register) instructions. This option is only meaningful when cputype=pentium (or later CPU models).

Note
If you experience crashes with running or installing Windows 95/98/ME, you may want to try to disable this.

enable cmpxchg8b

  • Default value: true

  • Valid values: true, false

Enable Pentium CMPXCHG8B (compare and exchange 8 bytes) instruction. This option is only meaningful when cputype=auto or cputype=pentium (or later CPU models).

Enable this explicitly if using software that uses this instruction.

Note
You must enable this option to run Windows ME because portions of the Windows kernel rely on this instruction.

enable syscall

  • Default value: true

  • Valid values: true, false

Allow SYSENTER/SYSEXIT (Fast call to enter/exit to privilege level 0) instructions. This option is only meaningful when cputype=pentium_ii (or later CPU models).

ignore undefined msr

  • Default value: false

  • Valid values: true, false

Ignore RDMSR/WRMSR (Read and Write of model-specific register) on undefined registers. Normally the CPU will fire an Invalid Opcode exception in that case.

This option is off by default, enable if using software or drivers that assumes the presence of certain MSR registers without checking.

If you are using certain versions of the 3dfx Glide drivers for MS-DOS you will need to set this to TRUE as 3dfx appears to have coded GLIDE2X.OVL to assume the presence of Pentium Pro/Pentium II MTRR registers. Of course a better fix is to set cputype=ppro_slow, cputype=pentium_ii or cputype=pentium_iii which will prevent this issue.

Warning
Leaving this option enabled while installing Windows 95/98/ME can cause crashes.

interruptible rep string op

  • Default value: -1

  • Valid values: -1, 0, 1-8

If non-zero, REP string instructions (LODS/MOVS/STOS/INS/OUTS) are interruptible (by interrupts or other events).

If zero, REP string instructions are carried out in full before processing events and interrupts. Set to -1 for a reasonable default setting of "4".

A setting of 0 can improve emulation speed at the expense of emulation accuracy.

A non-zero setting (1-8) may be needed for DOS games and demos that use the IRQ 0 interrupt to play digitized samples while doing VGA palette animation at the same time (use case of REP OUTS), where the non-interruptible version would cause an audible drop in audio pitch.

dynamic core cache block size

  • Default value: 32

  • Valid values: 1-65536

The dynamic core cache block size (the default value is 32). Please change this value carefully.

According to forum discussions, setting this to 1 can aid debugging, however doing so also causes problems with 32-bit protected mode DOS games and reduces the performance of the dynamic core.

cputype

  • Default value: auto

  • Valid values: auto, 8086, 8086_prefetch, 80186, 80186_prefetch, 286, 286_prefetch, 386, 386_prefetch, 486old, 486old_prefetch, 486, 486_prefetch, pentium, pentium_mmx, ppro_slow, pentium_ii, experimental

CPU Type used in emulation.

  • auto - Emulates a 486 which tolerates Pentium instructions.

  • 8086 - Similar to the 8088 found in the original IBM PC and IBM PC XT.

  • 80186 - Similar to the 8086, rarely found in IBM PC Compatibles.

  • 286 - Sequel to the 8086, as found in the IBM PC AT. Also called the 80286.

  • 386 - Sequel to the 286. Also called the 80386. First 32-bit capable x86 CPU.

  • 486 - Sequel to the 386. Also called the 80486 or i486.

  • pentium - Sequel to the 486. Also called the 586.

  • pentium_mmx - Similar to the Pentium, but with additional (MMX) instructions added.

  • ppro - Pentium Pro, sequel to the Pentium (without MMX). Also called the 686.

  • pentium_ii - Pentium II (aka P2), sequel to the Pentium Pro, but with MMX instructions.

  • pentium_iii - Pentium III (aka P3), sequel to the Pentium II, with added SSE instructions.

  • experimental - Enables newer instructions not normally found in the CPU types emulated by DOSBox-X, such as FISTTP.

  • *_prefetch - CPU types enable more accurate prefetch queue emulation, at the expense of speed

  • *_slow - CPU types enable more accurate page privilege check emulation, at the expense of speed

Note
Regular DOSBox has a few other cputype options not available in DOSBox-X (386_slow, 486_slow and pentium_slow). These cputype options are ignored in DOSBox-X, and auto will be used instead.

cycles

  • Default value: auto

  • Valid values: fixed nnnn | max [default%] [limit cycle limit] | auto [realmode default] [protected mode default%] [limit "cycle limit"]

Number of instructions DOSBox-X tries to emulate each millisecond.

Examples:

  • cycles=fixed 5000 or cycles=5000 - All programs you start are run with a fixed speed of ~5 MIPS. Useful for speed sensitive games or games that need a continuous CPU speed.

  • cycles=max - All programs you start run at the maximum speed your CPU permits.

  • cycles=max limit 50000 - All programs you start run at up to 50000 cycles, depending on the power of your CPU.

  • cycles=max 50% - About 50% of your CPU power will be used.

  • cycles=auto - Real mode programs will run at 3000 cycles. Protected mode programs run with cycles=max.

  • cycles=auto 5000 50% limit 50000 - Real mode programs run with 5000 fixed cycles, protected mode programs with cycles=max 50% limit 50000.

Some rough guidance on how cycles relates to various legacy CPUs. Note that it depends on which emulated CPU instructions the program uses as DOSBox-X is not cycle accurate.

Emulated CPU cycles

8088 at 4.77MHz

240

286 at 8MHz

750

286 at 12MHz

1510

286 at 25MHz

3300

386DX at 25MHz

4595

386DX at 33MHz

6075

486DX at 33MHz

12019

486DX2 at 66MHz

23880

486DX4 at 100MHz

33445

486DX5 at 133MHz

47810

Pentium at 60MHz

31545

Pentium at 66MHz

35620

Pentium at 75MHz

43500

Pentium at 90MHz

52000

Pentium at 100MHz

60000

Pentium at 120MHz

74000

Pentium at 133MHz

80000

Pentium at 166MHz

97240

Pentium II at 300MHz

200000

AMD K6 at 166MHz

110000

AMD K6 at 200MHz

130000

AMD K6-2 at 300MHz

193000

Warning
Setting the cycles value too high for your host CPU, results in sound dropouts and lag.
Note
More host CPU cores do not help to increase emulation speed. A newer generation host CPU and higher host CPU clock frequency (GHz) do help.

cycleup

  • Default value: 10

  • Valid values: 1-1000000

Amount of cycles to increase with the mapped keyboard shortcut. Setting the value lower than 100, and it will be interpreted as a percentage.

The default value of 10 will be interpreted as 10%.

cycledown

  • Default value: 20

  • Valid values: 1-1000000

Amount of cycles to decrease with the mapped keyboard shortcut. Setting the value lower than 100, and it will be interpreted as a percentage.

The default value of 20 will be interpreted as 20%.

cycle emulation percentage adjust

  • Default value: 0

  • Valid values: -50-50

The percentage adjustment for use with the "Emulate CPU speed" feature.

Default is 0 (no adjustment), but you can adjust it (between -25% and 25%) if necessary.

turbo

  • Default value: false

  • Valid values: true, false

Enables Turbo (Fast Forward) mode to speed up operations.

By default, any key press will disengage turbo mode. Since DOSBox-X 0.83.25 this can be controlled with the turbo stop on key setting.

Note
This has no relation to the turbo button found on many retro PCs. Instead, this is more a fast-forward mode.

turbo last second

  • Default value: 0

  • Valid values: 0-2147483647

Introduced with DOSBox-X 0.83.25. If a positive integer is specified, the Turbo function will last for the specific amount of seconds.

This is useful when starting a program that takes a long time to load.

turbo stop on key

  • Default value: true

  • Valid values: true, false

Introduced with DOSBox-X 0.83.25. If set, the Turbo mode will be automatically stopped if keyboard input is detected.

use dynamic core with paging on

  • Default value: auto

  • Valid values: auto, true, false

Allow dynamic cores (dynamic_x86 and dynamic_rec) to be used with 386 paging enabled.

  • If the dynamic_x86 core is set, this allows Windows 9x/ME to run properly, but may somewhat decrease the performance.

  • If the dynamic_rec core is set, this disables the dynamic core if the 386 paging functions are currently enabled.

  • If set to auto, this option will be enabled depending on if the 386 paging and a guest system are currently active.

ignore opcode 63

  • Default value: true

  • Valid values: true, false

When debugging, do not report illegal opcode 0x63.

Enable this option to ignore spurious errors while debugging from within Windows 3.1/9x/ME.

apmbios

  • Default value: true

  • Valid values: true, false

Emulate Advanced Power Management (APM) BIOS calls.

This for instance allows a guest OS such as Windows 9x to turn off DOSBox-X on shutdown.

apmbios pnp

  • Default value: false

  • Valid values: true, false

If emulating ISA PnP BIOS, announce APM BIOS in PnP enumeration.

Warning
This can cause Windows 95 OSR2 and later to enumerate the APM BIOS twice and cause problems. Due to this, it is not recommended to enable this option, at this point in time.

apmbios version

  • Default value: auto

  • Valid values: auto, 1.0, 1.1, 1.2

What version of the APM BIOS specification to emulate.

You will need at least APM BIOS v1.1 for emulation to work with Windows 95/98/ME.

apmbios allow realmode

  • Default value: true

  • Valid values: true, false

Allow guest OS to connect from real mode

apmbios allow 16-bit protected mode

  • Default value: true

  • Valid values: true, false

Allow guest OS to connect from 16-bit protected mode

apmbios allow 32-bit protected mode

  • Default value: true

  • Valid values: true, false

Allow guest OS to connect from 32-bit protected mode

If you want power management in Windows 95/98/ME (beyond using the APM to shut down the computer) you MUST enable this option.

Windows 95/98/ME does not support the 16-bit real and protected mode APM BIOS entry points. Please note at this time that 32-bit APM is unstable under Windows ME.

integration device

  • Default value: false

  • Valid values: true, false

Enable DOSBox-X integration I/O device. This could be used in the future by the guest OS to match mouse pointer position, for example.

EXPERIMENTAL! Do not enable unless you’re a developer wanting to work on this functionality.

integration device pnp

  • Default value: false

  • Valid values: true, false

List DOSBox-X integration I/O device as part of ISA PnP enumeration. This has no purpose yet.

isapnpbios

  • Default value: true

  • Valid values: true, false

Emulate ISA Plug & Play BIOS.

Enable if using DOSBox-X to run a PnP aware DOS program or if booting Windows 9x. Do not disable if Windows 9x is configured around PnP devices, you will likely confuse it.

realbig16

  • Default value: false

  • Valid values: true, false

Allow the B (big) bit in real mode. If set, allow the DOS program to set the B bit, then jump back to realmode with B still set (aka Huge Unreal mode).

Needed for the Project Angel demo.

Differences in emulated CPU types

Note
This is based on: https://www.vogons.org/viewtopic.php?p=905713#p905713 and extended/modified for DOSBox-X. It is not guaranteed to be 100% accurate.

8086 to 386

Table 1. cputype options
8086 8086 prefetch 80186 80186 prefetch 286 286 prefetch 386 386 prefetch

Real mode

x

x

x

x

x

x

x

x

Protected mode

x

x

x

x

Virtual 8086 mode

x

x

386 CPUID

x

x

386 specific page access level calculation

x

x

loose (fast) page privilege check

x

x

tight (slow) page privilege check

Prefetch queue emulation

x

x

x

x

486 to Pentium III

Table 2. cputype options
486old 486old prefetch 486 486 prefetch auto pentium ppro slow pentium mmx pentium ii pentium iii

Real mode

x

x

x

x

x

x

x

x

x

x

Protected mode

x

x

x

x

x

x

x

x

x

x

Virtual 8086 mode

x

x

x

x

x

x

x

x

x

x

486 CPUID

x

x

x

Pentium CPUID

x

x

x

x

x

486 specific page access level calculation

x

x

x

x

loose (fast) page privilege check

tight (slow) page privilege check

x

BSWAP, XADD, INVD, WBINVD

x

x

x

x

x

x

x

x

x

x

CMPXCHG

x

x

x

x

x

x

x

x

RDTSC

x

x

x

x

x

x

CMPXCHG8B,RDMSR, WRMSR, RSM

x

x

x

x

x

CMOV, FCMOV, FCOMI/FCOMIP, FUCOMI/FUCOMIP, RDPMC, UD2, NOPL

x

x

x

486 specific CR register behaviour

x

x

x

x

x

Pentium specific CR register behaviour

x

x

x

x

x

Prefetch queue emulation

x

x

MMX instruction set

x

x

x

SSE instruction set

x

Weitek FPU

Weitek in the 80’s made Math co-processors compatible with the FPU socket found on x86 systemboards. But note that these Weitek FPUs are not software compatible with Intel and AMD FPU units, and can only be used by applications that specifically support it. DOSBox-X supports emulation of Weitek FPUs, but only in combination with 386 and 486 cpu types.

To enable Weitek FPU emulation, set the following options in your config file:

[dosbox]
weitek=true

FAQ

Why is there no 8088 CPU option?

Q: The 8088 is what IBM used in the original IBM PC’s. So why is there no 8088 option?

A: Because there is no difference in terms of emulation between an 8086 and 8088.

Intel released the 8086 first as a 16-bit CPU, and later released the 8088 to reduce cost for manufacturers.

The difference is that the 8086 uses both 16-bit internal and external to the CPU, while the 8088 is 16-bit internal but only 8-bit external to reduce cost. The only practical difference, in regard to emulation, is that a 8088 is a little slower because of this, but that can be compensated for using the cycles= setting.

Note
Some software may claim the CPU to be a 8088 when cputype=8086, this is simply because there is no way for the software to know which one you really have, and the 8088 was more common.

Why does DOSBox-X support the 80186?

Q: The 80186 was never used for the IBM PC, so why include it?

A: Indeed, the 80186 was mainly meant for embedded use. The 80186 was never used by IBM, but there were a few rare PC clones that used it. Although they typically had various compatibility problems.

Since various DOS tools support the detection of the 80186, DOSBox-X supports its emulation.

Note
Similar to the 8086/8088, there was also a 80188 with 8-bit external data path to the CPU to reduce cost for manufacturers. And just like with the 8086, software may identify the 80186 as a 80188.

Is DOSBox-X cycle accurate?

Q: Does DOSBox-X emulate the CPU cycles accurately?

A: No. This would just slow down the emulation, and is practical never needed for running PC programs and games.

On a legacy PC the amount of CPU cycles it takes to complete an instruction can vary depending on the type of instruction and the CPU generation and CPU vendor. DOSBox and by extension DOSBox-X instead completes one instruction per emulated-cycle. As such the cycles= value has no direct relation to the clock frequency or the amount of flops of the emulated system.

For many legacy systems, cycle accurate emulation is desirable. But this does not apply to emulating PCs. Due to the vast amount of clone systems and CPU options produced, software developers could not rely on the amount of time it takes to complete a given instruction. Software developers therefore used other timing methods, and therefore cycle accurate emulation is simply not needed.

If for some reason cycle accurate emulation is required, we suggest you use the PCem or 86Box emulator.

TODO

  • Why are there the 486old* options? They are presumably the 486 options from vanilla DOSBox, but why retain them?

  • How does DOSBox-X handle page privilege check differently? And why is there still a ppro_slow, if the others where removed?

Clone this wiki locally