Mouse & Shared folder

About Qemu-system-ppc, a PPC Mac emulator for Windows, macOS and Linux that can run Mac OS 9.0 up to Mac OS X 10.5

Moderators: Cat_7, Ronald P. Regensburg

Ringworld
Space Cadet
Posts: 3
Joined: Thu Jun 29, 2017 2:23 pm

Mouse & Shared folder

Post by Ringworld »

I'm a neophyte, I installed Qemu on Mac with Sierra 10.12.5, with some attempts to get it running, I have to solve two problems: the mouse runs slowly in Qemu and I do not know how to create a shared folder from Qemu and the host.
There is a solution to these problems. Thank you.
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Mouse & Shared folder

Post by Cat_7 »

Hi,

There is no working shared folder functionality available right now.
Which Mac OS are you emulating? Have you checked the mouse speed settings in the guest OS?

Best,
Cat_7
Ringworld
Space Cadet
Posts: 3
Joined: Thu Jun 29, 2017 2:23 pm

Re: Mouse & Shared folder

Post by Ringworld »

Hi,
I emulate MacOs 9.2.1, about mouse tomorrow will control the settings.
I'm sorry that can not have a direct communication between Sierra and OS 9.2. Thank you.
User avatar
24bit
Forum All-Star
Posts: 1424
Joined: Wed Nov 11, 2009 5:47 pm
Location: Germany

Re: Mouse & Shared folder

Post by 24bit »

I´m using SheepShaver to write onto the Qemu raw image.
Not that elegant but working.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Mouse & Shared folder

Post by Ronald P. Regensburg »

If the QEMU HD is formatted HFS+, you can simply mount the image file in the OSX/macOS host and copy files to it or from it. To prevent possible file system corruption, be careful not to have the volume mounted in the host OS while QEMU is running.
User avatar
adespoton
Forum All-Star
Posts: 4226
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Mouse & Shared folder

Post by adespoton »

Because you can mount/eject images on the fly in QEMU, you can also create a "transfer" image that you can mount on either the host or the guest. That way, you can leave QEMU running, and treat it as if you're taking a USB stick out of one machine and inserting it in the other to transfer files.
Ringworld
Space Cadet
Posts: 3
Joined: Thu Jun 29, 2017 2:23 pm

Re: Mouse & Shared folder

Post by Ringworld »

I found very useful the advice of Ronald P. Regensburg and adespoton to transfer files to and from Qemu. About my question on the mouse I have now put the speed on fast and is faster but it is not fluid, can not make precise moves.
HedgehogAlbedo
Space Cadet
Posts: 1
Joined: Thu Dec 06, 2018 8:35 am

Re: Mouse & Shared folder

Post by HedgehogAlbedo »

Another way to transfer files - in my use case because I'm using an IDE in the host but compiling code on the ARM QEMU guest - is to setup something like fswatch in combination with a file syncing or copying tool (scp or rsync). When correctly configured this will copy files to the QEMU machine whenever they change.

scp on its own should be sufficient to move files to or from the guest without resorting to the risks of a mount-unmount cycle but requires running manually.

Couple of assumptions I've made: your host is a modern OS. fswatch works cross-platform but in subtly different ways. I've also assumed that the guest is running an ssh daemon. There's nothing stopping fswatch using FTP (and a corresponding guest FTP daemon) if that works for you. A Linux host also has inotify-based tools.

It's not strictly a shared folder but the end result is mostly the same.

HTH.
User avatar
adespoton
Forum All-Star
Posts: 4226
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Mouse & Shared folder

Post by adespoton »

Ringworld wrote:I found very useful the advice of Ronald P. Regensburg and adespoton to transfer files to and from Qemu. About my question on the mouse I have now put the speed on fast and is faster but it is not fluid, can not make precise moves.
I just started experiencing the same problem; changing to -m mac99,via=pmu fixed the issue for me. Seems to be something introduced in the CUDA emulation.
kanjitalk755
Apple Corer
Posts: 239
Joined: Thu Nov 09, 2017 12:06 pm

