Comments (8)
Ugh, I wonder if this is related to #22 - I have some ideas, but not sure (i.e. do we need to restore extended registers if we're mangling them from not 386 protected mode?)
from vmwmouse.
Stupid stupid idea: try this patch. I don't think it'll change much, but it'll guard changing extended registers from 16-bit world.
diff --git a/ps2.asm b/ps2.asm
index c8ef944..bf521bf 100644
--- a/ps2.asm
+++ b/ps2.asm
@@ -253,12 +253,12 @@ ps2_int proc far
test PS2_DATA_FLAG,0FFh
jz ps2_int_exit ;Not a valid PS/2 mouse interrupt
- push ax ;Save the world
- push bx
- push cx
- push dx
- push si
- push di
+ push eax ;Save the world
+ push ebx
+ push ecx
+ push edx
+ push esi
+ push edi
push bp
push ds
push es
@@ -357,12 +357,12 @@ ps2_no_data:
pop es
pop ds
pop bp
- pop di
- pop si
- pop dx
- pop cx
- pop bx
- pop ax
+ pop edi
+ pop esi
+ pop edx
+ pop ecx
+ pop ebx
+ pop eax
ps2_int_exit:
pop ds
@@ -480,6 +480,10 @@ page
ps2_search proc near
; Check for the VMware backdoor.
+ push eax
+ push ebx
+ push ecx
+ push edx
xor ebx, ebx
mov ecx, CMD_GETVERSION
call Backdoor
@@ -490,13 +494,18 @@ ps2_search proc near
; Under hypervisors, always assume the 286/386 PS/2 mouse vector
mov vector, 074h
stc ;Show mouse was found
- ret
+ jmp ps2_search_pop
ps2_cant_use_it:
mov vector,-1 ;Restore to "no mouse" value
ps2_machine_not_found:
clc ;'C' clear shows not found
+ps2_search_pop:
+ pop edx
+ pop ecx
+ pop ebx
+ pop eax
ret
ps2_search endp
@@ -642,6 +651,10 @@ vmware_load_ini:
mov wheel_enabled, ax
vmware_enable_absolute:
+ push eax
+ push ebx
+ push ecx
+ push edx
; We need to do this *after* successfully setting up our hook.
; I don't know if these can fail, but OSDev Wiki doesn't check,
; and we do check if we're on something VMware-shaped before...
@@ -663,6 +676,10 @@ vmware_enable_absolute:
mov ebx, ABSPOINTER_ABSOLUTE
mov ecx, CMD_ABSPOINTER_COMMAND
call Backdoor
+ pop edx
+ pop ecx
+ pop ebx
+ pop eax
ps2_enable_abort:
ret
@@ -728,9 +745,17 @@ ps2_disable_exit:
; (CB) Put the mouse back to relative on disable?
; Enable relative
+ push eax
+ push ebx
+ push ecx
+ push edx
mov ebx, ABSPOINTER_RELATIVE
mov ecx, CMD_ABSPOINTER_COMMAND
call Backdoor
+ pop edx
+ pop ecx
+ pop ebx
+ pop eax
ret
from vmwmouse.
Seems to work. I have manually applied the patch to current main - and the Total Commander works correctly now, at least for me.
from vmwmouse.
Interesting; I wonder what specific hunk is solving the issue. Could you try basically try adding them one by one until you can confirm one solves the issue?
I also wonder if this even solves the issue too, or if it's just luck that it's not triggering. I have to wonder what's happening, and why. I wouldn't think changing the extended registers from 16-bit code would hurt things either, but things surprise me when you drop to this level, unfortunately....
from vmwmouse.
FWIW, this also doesn't solve #22, so this is just for this, it seems.
from vmwmouse.
Could you try basically try adding them one by one until you can confirm one solves the issue?
I'll try when I have some more time.
from vmwmouse.
I don't have much time to test (I have full hands with my development), but it seems the first change (in ps2_int / ps2_no_data) is enough to stop the crashes.
from vmwmouse.
I wouldn't think changing the extended registers from 16-bit code would hurt things either, but things surprise me when you drop to this level, unfortunately....
I am also clobbering the 32-bit upper half of registers during Enable/Disable but I have not seen any issues so far.
As for clobbering inside the actual PS/2 callback, while I don't know the VMware BIOS, the VBox BIOS does push the 32-bit registers before calling the PS/2 callback. If it didn't, clobbering them from the PS/2 callback would be really bad.
Or it could also be that some program is either hooking the PS/2 interrupt or inserting itself in the PS/2 callback chain, and it does not expect the 32-bit registers to be clobbered by the other handlers.
from vmwmouse.
Related Issues (20)
- Windows 9x HOT 1
- INF setup HOT 1
- OS/2 1.x PM
- Check if the VMware backdoor works before enabling the device
- Hide cursor when mouse leaves the VM HOT 7
- DOS `mouse.com` implementations broken HOT 2
- Move VMware reading to the soft interrupt handler?
- Video Driver for Windows 3.x HOT 5
- Windows Nt 3.1 / 3.51 HOT 1
- installation renders windows unbootable HOT 3
- weird disk issue in vmware HOT 4
- Building from Linux/CI
- Add the fact this is also useful when using VNC in the readme.md
- Missing file? HOT 4
- Mouse driver crashes Program Manager HOT 3
- Remove other mice types
- Refactor/rewrite HOT 2
- Find exact terms for sample drivers HOT 1
- Windows 1/2/3.0 support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vmwmouse.