Skip to content

Releases: MykeHaunt/Mac-OLS

Mac OLS

23 Jun 19:11
50968f4

Choose a tag to compare

Mac OLS Pre-release
Pre-release

Mac-OLS Project

Mac-OLS is an open-source, native ECU (Engine Control Unit) tuning suite for macOS (Apple Silicon) that aims to replicate and extend the functionality of the industry-standard Windows software WinOLS. ECU tuning involves reading a car’s binary calibration data, locating maps (tables of values) within that data, and adjusting them to improve performance or efficiency. Tools like WinOLS “are written especially to modify the memory contents of ECUs” and “facilitate the searching and finding of maps” in those binaries. WinOLS provides a rich GUI with 2D/3D visualizations (tables and graphs), automatic map search, and export/import of various binary formats. For example, WinOLS displays raw ECU data in 2D/3D charts or hex dumps and includes a 3D preview window to help the user identify map shapes. However, WinOLS is Windows-only – WinOLS 5 “requires Windows 10 (x64), Windows 11 (x64) or Windows 11 (ARM)” – so Mac-OLS seeks to provide equivalent capabilities in a native Mac environment.

WinOLS 3D View Example

Figure: WinOLS “Slices” view (3D map visualization) – Mac-OLS aims to provide similar map editing and visualization tools.

Mac-OLS is motivated by the limitations of running Windows ECU software on macOS. Modern Macs (especially Apple Silicon) cannot natively run x86 Windows apps, and virtualization or translation layers can be slow or unreliable. For example, WinOLS plugins and hardware support (BDM, OLS programmers, etc.) may not work under emulation, and Windows 11 ARM (required for Apple M-series) still lacks support for all WinOLS features. Mac-OLS addresses these challenges by being a native macOS application (supporting Apple Silicon and Intel) written in high-performance Rust for core processing and SwiftUI for the interface. Its design goals include fully replicating WinOLS-like features (binary import/export, map search, editing UI, checksums, etc.) while being free and open-source. Like other community ECU projects, it aims for “always free and open source” software and broad platform support. Key functional requirements are binary I/O (loading raw ECU dumps), heuristic map detection, editing capabilities (2D/3D view and table editing), project/version management, and a plugin system (e.g. for checksums or new file formats).

Technology Stack

Mac-OLS uses Rust for its core engine and SwiftUI for the native macOS GUI. Rust provides speed and safety for processing large binary files and performing pattern detection, while SwiftUI delivers a modern, responsive interface. The two languages are bridged via a C-compatible ABI: Rust exposes C-callable functions and data (using #[no_mangle] extern "C") and Swift imports them through a module map or header files. This foreign function interface (FFI) approach is common. In practice Mac-OLS uses Rust to parse and analyze ECU files and SwiftUI for windowing, charting (3D Surface graphs), and user interactions, with data passed between them over the stable C-ABI.

The project also includes a plugin system. Plugins (written in Rust) are compiled as dynamic libraries conforming to a C ABI so they can be loaded at runtime. Since Rust has no stable native ABI, Mac-OLS follows the recommended pattern: each plugin exposes a C-callable interface and Mac-OLS loads it and calls into it via dlsym or equivalent. This allows third-party extensions (e.g. custom checksum calculators or file format handlers) to be added without rebuilding the core app.

Phase-wise Implementation Plan

Development proceeds in phases:

  • Phase 0 – Foundation: Set up the SwiftUI app shell and embed the Rust core library. Implement a basic file-open dialog and a minimal Rust parser for binary files.

  • Phase 1 – Binary I/O and Data Structures: Robust binary import/export. Rust reads BIN, HEX, or zipped images. Defines Project, Map, Axis structures. GUI can display a raw hex dump.

  • Phase 2 – Map Detection: Add automatic map-finding using heuristics (monotonic data, rectangular float/int tables). Rust provides map region data, which is visualized in SwiftUI. GUI overlays detected regions on hex view or charts.

Map Detection Visualization

Figure: WinOLS showing detected maps and 3D visualization. Mac-OLS mimics this with SwiftUI.

  • Phase 3 – Editing and Plugins: Users can click detected maps, open editor views, and modify values. Undo/redo/versioning is supported. Plugins (e.g. checksum handlers) are loaded dynamically via Rust C-ABI. Full project archives (metadata, images, annotations) are supported.

  • Phases 4 & 5 (Planned): Add flashing tools, ECU communication support, performance tuning, cloud sync, and compatibility with more formats or brands.

Binary I/O and Map Detection

Rust defines a Project struct storing the binary buffer (Vec<u8>) and metadata. It supports formats like Intel HEX and raw BIN. Map detection scans for 1D/2D sequences matching known patterns. Maps are stored as offsets and dimensional metadata. GUI highlights and visualizes these.

The plugin system allows checksums and advanced processing to be handled by external dynamic libraries. Plugins expose C ABI and are called from SwiftUI.

Cross-Language Integration

Rust and Swift communicate via C-ABI. Rust exposes functions like macols_open_project(const char* path) and Swift calls them via bridging headers or Swift Packages. Rust is compiled as a universal binary (x86_64 + arm64), and tools like lipo combine artifacts. SwiftUI calls Rust for performance-intensive tasks and receives byte buffers or float arrays.

Testing and CI/CD

Rust uses cargo test, Swift uses XCTest. GitHub Actions CI builds and tests both. Releases include ZIP or installer for macOS. Documentation uses rustdoc and Apple’s DocC, with project-level Markdown guides.

Challenges and Solutions

  • Rust↔Swift integration required ABI planning and data type marshalling.
  • Plugin system had to work around Rust’s unstable native ABI.
  • Universal binary builds were automated with multi-target compilation and lipo.
  • SwiftUI was tuned for handling large data tables via offloading computation to Rust.

Mac-OLS combines Rust’s safety and performance with SwiftUI’s native macOS experience to deliver a modern, extensible ECU tuning tool for Mac users.
images
winols_text_3d
WinOLS program