-
Notifications
You must be signed in to change notification settings - Fork 2
Guide:CPU settings in DOSBox‐X
Back to the DOSBox-X Wiki Welcome page.
-
CPU settings in DOSBox-X
- Overview
-
[cpu] config section
- core
- fpu
- segment limits
- double fault
- reset on triple fault
- always report double fault
- always report triple fault
- allow lmsw to exit protected mode
- report fdiv bug
- enable msr
- enable cmpxchg8b
- enable syscall
- ignore undefined msr
- interruptible rep string op
- dynamic core cache block size
- cputype
- cycles
- cycleup
- cycledown
- cycle emulation percentage adjust
- turbo
- use dynamic core with paging on
- ignore opcode 63
- apmbios
- apmbios pnp
- apmbios version
- apmbios allow realmode
- apmbios allow 16-bit protected mode
- apmbios allow 32-bit protected mode
- integration device
- integration device pnp
- isapnpbios
- realbig16
- Differences in emulated CPU types
- FAQ
- TODO
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.
-
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. |
-
Default value: true
-
Valid values: true, false
Floating Point Unit (FPU). Also referred to as the x87, or Math co-processor. FPU emulation is enabled by default.
If cputype=
is a 486 variation and fpu=true
, 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 a FPU to be present with these later CPU types. |
Warning
|
The real FPUs have an 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 your running Windows as the host OS, you can either disable the FPU emulation, or if proper FPU emulation is important, use the MinGW builds. |
-
Default value: true
-
Valid values: true, false
Enforce checks for segment limits on 80286 and higher CPU types.
-
Default value: true
-
Valid values: true, false
Reset CPU on triple fault condition (failure to handle double fault)
-
Default value: false
-
Valid values: true, false
Always report (to log file) double faults if set. Else, a double fault is reported only once. Set this option for debugging purposes.
-
Default value: false
-
Valid values: true, false
Always report (to log file) triple faults if set. Else, a triple fault is reported only once. Set this option for debugging purposes.
-
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).
-
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. |
-
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. |
-
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. |
-
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).
-
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. |
-
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.
-
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.
-
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.
|
-
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
orcycles=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. |
-
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%.
-
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%.
-
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.
-
Default value: false
-
Valid values: true, false
Enables Turbo (Fast Forward) mode to speed up operations.
Any key press will disengage turbo mode.
Note
|
This has no relation to the turbo button found on many retro PCs. Instead this is more a fast-forward mode. |
-
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.
-
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.
-
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.
-
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, as such it is not recommended to enable this option at this point in time. |
-
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.
-
Default value: true
-
Valid values: true, false
Allow guest OS to connect from real mode
-
Default value: true
-
Valid values: true, false
Allow guest OS to connect from 16-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 shutdown 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.
-
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 your a developer wanting to work on this functionality.
-
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.
-
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.
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 | 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 |
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 |
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 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
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 with regards 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.
|
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 where 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. |
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 emulator.