Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PS/2 soft reset #1300

Closed
chschnell opened this issue Apr 6, 2025 · 2 comments
Closed

PS/2 soft reset #1300

chschnell opened this issue Apr 6, 2025 · 2 comments

Comments

@chschnell
Copy link
Contributor

When executing the REBOOT console command under FreeDOS 1.4 the PS/2 keyboard becomes unresponsive after rebooting.

You can reproduce it using the XCom profile (which is FreeDOS-based) or with the attached HDA image file fdos14-64m.zip which contains a minimal FreeDOS 1.4 installation (no audio or network). The KolibriOS profile actually freezes after a soft reset when it initializes the PS/2 mouse.

In all cases, a PS/2 device is in trouble after a reboot was triggered from within the guest OS.

I believe the reason for this to be an invalid runtime state of the PS2 object after reboot_internal() has been invoked.

So I added a method PS2.reset() which simply resets all scalar object members back to the values assigned in the PS2 constructor, and then I added a call to this.devices.ps2.reset() in reboot_internal() along the same pattern in which the other devices virtio_9p, virtio_console and virtio_net are handled there.

This fixed it.

It seems that FreeDOS expects the PS/2 device to be reset after triggering a soft reset (which suggests that other emulators do so). Obviously though, most other guest OSes do not have that problem.

I don't think that this patch could have any negative effects on the other OSes, but before creating a PR I just want to make sure that I didn't miss anything here.

@copy
Copy link
Owner

copy commented Apr 6, 2025

Sounds good, feel free to send a PR.

@chschnell
Copy link
Contributor Author

All right, it's checked in. I did not want to duplicate all those assignments so I moved them out of the constructor, hope that's ok.

This also greatly simplifies using the FreeDOS 1.4 installer which triggers a reboot during installation, and before it needed some trickery to reenter that 2nd phase of the installation process with the keybord intact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants