Posts

Post not yet marked as solved
3 Replies
664 Views
Is there any sample code for obtaining a Music User Token using the JSON web api directly, without using MusicKit? I am writing a utility in C++ to interact with Apple Music, and was not able to figure out how this works from the MusicKit or MusicKit for Android docs. Thank you.
Posted
by nealsid.
Last updated
.
Post not yet marked as solved
3 Replies
1.6k Views
I have a driver that is not much more than the sample code for a USB mouse. I am able to get the driver to match with my device (Logitech G600 mouse), and I can see logging inside my handleReport() function, but dispatchRelativePointerEvent does not seem to cause any effect, although it returns KERN_SUCCESS. I've tried it with both SUPERDISPATCH and without (it isn't clear to me if the superclass method needs to be called in the kernel or not in this case), and by subclassing both IOUserHIDEventService and IOUserHIDEventDriver. Below is my handleReport function. Thanks in advance for any assistance, and this is on macOS Ventura Beta 2 void G600Driver::handleReport(uint64_t timestamp,                               uint8_t *report,                               uint32_t reportLength,                               IOHIDReportType type,                               uint32_t reportID) {   kern_return_t kr = dispatchRelativePointerEvent(timestamp, -10, -10, 0, 0, SUPERDISPATCH);   DRLOG("ret: %d", kr); }```
Posted
by nealsid.
Last updated
.
Post not yet marked as solved
0 Replies
600 Views
I'm trying to gain some understanding of how mp_rendezvous works on x86, and I have a few questions: There are two variants, mp_rendezvous_no_intrs and mp_rendezvous. The first states that it disables interrupts during the execution of the requested function. However both boil down to mp_cpus_call1, which seems to disable interrupts for reasons not related to whether the "no_intrs" variant of mp_rendezvous was called (from osfmk/i386/mp.c), if the function is being called on cpus other than the master cpu: topo_lock = (cpus != cpu_to_cpumask(master_cpu)); if (topo_lock) { ml_set_interrupts_enabled(FALSE); (void) mp_safe_spin_lock(&x86_topo_lock); } Additionally interrupts seem to be disabled for the execution on the current CPU, as well: /* Call locally if mode not SYNC */ if (mode != SYNC && call_self) { KERNEL_DEBUG_CONSTANT( TRACE_MP_CPUS_CALL_LOCAL, VM_KERNEL_UNSLIDE(action_func), VM_KERNEL_UNSLIDE_OR_PERM(arg0), VM_KERNEL_UNSLIDE_OR_PERM(arg1), 0, 0); if (action_func != NULL) { ml_set_interrupts_enabled(FALSE); action_func(arg0, arg1); ml_set_interrupts_enabled(intrs_enabled); } } Finally, I noticed that if I have a function that is being called via mp_rendezvous, and trace it using DTrace, only the execution on the CPU that mp_rendezvous is called on hits the Dtrace probe. Is that because the other CPU's are executing the function on an interrupt thread when handling the IPI? Thank you, Neal
Posted
by nealsid.
Last updated
.
Post not yet marked as solved
0 Replies
1.2k Views
I'm wondering if anyone has done any work to make using Kernel headers inside Dtrace scripts possible when using its functionality to run the preprocessor over a D script. AFAICT, D's compiler won't compile clang built-ins, inline functions or extern "C" declarations, C++ constructs, etc. Thanks in advance.
Posted
by nealsid.
Last updated
.
Post marked as solved
4 Replies
738 Views
I'm trying to build a small toy MusicKit app on macOS Ventura (beta 4), and am running into something I think is probably an easy issue. I've started with the single-view application template, and have added a button, the target of which calls MusicKit methods: @IBAction func buttonPushed(_ sender: Any) {     Task {       let status = await MusicAuthorization.request()       switch status {       case .authorized:         print("auth")       case .restricted:         print("restricted")       case .notDetermined:         print("not determined")       case .denied:         print("denied")       @unknown default:         print("default")       }       print(MusicAuthorization.currentStatus)     } } I have added the NSAppleMusicUsageDescription key to the application's Info.plist However, I am always seeing that MusicAuthorization.request() returns denied with no prompt to the user for access. Thank you in advance.
Posted
by nealsid.
Last updated
.
Post marked as solved
2 Replies
1k Views
I'm debugging a USB DriverKit driver, and noticed the os_log messages during the kernel verification checks do not have a subsystem (not my driver's logging): { "traceID" : 44303244788367364, "eventMessage" : "DK: G600Driver-0x1002dd073: family entitlements check failed", "eventType" : "logEvent", "source" : null, "formatString" : "DK: %s-0x%qx: family entitlements check failed\n", "activityIdentifier" : 0, "subsystem" : "", "category" : "", "threadID" : 2655768, "senderImageUUID" : "198748B0-2858-345A-957A-45C9ACB4C2F2", "backtrace" : { "frames" : [ { "imageOffset" : 9007231, "imageUUID" : "198748B0-2858-345A-957A-45C9ACB4C2F2" } ] }, "bootUUID" : "", "processImagePath" : "\/kernel", "timestamp" : "2022-06-14 01:57:51.171906-0700", "senderImagePath" : "\/kernel", "machTimestamp" : 281599031530198, "messageType" : "Default", "processImageUUID" : "198748B0-2858-345A-957A-45C9ACB4C2F2", "processID" : 0, "senderProgramCounter" : 9007231, "parentActivityIdentifier" : 0, "timezoneName" : "" } Is there a recommended way (other than substring matching on the driver name) to create a predicate for filtering the log to messages relevant to my driver? Thanks.
Posted
by nealsid.
Last updated
.
Post not yet marked as solved
0 Replies
595 Views
Hello,I recently purchased a Mac Mini (my first Mac with T2) and wanted to see what was the right way to debug the kernel with a debug/development kernel that I may have missed. I disabled Secure Boot from Recovery Mode, but still found my debug/development kernel was not being picked up with the kcsuffix boot arg after I copied it into /System/Library/Kernels and invalidated the kext cache.What did work was to overwrite the immutablekernel file in the PrelnkKernels directory wih my debug/development kernel (I assumed that after I disabled Secure Boot it would not check the certificates or verify the integrity of the binar); is this the only way? Is kcsuffix no longer supported with Secure Boot?Thanks,Neal
Posted
by nealsid.
Last updated
.
Post not yet marked as solved
7 Replies
3k Views
Just installed 19A487l and I don't see my iCloud Desktop being synced. I tried various things like logging out and back into iCloud, toggling the Desktop sync option off and then back on, rebooting, etc. unfortunately with no change.Someone in another post suggested that adding certain system daemons to the Full Disk Access list in System Preferences -> Security & Privacy -> Privacy syspref would fix it, but when I click on the '+' button to try, System Preferences hangs. The best I could debug was correlate some messages in Console by timestamp to when I clicked on '+':error16:20:02.458461-0800diagnostics_agentInvalid receipt [0 bytes] -- [<private>]fault16:20:02.479769-0800cfprefsdAllowing process impersonation by process com.apple.appkit.xpc.openAndSav (909) despite not having the com.apple.private.defaults-impersonate entitlement due to it not being sandboxed. Please add com.apple.private.defaults-impersonate instead, this will stop working in the future.fault16:20:02.479798-0800cfprefsdAllowing process impersonation by process com.apple.appkit.xpc.openAndSav (909) despite not having the com.apple.private.defaults-impersonate entitlement due to it not being sandboxed. Please add com.apple.private.defaults-impersonate instead, this will stop working in the future.error16:20:02.576666-0800runningboarddCould not rationalize xpc service at: /System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/QuickLookUI.framework/Versions/A/XPCServices/QuickLookUIService.xpcerror16:20:02.579777-0800diagnostics_agentInvalid receipt [0 bytes] -- [<private>]error16:20:02.802223-0800dmdClient <private> does not have required com.apple.private.dmd.policy entitlementerror16:20:02.802402-0800com.apple.appkit.xpc.openAndSavePanelServiceCould not add registration: Error Domain=NSCocoaErrorDomain Code=4097 "connection to service on pid 0 named com.apple.dmd.policy" UserInfo={NSDebugDescription=connection to service on pid 0 named com.apple.dmd.policy}Also, when this happens, the following two processes are hung:com.apple.appkit.xpc.openAndSavePanelService (com.apple.preference.security.remoteservice (System Preferences)) (Not Responding)9.1 MB3216909***0.00.39(null)0.00.00No0 bytes0 bytes0 bytesNoNo(null)(null)No0 bytes0 bytes00-0 bytes0 bytes0 bytes0 bytesNoYescom.apple.preference.security.remoteservice (System Preferences) (Not Responding)35.4 MB5511902***0.02.54(null)0.00.00No0 bytes0 bytes0 bytesNoNo(null)(null)No0 bytes0 bytes00-0 bytes0 bytes0 bytes0 bytesNoYesThanks so much in advance for any suggestions or if you need more information let me know!Neal
Posted
by nealsid.
Last updated
.