Re: Mouse & Shared folder

Post by kanjitalk755 »

I have tried to improve mouse movement under macOS.

https://github.com/kanjitalk755/qemu
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Mouse & Shared folder

Post by Cat_7 »

Hi,

I can't compile the source. The folder gamepad-osx is empty.
Should I somehow init the submodule?

Only submodules known are the default ones: ui/keycodemapdb tests/fp/berkeley-testfloat-3 tests/fp/berkeley-softfloat-3 dtc capstone

EDIT: I found the required files here: https://github.com/suzukiplan/gamepad-o ... 2349cdd495

Best,
Cat_7
Last edited by Cat_7 on Tue Apr 23, 2019 5:11 pm, edited 1 time in total.
Reason:  
kanjitalk755
Apple Corer
Posts: 239
Joined: Thu Nov 09, 2017 12:06 pm

Re: Mouse & Shared folder

Post by kanjitalk755 »

I found how to do mouse integration, but it didn't work QEMU3.1.0/4.0.0-rc4.

https://wiki.archlinux.org/index.php/QE ... ntegration

Does anyone know how to do mouse integration with the latest version?
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Mouse & Shared folder

Post by Cat_7 »

I struggled with that before, but there is no tablet driver available in Mac OS 9.

Some fixes to the SDL code were made by the SDL maintainer to get a decent mouse/keyboard behaviour in Mac OS 9. Particularly when two Qemu instances were running.

As OSX hosts do not use SDL or GTK by default, it might be the mouse integration does not work for OSX guests?

Best,
Cat_7
User avatar
adespoton
Forum All-Star
Posts: 4226
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Mouse & Shared folder

Post by adespoton »

How does VirtualBox do it? Because it definitely has Mouse Integration under macOS.
kanjitalk755
Apple Corer
Posts: 239
Joined: Thu Nov 09, 2017 12:06 pm

Re: Mouse & Shared folder

Post by kanjitalk755 »

According to System Profiler, the guest OS X is connected to a USB tablet.

It turned out that QEMU's mouse integration can be realized by appending "-usb tablet" argument if guest is OS X.

If Mac OS 9 has a standard USB tablet driver, the mouse integration may be realized.
User avatar
adespoton
Forum All-Star
Posts: 4226
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Mouse & Shared folder

Post by adespoton »

Right... after checking, that's how VBox does it too. Of course, it doesn't run OS 9.

I know there are tablet drivers for classic Mac OS (Wacom ones, for instance), but I'm not sure offhand if OS 9 has them by default. I would expect it to, as 10.1 contains them, but Apple was not really consistent back then.

If integration doesn't work by default with "-usb tablet" then we could try installing a Wacom driver and see if that makes it work.
kanjitalk755
Apple Corer
Posts: 239
Joined: Thu Nov 09, 2017 12:06 pm

Re: Mouse & Shared folder

Post by kanjitalk755 »

I tried Wacom tablet driver with argument "-device usb-wacom-tablet".

http://macintoshgarden.org/apps/wacom

Unfortunately it behaved like a mouse (relative position) even if specifying pen mode (absolute position).
kanjitalk755
Apple Corer
Posts: 239
Joined: Thu Nov 09, 2017 12:06 pm

Re: Mouse & Shared folder

Post by kanjitalk755 »

I have developed an application for mouse integration between QEMU and Mac OS 9.

https://github.com/kanjitalk755/macos9- ... t/releases
  • Expand USBTablet.sit and move to System Folder -> Startup Items.
    Append "-device usb-tablet" instead of "-device usb-mouse" to argument of QEMU.
This is experimental, you may lost mouse control.
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Mouse & Shared folder

Post by Cat_7 »

Hi,

The application works with MacOS 9.2 when you use --M mac99 -device usb-kbd -device usb-tablet, as this does not present usb devices by default to Mac OS.
Using -M mac99,via=pmu already presents usb mouse and kbd to Mac OS, so the mouse gets stuck in the left upper corner.

