kextunload to use USB

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

Post Reply
nsputnik
Student Driver
Posts: 23
Joined: Mon Apr 30, 2012 6:52 pm

kextunload to use USB

Post by nsputnik »

In the docs https://www.emaculation.com/doku.php/pp ... _and_above
It says to Run a terminal and execute:

Code: Select all

sudo kextunload /System/Library/Extensions/ the device.kext
This is done in the host? I think it is, just looking for clarification.
What if there are no drivers for the host but it is recognized (giving me a vendorid and productid) by the host in System Profiler?
I did happen to find a kext named after the device at System/Library/Extensions and I tried unloading it and did not get an error message the first time (as I did when I ran it a 2nd time presumably since it was already unloaded) but I still cannot get Qemu to see it.
I did add

Code: Select all

sudo
before

Code: Select all

./qemu-system-ppc 
And I did add

Code: Select all

-device usb-ehci,id=ehci -device usb-host,bus=ehci.0,vendorid=0x0dba,productid=0x3000
as required.

I'm running 10.13.6 as the host (but I can run Monterey with M1 also), 10.4.11 as the guest. My Qemu does not have a version number I can find but the created/last mod date on qemu-system-ppc is April 24 2019.
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: kextunload to use USB

Post by Cat_7 »

Hi,

Passing through USB devices is very much a process of hit and miss.

You correctly assumed the kext has to be unloaded on the host. Qemu needs the host to release the device so it can attempt to control it.
However, sometimes there are multiple kexts loaded for one device. If there are others required to run the device on the host, you would need to unload those as well, and there the problems begin. There is no easy way to tell which kexts are loaded for a device, and certainly no guarantee all can be unloaded.
To add to the complexity there is an issue in the Qemu code that prevents passing through certain composite devices.

The command line seems OK: you add an USB2 controller to qemu and attach a device to it. And even run Qemu as root.
Is the device itself a USB2 device? If not, you might add it as in the earlier example on the page you refer to.

If Qemu can take over the device, this should do.
Is there nothing showing up in the 10.4 system profiler under USB devices?

EDIT: Your qemu version seems a bit old. Did you try to pass through a simple device first such as an usb stick?

Best,
Cat_7
nsputnik
Student Driver
Posts: 23
Joined: Mon Apr 30, 2012 6:52 pm

Re: kextunload to use USB

Post by nsputnik »

The device is USB 2.0.
I have not yet tired to pass through a usb flash drive first. I can try that.
That makes sense, about a device having multiple kexts because I could still see the host acknowledging it in certain places after I kextunload it. Will look for other kexts in addition and unload them. Is there a way to string multiple kextunloads in one string?

The device is so old that there are no drivers for the version of Mac OS running on the host. Can I just delete all of the kexts instead? I think they are there because I had migrated my user account across multiple machines, dating back to when a driver was available on the host machine back to 10.8.
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: kextunload to use USB

Post by Cat_7 »

Not knowing what happens when you delete the kexts you think are related to the device, I would advise against deleting them.
I know no way to string several kext to unload. Just manual labour. There can't be that much? ;-)

Best,
Cat_7
Post Reply