SlideShare a Scribd company logo
1 of 20
Download to read offline
My first ebook reader
                                            Tal
                                               kC
                                            NO onta
                                                DR ins
   J esse Vincent                                 M

   jesse@fsck.com


   The content of this talk
   does not necessarily        I bought the Kindle 2 to
   reflect the views of my
   employer.                  read books, but I couldn’t
                               leave well-enough alone.
Some quick Kindle facts
ARM 1136JF-S             Linux 2.6, glibc 2.5, DBus, busybox

2Gb flash (4 on the DX)   Most of /sbin is in sh

128 Mb RAM               2.0 shipped with a USB-
                         Networking debug mode
3G Modem
                         GUI is Java (Obfuscated)
USB OTG
                         Browser and JVM provided by
600x800 16 grey screen   ACCESS

Great battery
Things not to do
Don’t steal books
Don’t use your Kindle as a 3G modem
Don’t crack Amazon’s Topaz DRM
Don’t crack Amazon’s .mobi DRM
Think twice before you
    h4xx0r your Kindle
Amazon knows where you are
Amazon knows who you are
Amazon has your credit card number
Your syslog gets sent to Amazon
You might brick your Kindle
Why hack the Kindle?
I like to read. A lot. I love the Kindle’s 3G modem.

The Kindle has limited format support:

    No ePub. No PDF. No .lit. No .chm.

...so I couldn’t read a lot of stuff I wanted to read.

The Kindle does support .prc (Mobipocket)
and .cbz (Comic books)
(Open Formats)++
ePub is just zipped HTML and images
PDF is... PDF
.prc (Mobipocket) is HTML 3.2 +
extensions + glue
.cbz is just zipped .pngs and .jpgs
Calibre
http://calibre.kovidgoyal.net
Calibre is free and open
It runs on the desktop
That kind of defeats the purpose
of the Kindle
Early Hackery
Perl app to convert ePub to Mobipocket


Web-based document conversion system
http://kindle.fsck.com/http://some.com/foo.epub


Custom Kindle book to automate delivery
Then I found the USB
    Network mode
:debug
`usbNetowk
`usbQa


192.168.15.244 ➨ 192.168.15.200
Now I didn’t need the 3G modem
What next?
The Kindle 1 software update format
was based on tar, sh and MD5

Reverse engineered (by somebody
else) - see http://igorsk.blogspot.com

The Kindle 2 and DX use the exact
same updater format
Getting in the first time
Amazon’s busybox is built without telnetd
ARM Linux is pretty standard these days
A statically linked busybox is just fine
Early discoveries:
   /proc/config.gz
   Kernel built with NFS
   User-data partition NOT mounted noexec
   Undocumented support for .cbz files
Buildfarm on an N810
Cross-compiling is ... not reliable
Linux 2.6, glibc 2.5 and gcc
Built nfsmount, screen, and everything else
           needed to get some “work” done
Building Calibre on Kindle

 Qt, Python
 (unladen swallow)
 PyQt
 Took 12 hours to
 convert a book...after I built
 swaptools and gave it 256M
Savory for Kindle
Hacked Calibre down to size
Poppler-based .pdf ➨.cbz engine
inotify and DBus based daemon
Kindle updater that adds an init script
ext2 disk image with Savory runtime
That was good enough...
...until I got DX envy.
The Kindle 2 is codenamed ‘turing’
Test scripts on the device talked about
‘nell’ (and about a turing with a trackball)


When the DX came out, I wanted a real PDF
reader...with zoom, search and indexes
This should be easy!

1. Figure out how to paint the screen
2. Figure out how to read the keyboard and
   fiveway controller
3. Build a custom PDF reader for the Kindle
Screen and Keyboard
/dev/fb0 - Virtual framebuffer
   echo “{1,2,3}” > /proc/eink_fb/update_display

/dev/input/event{0,1} - Keyboard and Keyboard
   The 5-way is just another keyboard

Drivers in GPL Kernel release
Like everything else, bog-standard linux
Ubuntu
Ubuntu Jaunty Jackalope - ported to ARM
Installed on qemu
Tarred up the root image
NFS mounted on the Kindle


