MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Kindle Developer's Corner (https://www.mobileread.com/forums/forumdisplay.php?f=150)
-   -   Kindle 3.1 software for Kindle 2, 2i, & DX (under construction) (https://www.mobileread.com/forums/showthread.php?t=127969)

yifanlu 04-01-2011 11:59 PM

Kindle 3.1 software for Kindle 2, 2i, & DX
 
I have managed to get the Kindle 3.1 software to run on a Kindle 2. Unlike what I expected, the software runs fine with no slowdowns (it is slower then the K3, but on 2.5.8, it is also slower). I've tested the internet browser, pdf reader, audiobook reader, etc. Everything works just as it does on the Kindle 3.

There are TWO things you can do to help test.

Kindles
If you have a broken/unwanted Kindle that you can donate for science, PM me. I'm looking for K2i, DX, DXi, DXGs.

Beta Test
You can also help beta test the packages. Installation directions are found in README.txt. Recovery directions are also in there. With my custom kernel, you do not need TTL access to recover from most errors. This also makes your Kindle mostly brick-proof. Please post the logs found in the output folder after you use this even if everything went well.

YOU MUST PROVIDE ME WITH LOGS IF YOU WANT HELP/SUPPORT, OTHERWISE I HAVE NO IDEA WHAT'S WRONG!!! (sorry about the annoying text, but NOBODY seems to understand this fact.)

Confirmed Working
Kindle 2 US
Kindle 2 International
Kindle DX US
Kindle DXG

I need someone to test Kindle DX international.

Known Bugs
-Sound fuzzy sometimes
-Active content doesn't work

Demo
http://www.youtube.com/watch?v=OMFIYSGLz4M

Changelog
1.0:
-Same as beta 4, just removed the beta.
Beta 4:
-Better logging, all output redirected to log
-Better "save old files" method. Using the rsync --delete option instead of taring up old files and copying them back. Should save some time.
Beta 3:
-Using rsync instead of cp for better memory management and speedups in the update maker
-Fixed no 3G bug on DX
-Fixed no USB bug on DX
-Fixed web browser on DX
-Removed "NO_TTS" option, no longer needed
Beta 2:
-New package generator, allows easy extendibility
-Factory reset on first boot
-Fixed some bugs
Beta 1:
-Initial release

Download
http://yifan.lu/p/kindleupdater

montalex 04-02-2011 03:12 PM

Boy, Yifanlu, I really wish I could help with this! I am afraid I lack the skills to be of assistance, but I am really excited about your work, and can't wait to give it a try on one of my 2 Kindle 2's. As I wrote elsewhere, I really like the Kindle 2 for its sturdy construction and full keyboard, so I bought a 2nd (reconditioned) one. This way, if I mess something up, I have a backup.

yifanlu 04-02-2011 11:25 PM

Progress report:
One of the things I want to do is allow the Kindle to create it's own update. So the Kindle 3 can generate the Kindle 2 update using its own files. (Otherwise, you have to copy all the files from the K3 to your computer and make an update with kindle_update_tool.py). The hard thing about creating a K3 update is Amazon's "encryption" method (left shift 4 OR right shift 4 & 0xff ^ 0x7a). Igor wrote the nice kindle_update_tool.py, but it would be stupid to port python to Kindle just for this one thing. So what I did was disassemble amazon's "dm" (decrypt update) and modified it to a new file "md" (encrypt update). Here's the changes

DM (from Amazon, comment by me):
Code:

                BL        getchar // get byte to modify
                EOR        R3, R0,        #0x7A // R3 = R0 ^ 0x7A
                CMN        R0, #1 // if !(R0 == 1), we are at the end of the file ...
                MOV        R0, R3,LSR#4 // R0 = R3 >> 4
                AND        R0, R0,        #0xF // R0 = R0 & 0xF
                ORR        R0, R0,        R3,LSL#4 // R0 = R0 | R3 << 4
                BNE        loc_8470 // ... then jump to end of program
                MOV        R0, #0 // clear R0 register
                ADD        SP, SP,        #4 // don't care
                LDMFD        SP!, {PC} // don't care

MD (by me, comment by me):
Code:

                BL        getchar // get byte to modify
                CMN        R0, #1 // if byte is 0x01, then ...
                MOV        R3, R0,LSR#4 // set R0 to R0 >> 0x4
                AND        R3, R3,        #0xF // set R4 to R4 & 0xF
                ORR        R3, R3,        R0,LSL#4 // set R3 to R3 | ( R0 << 0x4 )
                EOR        R0, R3,        #0x7A // set R0 to R3 ^ 0x7A
                BNE        loc_8470 // ... exit program
                MOV        R0, #0 // clear register R0
                ADD        SP, SP,        #4 // don't care
                LDMFD        SP!, {PC} // don't care

Now we can create updates from the Kindle directly.

If you want to try it out, here's the patch from dm to md: http://yifan.lu/files/md.bspatch

MD5 values:
dm: 6725ac822654b97355facd138f86d438
md.bspatch: 64404f7f82b0a1ba3561cdf12e9cbd18
md: 3b650bcf4021b41d70796d93e1aad658

Usage: bspatch /path/to/dm md /path/to/md.bspatch

You can play around with encryption, decryption by:
echo 'hello world' | md > hello.bin
cat hello.bin | dm
You should see you message back.


EDIT: Here's a script that will run on the Kindle and convert a tar.gz into an update package http://pastebin.com/2L4pqhsw

troyme 04-05-2011 12:53 AM

Can the 3.1 software run in the linux chroot mode ???
If it can , then all will be much easy.

yifanlu 04-05-2011 02:04 AM

The problem is that 3.1 is completely different starting with the init scripts and low level binaries. It may be possible to do a "soft" reboot, but the OS is 500MB, and that's 1/3 of the userstore.

Also progress update: I've finished writing all the installation and package creation scripts. However they are completely untested. I plan to test this weekend.

bZkindle 04-05-2011 03:29 AM

And they said it wasn't possible! Incredible stuff yifanlu!

Caleb666 04-05-2011 03:59 AM

I know this is offtopic, but this just goes to show that Amazon really did screw their DX customers.

montalex 04-07-2011 07:59 PM

If I were to install 3.1 on my Kindle 2i, would that mean that I would have to use jailbreaks and hacks meant for Kindle 3? How would that work?

yifanlu 04-07-2011 08:00 PM

Quote:

Originally Posted by montalex (Post 1482416)
If I were to install 3.1 on my Kindle 2i, would that mean that I would have to use jailbreaks and hacks meant for Kindle 3? How would that work?

No, you still use hacks for kindle 2. Just make sure it works.

troyme 04-07-2011 11:02 PM

Quote:

Originally Posted by yifanlu (Post 1482419)
No, you still use hacks for kindle 2. Just make sure it works.


Could you please first release the version 3.1 rootfs img got by dd ????
then I can see what's new in it and play with.

yifanlu 04-08-2011 02:28 AM

Quote:

Originally Posted by troyme (Post 1482647)
Could you please first release the version 3.1 rootfs img got by dd ????
then I can see what's new in it and play with.

If you have recovery access and would like to beta test, pm me.

yifanlu 04-08-2011 10:39 PM

Another progress update. The installer is 2/3 complete. Currently, I am able to create a recovery package directly on the Kindle. The process currently is:

1) Copy "update_make_image.bin" to Kindle 2
2) Generates "output/update_recover_k2_os.bin" and "output/rootfs.img" and also installs recovery kernel. Copying "update_recover_k2_os.bin" to the root and you can restore your Kindle to whatever it was before.
4) Copy rootfs.img and update_make_image.bin to Kindle 3
5) Kindle 3 takes rootfs.img and generates "update_k2_os.bin" which will install Kindle 3.1 when you copy it back to the Kindle 2.

