joncampbell123 / dosbox-x

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

IDE transfer speeds. #2720

Open Keatah opened 3 years ago

Keatah commented 3 years ago

Feature suggestion: I'd like to see an option to change and/or limit the disk transfer speeds. I want to be able to see status messages some game generate as they start. Experience the slow disk speeds of yesteryear. That sort of thing.

I was thinking something like an MB/s speed option or limiter. 10 Mb/s 20 MB/s 30 MB/s 60 MB/s xx MB/s where you type in your own speed, such as 47 MB/s or 53MB/s for example.

Or have options representing common speeds listed here: https://en.wikipedia.org/wiki/Parallel_ATA#ATA_standards_versions,_transfer_rates,_and_features

Maybe make it part of the advanced options or a sub-menu in some existing drop-down.

What do you think?

Wengier commented 3 years ago

Thanks for the suggestion, but I think there is already such a config option - see "hard drive data rate limit" in [dos] section. Hope this helps.

joncampbell123 commented 3 years ago

Agreed. The "hard drive data rate limit" only affects INT 13h at this time. Once Windows 95 boots the disk rate limit disappears.

IDE emulation could emulate the rate limit by adding a delay between the issuance of READ/WRITE and the IRQ and data ready signals.

grapeli commented 3 years ago

On Linux, you can use cgroup2 and limit block devices like this. systemd-run -G --user -p IOReadBandwidthMax='/dev/sda 1M' -p IOWriteBandwidthMax='/dev/sda 1M' dosbox-x

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/admin-guide/cgroup-v2.rst#n1550

Keatah commented 3 years ago

Thanks for pointing it out. Play with it over the next days and weeks ahead.

Torinde commented 2 years ago

http://86box.net/2022/07/31/86box-v3-7.html

throttling disk speeds has a positive side effect of improving emulation performance (as measured in %), since it effectively spreads the emulated CPU’s I/O workload over time; in other words, the CPU has to work less often than it would with an instant-access disk, reducing or even eliminating the percentage dips that occur due to interrupt bursts during I/O.

So, it would be beneficial to apply the HDD/FDD/CD data rate limits not only to INT 13h/DOS, but also inside Windows guests.

rderooy commented 2 years ago

These kind of throttles, while good for a small selection of programs, causes user complaints that DOSBox-X is slow. I personally feel that these slowdowns should not be the default.

Keatah commented 2 years ago

Yikes. I don't think there is a correct answer here. Some of us want authentic speeds. Others want full-speed-ahead. What's a developer to do?