chroot /tmp/kindle sh
X.org

X.org needs a TTY or VT to start up
The Kindle’s Kernel is built without CONFIG_VT
I did awful (but small) things to X.org
Xfbdev “just works”
What’s next?
Polish
Documentation
Publication
Fixing X.org’s colormap
Building a useful user experience

More Related Content

Viewers also liked

Qiang 羌 references in the book of han 汉书 part 1
Qiang 羌 references in the book of han 汉书 part 1Qiang 羌 references in the book of han 汉书 part 1
Qiang 羌 references in the book of han 汉书 part 1qianghistory
 
Quran in Hindi Part-30
Quran in Hindi Part-30Quran in Hindi Part-30
Quran in Hindi Part-30Sharaz Ahmed
 
Ciclo basico diurno vigencia 2009 scp
Ciclo basico diurno vigencia 2009 scpCiclo basico diurno vigencia 2009 scp
Ciclo basico diurno vigencia 2009 scpRuth Santana
 
Zeus superior k w export manual tehnic - st-zkw ed 12-07 (en)
Zeus superior k w export   manual tehnic - st-zkw ed 12-07 (en)Zeus superior k w export   manual tehnic - st-zkw ed 12-07 (en)
Zeus superior k w export manual tehnic - st-zkw ed 12-07 (en)Costel Sirghi
 
Nc verification and re processing for collaborative machining
Nc verification and re processing for collaborative machiningNc verification and re processing for collaborative machining
Nc verification and re processing for collaborative machiningLiu PeiLing
 
ニコニコ動画でのHTML5
ニコニコ動画でのHTML5ニコニコ動画でのHTML5
ニコニコ動画でのHTML5Sho KUSANO
 
Writing jQuery that doesn't suck - London jQuery
Writing jQuery that doesn't suck - London jQueryWriting jQuery that doesn't suck - London jQuery
Writing jQuery that doesn't suck - London jQueryRoss Bruniges
 
ELT Pedagogy (Teaching Producyive Skills)
ELT Pedagogy (Teaching Producyive Skills)ELT Pedagogy (Teaching Producyive Skills)
ELT Pedagogy (Teaching Producyive Skills)Rismi Rismi
 
4-31 NTC Information Sheet SEP 2012
4-31 NTC Information Sheet SEP 20124-31 NTC Information Sheet SEP 2012
4-31 NTC Information Sheet SEP 2012Tracey Jones
 
P pt keys for good and happy life.
P pt keys for good and happy life.P pt keys for good and happy life.
P pt keys for good and happy life.Rajasekhar Dasari
 

Viewers also liked (15)

Qiang 羌 references in the book of han 汉书 part 1
Qiang 羌 references in the book of han 汉书 part 1Qiang 羌 references in the book of han 汉书 part 1
Qiang 羌 references in the book of han 汉书 part 1
 
Quran in Hindi Part-30
Quran in Hindi Part-30Quran in Hindi Part-30
Quran in Hindi Part-30
 
Excample
ExcampleExcample
Excample
 
aplication gogogo
aplication gogogoaplication gogogo
aplication gogogo
 
Ciclo basico diurno vigencia 2009 scp
Ciclo basico diurno vigencia 2009 scpCiclo basico diurno vigencia 2009 scp
Ciclo basico diurno vigencia 2009 scp
 
Zeus superior k w export manual tehnic - st-zkw ed 12-07 (en)
Zeus superior k w export   manual tehnic - st-zkw ed 12-07 (en)Zeus superior k w export   manual tehnic - st-zkw ed 12-07 (en)
Zeus superior k w export manual tehnic - st-zkw ed 12-07 (en)
 
Nc verification and re processing for collaborative machining
Nc verification and re processing for collaborative machiningNc verification and re processing for collaborative machining
Nc verification and re processing for collaborative machining
 
Cmmi1.3
Cmmi1.3Cmmi1.3
Cmmi1.3
 
ニコニコ動画でのHTML5
ニコニコ動画でのHTML5ニコニコ動画でのHTML5
ニコニコ動画でのHTML5
 
Rxpay-sepa-germany-01
Rxpay-sepa-germany-01Rxpay-sepa-germany-01
Rxpay-sepa-germany-01
 
Writing jQuery that doesn't suck - London jQuery
Writing jQuery that doesn't suck - London jQueryWriting jQuery that doesn't suck - London jQuery
Writing jQuery that doesn't suck - London jQuery
 
ELT Pedagogy (Teaching Producyive Skills)
ELT Pedagogy (Teaching Producyive Skills)ELT Pedagogy (Teaching Producyive Skills)
ELT Pedagogy (Teaching Producyive Skills)
 
4-31 NTC Information Sheet SEP 2012
4-31 NTC Information Sheet SEP 20124-31 NTC Information Sheet SEP 2012
4-31 NTC Information Sheet SEP 2012
 
P pt keys for good and happy life.
P pt keys for good and happy life.P pt keys for good and happy life.
P pt keys for good and happy life.
 
sdfghjk
sdfghjksdfghjk
sdfghjk
 

More from Jesse Vincent

Building a keyboard from scratch
Building a keyboard from scratchBuilding a keyboard from scratch
Building a keyboard from scratchJesse Vincent
 
So, I made a keyboard
So, I made a keyboardSo, I made a keyboard
So, I made a keyboardJesse Vincent
 
Dancing App Stores - Android Open 2011
Dancing App Stores - Android Open 2011Dancing App Stores - Android Open 2011
Dancing App Stores - Android Open 2011Jesse Vincent
 
Perl 5.16 and Beyond - YAPC::Asia 2011
Perl 5.16 and Beyond - YAPC::Asia 2011Perl 5.16 and Beyond - YAPC::Asia 2011
Perl 5.16 and Beyond - YAPC::Asia 2011Jesse Vincent
 
Perl 5.16 and beyond
Perl 5.16 and beyondPerl 5.16 and beyond
Perl 5.16 and beyondJesse Vincent
 
OSCON 2011 - Perl 5.16 and beyond
OSCON 2011 - Perl 5.16 and beyondOSCON 2011 - Perl 5.16 and beyond
OSCON 2011 - Perl 5.16 and beyondJesse Vincent
 
RT4 - The whole sordid story
RT4 - The whole sordid storyRT4 - The whole sordid story
RT4 - The whole sordid storyJesse Vincent
 
K-9 Mail for Android
K-9 Mail for AndroidK-9 Mail for Android
K-9 Mail for AndroidJesse Vincent
 
P2P Bug Tracking with SD
P2P Bug Tracking with SDP2P Bug Tracking with SD
P2P Bug Tracking with SDJesse Vincent
 
SD - A peer to peer issue tracking system
SD - A peer to peer issue tracking systemSD - A peer to peer issue tracking system
SD - A peer to peer issue tracking systemJesse Vincent
 
SD, a P2P bug tracking system
SD, a P2P bug tracking systemSD, a P2P bug tracking system
SD, a P2P bug tracking systemJesse Vincent
 
Prophet - Beijing Perl Workshop
Prophet - Beijing Perl WorkshopProphet - Beijing Perl Workshop
Prophet - Beijing Perl WorkshopJesse Vincent
 
Beijing Perl Workshop 2008 Hiveminder Secret Sauce
Beijing Perl Workshop 2008 Hiveminder Secret SauceBeijing Perl Workshop 2008 Hiveminder Secret Sauce
Beijing Perl Workshop 2008 Hiveminder Secret SauceJesse Vincent
 
A brief introduction to RTIR
A brief introduction to RTIRA brief introduction to RTIR
A brief introduction to RTIRJesse Vincent
 
An introduction to RTIR
An introduction to RTIRAn introduction to RTIR
An introduction to RTIRJesse Vincent
 
Prophet: a path out of the Cloud
Prophet: a path out of the CloudProphet: a path out of the Cloud
Prophet: a path out of the CloudJesse Vincent
 
Web 2.0 is Sharecropping
Web 2.0 is SharecroppingWeb 2.0 is Sharecropping
Web 2.0 is SharecroppingJesse Vincent
 