yifanlu 04-09-2011 08:59 PM

2 Attachment(s)
It's done! Well, sort of. It's done, but untested. I'm going to release the first alpha, but here are the current limitations:

-ONLY supports upgrading Kindle 2 US 2.5.8 to 3.1 using a Kindle 3 3G 3.1 (All conditions version, model, etc must be met)
However, you can easily change the code to support other versions/models, but I want to concentrate on getting one thing right at a time. I made sure no model/version specific code exists, so you can rename stuff to produce other packages, but if you are knowledged enough to do this, I don't need to give directions.
-Slow. It WILL take 2 hours. Luckly, you don't have to stare at it. Just keep it charged.
-You need 900MB of free space on the Kindle 2.
-You need 1.2GB of free space on the Kindle 3.
-Make sure to back up your Kindle 2!!!

DO NOT PROCEED UNLESS YOU KNOW HOW TO RECOVER! I TRY TO MAKE IT BRICK PROOF, BUT IT IS UNTESTED

To use:
1) Copy "update_k2_2.5.8_prepare_kindle.bin" to your Kindle 2 US. It must be version 2.5.8 (555370010)
2) Run the updater. The updater will create a rootfs image and a backup recovery package (for restoring beck to 2.5.8). It will also flash the patched recovery kernel for running unsigned recovery packages. This will take around 45 minutes to complete (the compression takes the most time).
3) After the updater completes, connect the kindle 2 to the computer and open up the folder "output" on the usb drive. You'll find two files: update_restore-k2-os.bin and rootfs.img. Keep update_restore-k2-os.bin safe, as you need that to restore 2.5.8.
4) Copy rootfs.img from the Kindle 2's output folder and "update_k3g_3.1_create_updater.bin" from the download to the root of the Kindle 3's usb partition.
5) Run the update. This will take about an hour. Do NOT interrupt!
6) After that completes, connect your Kindle 3 back to your computer and you'll find "update_k2-os.bin" and "tts-files.tar" in the output folder.
7) Copy those two files to the root of the Kindle 2 (you can delete the output folder from Kindle 2)
8) Restart your kindle 2 and it'll update.

NOTES:
-Check the log files in the output folder to see what steps completed (if it fails)
-The kindle will display progress and error messages on the lower right hand corner of the screen.
-If you do not want to flash the recovery kernel because you flashed it before (recovery kernel is REQUIRED for upgrading), create a file named "NO_KERNEL" on the root of the USB partition.
-If you want to skip file checks, create a file named "NO_VALIDITY_CHECKS" on the root of the USB partition to bypass the md5 checks.

tekkasit 04-10-2011 01:42 AM

yifanlu, I just confused with the following statement.

1. That means I need to have Kindle 3 and 2, right?

2. How to uninstall or undo this thing on Kindle 2 (including remove the backup recovery package)? Because I afraid that if I feel doesn't like software v3.1 for what ever reason, I can't revert back my K2 to the original state.

3. After the upgrade K2 to run v3.1 software, what will happen if Amazon release an update of K3 software?

troyme 04-10-2011 09:54 AM

Quote:

Originally Posted by tekkasit (Post 1485636)
yifanlu, I just confused with the following statement.

'-You need 1.2GB of free space on the Kindle 3.'

Because you need a working k3 to extract the 3.1 software

the-equinoxe 04-10-2011 09:57 AM

Quote:

Originally Posted by tekkasit (Post 1485636)
yifanlu, I just confused with the following statement.
'-You need 1.2GB of free space on the Kindle 3.'

From what I understand: You need a K3 to rip the rootFS from.
On that K3 you need approx 0.6 GB for the FS itself and than the rest for the encrypting routine to make a Kindle readable update package.

Regards,

EqX

yifanlu 04-10-2011 11:34 AM

Quote:

Originally Posted by tekkasit (Post 1485636)
yifanlu, I just confused with the following statement.

1. That means I need to have Kindle 3 and 2, right?

2. How to uninstall or undo this thing on Kindle 2 (including remove the backup recovery package)? Because I afraid that if I feel doesn't like software v3.1 for what ever reason, I can't revert back my K2 to the original state.

3. After the upgrade K2 to run v3.1 software, what will happen if Amazon release an update of K3 software?

