TomHeaven / HoRNDIS

Tom's Repo of HoRNDS——the USB tethering driver for Mac OS 11+
Other
108 stars 10 forks source link

HoRNDIS(the USB tethering driver for macOS 11+)

HoRNDIS (pronounce: "horrendous") is a driver for macOS 11+ that allows you to use your Android phone's native USB tethering mode to get Internet access.

For more information, visit the home page for HoRNDIS.

About this Repo

Installation

Use the kext with OpenCore or install it to Library/Extension/ folder and fix privilleges with KextUtility.

Building the source

Debugging and Development Notes

This sections contains tips and tricks for developing and debugging the driver.

USB Device Information

Mac OS System Menu -> About This Mac -> System Report --> Hardware/USB
Lists all USB devices that OS recognizes. Unfortunately, it does not give USB descriptors.

lsusb -v
It prints USB configuration, such as interface and endpoint descriptors. You can print it for all devices or limit the output to specific ones. In order to run this command, you need to install usbutils.

IO Registry

ioreg -l -r -c IOUSBHostDevice
This command lists all the Mac OS IO Registry information under all USB devices. Unlike lsusb, ioreg tells how Mac OS recognized USB devices and interfaces, and how it matched drivers to these interfaces. The -r -c IOUSBHostDevice limits the output to USB devices; to get complete OS registry, please run ioreg -l.

OS Logging

The LOG(....) statements, sprinkled throughout the HoRNDIS code, call the IOLog functions. On Mac OS El Capitan (10.11) and earlier, the log messages go into /var/log/system.log. Starting from Sierra (10.12), these messages are no longer written to system.log and instead can be viewed via:

I've observed that Mac OS logging is unreliable (especially in Sierra). In some cases, the messages may come out garbled (looking like bad multi-threaded code). In other cases, either GUI or Command Line may be missing messages that were emitted. Sometimes, reloading the driver may fix the problem.