How spin24/bsdsensors works
bsdsensors is a FreeBSD hardware-monitoring CLI. The principal workflow parses command-line options, probes supported Super I/O chip families through /dev/io, reads temperature, voltage, fan-speed, and fan-control state into protobuf sensor data, optionally adds disk temperatures via smartctl, then prints tables, protobuf text, or JSON. Configuration requests branch into chip-specific fan-control or temperature-source writes. The graph preserves documented chip families and integrations; several family implementations are represented from the tree without claiming unsampled internal call details.
Components 20
CLI Orchestration
- CLI Runner
src/main.cc - Device Registry
lib/dev_db.cc - Output Formatter
lib/util.cc
Hardware Access
- Port I/O
lib/port_io.cc - Super I/O
lib/super_io.cc - Banked Registers
lib/banked_io.cc - Nuvoton Adapter
lib/nuvoton_chip.cc - ITE Adapter
lib/ite_chip.cc - Fintek Adapter
lib/fintek_chip.cc - Microchip Adapter
lib/microchip_chip.cc - Chip Metadata
lib/nuvoton_chip_info.cc
Sensing Control
- Temperature Sensors
lib/nuvoton_temp_sensor.cc - Voltage Sensors
lib/nuvoton_volt_sensor.cc - Fan Speed Sensors
lib/nuvoton_fan_speed.cc - Fan Control
lib/nuvoton_fan_control.cc
Data Integrations
- Sensor Data
proto/sensors.proto - Request Schema
proto/request.proto - Disk Temperatures
lib/disk_temp.cc
Other components
- Operator
- smartctl
Connections 31
- Operator → CLI Runner: runs
- CLI Runner → Port I/O: creates
- CLI Runner → Nuvoton Adapter: probes
- CLI Runner → ITE Adapter: probes
- CLI Runner → Fintek Adapter: probes
- CLI Runner → Microchip Adapter: probes
- CLI Runner → Device Registry: registers
- CLI Runner → Request Schema: parses
- CLI Runner → Disk Temperatures: adds disks
- CLI Runner → Output Formatter: prints
- Nuvoton Adapter → Super I/O: initializes
- ITE Adapter → Super I/O: initializes
- Fintek Adapter → Super I/O: initializes
- Microchip Adapter → Super I/O: initializes
- Nuvoton Adapter → Banked Registers: reads registers
- Nuvoton Adapter → Chip Metadata: loads metadata
- Nuvoton Adapter → Temperature Sensors: loads sensors
- Nuvoton Adapter → Voltage Sensors: loads sensors
- Nuvoton Adapter → Fan Speed Sensors: loads sensors
- Nuvoton Adapter → Fan Control: loads controls
- Nuvoton Adapter → Sensor Data: fills readings
- ITE Adapter → Sensor Data: fills readings
- Fintek Adapter → Sensor Data: fills readings
- Microchip Adapter → Sensor Data: fills readings
- Fan Control → Banked Registers: writes settings
- Temperature Sensors → Banked Registers: reads values
- Voltage Sensors → Banked Registers: reads values
- Fan Speed Sensors → Banked Registers: reads values
- Disk Temperatures → smartctl: invokes
- Disk Temperatures → Sensor Data: adds readings
- Output Formatter → Sensor Data: formats