From 97b4a5b95e0f6a3fbe2f785b95dd92663f40c8cc Mon Sep 17 00:00:00 2001 From: Javier Date: Mon, 28 Feb 2022 02:52:07 +0000 Subject: fix README --- README.md | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d26c58f..7898750 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ This is a mouse driver for Windows 3.x with VirtualBox mouse integration support. -I have tested it with Windows 3.0 in real and 386 enhanced modes, as well as Windows 3.11 in 386 enhanced mode. +I have tested it with Windows 3.0 in real and 386 enhanced modes, Windows 3.11 in 386 enhanced mode +with paging on, as well as Windows 95 (Windows 9x can use 16-bit mouse drivers). # Install @@ -14,7 +15,7 @@ and point the Windows Setup program to it when it asks for a 3rd party mouse dri # Building -This requires [http://open-watcom.github.io/](OpenWatcom 2.0), albeit it may work with an older version, +This requires [OpenWatcom 2.0](http://open-watcom.github.io/), albeit it may work with an older version, and was only tested on a Linux host. The included makefile is a wmake makefile. To build it just enter the OpenWatcom environment and run `wmake vbmouse.drv`. @@ -33,9 +34,17 @@ The driver uses the real-mode PCI BIOS to request the current configuration of t To communicate with the host, the guest must send the PCI device the (physical) address of a buffer containing commands to be sent to the host. The host will write back the response in the same buffer. -Further details are available in [https://wiki.osdev.org/VirtualBox_Guest_Additions](OSDev). -The only challenge here is getting the physical address from inside 386 protected mode Windows, -but turns out this can be done with the `GetSelectorBase()` WINAPI. +Further details are available in [OSDev](https://wiki.osdev.org/VirtualBox_Guest_Additions). + +The only challenge here is getting the physical address (what the VirtualBox PCI device expects) +corresponding to a logical address (segment:offset) as seen from inside Windows. +In real mode Windows, the segment can be converted to a physical address without difficulty. +In 386 enhanced mode, the segment is actually a selector, but turns out one can obtain the base +of a selector with the `GetSelectorBase()` WINAPI. +However, if paging is enabled, that only computes the linear address, which is still not the same +as the physical address. +In this case, the [Virtual DMA services](https://en.wikipedia.org/wiki/Virtual_DMA_Services) are used +to obtain the physical address, even though we are not doing DMA. When VirtualBox is told that the guest wants absolute mouse information, VirtualBox will stop sending relative mouse information via the PS/2 mouse. However, the PS/2 controller will still send interrupts -- cgit v1.2.3