Post

Replies

Boosts

Views

Activity

Reply to How to use DriverKit for transmission of network data packets?
I'm also trying to make a network device driver using NetworkingDriverKit. It seems to success a making queues, but I couldn't found any packet transmissions by my driver. Logs of my driver in initialization as following.   default 10:29:43.107556+0900  kernel Found class: nictest   default 10:29:43.109040+0900  kernel init method is called   default 10:29:43.109380+0900  kernel Hello World at start   default 10:29:43.114891+0900  kernel net dext: IOUserNetworkPacketBufferPool::Create(this, "pool", packet_count, buffer_count, buffer_size, &pool);   default 10:29:43.115073+0900  kernel net dext: IOUserNetworkTxSubmissionQueue::Create(pool, this, packet_count, 0, dispatch_queue, &tx_sub_queue);   default 10:29:43.115077+0900  kernel net dext: sub_queue->CopyDataQueue(&ivars->tx_sub_dsource)   default 10:29:43.115098+0900  kernel net dext: CreateActionTxSubAvailable(sizeof (void*), &ivars->tx_sub_action);   default 10:29:43.115107+0900  kernel net dext: ivars->tx_sub_dsource->SetDataAvailableHandler(ivars->tx_sub_action);   default 10:29:43.115112+0900  kernel net dext: ivars->tx_sub_dsource->SetEnable(true);   default 10:29:43.115119+0900  kernel net dext: tx_sub_queue->SetEnable(true)   default 10:29:43.115226+0900  kernel net dext: IOUserNetworkTxCompletionQueue::Create(pool, this, packet_count, 0, dispatch_queue, &com_queue);   default 10:29:43.115230+0900  kernel net dext: tx_com_queue->CopyDataQueue(&ivars->tx_com_dsource);   default 10:29:43.115247+0900  kernel net dext: CreateActionTxComDataServiced(sizeof (void*), &ivars->tx_com_action);   default 10:29:43.115251+0900  kernel net dext: ivars->tx_com_dsource->SetDataAvailableHandler(ivars->tx_com_action);   default 10:29:43.115253+0900  kernel net dext: ivars->tx_com_dsource->SetEnable(true);   default 10:29:43.115257+0900  kernel net dext: tx_com_queue->SetEnable(true);   default 10:29:43.115381+0900  kernel net dext: IOUserNetworkRxSubmissionQueue::Create(pool, this, packet_count, 0, dispatch_queue, &rx_sub_queue);   default 10:29:43.115385+0900  kernel net dext: rx_sub_queue->CopyDataQueue(&ivars->rx_sub_dsource);   default 10:29:43.115401+0900  kernel net dext: CreateActionRxSubAvailable(sizeof (void*), &ivars->rx_sub_action);   default 10:29:43.115406+0900  kernel net dext: ivars->rx_sub_dsource->SetDataAvailableHandler(ivars->rx_sub_action);   default 10:29:43.115408+0900  kernel net dext: ivars->rx_sub_dsource->SetEnable(true);   default 10:29:43.115416+0900  kernel net dext: rx_sub_queue->SetEnable(true);   default 10:29:43.115709+0900  kernel net dext: IOUserNetworkRxCompletionQueue::Create(pool, this, packet_count, 0, dispatch_queue, &rx_com_queue);   default 10:29:43.115712+0900  kernel net dext: com_queue->CopyDataQueue(&ivars->rx_sub_dsource);   default 10:29:43.115729+0900  kernel net dext: CreateActionRxComDataServiced(sizeof (void*), &ivars->rx_com_action);   default 10:29:43.115739+0900  kernel net dext: ivars->rx_sub_dsource->SetDataServicedHandler(ivars->rx_com_action);   default 10:29:43.115741+0900  kernel net dext: ivars->rx_sub_dsource->SetEnable(true);   default 10:29:43.115746+0900  kernel net dext: rx_com_queue->SetEnable(true);   default 10:29:43.115776+0900  kernel net dext: const IOUserNetworkMediaType types[] = {    kIOUserNetworkMediaEthernetAuto,    kIOUserNetworkMediaEthernetNone,    kIOUserNetworkMediaEthernet1000BaseT | kIOUserNetworkMediaOptionFullDuplex  };   default 10:29:43.115778+0900  kernel net dext: ret = ReportAvailableMediaTypes(types, 3);   default 10:29:43.115806+0900  kernel net dext: ReportLinkStatus(kIOUserNetworkLinkStatusInactive, kIOUserNetworkMediaEthernetNone);   default 10:29:43.115832+0900  kernel net dext: RegisterEthernetInterface(macAddress, pool, ivars->queues, 4);   default 10:29:43.142245+0900  kernel net dext: GetMaxTransferUnit methos is called   default 10:29:43.143402+0900  kernel net dext: SetInterfaceEnable method is called [isEnable == true]   default 10:29:43.143810+0900  kernel net dext: SetInterfaceEnable method is called [isEnable == false] I'm not sure why this driver is disabled after enabled. Do you have any solution for it? Thank you.
Jul ’20
Reply to How to use DriverKit for transmission of network data packets?
Thank you,  sl149q. What do you mean the result from SetInterfaceEnable? According to a document (https://developer.apple.com/documentation/networkingdriverkit/iousernetworkethernet), we have to override the SetInterfaceEnable on a custom class that we define, and then the function called by system, I think. Also, GetMaxTransferUnit. My code for these functions are following. ... kern_return_t IMPL(nictest, SetInterfaceEnable) {   if(isEnable)   {     log("SetInterfaceEnable method is called [isEnable == true] : Return kIOReturnSuccess");   }   else   {     log("SetInterfaceEnable method is called [isEnable == false] : Return kIOReturnSuccess");   }   return kIOReturnSuccess; } ... kern_return_t IMPL(nictest, GetMaxTransferUnit) {   log("GetMaxTransferUnit method is called : return kIOReturnSuccess");   *mtu = 1500;   return kIOReturnSuccess; } ... Thanks.
Jul ’20
Reply to Cannot replicate a bootable Big Sur using asr.
Hello, Naoned. Could you try to specify a snapshot using --toSnapshot with snapshot id? The id is shown in diskutil apfs list. I think the system volume is mounted on a snapshot. In my environment, disk2s5s1 is snapshot. it has correct seal and mount on '/'. $ diskutil list apfs ...    +-> Volume disk2s5 D75FFE69-60AA-4C51-A3DE-52B1753DA61D          APFS Volume Disk (Role):  disk2s5 (System)     Name:           sysapfs (Case-insensitive)     Mount Point:        /Users/username/mnt     Capacity Consumed:     15121588224 B (15.1 GB)     Sealed:          Broken     FileVault:         No (Encrypted at rest)     |     Snapshot:         5891FB51-B637-4CC6-8EEF-959D961167C8     Snapshot Disk:       disk2s5s1     Snapshot Mount Point:   /     Snapshot Sealed:      Yes In addition, Bombich Software (they makes Carbon Copy Cloner) also face a same obstacle, and they're working with Apple.
Sep ’20