Skip to content

FrameworkComputer/framework-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Framework System

Rust libraries and tools to interact with the system.

The tool works on Linux, Windows and the UEFI shell. Most features are supported on every "OS".

You can find lots of examples in EXAMPLES.md.

Installation

Linux

Windows

winget install FrameworkComputer.framework_tool

FreeBSD

sudo pkg install framework-system

Features

To check which features are supported on which OS and platform, see the Support Matrices.

Operating System Support

The following operating environments are supported.

  • Linux
  • Windows
  • UEFI
  • FreeBSD

Most functionality depends communication with the EC. For Linux and Windows there are dedicated drivers. On UEFI and FreeBSD raw port I/O is used - on Linux this can also be used as a fallback, if the driver is not available or not working.

Port I/O Linux Windows
Framework 12
Intel Core 12th Gen Yes 6.12 Yes
Framework 13
Intel Core 11th Gen Yes 6.11 Not yet
Intel Core 12th Gen Yes 6.13 Not yet
Intel Core 13th Gen Yes 6.13 Not yet
AMD Ryzen 7040 Yes 6.10 BIOS 3.16+
Intel Core Ultra S1 Yes 6.12 BIOS 3.06+
AMD Ryzen AI 300 Yes 6.12 Yes
Framework 16
AMD Ryzen 7040 Yes 6.10 BIOS 3.06+
Framework Desktop
AMD Ryzen AI Max Yes 6.15 Yes
Firmware Information
  • Show system information
    • ESRT table (UEFI, Linux, FreeBSD only) (--esrt)
    • SMBIOS
  • Get firmware version from binary file
    • EC (Legacy and Zephyr based) (--ec-bin)
    • CCG5 PD (11th Gen TigerLake) (--pd-bin)
    • CCG6 PD (Intel systems, Framework Desktop) (--pd-bin)
    • CCG8 PD (AMD Laptops) (--pd-bin)
    • H2O BIOS Capsule (--h2o-capsule)
      • BIOS Version
      • EC Version
      • CCG5/CCG6/CCG8 PD Version
    • UEFI Capsule (--capsule)
  • Parse metadata from capsule binary
    • Determine type (GUID) of capsule binary
    • Extract bitmap image from winux capsule to file
  • Get firmware version from system (--versions)
    • BIOS
    • EC
    • PD Controller
    • ME (Only on Linux)
    • Retimer
    • Touchpad (Linux, Windows, FreeBSD, not UEFI)
    • Touchscreen (Linux, Windows, FreeBSD, not UEFI)
  • Get Expansion Card Firmware (Not on UEFI so far)
    • HDMI Expansion Card (--dp-hdmi-info)
    • DisplayPort Expansion Card (--dp-hdmi-info)
    • Audio Expansion Card (--audio-card-info)
  • Update Expansion Card Firmware (Not on UEFI so far)
    • HDMI Expansion Card (--dp-hdmi-update)
    • DisplayPort Expansion Card (--dp-hdmi-update)
    • Audio Expansion Card
System Status

All of these need EC communication support in order to work.

  • Get information about battery/AC (--power)
  • Get information about USB-C PD ports (--pdorts)
  • Get information about CCGX PD Controllers (--pd-info)
  • Show status of intrusion switches (--intrusion)
  • Show status of privacy switches (--privacy)
  • Check recent EC console output (--console recent)
Changing settings
  • Get and set keyboard brightness (--kblight)
  • Get and set battery charge limit (--charge-limit)
  • Get and set fingerprint LED brightness (--fp-brightness, --fp-led-level)
  • Override tablet mode, instead of follow G-Sensor and hall sensor (--tablet-mode)
  • Disable/Enable touchscreen (--touchscreen-enable)
Communication with Embedded Controller
  • Framework Laptop 12 (Intel 13th Gen)
  • Framework Laptop 13 (Intel 11-13th Gen)
  • Framework Laptop 13 (AMD Ryzen 7080)
  • Framework Laptop 13 (AMD Ryzen AI 300)
  • Framework Laptop 16 (AMD Ryzen 7080)
  • Framework Desktop (AMD Ryzen AI Max 300)
  • Port I/O communication on Linux
  • Port I/O communication in UEFI
  • Port I/O communication on FreeBSD
  • Using cros_ec driver in Linux kernel
  • Using Framework EC Windows driver based on coolstar's
  • Using DHowett's Windows CrosEC driver

Building

Dependencies

Rustup is convenient for setting up the right Rust version. Based on rust-toolchain.toml it will install the right toolchain and version for this project.

MSRV (Minimum Supported Rust Version):

  • 1.74 for Linux/Windows
  • 1.74 for UEFI

System dependencies

# NixOS
nix-shell --run fish -p cargo systemd udev hidapi pkg-config
direnv shell

# Fedora
sudo dnf install systemd-devel hidapi-devel

# FreeBSD
sudo pkg install hidapi
# Running linter
cargo clippy

# Running autoformatter as a check
cargo fmt --check

# Fixing format issues
cargo fmt

# Building the library and tool
cargo build

# Building only the library
cargo build -p framework_lib

# Building only the tool
cargo build -p framework_tool
ls -l target/debug/framework_tool

# Build the UEFI application
# Can't be built with cargo! That's why we need to exclude it in the other commands.
make -C framework_uefi
ls -l framework_uefi/build/x86_64-unknown-uefi/boot.efi

Install local package

> cargo install --path framework_tool
> which framework_tool
/home/zoid/.cargo/bin/framework_tool

Running

Run without any arguments to see the help.

Many actions require root. First build with cargo and then run the binary with sudo:

cargo build && sudo ./target/debug/framework_tool

About

Rust libraries and tools to interact with the Framework Computer systems

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages