10-02-2013, 12:12 AM | #31 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
It was broken into a two-stage bootstrap -
First part has a small memory footprint and very limited functions, the second part is a more complete build with more functions but has to be started manually (I think). I am not even sure I recall its name, bist, I think. EDIT 1: Yes, it is called bist (Built In Self Test) - that should be the full featured build of u-boot if you want to try it from the u-boot menu. EDIT 2: Ah, I see you already did that. Thanks, that is indeed still the fuller featured build of u-boot. Really, really, nice to see that lab126 hasn't (yet) thought through the locking down of an embedded *nix (Unix) system machine. Last edited by knc1; 10-02-2013 at 12:21 AM. |
10-02-2013, 12:18 AM | #32 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
It does show that we can take over the machine using the features offered over the serial port. |
|
Advert | |
|
10-02-2013, 12:26 AM | #33 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
In fact, once it is in fastboot mode (however it got there), then Kubrick can be extended to handle de-bricking a Kpw2. It looks like you have documented that everything the Kindle-Krackers might need is still present. Way past this old man's bedtime - Will just wait for the dev's in other time zones to get caught up, reading all of this information. They will probably ask you to do some more things with your device over the serial port, such as make copies of the firmware. I am far to sleepy to even dare to give you step-by-step on doing that. But if you can leave your working setup alone, until someone else wakes up . . . . We may not know if the end-user will very be able to "Jailbreak" the device, but we are now certain that we can de-brick one over the serial line. Many thanks for all this information ! I can see that you have been reading Geekmaster's de-bricking threads (and the related threads) - smart move to learn what you can about the device first. Well done. Last edited by knc1; 10-02-2013 at 12:48 AM. |
|
10-02-2013, 01:22 AM | #34 |
1st KPW2 JB
Posts: 26
Karma: 133537
Join Date: Oct 2013
Device: PW2
|
I have also gained root access to the diag partition. Which seems to be...
Code:
#!/usr/bin/env python import hashlib print("fiona%s"%hashlib.md5("XXXYOURSERIALXXX\n".encode('utf-8')).hexdigest()[13:16]) |
10-02-2013, 01:40 AM | #35 |
1st KPW2 JB
Posts: 26
Karma: 133537
Join Date: Oct 2013
Device: PW2
|
I will try to check this page a few times, but I have class and some studying to do for an exam on the 2nd. So I won't be doing a whole lot with this kindle till late at night.
But if there are people who want me to try stuff let me know. And I am excited to learn this stuff so anyone who wants to give information about what I am seeing/what needs to be done would be awesome. As well as any resources I should look into |
Advert | |
|
10-02-2013, 06:42 AM | #36 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
Once you can login as root on the 'diag' partition (/dev/mmcblk0p2), then you have permissions that allow you to mount the 'main' partition (/dev/mmcblk0p1). (just make a mount point in /tmp of some name) With the 'main' partition mounted (say, at: /tmp/main) you can then navigate to the passwd and shadow files of the main partition. Then give the password cracker utility a go at root's password in the 'main' partition. Then you will have access as 'root' in either 'diags' or 'main' mode. You do need both, because you can not reliably copy the contents of a partition that is in-use. I.E: You have to be in 'diags' to copy out /dev/mmcblk0p1 and you have to be in 'main' to copy out /dev/mmcblk0p2. (and you have to be in the ram-resident, 'recovery mode' to copy out the hidden partitions of the flash chip. That gets a bit technical, you have diddle registers on the flash chip. So for that, then the pictures that show part numbers is required. Have to id the flash chip part number and look up its datasheet.) - - - well, back to the 'user' visible parts of the flash storage - - - Flash storage is copied in units of an 'erase block' size. Without knowing the flash chip part number, assume: 4096 bytes. The eMMC flash chip will have a DOS format disk label at the start of the device. You can read that using: Code:
fdisk -l /dev/mmcblk0 You will find in that output that the partitioned portion of the flash does not start immediately after the disk label. It starts some 'offset' amount into the raw device. The area from the end of the disk label to the start of the first partition (outside of any file system) is in use. That holds device and user specific data. You will want a back-up copy of that, but DO NOT post it. (although one or more of the Kindle-Krackers may PM you for a copy of that - those people you can trust not to mis-use the information - you can tell who they are from their post history here) With a post of the output of that fdisk -l command, we can tell you how many erase blocks to copy. ok - that takes care of the storage area outside of the main partitioned, user visible. while running in 'diags' mode, you can copy-out the 'main' mode filesytem storage area (/dev/mmcblk0p1) while running in 'main' mode, you can copy-out the 'diags' mode filesystem storage area (/dev/mmcblk0p2) there is a partition of persistent system data, known as the /var/local/* sub-tree in either 'diags' or 'main' mode. Same, same partition is used by both modes. that will /dev/mmcblk0p3 You will want to make a back-up copy of that for yourself, but no need to post that (again, one or more of the Kindle-Krackers may PM you for a copy of that). and then there is the partition used for the "user storage" area, visible over the USB cable by the end-user. This one is a bit tricky - it is a DOS disk label partitioned storage area, located in the fourth partition for the primary DOS disk label. (Yes - that is legal, although MS never used that, that I know of, although it is in their specs.) So that disk label can also be read with the fdisk -l(ist) command. Just tell it to read /dev/mmcblk0p4 as if that was the physical start of the storage device. Here, you will find another "outside of the (second level) partitioned area. You will want a backup of that. The file system within the (second level) disk label partition is already accessible when the kindle is in 'mass storage mode' using the usb cable. That will be the destination of all the copies made above (so that those binary copies will end up as files in the user's usb storage area when the device is running normally). pant, pant, pant - - - rather long, and I left out the copy commands in the above. they aren't 'secret' by any means, but it would be better to work through this the first time interactively. mostly because the above is all from memory of prior kindle system structure - and a new device may have hidden surprises. See the sticky at the top of the forum index page about the IRC, kindle-dev channel. Somebody (ixtab, NiLuJe, twobob, myself) will be there to meet you and walk you through all the commands and option numbers when you have some more free hobby time. |
|
10-02-2013, 09:00 AM | #37 |
BLAM!
Posts: 13,497
Karma: 26047188
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
Yep, add me to the list of people wanting to take a look at a dump of the rootfs & diags parts, as well as the full kernel .
Thanks . FWIW, the root account is locked since FW 5.3, which might explain why the login over serial in main doesn't work. (Check the passwd file on the main part, there's a '!' somewhere to indicate that the account is locked). Last edited by NiLuJe; 10-02-2013 at 09:38 AM. |
10-02-2013, 09:34 AM | #38 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
but since he is now 'root' in the 'diags' partition, he can make a copy of mmcblk0p1 (main) for us and we can decide what to do about it. Perhaps (one sleep-dulled idea) - stuff Dos1's event handler into the main system, then diddle from USB storage with custom event handlers. Ah, I forgot where/what to use as the USB storage destination target file system of the dd copies (/mnt/base-us ?? or shall we look at the output of 'mount' first?). Please someone, add that recommendation here. |
|
10-02-2013, 09:39 AM | #39 |
BLAM!
Posts: 13,497
Karma: 26047188
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
@knc1: I usually just dd to netcat when dumping a partition (it's also what's in the wiki, IIRC).
|
10-02-2013, 09:48 AM | #40 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
Right - maybe post a link? This is npoland's first thread here. Although he has obviously done his research on this subject. The serial port connection is the same PCB pattern on the Kpw2 as the Kpw1 - so I would use the same labels on the connection points. (Lazy draftsman - reused the connection layout file.) Since npoland is either asleep or in class now - Just stuff this thread with things he can use directly, without searching for it. |
|
10-02-2013, 09:53 AM | #41 |
BLAM!
Posts: 13,497
Karma: 26047188
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
For the backup procedure: https://wiki.mobileread.com/wiki/Kind...Hacking#Backup
Not sure get_kernels will handle the PW2, but if it can, I'd be very glad for a kernel dump too . @npoland: Take your time, there's no rush . Last edited by NiLuJe; 10-02-2013 at 09:57 AM. |
10-02-2013, 10:11 AM | #42 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
We never got around to learning if USBnetworking is pre-installed in this 'diags' environment. The only thing I have a serial port connection installed on here in my stack of things is a K3. Duh... Maybe some of the information in 'serial port de-bricking' threads could be adapted for npoland's use. (sorry, still need another nap here) |
|
10-02-2013, 04:19 PM | #43 | |
but forgot what it's like
Posts: 741
Karma: 2345678
Join Date: Dec 2011
Location: north (by northwest)
Device: Kindle Touch
|
npoland, thanks for your efforts. This topic is for now defintely the most interesting place for those who familiar with software internals of previous Kindles. Will wait for release of rootfs dump. Ahhh, suspense time...
UPD: BTW, mmc driver in PW2 kernel has access to eMMC internal boot partition (where U-Boot is stored). Here is relevant excerpt: Quote:
Last edited by eureka; 10-02-2013 at 04:40 PM. |
|
10-02-2013, 05:19 PM | #44 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
Should make it easier to install Tizen Board/Parts pictures on the way, later in the day. Amazon has already posted a (broken) link to the 5.4.0 sources. |
|
10-02-2013, 07:39 PM | #45 |
1st KPW2 JB
Posts: 26
Karma: 133537
Join Date: Oct 2013
Device: PW2
|
Teardown Images. I may have heated some connectors a bit much while tearing it apart. Everything still works though.
|
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
second gen paperwhite in a first gen case? | BeccaPrice | Amazon Kindle | 9 | 10-06-2013 08:05 PM |
Kindle Fire (1st gen and 2nd gen) now officially CyanogenMod supported | Jessica Lares | Kindle Fire | 8 | 04-01-2013 02:27 PM |
Content PaperWhite & Fire 2nd Gen MOBIs don't need an inline TOC | alansplace | Amazon Kindle | 4 | 01-14-2013 08:04 PM |
Polarizing Filter on KF 2nd Gen (not HD)? | Doc109 | Kindle Fire | 0 | 01-06-2013 11:46 PM |
Ended Irex Iliad 2nd Gen | devant | Flea Market | 8 | 01-27-2010 01:49 AM |