Mouse control is temporarily lost before the application is loaded from the start-up folder.
It seems the mouse can move out of the Mac OS window, but it requires a click in the Mac OS window to capture it again.

The application crashes in my MacOS 9.0 when used with -M mac99 -device usb-kbd -device usb-tablet.

Best,
Cat_7
Last edited by Cat_7 on Tue Apr 30, 2019 2:35 pm, edited 1 time in total.
Reason: added some info about 9.0
kanjitalk755
Apple Corer
Posts: 239
Joined: Thu Nov 09, 2017 12:06 pm

Re: Mouse & Shared folder

Post by kanjitalk755 »

Cat_7 wrote:Using -M mac99,via=pmu already presents usb mouse and kbd to Mac OS, so the mouse gets stuck in the left upper corner.
You can't use it if you can't delete the usb-mouse.
Cat_7 wrote:Mouse control is temporarily lost before the application is loaded from the start-up folder.
If it is System Extension, it will be effective earlier, but the document for making it was not found.
Cat_7 wrote:It seems the mouse can move out of the Mac OS window, but it requires a click in the Mac OS window to capture it again.
The mouse grab is uncontrollable from guest OS.
Cat_7 wrote:The application crashes in my MacOS 9.0 when used with -M mac99 -device usb-kbd -device usb-tablet.
It may not be usable if not Mac OS 9.2.
kanjitalk755
Apple Corer
Posts: 239
Joined: Thu Nov 09, 2017 12:06 pm

Re: Mouse & Shared folder

Post by kanjitalk755 »

kanjitalk755 wrote:
Cat_7 wrote:It seems the mouse can move out of the Mac OS window, but it requires a click in the Mac OS window to capture it again.
The mouse grab is uncontrollable from guest OS.
I have fixed mouse grab of QEMU.

https://github.com/kanjitalk755/qemu
User avatar
adespoton
Forum All-Star
Posts: 4226
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Mouse & Shared folder

Post by adespoton »

kanjitalk755 wrote:
Cat_7 wrote:Mouse control is temporarily lost before the application is loaded from the start-up folder.
If it is System Extension, it will be effective earlier, but the document for making it was not found.
I think I've got an extension template around somewhere; I used to have luck with just shoehorning the code in to a pre-compiled shell using ResEdit as well.

Let me know if you need any help here.
kanjitalk755
Apple Corer
Posts: 239
Joined: Thu Nov 09, 2017 12:06 pm

Re: Mouse & Shared folder

Post by kanjitalk755 »

Please let me know if there is a sample code to make INIT.
User avatar
adespoton
Forum All-Star
Posts: 4226
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Mouse & Shared folder

Post by adespoton »

Which IDE are you using? I've got sample code stashed away somewhere for MPW and also for CodeWarrior.

[edit] Found the following:
https://www.applefritter.com/node/13008 - CDEV framework for CodeWarrior
ftp://ftp.uni-potsdam.de/pub/systems/ma ... ev-src.txt - cdev-stub-cw.hqx (another CDEV stub for CodeWarrior).

[edit2] Found this:
https://retrocomputing.stackexchange.co ... sic-mac-os

IIRC, you just take the CODE resource and change it to an INIT resource, then lock it.

Also, it looks like the source for Extensions Manager is available here:
https://staticky.com/mirrors/ftp.apple. ... ool_Chest/
This would make a good framework if you want to build from scratch using MPW.
kanjitalk755
Apple Corer
Posts: 239
Joined: Thu Nov 09, 2017 12:06 pm

Re: Mouse & Shared folder

Post by kanjitalk755 »

adespoton wrote:Which IDE are you using? I've got sample code stashed away somewhere for MPW and also for CodeWarrior.
I use CodeWarrior Pro 6.

The links you introduced unfortunately did not fit my purpose.
Post Reply