Post

Replies

Boosts

Views

Activity

Reply to How to get access of Admin Submission/Completion queues for NVMe devices from any driver or user space application to submit Admin command ?
I had briefly seen this program before, and then I saw the flaws of this project. You cannot access your NVMe SSD through the file system in MacOS. You can only read and write your NVMe SSD through the NVMe test program written by IOUserUserClient. Such restrictions cannot meet the needs of ordinary users. Unless it evolves into /SCSIControllerDriverKit/IOUserSCSIParallelInterfaceController.
Topic: App & System Services SubTopic: Drivers Tags:
Nov ’24
Reply to Error of invalid code signature
This driver can load and execute on my Mac mini x86 MacOS 12.61 but got invalid of signature on my Mac mini arm64 MacOS13 Translated Report (Full Report Below) Incident Identifier: 41328A83-831A-4BF2-A78A-AACF4F5A5749 CrashReporter Key: 339C68DB-9000-8F1B-DD99-CCBFCD174A7D Hardware Model: Macmini9,1 Process: com.Areca.ArcMSRUserSpaceDriver [659] Path: /Library/SystemExtensions/*/com.Areca.ArcMSRUserSpaceDriver Identifier: com.Areca.ArcMSRUserSpaceDriver Version: 1.5.0 (1.5.0) Code Type: ARM-64 (Native) Role: Default Parent Process: launchd [1] Coalition: com.Areca.ArcMSRUserSpaceDriver [665] Date/Time: 2022-12-23 17:24:56.4811 +0800 Launch Time: 2022-12-23 17:24:56.3300 +0800 OS Version: macOS 13.0 (22A380) Release Type: User Report Version: 104 Exception Type: EXC_CRASH (SIGKILL (Code Signature Invalid)) Exception Codes: 0x0000000000000000, 0x0000000000000000 Termination Reason: CODESIGNING 1 Taskgated Invalid Signature Highlighted by Thread: 0 Backtrace not available No thread state (register information) available Binary Images: Binary images description not available Error Formulating Crash Report: dyld_process_info_create failed with 30 dyld_process_snapshot_get_shared_cache failed Failed to create CSSymbolicatorRef - corpse still valid ¯_(ツ)/¯ thread_get_state(PAGEIN) returned 0x10000003: (ipc/send) invalid destination port thread_get_state(EXCEPTION) returned 0x10000003: (ipc/send) invalid destination port thread_get_state(FLAVOR) returned 0x10000003: (ipc/send) invalid destination port EOF Full Report {"app_name":"com.Areca.ArcMSRUserSpaceDriver","timestamp":"2022-12-23 17:24:59.00 +0800","app_version":"1.5.0","slice_uuid":"cff72877-de1e-3ebc-87d0-139ac20f975d","build_version":"1.5.0","platform":0,"bundleID":"com.Areca.ArcMSRUserSpaceDriver","share_with_app_devs":0,"is_first_party":1,"bug_type":"309","os_version":"macOS 13.0 (22A380)","roots_installed":0,"name":"com.Areca.ArcMSRUserSpaceDriver","incident_id":"41328A83-831A-4BF2-A78A-AACF4F5A5749"} { "uptime" : 48, "procRole" : "Default", "version" : 2, "userID" : 270, "deployVersion" : 210, "modelCode" : "Macmini9,1", "coalitionID" : 665, "osVersion" : { "train" : "macOS 13.0", "build" : "22A380", "releaseType" : "User" }, "captureTime" : "2022-12-23 17:24:56.4811 +0800", "incident" : "41328A83-831A-4BF2-A78A-AACF4F5A5749", "pid" : 659, "translated" : false, "cpuType" : "ARM-64", "roots_installed" : 0, "bug_type" : "309", "procLaunch" : "2022-12-23 17:24:56.3300 +0800", "procStartAbsTime" : 1154811220, "procExitAbsTime" : 1158430980, "procName" : "com.Areca.ArcMSRUserSpaceDriver", "procPath" : "/Library/SystemExtensions/*/com.Areca.ArcMSRUserSpaceDriver", "bundleInfo" : {"CFBundleShortVersionString":"1.5.0","CFBundleVersion":"1.5.0","CFBundleIdentifier":"com.Areca.ArcMSRUserSpaceDriver"}, "parentProc" : "launchd", "parentPid" : 1, "coalitionName" : "com.Areca.ArcMSRUserSpaceDriver", "crashReporterKey" : "339C68DB-9000-8F1B-DD99-CCBFCD174A7D", "sip" : "disabled", "exception" : {"codes":"0x0000000000000000, 0x0000000000000000","rawCodes":[0,0],"type":"EXC_CRASH","signal":"SIGKILL (Code Signature Invalid)"}, "termination" : {"flags":66,"code":1,"namespace":"CODESIGNING","indicator":"Taskgated Invalid Signature"}, "extMods" : {"caller":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"system":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"targeted":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"warnings":0}, "legacyInfo" : { "threadHighlighted" : 0 }, "reportNotes" : [ "dyld_process_info_create failed with 30", "dyld_process_snapshot_get_shared_cache failed", "Failed to create CSSymbolicatorRef - corpse still valid ¯\(ツ)_/¯", "thread_get_state(PAGEIN) returned 0x10000003: (ipc/send) invalid destination port", "thread_get_state(EXCEPTION) returned 0x10000003: (ipc/send) invalid destination port", "thread_get_state(FLAVOR) returned 0x10000003: (ipc/send) invalid destination port" ] }
Topic: Programming Languages SubTopic: Swift Tags:
Dec ’22
Reply to Can Xcode DriverKit library include kern/clock.h?
CLOCK_REALTIME 0 ==> System-wide real-time clock. This clock is supported by all implementations and returns the number of seconds and nanoseconds since the Epoch. Type of a clock value from clock_gettime_nsec_np(CLOCK_REALTIME). Equivalent to a value from gettimeofday() in nanoseconds. ==> clock_get_calendar_microtime(&currentTime_sec, &currentTime_usec)
Topic: App & System Services SubTopic: Drivers Tags:
Dec ’22
Reply to How to access dmaaddress (Physical Address) in DriverKit?
IODMACommandSpecification dmaSpecification; IOAddressSegment dma_physical_address_segment = {0}; IOAddressSegment dma_virtual_address_segment; uint64_t offset, uncached_resource_size, dma_res_Phys, dmaFlags = kIOMemoryDirectionInOut; uint32_t dmaSegmentCount = 1;/* for get Physical Address, we need only one large Segment */ if(IOBufferMemoryDescriptor::Create(kIOMemoryDirectionInOut, uncached_resource_size /* capacity */, 256 /* alignment */, &ivars->dma_resource_descriptor) != kIOReturnSuccess) { return false; } /* ************************************************************************ ** IOBufferMemoryDescriptor have capacity allocated at Create() ** but no valid data until set with this method. ************************************************************************ */ if(ivars->dma_resource_descriptor->SetLength(uncached_resource_size) != kIOReturnSuccess) { return false; } if(ivars->dma_resource_descriptor->GetAddressRange(&dma_virtual_address_segment) != kIOReturnSuccess) { return false; } /* */ bzero(&dmaSpecification, sizeof(dmaSpecification)); dmaSpecification.options = kIODMACommandSpecificationNoOptions; dmaSpecification.maxAddressBits = 64; if(IODMACommand::Create(ivars->pciDevice, kIODMACommandCreateNoOptions, &dmaSpecification, &ivars->dma_resource_iodmacommand) != kIOReturnSuccess) { return false; } if(ivars->dma_resource_iodmacommand->PrepareForDMA(kIODMACommandPrepareForDMANoOptions, ivars->dma_resource_descriptor, 0/*offset*/, uncached_resource_size/*length*/, &dmaFlags, &dmaSegmentCount, &dma_physical_address_segment) != kIOReturnSuccess) { return false; } /* */ dma_res_Phys = (uint64_t)dma_physical_address_segment.address; dma_res->Physical_Address.parts.low = (uint32_t)(dma_res_Phys & 0xFFFFFFFF); dma_res->Physical_Address.parts.high = (uint32_t)(dma_res_Phys >> 32); /* */ dma_res->Virtual_Address = reinterpret_cast <uint8_t *> (dma_virtual_address_segment.address);
Topic: App & System Services SubTopic: Drivers Tags:
Dec ’22
Reply to SCSIControllerDriverKit: Process gets stuck on UserCreateTargetForID.
/* ** UserGetDataBuffer */ if(parallelTask.fCommandDescriptorBlock[0] == SCSI_CMD_INQUIRY) { IOBufferMemoryDescriptor *data_buffer_memory_descriptor = nullptr; /* ****************************************************************************************************************************************** ** virtual kern_return_t UserGetDataBuffer(SCSIDeviceIdentifier fTargetID, uint64_t fControllerTaskIdentifier, IOBufferMemoryDescriptor **buffer); ****************************************************************************************************************************************** */ if((UserGetDataBuffer(parallelTask.fTargetID, parallelTask.fControllerTaskIdentifier, &data_buffer_memory_descriptor) == kIOReturnSuccess) && (data_buffer_memory_descriptor != NULL)) { IOAddressSegment data_buffer_virtual_address_segment = {0}; if(data_buffer_memory_descriptor->GetAddressRange(&data_buffer_virtual_address_segment) == kIOReturnSuccess) { IOAddressSegment data_buffer_physical_address_segment = {0}; IODMACommandSpecification dmaSpecification; IODMACommand *data_buffer_iodmacommand = {0}; bzero(&dmaSpecification, sizeof(dmaSpecification)); dmaSpecification.options = kIODMACommandSpecificationNoOptions; dmaSpecification.maxAddressBits = 64; if(IODMACommand::Create(ivars->pciDevice, kIODMACommandCreateNoOptions, &dmaSpecification, &data_buffer_iodmacommand) == kIOReturnSuccess) { uint64_t dmaFlags = kIOMemoryDirectionInOut; uint32_t dmaSegmentCount = 1; pCCB->data_buffer_iodmacommand = data_buffer_iodmacommand; if(data_buffer_iodmacommand->PrepareForDMA(kIODMACommandPrepareForDMANoOptions, data_buffer_memory_descriptor, 0/*offset*/, parallelTask.fRequestedTransferCount/*length*/, &dmaFlags, &dmaSegmentCount, &data_buffer_physical_address_segment) == kIOReturnSuccess) { parallelTask.fBufferIOVMAddr = (uint64_t)data_buffer_physical_address_segment.address; /* data_buffer_physical_address: overwrite original fBufferIOVMAddr */ pCCB->OSDataBuffer = reinterpret_cast <uint8_t *> (data_buffer_virtual_address_segment.address);/* data_buffer_virtual_address */ } } } } } in command completion stage response.fBytesTransferred = dataxferlen; response.version = kScsiUserParallelTaskResponseCurrentVersion1; response.fTargetID = TARGETLUN2SCSITARGET(TargetID, 0); response.fControllerTaskIdentifier = pCCB->fControllerTaskIdentifier; response.fCompletionStatus = taskStatus; response.fServiceResponse = serviceResponse; response.fSenseLength = taskStatus; IOUserSCSIParallelInterfaceController::ParallelTaskCompletion(pCCB->completion, response); pCCB->completion->release(); pCCB->completion = NULL; pCCB->ccb_flags.start = 0;/reset startdone for outstanding ccb check/ if(pCCB->data_buffer_iodmacommand != NULL) { pCCB->data_buffer_iodmacommand->CompleteDMA(kIODMACommandCompleteDMANoOptions); OSSafeReleaseNULL(pCCB->data_buffer_iodmacommand); // pCCB->data_buffer_iodmacommand->free(); pCCB->data_buffer_iodmacommand = NULL; pCCB->OSDataBuffer = NULL; }
Topic: App & System Services SubTopic: Drivers Tags:
Nov ’22
Reply to SCSIControllerDriverKit: Process gets stuck on UserCreateTargetForID.
My project is hardware raid 'user space driver' . My driver has now completed the io stress test. Your problem should be in the SCSI command with data transfer. And you want to send data to the system by your software driver to complete the SCSI ' inquiry ' command. I think you also used 'UserGetDataBuffer'. It seems to be some distance from iokit's function.
Topic: App & System Services SubTopic: Drivers Tags:
Oct ’22
Reply to Is Bug of DriverKit SetPowerState?
arcmsr_debug_print("ArcMSRUserSpaceDriver %d: ********************************************************************** \n", ivars->adapter_index); arcmsr_debug_print("ArcMSRUserSpaceDriver %d: ** 【Get system status notification service】 \n", ivars->adapter_index); arcmsr_debug_print("ArcMSRUserSpaceDriver %d: ** Call this function to get system "shutdown or restart" notification \n", ivars->adapter_index); arcmsr_debug_print("ArcMSRUserSpaceDriver %d: ** If our driver gets this service \n", ivars->adapter_index); arcmsr_debug_print("ArcMSRUserSpaceDriver %d: ** It will cause our IMPL (ArcMSRUserSpaceDriver, Stop) \n", ivars->adapter_index); arcmsr_debug_print("ArcMSRUserSpaceDriver %d: ** to be called during the system "shutdown or restart" phase \n", ivars->adapter_index); arcmsr_debug_print("ArcMSRUserSpaceDriver %d: ********************************************************************** \n", ivars->adapter_index); /* ************************************************************************************************************** ** ** If your system is MacOS11.52 . ** This Function would cause IOSerrvice::ClientCrashed(IOService * client, uint64_t options); ** This Function could supported from MacOS12.03 , ready for shutdown and restart notification from MacOS12.60 ** ** =========================================================================================== ** Obtain the system state notification service ** ** To Let our Stop() is called when the system shuts down or restarts. ** ** IOServiceStateNotificationDispatchSource for got "System Shutdown or Restart Notify" ** ** this function "StateNotificationItemCopy" should be call ** ** values for OSNumber kIOSystemStateHaltDescriptionKey:kIOSystemStateHaltDescriptionHaltStateKey ** ** enum ** { ** kIOServiceHaltStatePowerOff = 0x00000001, ** kIOServiceHaltStateRestart = 0x00000002, ** }; ** ** virtual kern_return_t StateNotificationItemCopy(OSString * itemName, OSDictionary ** value); ** ************************************************************************************************************** */ if(IOService::CopySystemStateNotificationService(&ivars->ArcmsrSystemStateNotificationService) != kIOReturnSuccess)/* Register the service with the system. Obtain the system state notification service */ { goto initialize_fail; }
Topic: App & System Services SubTopic: Drivers Tags:
Oct ’22
Reply to Error of invalid code signature
I have the same problem as you After a few experiences I just realized that this is because I use the same hard drive to compile my project programs back and forth between MacOS X86 / ARM64(M1) Such behavior leads to Exception Type: EXC_CRASH (SIGKILL (Code Signature Invalid))
Topic: Programming Languages SubTopic: Swift Tags:
Oct ’22
Reply to xCode running in external ssd/nvme
Yes You can. I do this for a long time
Replies
Boosts
Views
Activity
Nov ’24
Reply to How to get access of Admin Submission/Completion queues for NVMe devices from any driver or user space application to submit Admin command ?
I had briefly seen this program before, and then I saw the flaws of this project. You cannot access your NVMe SSD through the file system in MacOS. You can only read and write your NVMe SSD through the NVMe test program written by IOUserUserClient. Such restrictions cannot meet the needs of ordinary users. Unless it evolves into /SCSIControllerDriverKit/IOUserSCSIParallelInterfaceController.
Topic: App & System Services SubTopic: Drivers Tags:
Replies
Boosts
Views
Activity
Nov ’24
Reply to "How to" for dext distribution
I encountered the same problem as you and the same error message. I started an Apple DTS to ask for a solution, but so far I have only received a reply from the Apple robot. I use Xcode16, and Xcode16.1 but there is no difference.
Replies
Boosts
Views
Activity
Oct ’24
Reply to Unsatisfied entitlements when moving to macOS13
I got the same bug as yours, my project compiles and runs just fine in MacOS12.6 but upon moving to MacOS13.  I am now getting the error: Unsatisfied entitlements: com.apple.developer.driverkit.transport.pci
Topic: Code Signing SubTopic: Entitlements Tags:
Replies
Boosts
Views
Activity
Mar ’23
Reply to macOS application crashes on start
I got the same error as yours on my project. But until now I couldn't get any solution from Apple. MacMini x86_64 macOS Venture 13.2 Xcode 14.2
Topic: Code Signing SubTopic: General Tags:
Replies
Boosts
Views
Activity
Mar ’23
Reply to Error Formulating Crash Report: dyld_process_snapshot_get_shared_cache failed
I got the same error as yours on my project. But until now I couldn't get any solution from Apple. MacMini x86_64 macOS Venture 13.2 Xcode 14.2
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Mar ’23
Reply to Error of invalid code signature
This driver can load and execute on my Mac mini x86 MacOS 12.61 but got invalid of signature on my Mac mini arm64 MacOS13 Translated Report (Full Report Below) Incident Identifier: 41328A83-831A-4BF2-A78A-AACF4F5A5749 CrashReporter Key: 339C68DB-9000-8F1B-DD99-CCBFCD174A7D Hardware Model: Macmini9,1 Process: com.Areca.ArcMSRUserSpaceDriver [659] Path: /Library/SystemExtensions/*/com.Areca.ArcMSRUserSpaceDriver Identifier: com.Areca.ArcMSRUserSpaceDriver Version: 1.5.0 (1.5.0) Code Type: ARM-64 (Native) Role: Default Parent Process: launchd [1] Coalition: com.Areca.ArcMSRUserSpaceDriver [665] Date/Time: 2022-12-23 17:24:56.4811 +0800 Launch Time: 2022-12-23 17:24:56.3300 +0800 OS Version: macOS 13.0 (22A380) Release Type: User Report Version: 104 Exception Type: EXC_CRASH (SIGKILL (Code Signature Invalid)) Exception Codes: 0x0000000000000000, 0x0000000000000000 Termination Reason: CODESIGNING 1 Taskgated Invalid Signature Highlighted by Thread: 0 Backtrace not available No thread state (register information) available Binary Images: Binary images description not available Error Formulating Crash Report: dyld_process_info_create failed with 30 dyld_process_snapshot_get_shared_cache failed Failed to create CSSymbolicatorRef - corpse still valid ¯_(ツ)/¯ thread_get_state(PAGEIN) returned 0x10000003: (ipc/send) invalid destination port thread_get_state(EXCEPTION) returned 0x10000003: (ipc/send) invalid destination port thread_get_state(FLAVOR) returned 0x10000003: (ipc/send) invalid destination port EOF Full Report {"app_name":"com.Areca.ArcMSRUserSpaceDriver","timestamp":"2022-12-23 17:24:59.00 +0800","app_version":"1.5.0","slice_uuid":"cff72877-de1e-3ebc-87d0-139ac20f975d","build_version":"1.5.0","platform":0,"bundleID":"com.Areca.ArcMSRUserSpaceDriver","share_with_app_devs":0,"is_first_party":1,"bug_type":"309","os_version":"macOS 13.0 (22A380)","roots_installed":0,"name":"com.Areca.ArcMSRUserSpaceDriver","incident_id":"41328A83-831A-4BF2-A78A-AACF4F5A5749"} { "uptime" : 48, "procRole" : "Default", "version" : 2, "userID" : 270, "deployVersion" : 210, "modelCode" : "Macmini9,1", "coalitionID" : 665, "osVersion" : { "train" : "macOS 13.0", "build" : "22A380", "releaseType" : "User" }, "captureTime" : "2022-12-23 17:24:56.4811 +0800", "incident" : "41328A83-831A-4BF2-A78A-AACF4F5A5749", "pid" : 659, "translated" : false, "cpuType" : "ARM-64", "roots_installed" : 0, "bug_type" : "309", "procLaunch" : "2022-12-23 17:24:56.3300 +0800", "procStartAbsTime" : 1154811220, "procExitAbsTime" : 1158430980, "procName" : "com.Areca.ArcMSRUserSpaceDriver", "procPath" : "/Library/SystemExtensions/*/com.Areca.ArcMSRUserSpaceDriver", "bundleInfo" : {"CFBundleShortVersionString":"1.5.0","CFBundleVersion":"1.5.0","CFBundleIdentifier":"com.Areca.ArcMSRUserSpaceDriver"}, "parentProc" : "launchd", "parentPid" : 1, "coalitionName" : "com.Areca.ArcMSRUserSpaceDriver", "crashReporterKey" : "339C68DB-9000-8F1B-DD99-CCBFCD174A7D", "sip" : "disabled", "exception" : {"codes":"0x0000000000000000, 0x0000000000000000","rawCodes":[0,0],"type":"EXC_CRASH","signal":"SIGKILL (Code Signature Invalid)"}, "termination" : {"flags":66,"code":1,"namespace":"CODESIGNING","indicator":"Taskgated Invalid Signature"}, "extMods" : {"caller":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"system":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"targeted":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"warnings":0}, "legacyInfo" : { "threadHighlighted" : 0 }, "reportNotes" : [ "dyld_process_info_create failed with 30", "dyld_process_snapshot_get_shared_cache failed", "Failed to create CSSymbolicatorRef - corpse still valid ¯\(ツ)_/¯", "thread_get_state(PAGEIN) returned 0x10000003: (ipc/send) invalid destination port", "thread_get_state(EXCEPTION) returned 0x10000003: (ipc/send) invalid destination port", "thread_get_state(FLAVOR) returned 0x10000003: (ipc/send) invalid destination port" ] }
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Dec ’22
Reply to Can Xcode DriverKit library include kern/clock.h?
CLOCK_REALTIME 0 ==> System-wide real-time clock. This clock is supported by all implementations and returns the number of seconds and nanoseconds since the Epoch. Type of a clock value from clock_gettime_nsec_np(CLOCK_REALTIME). Equivalent to a value from gettimeofday() in nanoseconds. ==> clock_get_calendar_microtime(&currentTime_sec, &currentTime_usec)
Topic: App & System Services SubTopic: Drivers Tags:
Replies
Boosts
Views
Activity
Dec ’22
Reply to How to access dmaaddress (Physical Address) in DriverKit?
IODMACommandSpecification dmaSpecification; IOAddressSegment dma_physical_address_segment = {0}; IOAddressSegment dma_virtual_address_segment; uint64_t offset, uncached_resource_size, dma_res_Phys, dmaFlags = kIOMemoryDirectionInOut; uint32_t dmaSegmentCount = 1;/* for get Physical Address, we need only one large Segment */ if(IOBufferMemoryDescriptor::Create(kIOMemoryDirectionInOut, uncached_resource_size /* capacity */, 256 /* alignment */, &ivars->dma_resource_descriptor) != kIOReturnSuccess) { return false; } /* ************************************************************************ ** IOBufferMemoryDescriptor have capacity allocated at Create() ** but no valid data until set with this method. ************************************************************************ */ if(ivars->dma_resource_descriptor->SetLength(uncached_resource_size) != kIOReturnSuccess) { return false; } if(ivars->dma_resource_descriptor->GetAddressRange(&dma_virtual_address_segment) != kIOReturnSuccess) { return false; } /* */ bzero(&dmaSpecification, sizeof(dmaSpecification)); dmaSpecification.options = kIODMACommandSpecificationNoOptions; dmaSpecification.maxAddressBits = 64; if(IODMACommand::Create(ivars->pciDevice, kIODMACommandCreateNoOptions, &dmaSpecification, &ivars->dma_resource_iodmacommand) != kIOReturnSuccess) { return false; } if(ivars->dma_resource_iodmacommand->PrepareForDMA(kIODMACommandPrepareForDMANoOptions, ivars->dma_resource_descriptor, 0/*offset*/, uncached_resource_size/*length*/, &dmaFlags, &dmaSegmentCount, &dma_physical_address_segment) != kIOReturnSuccess) { return false; } /* */ dma_res_Phys = (uint64_t)dma_physical_address_segment.address; dma_res->Physical_Address.parts.low = (uint32_t)(dma_res_Phys & 0xFFFFFFFF); dma_res->Physical_Address.parts.high = (uint32_t)(dma_res_Phys >> 32); /* */ dma_res->Virtual_Address = reinterpret_cast <uint8_t *> (dma_virtual_address_segment.address);
Topic: App & System Services SubTopic: Drivers Tags:
Replies
Boosts
Views
Activity
Dec ’22
Reply to SCSIControllerDriverKit: Process gets stuck on UserCreateTargetForID.
/* ** UserGetDataBuffer */ if(parallelTask.fCommandDescriptorBlock[0] == SCSI_CMD_INQUIRY) { IOBufferMemoryDescriptor *data_buffer_memory_descriptor = nullptr; /* ****************************************************************************************************************************************** ** virtual kern_return_t UserGetDataBuffer(SCSIDeviceIdentifier fTargetID, uint64_t fControllerTaskIdentifier, IOBufferMemoryDescriptor **buffer); ****************************************************************************************************************************************** */ if((UserGetDataBuffer(parallelTask.fTargetID, parallelTask.fControllerTaskIdentifier, &data_buffer_memory_descriptor) == kIOReturnSuccess) && (data_buffer_memory_descriptor != NULL)) { IOAddressSegment data_buffer_virtual_address_segment = {0}; if(data_buffer_memory_descriptor->GetAddressRange(&data_buffer_virtual_address_segment) == kIOReturnSuccess) { IOAddressSegment data_buffer_physical_address_segment = {0}; IODMACommandSpecification dmaSpecification; IODMACommand *data_buffer_iodmacommand = {0}; bzero(&dmaSpecification, sizeof(dmaSpecification)); dmaSpecification.options = kIODMACommandSpecificationNoOptions; dmaSpecification.maxAddressBits = 64; if(IODMACommand::Create(ivars->pciDevice, kIODMACommandCreateNoOptions, &dmaSpecification, &data_buffer_iodmacommand) == kIOReturnSuccess) { uint64_t dmaFlags = kIOMemoryDirectionInOut; uint32_t dmaSegmentCount = 1; pCCB->data_buffer_iodmacommand = data_buffer_iodmacommand; if(data_buffer_iodmacommand->PrepareForDMA(kIODMACommandPrepareForDMANoOptions, data_buffer_memory_descriptor, 0/*offset*/, parallelTask.fRequestedTransferCount/*length*/, &dmaFlags, &dmaSegmentCount, &data_buffer_physical_address_segment) == kIOReturnSuccess) { parallelTask.fBufferIOVMAddr = (uint64_t)data_buffer_physical_address_segment.address; /* data_buffer_physical_address: overwrite original fBufferIOVMAddr */ pCCB->OSDataBuffer = reinterpret_cast <uint8_t *> (data_buffer_virtual_address_segment.address);/* data_buffer_virtual_address */ } } } } } in command completion stage response.fBytesTransferred = dataxferlen; response.version = kScsiUserParallelTaskResponseCurrentVersion1; response.fTargetID = TARGETLUN2SCSITARGET(TargetID, 0); response.fControllerTaskIdentifier = pCCB->fControllerTaskIdentifier; response.fCompletionStatus = taskStatus; response.fServiceResponse = serviceResponse; response.fSenseLength = taskStatus; IOUserSCSIParallelInterfaceController::ParallelTaskCompletion(pCCB->completion, response); pCCB->completion->release(); pCCB->completion = NULL; pCCB->ccb_flags.start = 0;/reset startdone for outstanding ccb check/ if(pCCB->data_buffer_iodmacommand != NULL) { pCCB->data_buffer_iodmacommand->CompleteDMA(kIODMACommandCompleteDMANoOptions); OSSafeReleaseNULL(pCCB->data_buffer_iodmacommand); // pCCB->data_buffer_iodmacommand->free(); pCCB->data_buffer_iodmacommand = NULL; pCCB->OSDataBuffer = NULL; }
Topic: App & System Services SubTopic: Drivers Tags:
Replies
Boosts
Views
Activity
Nov ’22
Reply to Where is SCSIControllerDriverKit now?
My project is hardware raid 'user space driver' . My driver has now completed the io stress test. All of you can work at MacOS12.6 and Xcode13.21
Topic: App & System Services SubTopic: Drivers Tags:
Replies
Boosts
Views
Activity
Oct ’22
Reply to SCSIControllerDriverKit: Process gets stuck on UserCreateTargetForID.
My project is hardware raid 'user space driver' . My driver has now completed the io stress test. Your problem should be in the SCSI command with data transfer. And you want to send data to the system by your software driver to complete the SCSI ' inquiry ' command. I think you also used 'UserGetDataBuffer'. It seems to be some distance from iokit's function.
Topic: App & System Services SubTopic: Drivers Tags:
Replies
Boosts
Views
Activity
Oct ’22
Reply to Is Bug of DriverKit SetPowerState?
arcmsr_debug_print("ArcMSRUserSpaceDriver %d: ********************************************************************** \n", ivars->adapter_index); arcmsr_debug_print("ArcMSRUserSpaceDriver %d: ** 【Get system status notification service】 \n", ivars->adapter_index); arcmsr_debug_print("ArcMSRUserSpaceDriver %d: ** Call this function to get system "shutdown or restart" notification \n", ivars->adapter_index); arcmsr_debug_print("ArcMSRUserSpaceDriver %d: ** If our driver gets this service \n", ivars->adapter_index); arcmsr_debug_print("ArcMSRUserSpaceDriver %d: ** It will cause our IMPL (ArcMSRUserSpaceDriver, Stop) \n", ivars->adapter_index); arcmsr_debug_print("ArcMSRUserSpaceDriver %d: ** to be called during the system "shutdown or restart" phase \n", ivars->adapter_index); arcmsr_debug_print("ArcMSRUserSpaceDriver %d: ********************************************************************** \n", ivars->adapter_index); /* ************************************************************************************************************** ** ** If your system is MacOS11.52 . ** This Function would cause IOSerrvice::ClientCrashed(IOService * client, uint64_t options); ** This Function could supported from MacOS12.03 , ready for shutdown and restart notification from MacOS12.60 ** ** =========================================================================================== ** Obtain the system state notification service ** ** To Let our Stop() is called when the system shuts down or restarts. ** ** IOServiceStateNotificationDispatchSource for got "System Shutdown or Restart Notify" ** ** this function "StateNotificationItemCopy" should be call ** ** values for OSNumber kIOSystemStateHaltDescriptionKey:kIOSystemStateHaltDescriptionHaltStateKey ** ** enum ** { ** kIOServiceHaltStatePowerOff = 0x00000001, ** kIOServiceHaltStateRestart = 0x00000002, ** }; ** ** virtual kern_return_t StateNotificationItemCopy(OSString * itemName, OSDictionary ** value); ** ************************************************************************************************************** */ if(IOService::CopySystemStateNotificationService(&ivars->ArcmsrSystemStateNotificationService) != kIOReturnSuccess)/* Register the service with the system. Obtain the system state notification service */ { goto initialize_fail; }
Topic: App & System Services SubTopic: Drivers Tags:
Replies
Boosts
Views
Activity
Oct ’22
Reply to Error of invalid code signature
I have the same problem as you After a few experiences I just realized that this is because I use the same hard drive to compile my project programs back and forth between MacOS X86 / ARM64(M1) Such behavior leads to Exception Type: EXC_CRASH (SIGKILL (Code Signature Invalid))
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Oct ’22
Reply to help needed for signing certificate for Developer ID Application.
My project can be compiled on other operating systems But there are some systems that have the same problem as you
Topic: Code Signing SubTopic: General Tags:
Replies
Boosts
Views
Activity
Sep ’22