Hiveminder - Everything but the Secret Sauce
Hiveminder - Everything but the Secret SauceHiveminder - Everything but the Secret Sauce
Hiveminder - Everything but the Secret SauceJesse Vincent
 
Prophet - A peer to peer replicated disconnected database
Prophet - A peer to peer replicated disconnected databaseProphet - A peer to peer replicated disconnected database
Prophet - A peer to peer replicated disconnected databaseJesse Vincent
 

More from Jesse Vincent (20)

Building a keyboard from scratch
Building a keyboard from scratchBuilding a keyboard from scratch
Building a keyboard from scratch
 
So, I made a keyboard
So, I made a keyboardSo, I made a keyboard
So, I made a keyboard
 
Dancing App Stores - Android Open 2011
Dancing App Stores - Android Open 2011Dancing App Stores - Android Open 2011
Dancing App Stores - Android Open 2011
 
Perl 5.16 and Beyond - YAPC::Asia 2011
Perl 5.16 and Beyond - YAPC::Asia 2011Perl 5.16 and Beyond - YAPC::Asia 2011
Perl 5.16 and Beyond - YAPC::Asia 2011
 
Perl 5.16 and beyond
Perl 5.16 and beyondPerl 5.16 and beyond
Perl 5.16 and beyond
 
OSCON 2011 - Perl 5.16 and beyond
OSCON 2011 - Perl 5.16 and beyondOSCON 2011 - Perl 5.16 and beyond
OSCON 2011 - Perl 5.16 and beyond
 
RT4 - The whole sordid story
RT4 - The whole sordid storyRT4 - The whole sordid story
RT4 - The whole sordid story
 
K-9 Mail for Android
K-9 Mail for AndroidK-9 Mail for Android
K-9 Mail for Android
 
Perl 5.12.0
Perl 5.12.0Perl 5.12.0
Perl 5.12.0
 
P2P Bug Tracking with SD
P2P Bug Tracking with SDP2P Bug Tracking with SD
P2P Bug Tracking with SD
 
SD - A peer to peer issue tracking system
SD - A peer to peer issue tracking systemSD - A peer to peer issue tracking system
SD - A peer to peer issue tracking system
 
SD, a P2P bug tracking system
SD, a P2P bug tracking systemSD, a P2P bug tracking system
SD, a P2P bug tracking system
 
Prophet - Beijing Perl Workshop
Prophet - Beijing Perl WorkshopProphet - Beijing Perl Workshop
Prophet - Beijing Perl Workshop
 
Beijing Perl Workshop 2008 Hiveminder Secret Sauce
Beijing Perl Workshop 2008 Hiveminder Secret SauceBeijing Perl Workshop 2008 Hiveminder Secret Sauce
Beijing Perl Workshop 2008 Hiveminder Secret Sauce
 
A brief introduction to RTIR
A brief introduction to RTIRA brief introduction to RTIR
A brief introduction to RTIR
 
An introduction to RTIR
An introduction to RTIRAn introduction to RTIR
An introduction to RTIR
 
Prophet: a path out of the Cloud
Prophet: a path out of the CloudProphet: a path out of the Cloud
Prophet: a path out of the Cloud
 
Web 2.0 is Sharecropping
Web 2.0 is SharecroppingWeb 2.0 is Sharecropping
Web 2.0 is Sharecropping
 
Hiveminder - Everything but the Secret Sauce
Hiveminder - Everything but the Secret SauceHiveminder - Everything but the Secret Sauce
Hiveminder - Everything but the Secret Sauce
 
Prophet - A peer to peer replicated disconnected database
Prophet - A peer to peer replicated disconnected databaseProphet - A peer to peer replicated disconnected database
Prophet - A peer to peer replicated disconnected database
 

Recently uploaded

How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 

Recently uploaded (20)

How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 

Hacking your Kindle (OSCON Lightning Talk)

  • 1. My first ebook reader Tal kC NO onta DR ins J esse Vincent M jesse@fsck.com The content of this talk does not necessarily I bought the Kindle 2 to reflect the views of my employer. read books, but I couldn’t leave well-enough alone.
  • 2. Some quick Kindle facts ARM 1136JF-S Linux 2.6, glibc 2.5, DBus, busybox 2Gb flash (4 on the DX) Most of /sbin is in sh 128 Mb RAM 2.0 shipped with a USB- Networking debug mode 3G Modem GUI is Java (Obfuscated) USB OTG Browser and JVM provided by 600x800 16 grey screen ACCESS Great battery
  • 3. Things not to do Don’t steal books Don’t use your Kindle as a 3G modem Don’t crack Amazon’s Topaz DRM Don’t crack Amazon’s .mobi DRM
  • 4. Think twice before you h4xx0r your Kindle Amazon knows where you are Amazon knows who you are Amazon has your credit card number Your syslog gets sent to Amazon You might brick your Kindle
  • 5. Why hack the Kindle? I like to read. A lot. I love the Kindle’s 3G modem. The Kindle has limited format support: No ePub. No PDF. No .lit. No .chm. ...so I couldn’t read a lot of stuff I wanted to read. The Kindle does support .prc (Mobipocket) and .cbz (Comic books)
  • 6. (Open Formats)++ ePub is just zipped HTML and images PDF is... PDF .prc (Mobipocket) is HTML 3.2 + extensions + glue .cbz is just zipped .pngs and .jpgs
  • 7. Calibre http://calibre.kovidgoyal.net Calibre is free and open It runs on the desktop That kind of defeats the purpose of the Kindle
  • 8. Early Hackery Perl app to convert ePub to Mobipocket Web-based document conversion system http://kindle.fsck.com/http://some.com/foo.epub Custom Kindle book to automate delivery
  • 9. Then I found the USB Network mode :debug `usbNetowk `usbQa 192.168.15.244 ➨ 192.168.15.200 Now I didn’t need the 3G modem
  • 10. What next? The Kindle 1 software update format was based on tar, sh and MD5 Reverse engineered (by somebody else) - see http://igorsk.blogspot.com The Kindle 2 and DX use the exact same updater format
  • 11. Getting in the first time Amazon’s busybox is built without telnetd ARM Linux is pretty standard these days A statically linked busybox is just fine Early discoveries: /proc/config.gz Kernel built with NFS User-data partition NOT mounted noexec Undocumented support for .cbz files
  • 12. Buildfarm on an N810 Cross-compiling is ... not reliable Linux 2.6, glibc 2.5 and gcc Built nfsmount, screen, and everything else needed to get some “work” done
  • 13. Building Calibre on Kindle Qt, Python (unladen swallow) PyQt Took 12 hours to convert a book...after I built swaptools and gave it 256M
  • 14. Savory for Kindle Hacked Calibre down to size Poppler-based .pdf ➨.cbz engine inotify and DBus based daemon Kindle updater that adds an init script ext2 disk image with Savory runtime
  • 15. That was good enough... ...until I got DX envy. The Kindle 2 is codenamed ‘turing’ Test scripts on the device talked about ‘nell’ (and about a turing with a trackball) When the DX came out, I wanted a real PDF reader...with zoom, search and indexes
  • 16. This should be easy! 1. Figure out how to paint the screen 2. Figure out how to read the keyboard and fiveway controller 3. Build a custom PDF reader for the Kindle
  • 17. Screen and Keyboard /dev/fb0 - Virtual framebuffer echo “{1,2,3}” > /proc/eink_fb/update_display /dev/input/event{0,1} - Keyboard and Keyboard The 5-way is just another keyboard Drivers in GPL Kernel release Like everything else, bog-standard linux
  • 18. Ubuntu Ubuntu Jaunty Jackalope - ported to ARM Installed on qemu Tarred up the root image NFS mounted on the Kindle chroot /tmp/kindle sh
  • 19. X.org X.org needs a TTY or VT to start up The Kindle’s Kernel is built without CONFIG_VT I did awful (but small) things to X.org Xfbdev “just works”
  • 20. What’s next? Polish Documentation Publication Fixing X.org’s colormap Building a useful user experience