A modern C++ and Qt application for visualizing and editing Device Tree (DTB/DTS) files with both GUI and CLI interfaces.
- Visualize and edit Device Tree files - Load and display DTB/DTS files in a user-friendly tree structure
- Diff two DTBs/DTS - Compare device trees to see changes (overlays vs base)
- Validate properties - Check device tree validity and schema compliance (future feature)
- Export parsed tree - Export to JSON/YAML for automation and integration
- CLI mode - Full command-line interface for headless environments
- Cross-platform - Linux (primary), Windows/macOS (optional)
- Modern Qt6-based interface
- Tree view for device tree nodes
- Property table for detailed property editing
- Source view for raw DTS content
- Diff viewer with visual change highlighting
- Drag and drop file support
- Search and filter capabilities
- Colored output with ANSI support
- Comprehensive error handling and validation
- Multiple export formats (JSON, YAML, DTS, DTB)
- File conversion between DTB and DTS
- Search and list functionality
- Progress indicators and detailed feedback
- Linux: Ubuntu 20.04+, Debian 11+, or similar
- C++20 compatible compiler (GCC 10+, Clang 12+)
- CMake 3.16+
- Qt6 (Core, Widgets, Gui)
- Device Tree Compiler (dtc) - for validation and conversion
# Clone the repository
git clone https://github.com/osamakader/DTE.git
cd DTE
# Create build directory
mkdir -p build && cd build
# Configure with CMake
cmake ..
# Build
make -j$(nproc)
# Install (optional)
sudo make installsudo apt update
sudo apt install build-essential cmake qt6-base-dev qt6-base-dev-tools \
device-tree-compiler pkg-configsudo dnf install gcc-c++ cmake qt6-qtbase-devel device-tree-compiler pkg-configsudo pacman -S base-devel cmake qt6-base device-tree-compiler pkg-configLaunch the graphical interface:
./bin/DeviceTreeExplorerOr with command line options:
# Open a specific file
./bin/DeviceTreeExplorer -f device.dtb
# Compare with another file
./bin/DeviceTreeExplorer -f base.dtb -d overlay.dtb
# Export to JSON
./bin/DeviceTreeExplorer -f device.dtb -e json -o output.jsonThe CLI provides a comprehensive set of commands for device tree operations:
# Show help
./bin/dte-cli --help
# Get information about a device tree
./bin/dte-cli info device.dtb
# Validate a device tree
./bin/dte-cli validate device.dts
# Compare two device trees
./bin/dte-cli diff base.dtb overlay.dtb
# Export to different formats
./bin/dte-cli export device.dtb json output.json
./bin/dte-cli export device.dtb yaml output.yaml
# Convert between formats
./bin/dte-cli convert device.dtb device.dts
./bin/dte-cli convert device.dts device.dtb
# Search for nodes
./bin/dte-cli search device.dtb "cpu"
# List tree structure
./bin/dte-cli list device.dtb
./bin/dte-cli list device.dtb "/soc"Display detailed information about a device tree file.
Output includes:
- File size and format
- Total node and property counts
- Root node information
- File validation status
Validate a device tree file for syntax and structure errors.
Features:
- Syntax checking
- Structure validation
- Property type verification
- Detailed error reporting
Compare two device tree files and show differences.
Output includes:
- Added/removed/modified nodes
- Property changes
- Color-coded diff output
- Summary statistics
Export device tree to different formats.
Supported formats:
json- JSON format for automationyaml- YAML format for configurationdts- Device Tree Source formatdtb- Device Tree Blob format
Convert between DTB and DTS formats.
Supported conversions:
- DTB → DTS (decompilation)
- DTS → DTB (compilation)
Search for nodes or properties matching a pattern.
Features:
- Pattern matching
- Recursive search
- Color-coded results
- Path display
List the structure of a device tree.
Features:
- Tree visualization
- Property display
- Optional path filtering
- Hierarchical output
# Get information about a device tree
./bin/dte-cli info /proc/device-tree
# Validate a custom device tree
./bin/dte-cli validate my-device.dts
# List the structure
./bin/dte-cli list my-device.dts# Compare base and overlay
./bin/dte-cli diff base.dtb overlay.dtb
# Compare different versions
./bin/dte-cli diff v1.0.dts v2.0.dts# Export for automation
./bin/dte-cli export device.dtb json config.json
# Export for documentation
./bin/dte-cli export device.dtb yaml docs/device-tree.yaml
# Convert for editing
./bin/dte-cli convert device.dtb device.dts# Find all CPU nodes
./bin/dte-cli search device.dtb "cpu"
# Find memory-related properties
./bin/dte-cli search device.dtb "memory"
# List specific subtree
./bin/dte-cli list device.dtb "/soc/ethernet"The application provides comprehensive error handling:
- File not found
- Permission denied
- Invalid file format
- Corrupted data
- Invalid DTB magic number
- Corrupted structure
- Invalid property values
- Version incompatibility
- Missing required properties
- Invalid property types
- Structure violations
- Schema compliance issues
- Color-coded error messages
- Detailed error descriptions
- Suggested solutions
- Exit codes for automation
DTE/
├── CMakeLists.txt # Main build configuration
├── include/ # Public headers
│ ├── DeviceTree.h # Core data structures
│ ├── DeviceTreeParser.h # Parser interfaces
│ ├── DeviceTreeDiff.h # Diff functionality
│ ├── MainWindow.h # GUI interface
│ └── CLIApp.h # CLI interface
├── src/ # GUI implementation
│ ├── CMakeLists.txt
│ ├── main.cpp # GUI entry point
│ ├── DeviceTree.cpp # Core implementation
│ ├── DeviceTreeParser.cpp # Parser implementation
│ ├── DeviceTreeDiff.cpp # Diff implementation
│ ├── MainWindow.cpp # GUI implementation
│ └── ...
├── cli/ # CLI implementation
│ ├── CMakeLists.txt
│ ├── main.cpp # CLI entry point
│ └── CLIApp.cpp # CLI implementation
└── resources/ # Application resources
├── icons/ # Application icons
└── translations/ # Localization files
# Debug build
cmake -DCMAKE_BUILD_TYPE=Debug ..
make
# Release build with optimizations
cmake -DCMAKE_BUILD_TYPE=Release ..
make# Run basic tests
./bin/dte-cli --version
./bin/dte-cli --help
# Test with sample files
./bin/dte-cli info /proc/device-tree
./bin/dte-cli validate sample.dts- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
- Follow modern C++20 practices
- Use Qt6 conventions for GUI code
- Include proper error handling
- Add documentation for new features
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with Qt6 for cross-platform GUI
- Uses Device Tree Compiler (dtc) for validation
- Inspired by modern device tree tools
- Community contributions welcome
For issues and questions:
- Check the documentation
- Search existing issues
- Create a new issue with details
- Include error messages and file examples