hack‑B008‑k3w.txt 

Contents: [Dobrica Pavlinušić's random unstructured stuff]
• Dobrica Pavlinušić's random unstructured stuff (Kindle 3 serial pinout) 
• Dobrica Pavlinušić's random unstructured stuff (Bus Pirate connection) 
• Dobrica Pavlinušić's random unstructured stuff (Links) 
• Dobrica Pavlinušić's random unstructured stuff (Kindle 2.5.8 update to 3.1) 
• Dobrica Pavlinušić's random unstructured stuff (client: Kindle DXG D00801 ‑ 2.5.8 555370010) 
• Dobrica Pavlinušić's random unstructured stuff (Host: Kindle 3G+Wifi D00901 ‑ 3.1 558700031) 
• Dobrica Pavlinušić's random unstructured stuff (API) 
• Dobrica Pavlinušić's random unstructured stuff (Source) 
• Dobrica Pavlinušić's random unstructured stuff (Amazon) 
• Dobrica Pavlinušić's random unstructured stuff (Open Source) 
• Dobrica Pavlinušić's random unstructured stuff (standalone kindle terminal) 
• Dobrica Pavlinušić's random unstructured stuff (Download Java2ME) 
• Dobrica Pavlinušić's random unstructured stuff (Web server mobi mime type) 
• Dobrica Pavlinušić's random unstructured stuff (wpa_supplicant) 
• Dobrica Pavlinušić's random unstructured stuff (X patch) 
• Dobrica Pavlinušić's random unstructured stuff (Kindle diagnostic mode) 
• Dobrica Pavlinušić's random unstructured stuff (Duokan) 
• Dobrica Pavlinušić's random unstructured stuff (QEmu) 
• Dobrica Pavlinušić's random unstructured stuff (rootfs images) 
• Dobrica Pavlinušić's random unstructured stuff (HTML to mobi) 
• Dobrica Pavlinušić's random unstructured stuff (manual network setup using wifi) 

Kindle 3 serial pinout

from http://www.electricstuff.co.uk/kindlehack.html 
Bus Pirate connection

TX	RxD	black	
RX	TxD	gray	
GND	GND	brown	
1.7V	VPU	green	

HiZ>v
Pinstates:
1.(BR)  2.(RD)  3.(OR)  4.(YW)  5.(GN)  6.(BL)  7.(PU)  8.(GR)  9.(WT)  0.(Blk)
GND     3.3V    5.0V    ADC     VPU     AUX     CLK     MOSI    CS      MISO
P       P       P       I       I       I       I       I       I       I
GND     0.00V   0.00V   0.00V   0.50V   L       L       H       L       H
HiZ>m
1. HiZ
2. 1-WIRE
3. UART
4. I2C
5. SPI
6. 2WIRE
7. 3WIRE
8. LCD
x. exit(without change)

(1)>3
Set serial port speed: (bps)
 1. 300
 2. 1200
 3. 2400
 4. 4800
 5. 9600
 6. 19200
 7. 38400
 8. 57600
 9. 115200
10. BRG raw value

(1)>9
Data bits and parity:
 1. 8, NONE *default 
 2. 8, EVEN 
 3. 8, ODD 
 4. 9, NONE
(1)>1
Stop bits:
 1. 1 *default
 2. 2
(1)>1
Receive polarity:
 1. Idle 1 *default
 2. Idle 0
(1)>1
Select output type:
 1. Open drain (H=Hi-Z, L=GND)
 2. Normal (H=3.3V, L=GND)

(1)>1
Ready
UART>P
Pull-up resistors ON
UART>v
Pinstates:
1.(BR)  2.(RD)  3.(OR)  4.(YW)  5.(GN)  6.(BL)  7.(PU)  8.(GR)  9.(WT)  0.(Blk)
GND     3.3V    5.0V    ADC     VPU     AUX     -       TxD     -       RxD
P       P       P       I       I       I       I       I       I       I
GND     0.00V   0.00V   0.00V   1.31V   L       L       H       L       H
UART>(1)
UART bridge
Reset to exit
Are you sure? y

Links
• http://www.mobileread.com/forums/showthread.php?t=88004  ‑ download jailbreak and usbnetwork
• http://www.cowlark.com/kindle/getting‑started.html 
• http://trac.ak‑team.com/browser/Configs/trunk/Kindle/Hacks 
fetchrss: http://feeds.delicious.com/v2/rss/dpavlin/kindle?count=15
• There was an error: 500 Can't connect to feeds.delicious.com:80 (Bad hostname 'feeds.delicious.com')

Kindle 2.5.8 update to 3.1
• http://yifan.lu/tag/kindle/ 
• http://www.mobileread.com/forums/showthread.php?t=127969 
# mount DXG

cp update_dxg-2.5.8-prepare_kindle.bin /mnt/usb/

# Update Your Kindle

dpavlin@t61p:~$ ls -al /mnt/usb/output/
total 694948
drwxr-xr-x 2 dpavlin dpavlin 4096 May 11 17:51 .
drwxr-xr-x 9 dpavlin dpavlin 4096 Jan 1 1970 ..
-rwxr-xr-x 1 dpavlin dpavlin 474 May 11 17:44 make-backup.log
-rwxr-xr-x 1 dpavlin dpavlin 297 May 11 16:56 make-image.log
-rwxr-xr-x 1 dpavlin dpavlin 419454976 May 11 17:51 rootfs.img
-rwxr-xr-x 1 dpavlin dpavlin 292155092 May 11 17:44 update_restore-os.bin

mkdir -p /mnt/backuppc/kindle-dxg
cp -rv /mnt/usb/output /mnt/backuppc/kindle-dxg/

# mount K3G

dpavlin@t61p:~/Downloads/kindle/kindle-updater-beta-3$ cp update_k3g-3.1-create_updater.bin /mnt/usb/

dpavlin@t61p:~$ cp /backup/kindle-dxg-output/rootfs.img /mnt/usb/
dpavlin@t61p:~$ touch /mnt/usb/NO_TTS

dpavlin@t61p:~$ sudo eject /dev/sdb

# Update Your Kindle

dpavlin@t61p:~$ mount /mnt/usb
dpavlin@t61p:~$ cp /mnt/usb/output/* /backup/kindle-k3g-output/
dpavlin@t61p:~$ sudo eject /dev/sdb

# mount DXG

dpavlin@t61p:~$ mount /mnt/usb

dpavlin@t61p:~$ cp /backup/kindle-k3g-output/update_dxg-update-os.bin /mnt/usb/
dpavlin@t61p:~$ cp /backup/kindle-k3g-output/tts-files.tar /mnt/usb/

dpavlin@t61p:~$ sudo eject /dev/sdb

# Update Your Kindle

client: Kindle DXG D00801 ‑ 2.5.8 555370010
[root@kindle root]# cat /proc/cpuinfo 
Processor       : ARMv6-compatible processor rev 4 (v6l)
BogoMIPS        : 1593.88
Features        : swp half thumb fastmult vfp edsp java 
CPU implementer : 0x41
CPU architecture: 6TEJ
CPU variant     : 0x0
CPU part        : 0xb36
CPU revision    : 4
Cache type      : write-back
Cache clean     : cp15 c7 ops
Cache lockdown  : format C
Cache format    : Harvard
I size          : 16384
I assoc         : 4
I line length   : 32
I sets          : 128
D size          : 16384
D assoc         : 4
D line length   : 32
D sets          : 128

Hardware        : Mario Platform
Revision        : 31020
Serial          : "B009A1A010860A1B"

[root@kindle root]# cat /proc/partitions 
major minor  #blocks  name

   7     0    3510232 loop0
  31     0        128 mtdblock0
  31     1       3584 mtdblock1
  31     2         32 mtdblock2
  31     3        128 mtdblock3
  31     4       3584 mtdblock4
  31     5         64 mtdblock5
  31     6        128 mtdblock6
  31     7         24 mtdblock7
  31     8         64 mtdblock8
 179     0    3952640 mmcblk0
 179     1     409624 mmcblk0p1
 179     2      24576 mmcblk0p2
 179     3       8192 mmcblk0p3
 179     4    3510240 mmcblk0p4

[root@kindle root]# cat /proc/meminfo | head -1
MemTotal:       127128 kB

[root@kindle root]# cat /proc/cmdline 
console=ttymxc0,115200 mem=128M ro ip=none root=/dev/mmcblk0p1 lpj=2654208 panic=10 quiet

Host: Kindle 3G+Wifi D00901 ‑ 3.1 558700031
[root@kindle root]# cat /proc/cpuinfo 
Processor       : ARMv6-compatible processor rev 3 (v6l)
BogoMIPS        : 511.18
Features        : swp half thumb fastmult vfp edsp java 
CPU implementer : 0x41
CPU architecture: 6TEJ
CPU variant     : 0x1
CPU part        : 0xb36
CPU revision    : 3
Cache type      : write-back
Cache clean     : cp15 c7 ops
Cache lockdown  : format C
Cache format    : Harvard
I size          : 16384
I assoc         : 4
I line length   : 32
I sets          : 128
D size          : 16384
D assoc         : 4
D line length   : 32
D sets          : 128

Hardware        : Amazon MX35 Luigi Board
Revision        : 35020
Serial          : "B006A0A0117503RS"
BoardId         : "SP1B000000000000"

[root@kindle root]# cat /proc/meminfo | head -1
MemTotal:       256536 kB

[root@kindle root]# cat /proc/partitions 
major minor  #blocks  name

   7     0    3205336 loop0
 179     0    3907584 mmcblk0
 179     1     665628 mmcblk0p1
 179     2      24576 mmcblk0p2
 179     3       8192 mmcblk0p3
 179     4    3205344 mmcblk0p4

[root@kindle root]# cat /proc/cmdline 
console=ttymxc0,115200 mem=256M panic=10 root=/dev/mmcblk0p1 ro ip=none quiet lpj=2555904

API
• http://kdk‑javadocs.s3.amazonaws.com/index.html?overview‑summary.html 
• http://download.oracle.com/javame/config/cdc/ref‑impl/pbp1.1.2/jsr217/index.html 
fetchrss: http://adq.livejournal.com/data/rss?tag=kindle
• There was an error: 500 SSL negotiation failed:

• http://code.google.com/p/adqmisc/ 
Source
Amazon
• http://www.amazon.com/gp/help/customer/display.html?ie=UTF8&nodeId=200203720 
Open Source
• https://github.com/apetresc/Kindle‑Widget‑Toolkit 
• https://github.com/proDOOMman/KindleNote 
• http://code.google.com/p/kdk‑emulator/ 
• http://www.mobileread.com/forums/showthread.php?t=103867 
• http://code.google.com/p/kindleflow/ 
• http://www.reddit.com/r/kindle/comments/dsrjm/readabilitymod_article_mode_update_for_kindle_3/ 
standalone kindle terminal
• http://info.iet.unipi.it/~luigi/kindle/ 
• http://www.mobileread.com/forums/showthread.php?t=125860 
Download Java2ME
Last version available for Linux: http://www.oracle.com/technetwork/java/download‑135801.html 
Web server mobi mime type
AddType application/x-mobipocket-ebook .mobi

wpa_supplicant
• http://www.mobileread.com/forums/showthread.php?t=99681 
id="$(wpa_cli add_network | sed -n '2p')"

wpa_cli \
set_network $id ssid "UIC-Wireless" \
set_network $id key_mgmt IEEE8021X \
set_network $id eap TTLS \
set_network $id identity "netid-here" \
set_network $id anonymous_identity "anonymous" \
set_network $id password "password-here" \
set_network $id ca_cert "/mnt/us/certs/Thawte_Premium_Server_CA.pem" \
set_network $id phase2 "auth=PAP" \
enable_network $id \
quit

X patch
• http://code.google.com/p/savory/source/browse/trunk/x11‑on‑kindle/xorg‑1.6.patch 
Kindle diagnostic mode
• http://www.mobileread.com/forums/showthread.php?t=122362 
touch /mnt/us/ENABLE_DIAGS
Duokan
• http://www.mobileread.com/forums/showthread.php?t=105316 
QEmu
• http://people.debian.org/~aurel32/qemu/armel/ 
wget http://people.debian.org/~aurel32/qemu/armel/debian_lenny_armel_standard.qcow2 \
http://people.debian.org/~aurel32/qemu/armel/initrd.img-2.6.26-2-versatile \
http://people.debian.org/~aurel32/qemu/armel/vmlinuz-2.6.26-2-versatile \

qemu-system-arm -M versatilepb -kernel vmlinuz-2.6.26-2-vert=/dev/sda1" -m 256

Convert image to ext3 image and it will also work on Kindle using loopback mount
rootfs images
qemu-img convert -f raw -O qcow2 /backup/kindle-dxg-output/rootfs.img dxg.qcow2

sudo mount /backup/kindle-dxg-output/rootfs.img rootfs/ -o loop,ro

HTML to mobi
• https://dev.mobileread.com/trac/mobiperl/wiki 
#!/bin/sh

dir=/home/dpavlin/Downloads/pdf/aosabook.org/www.aosabook.org/en/
list=/tmp/list
echo index.html > $list
grep '<td><a href="' $dir/index.html | cut -d\" -f2 | grep -v \# >> $list
ls $dir/*.html | sed "s!$dir/!!" > /tmp/list.all

sort /tmp/list /tmp/list.s
sort /tmp/list.all /tmp/list.all.s
diff /tmp/list.s /tmp/list.all.s | grep '^> ' | cut -d" " -f2 >> $list

tool_dir=`pwd`
cd $dir
$tool_dir/html2mobi \
        --mobifile /tmp/aosa.mobi \
        --title "The Architecture of Open Source Applications" \
        --author "Amy Brown and Greg Wilson (eds.)" \
        --coverimage $dir/../images/cover.jpg \
        --removejavascript \
        --imagerescale 0 \
        --gentoc \
        `cat $list`

manual network setup using wifi
# add wireless network
[root@kindle root]# vi /var/local/system/wpa_supplicant.conf
[root@kindle root]# /etc/init.d/wpa_supplicant restart
[root@kindle root]# udhcpc -i wlan0

# ip route add default via ip.of.gw

[root@kindle root]# cat /etc/resolv.conf 
nameserver 8.8.8.8

[root@kindle root]# iptables -A INPUT -i wlan0 -j ACCEPT
[root@kindle root]# iptables -A OUTPUT -o wlan0 -j ACCEPT