1) You need a k3 because it is illegal for me to redistribute the files. If it were not, it would be as easy as me releasing a 300MB file. You can use a friends' k3 too because nothing on the k3 is permentally modified and no personal information is stored.
2) You "uninstall" by restoring from the backup packaged generated from the k2. Nothing is installed on the k3.
3) if amazon releases 3.1 update. If it is minor, it MAY work. If it is major or modifies one of the three files I modified, then it will fail. My goal is to have no files modified, then you can upgrade.

tekkasit 04-10-2011 09:45 PM

I can't run update ('update_k2_2.5.8_prepare_kindle.bin') on my K2, the item 'Update Your Kindle' still disabled.

My K2 jailbroken, using NiLuJe's SS and Font Hack

bZkindle 04-10-2011 10:40 PM

yifanlu- I know you plainly stated it, but just to double confirm: this will only work with K2, US version, and will not work with DX/G?
Are you planning on a DXG version?
That would make some of us deliriously happy...

yifanlu 04-11-2011 12:05 AM

Quote:

Originally Posted by bZkindle (Post 1486831)
yifanlu- I know you plainly stated it, but just to double confirm: this will only work with K2, US version, and will not work with DX/G?
Are you planning on a DXG version?
That would make some of us deliriously happy...

I am planning to make it for every kindle K2, K2i, DX, DXi, DXG (as stated in the title). Right now, the first alpha version will be for kindle 2 only so I can work out bugs.

Quote:

Originally Posted by tekkasit (Post 1486785)
I can't run update ('update_k2_2.5.8_prepare_kindle.bin') on my K2, the item 'Update Your Kindle' still disabled.

My K2 jailbroken, using NiLuJe's SS and Font Hack

What is your Kindle 2 version? (Including the long OTA number, you can find it in the settings page)

EDIT: I've updated the zip file in the post, download it again, it should work now.

tekkasit 04-11-2011 04:05 AM

I using Kindle 2 International (B003), Kindle Software version 2.5.8 (555370010).

I can not run this update even with the updated 'update_k2_2.5.8_prepare_kindle.bin' file.

yifanlu 04-11-2011 08:45 AM

Quote:

Originally Posted by tekkasit (Post 1487057)
I using Kindle 2 International (B003), Kindle Software version 2.5.8 (555370010).

I can not run this update even with the updated 'update_k2_2.5.8_prepare_kindle.bin' file.

I can make a package for k2 international, but it won't be tested. do you want that?

FF2 04-11-2011 10:23 PM

Now if this comes to fruition, it could be used to replace the AD-supported firmware of the newly announced kindle!!

bZkindle 04-11-2011 11:39 PM

Quote:

Originally Posted by FF2 (Post 1488489)
Now if this comes to fruition, it could be used to replace the AD-supported firmware of the newly announced kindle!!

I don't think so. this is for porting the 3.1 firmware to kindle 2/DX/G.
I'm sure someone will find a really simple way around that ad-supported crap in no time. ;)

tekkasit 04-12-2011 01:07 AM

Quote:

I can make a package for k2 international, but it won't be tested. do you want that?
I may waiting a little bit. :D

luyt 04-12-2011 02:03 AM

yifanlu, great job!
This hack surely will make many happy. Hope you could finish testing early.

BTW, when it is done, does it mean we can have some k3-specific functions, such as dictionary look-up, pdf darker, etc, on Kindle DX or even Kindle 2?

Thank you very much.

yifanlu 04-12-2011 02:32 AM

Quote:

Originally Posted by luyt (Post 1488661)
yifanlu, great job!
This hack surely will make many happy. Hope you could finish testing early.

BTW, when it is done, does it mean we can have some k3-specific functions, such as dictionary look-up, pdf darker, etc, on Kindle DX or even Kindle 2?

Thank you very much.

Yup. Everything you can do on k3.

luyt 04-12-2011 07:05 AM

I just got a DX and the 3.1 software would be really fantastic to me.

Knowing little of programming, i wondering as kindle dx does not have a wifi but a 3G module and my kindle 3, on the contrary, has only a wifi module, would the package tranplanted from Kindle 3 to DX work properly?

And could you please estimate when will a useable package for DX be released?

Thanks.

