joncampbell123 / dosbox-x

DOSBox-X fork of the DOSBox project
GNU General Public License v2.0
2.78k stars 381 forks source link

Emulation of hard drive/floppy drive speed for late 1990s PCs #2039

Closed frank-deng closed 3 years ago

frank-deng commented 3 years ago

It seems that the hard drive I/O speed of DOSBox-X is far too fast compared with 1990s PCs, almost as fast as late 1990s RAM when running DOSBox-X on PCs equipped with modern SSD. I'm not sure whether such behavior will cause problems when running some demoscenes/games, and is it appropriate to use a configuration for slowing down hard drive I/O speed when encountering such problems? When running Windows 95 inside DOSBox-X on my new PC equipped with SSD, I found that the desktop finished loading almost within 1 second once mouse cursor appeared on the screen. On real machines from late 1990s, it should be almost 1 minute to finish loading desktop.

joncampbell123 commented 3 years ago

So far, slowdown is only applied to INT 21h disk I/O emulation. You are absolutely right in that INT 13h emulation needs to do the same.

I know of one demoscene executable (380 volt) that will hang at one transition point IF file I/O is too fast.

frank-deng commented 3 years ago

I also tried to use nbd+trickle for emulating a slow hard drive access under Linux, it seems that such method just hangs the whole emulator before the I/O operation finished.

frank-deng commented 3 years ago

Also, is it possible to apply slow-down feature at raw I/O level in case the guest OS handles hdd I/O directly without using any BIOS interrupts?

joncampbell123 commented 3 years ago

@frank-deng So, add the I/O delay to INT 13h, and then also adjust the IDE emulation to delay between receiving a command to read/write and completing it by the same I/O delay?

frank-deng commented 3 years ago

Maybe it's easier to implement INT 13h 's delay first, then implement delay at IDE emulation level later.

By the way, is it possible to implement delay for floppy & cdrom also altogether?