skiselev / 8088_bios

BIOS for Intel 8088 based computers
GNU General Public License v3.0
513 stars 61 forks source link

[book8088] BIOS POST intel chime plays slower than it should #50

Closed ImanolBarba closed 10 months ago

ImanolBarba commented 11 months ago

This is more of an interesting quirk that can lead to a broader realisation (perhaps on my part only) than a critical issue, but I noticed while testing this BIOS that the intel chime that plays at boot plays slower than normal.

I used two things to compare:

In both, the startup chime can be heard at the correct speed, but when played on the book8088 (also on pcem using the book8088 bios built from master on this repo, so it doesn't appear to be v20 related), it can be heard like this:

https://ima.lol/~imanol/boot_sound.wav

Comparing both audio sources reveals that the book8088 BIOS plays it 69.74% slower.

So it appears that for whichever reason, on the book8088 the speed of the chime is slower.

Another fun fact, if I turn on turbo mode on the book8088, it seems to play to the correct speed (or very close, I haven't measured).

So in short, there seems to be some timing issue with the platform, or the way the BIOS sets it up?

skiselev commented 11 months ago

The tune is not precisely timed, particularly on Book8088 and other XT-class systems, like my Micro 8088 design. On Xi 8088, bit 4 of port 0x61 is flipped every 15 µs, and that is used for delays. That provides a pretty good timing. On XT class systems, the delay is implemented using a loop. The speed here will depend on the CPU clock frequency and the CPU type (8088 vs. V20) At some point of the future, I'd like to implement delays using PIT, not only for the tune, but also for other, more critical parts, like floppy drive and flash ROM subroutines

skiselev commented 10 months ago

Should be fixed thanks to @640-KB's contribution. Please test the latest build

ImanolBarba commented 10 months ago

Just tested, timing is good both on turbo and normal mode as expected

Thank you both!