Over the last two weeks I have been working on stabilizing 286 protected mode in Daveemu. It took far more time than I expected, because getting "something that boots" is only the beginning. Once 286 protected mode started working, emulator performance dropped dramatically due to the extra 286-specific behavior I had to add along the way: stricter descriptor validation, privilege checks, call gates and task gates, stack and segment limit enforcement, expand-down stack handling, proper fault delivery, and many more protected-mode edge cases that real software depends on.

The good news is that the effort paid off. Windows 3.x standard mode is now in much better shape and the project has crossed an important milestone: 286 protected mode is no longer just an experiment, it is becoming something I can actually build on.

Windows 3.1 booting in protected mode

Another issue that became more visible as the project grew was regression hunting. As more code paths started interacting with each other, previously working features began breaking more often, and unit tests alone were not enough to catch that because the failures often appeared only in real-world scenarios. Right now the project has 634 unit tests and 11 end-to-end scenarios covering things like installing, booting, and using MS-DOS 3.30, MS-DOS 5.0, Windows 2.0, Windows 3.0 real mode, Windows 3.0 standard mode, and Windows 3.10 beta and final release setup paths. That makes tracking regressions much easier than before, and it already helped me catch quite a few of them.

Windows 3.1 About dialog

Performance was also a major problem. Even after protected mode v1 was functionally complete enough to run meaningful workloads, the speed was terrible, so I had to go back to profiling and move more diagnostics and tracing out of hot paths. I managed to improve things somewhat, but there is still a significant gap versus real mode, so I will need another round of profiling and more testing across different workloads before I am satisfied.

For now I also have a practical minimum CPU target: Intel Coffee Lake (8th gen) or newer. That comes from the current build and optimization choices used for the emulator.

Outside of protected mode work, I added a few quality-of-life improvements. Daveemu can now capture screenshots directly to the clipboard or save them to a file with format settings. I also fixed several smaller bugs and continued refining the HDD sound behavior. The HDD spin-up sound now resembles the old drives that would briefly overspin by roughly 5-10% before settling down to nominal RPM. A small detail, but I like those details.

New screenshot/settings dialog

We are getting closer to the 0.1.0-alpha release. Yes, I know I have said that more than once, but this time the growing list of software that actually works is a much better indicator than optimism alone.

SMARTDRV and antivirus running

I am also planning to upload a new video to my YouTube channel soon to show the emulator in action. I know the project is still not user-friendly enough yet, especially when it comes to command-line parameters, but that will improve too.

I also expect development to slow down a bit in the near future, because I am returning to full-time work as a software developer. Still, I would not worry too much about that. The hardest protected-mode implementation work is now largely behind me, and this recent push was very much about getting those painful pieces closed out while I still had the time and momentum. The next phase is more about stabilization, regression hunting, and incremental improvement.

Stay tuned.

Previous Post Next Post