corpnewt / USBMap

Python script for mapping USB ports in macOS and creating a custom injector kext.
MIT License
1.03k stars 88 forks source link

The instructions are pretty bad... but I figured it out... #46

Open miranda opened 1 year ago

miranda commented 1 year ago

I have been struggling for weeks to get my USB ports mapped with various tools... finally this one did the trick. Huge thanks to the developers for making this program! Here's how to make it work (at least for me with a z690 motherboard)...

First of all...

  1. Do not use USBInjectAll.kext - just get rid of that for good.
  2. Do not enable XHCIPortLimit in your config.plist
  3. Disable any other USB kexts and/or SSDTs that might interfere with the state of your USB until you get the mapping working, except for USB-plug-alt or the RHUB reset that you can create (if you need it... I didn't).
  4. Follow the instructions and use the program to generate a dummy USBMap.kext, and put that in your EFI.

Now when you reboot, you will likely have a bunch of USB ports that don't work, so you'll need to find one or two that work for your keyboard and mouse. Now follow the instructions for inserting a USB 2 and 3 device into each USB-A port. Don't be surprised if USB3 devices don't get detected at all. Just name all the ports as it says. I used U1, U2, U3, L1, L2, L3 etc for the upper and lower ports on the back of my computer. You should unplug and replug your keyboard/mouse so it will let you name them. When you are done with all the ports, you can quit USBMap and it will save your progress. Don't worry if most of your ports didn't work for USB3.

The part that is most unclear with the instructions is what to do with the USBMapInjectorEdit program, which is the next step. Like I said, you do not want to make a real USBMap.kext yet, you are still using the dummy. Don't make the mistake of generating a real USBMap.kext, that is for the final step only. Mount your EFI and Show Contents of the dummy USBMap.kext you are already using, and drag the Info.plist from that to USBMapInjectorEdit. All ports will be shown enabled... disable all the ones you named EXCEPT for the 1 or 2 you are using for keyboard and mouse. Quit the program, it will save it automatically. Now reboot.

Now when you run USBMap again, you should see a whole bunch of new ports which weren't there before because they were over the 15 port limit. Go through all the ports again like before, USB 3 devices should start registering (at least for me, the USB 3 ports were all the higher number ports). Name them the same labels you gave the same ports in 2.0 mode. When you are done you should have discovered all the ports in both USB 2.0 and USB 3 mode.

Now fix the types for the ports, including setting whatever Bluetooth is on to type 255. You will most likely be over the 15 port limit, so now you can choose what to disable. One thing that no one seems to mention is that USB 2.0 and USB 3 on the same physical port counts as 2 ports. So you don't need to disable whole ports. I had 18 ports when I was done mapping, and I decided to turn 2 physical ports into USB 3 only and one into USB 2.0 only, which took it down to 15 total. When you have everything the way you like it, you can now generate the real USBMap.kext and replace the dummy in your EFI.

That's, it. It should now work properly when you reboot. Another important thing to know is if you want to change what you disabled, you can drag your Info.plist from the new kext on your EFI into USBMapInjectorEdit any time.

I hope this helps anyone who was stuck like I was. Don't give up and resort to using USBToolBox on Windows. I did that at first and it turned my ports into a complete disaster. That program is not effective in doing this as it doesn't behave at all like how MacOS does and you'll have to disable entire physical ports, and it still won't work right in the end.

USBMap is genius. Finally all my ports work for the first time since building this machine.

corpnewt commented 1 year ago

I'm sorry that you found the quickstart guide to be insufficient - I've been in a bit of a slump with writing full featured guides/documentation the last few years. I'm glad you were able to figure it out though.

-CorpNewt

Spoolingturbo6 commented 1 year ago

thank you so much miranda . I joined GitHub just to post this =-)

williamcorney commented 10 months ago

I am trying to follow the instructions but running into a little difficulty

Create USBMAPdummy.kext, place in the kexts folder and update config.plist and reboot ✅ Ports show now as UKxx ( eg. 01,02) as the guide suggests ✅ Use USBmapinjectoredit.command to disable all ports except keyboard/mouse and reboot ✅ I can see now that only the port for keyboard/ mouse is enabled - in my case this is the port for the integrated Broadcom bluetooth/wifi card. Port set to type 255 ✅. I use an apple Magic Keyboard/mouse

The bit I am stuck on is that having now done all the above - the guide says to run USBmap.command, discover ports and make my final selection - however the only port which appears is the one port mentioned above - even when press discover. 🤷‍♂️

It seems sensible that only the one port would show as the usbmapdummy kext is in place and it was configured for just this port. However the guide doesn't say anything about removing the kext before proceeding to make final usb port selection with USBmap.command

I've included a few relevant screenshots below

image

image

image

image

image

Spoolingturbo6 commented 10 months ago

The bit I am stuck on is that having now done all the above - the guide says to run USBmap.command, discover ports and make my final selection - however the only port which appears is the one port mentioned above - even when press discover. 🤷‍♂️

You need to run the command , press D, and then plug/unplug a device into each port/ a USB2.0, USB3.0, & USB Type-C. into each of the ports on your motherboard. on USC C make sure to turn it 180* one way, then the other.

Bradamante3D commented 6 months ago

Same thing for me. I agree that the instructions are impossible to follow (I mean, "Run xyz.command on Windows"?). Just like Miranda I figured it out after a while, but the whole process just doesn't work. And I'd like to think I am an experienced hackintosher. This is with a GA-Z270N-Wifi in a CoolerMaster NR200P, which brings only two USB3 front ports via the standard USB3 front connector. Should be simple.

I can create the Dummy.kext, reboot with it, disable all ports expect for keyboard/mouse/bluetooth. Then reboot with the Dummy. However, when I then discover again only these few ports work, there are NO NEW PORTS:

Bildschirmfoto 2024-02-25 um 17 45 38

This all wouldn't be a problem for me, if there still was a Windows version. In the past I had 100% success rate on all kinds of builds (or was that USBToolMap?). Where did that Windows version go? No .bat file?

I don't want to be ungrateful for your work, but this whole process just doesn't work for me.

The bit I am stuck on is that having now done all the above - the guide says to run USBmap.command, discover ports and make my final selection - however the only port which appears is the one port mentioned above - even when press discover. 🤷‍♂️

corpnewt commented 6 months ago

disable all ports expect for keyboard/mouse/bluetooth

This is not correct. Per the quick start guide in the readme:

◦ Disable any of the first 15 port personalities that are not used for a keyboard or mouse - EVERYTHING ELSE in the first 15 can be disabled

You are not intended to disable all but those the kb and mouse attach to, just those within the first 15 personalities. The idea is to move the ones you've seen out of the way so you can see the others that were beyond the limit before.

-CorpNewt