yifanlu 04-12-2011 08:41 AM

Quote:

Originally Posted by luyt (Post 1488934)
I just got a DX and the 3.1 software would be really fantastic to me.

Knowing little of programming, i wondering as kindle dx does not have a wifi but a 3G module and my kindle 3, on the contrary, has only a wifi module, would the package tranplanted from Kindle 3 to DX work properly?

And could you please estimate when will a useable package for DX be released?

Thanks.

The thing is, nobody is helping me test :( (or they're not telling me, I need to know If it works or not). So currently, I can't do much but wait. If anyone can send me a DX (broken or not), I can probelty get it working in a week or so. If someone helps me test by having a DX with recovery access, I could probelty get it working in a month or two.

luyt 04-12-2011 09:40 AM

What a pity. I myself wish i could help but i know very little about both programming and linux.

I donot sure about the meaning of "having a DX with recovery access". Does it mean an access permission or a knowledge about how to recover DX when something unwanted happens.

I think many people would like to offer a hand if they know, I will try to tell people who are unsatisfied about current kindle version of their kindle dx.

eLiNK 04-12-2011 09:44 AM

yifanlu
Do not know anything about recovery access myself.

is [Full URL name needed - MODERATOR] article any good?

troyme 04-13-2011 03:07 AM

I have a kindle DX us,but can't find a k3 nearby.So .....

yifanlu 04-14-2011 06:14 PM

Ok, so some good news:
1) All Kindle versions (US/Init/DX/DXi/DXG) uses the same kernel. That means I do not have to recompile the recovery kernel and risk bricking on other devices. The kernel I test on the K2 should also work the same on other kindles.
2) It SEEMS from the DXG one of you provided that the DXG has the same FS as the Kindle 2 US (with the exception of one library that handle International modem).

This means that I can, more quickly, make the DX versions and that minimal testing would be required on the DX (after K2US works).

Here's what I still need:
-rootfs image from Kindle DX US
-rootfs image from Kindle DX Internation
-rootfs image from Kindle 2 International
(or a broken kindle you can send me if you can't extract the image)

modusop 04-14-2011 11:37 PM

Totally excited about this.

azuwis 04-15-2011 03:29 AM

Quote:

Originally Posted by yifanlu (Post 1493117)
2) It SEEMS from the DXG one of you provided that the DXG has the same FS as the Kindle 2 US (with the exception of one library that handle International modem).

Cool. Does this mean 3.x custom firmware on Kindle DXG will have 3G?

yifanlu 04-15-2011 02:43 PM

Quote:

Originally Posted by azuwis (Post 1493564)
Cool. Does this mean 3.x custom firmware on Kindle DXG will have 3G?

Yes, you can. However, that's one of the main things I want to test. The OS in all the Kindles 2.X are the same, except for the 3G drivers. It seems like all the Kindle uses different 3G cards. So it MAY not work at first release, but eventually it will.

Also, I've posted some packages in the first post to aid you in obtaining your rootfs image.

meepus 04-16-2011 02:41 AM

I have a kindle DX (the original, before international) and would greatly appreciate the results of this project. I have a college freshman level education in computer science, and I am very comfortable messing around with technology but have little to no coding experience. I am willing to do whatever to assist you with this, and if it will speed things along, I will extract the rootFS image for you. Let me know.

Edit: I have also brought the kindle subreddit's attention to this thread -- http://www.reddit.com/r/kindle/comme...n_the_updated/

tekkasit 04-16-2011 02:43 AM

This is my Kindle 2 Int (B003) rootfs.img with firmware 2.5.8, I split my rootfs into 3 zip files.

Full URL name needed - MODERATOR]

troyme 04-16-2011 04:39 AM

1 Attachment(s)
I see

I will PM the address

luyt 04-16-2011 05:10 AM

1 Attachment(s)
I also upload my Kindle DX US version 2.5.8 image.
I upload it in u.115.com like troyme used above, cause i found this is the fastest site i can upload.

http://u.115.com/file/f0176d7130#
KINDLE_DX_rootfs.zip


All times are GMT -4. The time now is 11:12 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.