Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

this doesnt work on my machine :( #2

Open
dm4uz3 opened this issue Sep 11, 2022 · 0 comments
Open

this doesnt work on my machine :( #2

dm4uz3 opened this issue Sep 11, 2022 · 0 comments

Comments

@dm4uz3
Copy link

dm4uz3 commented Sep 11, 2022

ok im at a loss here so tell me if you can help me out

*[main][~/Downloads/libusbd]$ ./build.sh
rm -f -- libusbd.dylib
clang -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -arch arm64 -O1 -Wall -g -fstack-protector-all -I include/ -I src/ -framework CoreFoundation -framework IOKit  -shared -Wl,-undefined -Wl,dynamic_lookup -lpthread -o libusbd.dylib src/libusbd.c src/plat/macos/impl.c src/plat/macos/alt_IOUSBDeviceControllerLib.c
src/libusbd.c:378:22: warning: unused variable 'pIface' [-Wunused-variable]
    libusbd_iface_t* pIface = &pCtx->aInterfaces[iface_num];
                     ^
1 warning generated.
src/plat/macos/impl.c:570:19: warning: unused variable 's_ret' [-Wunused-variable]
    kern_return_t s_ret;
                  ^
src/plat/macos/impl.c:572:19: warning: unused variable 'open_ret' [-Wunused-variable]
    kern_return_t open_ret;
                  ^
src/plat/macos/impl.c:671:19: warning: variable 's_ret' set but not used [-Wunused-but-set-variable]
    kern_return_t s_ret;
                  ^
src/plat/macos/impl.c:726:19: warning: variable 's_ret' set but not used [-Wunused-but-set-variable]
    kern_return_t s_ret;
                  ^
src/plat/macos/impl.c:728:19: warning: variable 'open_ret' set but not used [-Wunused-but-set-variable]
    kern_return_t open_ret;
                  ^
src/plat/macos/impl.c:897:19: warning: unused variable 'ret' [-Wunused-variable]
    kern_return_t ret = IOUSBDeviceInterface_CommitConfiguration(pImplCtx, iface_num); // TODO check
                  ^
src/plat/macos/impl.c:970:19: warning: unused variable 'ret' [-Wunused-variable]
    kern_return_t ret = IOUSBDeviceInterface_CreatePipe(pImplCtx, iface_num, type, direction, maxPktSize, interval, unk, pEpOut);
                  ^
src/plat/macos/impl.c:1015:17: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
        if (ret = libusbd_impl_iface_alloc_builtin_internal(pCtx, "AppleUSBNCMControl")) return ret;
            ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/plat/macos/impl.c:1015:17: note: place parentheses around the assignment to silence this warning
        if (ret = libusbd_impl_iface_alloc_builtin_internal(pCtx, "AppleUSBNCMControl")) return ret;
                ^
            (                                                                          )
src/plat/macos/impl.c:1015:17: note: use '==' to turn this assignment into an equality comparison
        if (ret = libusbd_impl_iface_alloc_builtin_internal(pCtx, "AppleUSBNCMControl")) return ret;
                ^
                ==
src/plat/macos/impl.c:1017:17: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
        if (ret = libusbd_impl_iface_alloc_builtin_internal(pCtx, "AppleUSBNCMData")) return ret;
            ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/plat/macos/impl.c:1017:17: note: place parentheses around the assignment to silence this warning
        if (ret = libusbd_impl_iface_alloc_builtin_internal(pCtx, "AppleUSBNCMData")) return ret;
                ^
            (                                                                       )
src/plat/macos/impl.c:1017:17: note: use '==' to turn this assignment into an equality comparison
        if (ret = libusbd_impl_iface_alloc_builtin_internal(pCtx, "AppleUSBNCMData")) return ret;
                ^
                ==
src/plat/macos/impl.c:1022:17: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
        if (ret = libusbd_impl_iface_alloc_builtin_internal(pCtx, name)) return ret;
            ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/plat/macos/impl.c:1022:17: note: place parentheses around the assignment to silence this warning
        if (ret = libusbd_impl_iface_alloc_builtin_internal(pCtx, name)) return ret;
                ^
            (                                                          )
src/plat/macos/impl.c:1022:17: note: use '==' to turn this assignment into an equality comparison
        if (ret = libusbd_impl_iface_alloc_builtin_internal(pCtx, name)) return ret;
                ^
                ==
10 warnings generated.
codesign -s - libusbd.dylib
*[main][~/Downloads/libusbd]$ cd examples/keyboard/ ; make clean && make && cp ./example_keyboard ../../ && cd ../../ && ./example_keyboard
rm -f -- example_keyboard
clang -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -arch arm64 -O1 -Wall -g -fstack-protector-all -isystem ../../include -framework CoreFoundation -framework IOKit  -L../.. -lusbd -o example_keyboard main.c
codesign -s - example_keyboard
libusbd macos: Start runloop
libusbd macos: Connecting to: 'IOService:/AppleARMPE/arm-io@10F00000/AppleT810xIO/usb-drd1@2280000/AppleT8103USBXDCI@0/gay_bowser_usbgadget'
[1]    2668 killed     ./example_keyboard
*[main][~/Downloads/libusbd]$

i've loaded the kext and i think that works fine ?? i dont know what to do now let me know if you have anything
macos 12.5 m1 air 2020
i've also changed usb-drd2 to usb-drd1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant