MCPcopy Create free account
hub / github.com/TomHeaven/HoRNDIS

github.com/TomHeaven/HoRNDIS @rel9.3_2

Chat with this repo
repository ↗ · DeepWiki ↗ · release rel9.3_2 ↗ · + Follow
73 symbols 104 edges 2 files 11 documented · 15% updated 3y agorel9.3_2 · 2022-08-12★ 1765 open issues

Browse by type

Functions 53 Types & classes 20
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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

  • 【2022.06.12】Fix Download speed monitor for macOS 11+.

Installation

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

Building the source

  • git clone the repository
  • Simply running xcodebuild in the checkout directory should be sufficient to build the kext.
  • If you wish to package it up, you can run make to assemble the package in the build/ directory

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. * Homebrew users: brew install mikhailai/misc/usbutils

Please do not install lsusb package from Homebrew Core, it's a different utility with the same name. * Macports users: sudo port 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: * GUI, using Console application, located in Utilities folder. You need to enter process:kernel in the search box in order to filter the relevant messages. * Command Line, using the log command. For example:

log show --predicate process==\"kernel\" --start "2018-12-11 22:54:00"

The start value needs to be several minutes in the past, so it would not flood the console. Here is a convenient command that prints the messages from the past 3 mintes:

log show --predicate process==\"kernel\" --start "$(date -v-3M +'%F %T')"

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.

Core symbols most depended-on inside this repo

Shape

Method 44
Class 20
Function 9

Languages

C++100%

Modules by API surface

HoRNDIS.cpp58 symbols
HoRNDIS.h15 symbols

For agents

$ claude mcp add HoRNDIS \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page