HN
Today

Rust (and Slint) on a Jailbroken Kindle

A developer creatively jailbreaks an old Kindle Paperwhite to run custom Rust applications with the Slint GUI framework. This technical deep dive showcases how to leverage low-level Linux device interaction for e-ink displays and touch input. It resonates with Hacker News's appreciation for repurposing hardware, cross-compilation feats, and pushing the boundaries of embedded systems.

30
Score
4
Comments
#4
Highest Rank
20h
on Front Page
First Seen
May 27, 9:00 PM
Last Seen
May 28, 4:00 PM
Rank Over Time
7466781111121113121211141619252024

The Lowdown

Homarp embarked on a journey to repurpose a 7th generation Kindle Paperwhite, initially for a simple clock but quickly escalating into a full-blown project to run custom Rust applications with the Slint GUI framework. This intricate process involved overcoming several technical hurdles, demonstrating a deep dive into embedded systems development on a consumer device.

  • The motivation evolved from merely displaying a clock to exploring the potential of running more complex Rust-based dashboards, driven by the desire to build something custom.
  • Cross-compilation for the Kindle's ARMv7 architecture was achieved using cargo-zigbuild, targeting armv7-unknown-linux-musleabihf, simplifying the toolchain setup significantly.
  • Shell access was established via the USBNetwork tool, enabling SSH access over USB or Wi-Fi, crucial for debugging and deploying applications.
  • Integrating a GUI involved Slint, utilizing its lightweight software renderer. The core challenge was rendering to the e-ink screen by writing grayscale output to /dev/fb0 and then issuing ioctl() calls to refresh the display.
  • Touch input was captured by reading raw events from /dev/input/event1, interpreting the Linux multi-touch protocol type B to translate screen taps and gestures into Slint's PointerPressed, PointerMoved, and PointerReleased events.
  • After extensive debugging, a functional counter with an increment button was successfully implemented, validating the entire setup. The author then extracted the Kindle-specific Slint backend into a reusable crate, slint-backend-kindle, available on crates.io.

This project not only showcases the technical feasibility of running modern GUI applications on an unexpected embedded platform like the Kindle but also provides a robust foundation for future custom e-ink display projects.

The Gossip

Jailbreak Jitters: Kindle's Custom Software Conundrum

Discussion revolves around the viability and long-term stability of jailbreaking Kindles. Commenters express interest in using Kindles for custom software but are wary of Amazon updates potentially breaking hacks and the perceived limited aftermarket ecosystem compared to devices like Boox. The underlying sentiment is a desire for a reliable, open e-ink platform for DIY projects.

Power Ponderings: The Plug-In Predicament

A practical question arose regarding the power requirements of running custom applications on a jailbroken Kindle, specifically whether the device would need to remain constantly plugged in, which is a common consideration for always-on e-ink displays and custom applications.

Commendable Code & Curiosity

The overall sentiment towards the project was highly positive, with several commenters expressing admiration for the technical achievement and the desire to replicate or learn from the author's detailed work.