Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 05-15-2017, 02:48 AM   #106
JotaCe
Member
JotaCe doesn't litterJotaCe doesn't litter
 
Posts: 23
Karma: 126
Join Date: May 2017
Location: Madrid
Device: Kindle PW2, PW3
Help!

I think I have bricked my kindle!

I have just edited (one more time) the jar, this time affecting the instruction "fonts.wordsperline.default", from 30 to 15. When resetting the kindle, it has entered an endless resetting loop. I have tried to stop the loop by pressing several seconds the on/off button, and now I have the message "it is necessary to repair the kindle".

Help please!
JotaCe is offline   Reply With Quote
Old 05-15-2017, 10:11 AM   #107
JotaCe
Member
JotaCe doesn't litterJotaCe doesn't litter
 
Posts: 23
Karma: 126
Join Date: May 2017
Location: Madrid
Device: Kindle PW2, PW3
Well, I have found some threads about debricking, but if somebody could help I would be grateful.

I just need to be able to connect to the kindle via ssh to replace the file I have modified. Is there any way to do it? I am familiar with the "recovery" mode in android, does it exist anything similar in kindle? Can I just start the system in some "debugging mode" and copy back the original file?

Last edited by JotaCe; 10-25-2017 at 04:12 AM.
JotaCe is offline   Reply With Quote
Advert
Old 05-15-2017, 11:35 AM   #108
JotaCe
Member
JotaCe doesn't litterJotaCe doesn't litter
 
Posts: 23
Karma: 126
Join Date: May 2017
Location: Madrid
Device: Kindle PW2, PW3
FIXED!

During the restart loops, the kindle was able to connect to the PC, and I managed to copy a system image in the root folder. After that, the kindle updated itself and... that's all!

Well, I am not sure if I feel like trying to modify the margins again or I will live with the defaults...
JotaCe is offline   Reply With Quote
Old 05-15-2017, 01:55 PM   #109
JotaCe
Member
JotaCe doesn't litterJotaCe doesn't litter
 
Posts: 23
Karma: 126
Join Date: May 2017
Location: Madrid
Device: Kindle PW2, PW3
Here I go again... I think I am a bit audacious... (but now with the rescue pack onboard, just in case...)

Well, once restored my kindle, I have tried again to modify the margins. No way! This time I have modified the three last values (50-100-150 to 10-20-30), which are the ones that worked (until I turn the page...) and also the other values (50.94-33.96-16.98 to 12.74-8.49-6.38) (ref post #103). The result is the same: I get the right margins, but they are reverted to the default as soon as I change the page.

Any idea?
JotaCe is offline   Reply With Quote
Old 05-15-2017, 02:02 PM   #110
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
What book format are you using for your tests?
The same reader code is not used for all books.

= = = =

You don't mention, so I will - -
Get some experience using RP now, before you need it.
Trying to learn how to use it when you need it is almost too late.
And you had better add-in the CRP option and get used to that also before you need it.


Unless, of course, you really want a reason to install the serial port on your Kindle, because you are heading in that direction.

= = = =

PS:
Embedded systems are not developed by making changes on the device.
You network boot the OS that you are modifying.
Then, when things go wrong (and they will), all you have to do is revert the file on the network server and re-boot to the on-board image.

Last edited by knc1; 05-15-2017 at 02:08 PM.
knc1 is offline   Reply With Quote
Advert
Old 05-16-2017, 03:27 AM   #111
JotaCe
Member
JotaCe doesn't litterJotaCe doesn't litter
 
Posts: 23
Karma: 126
Join Date: May 2017
Location: Madrid
Device: Kindle PW2, PW3
Quote:
Originally Posted by knc1 View Post
What book format are you using for your tests?
The same reader code is not used for all books.
I was thinking this could be the key. I am testing with mobi books. I expected the margins to be independent of the book format, but I was starting to ask myself is this could be the case. Your question seems to confirm that this could be the problem. I will try with azw3.

However, I would like to have the margins working for all the formats (well, at least azw3 + mobi; I rarely use other formats). What would be the file to edit for mobis? I remember to have read something about a file called "mobi-drawing" that was used to modify font sizes in mobis; maybe the same file for mobi margins? I'll have to check...

EDIT: Checked. I don't see anything related to margins in mobi-drawing-es.jar nor mobireader-impl-es.jar.

Quote:
Originally Posted by knc1 View Post
You don't mention, so I will - -
Get some experience using RP now, before you need it.
Trying to learn how to use it when you need it is almost too late.
And you had better add-in the CRP option and get used to that also before you need it.


Unless, of course, you really want a reason to install the serial port on your Kindle, because you are heading in that direction.
Ups, your last sentence is a little hard... but maybe you are right.

Well, in fact I haven't tried RP, because I have read the instructions and it seems to be quite easy to use. But I will follow your advice: better losing five minutes now than losing my kindle forever...

Quote:
Originally Posted by knc1 View Post
PS:
Embedded systems are not developed by making changes on the device.
You network boot the OS that you are modifying.
Then, when things go wrong (and they will), all you have to do is revert the file on the network server and re-boot to the on-board image.
Sorry, but I don't understand what you mean here.
Do you mean I could test the changes out of the kindle?
Or are you just talking about using the RP to restore the original file to the device in case that something goes wrong? (that is clear for me, but I don't understand your comment about using the network to boot the OS, and what the network server is...)

Could you please clarify? I am not an expert at all (as you surely already noticed), just someone used to tweak computer systems but at user level.

Thanks for your help!

Last edited by JotaCe; 05-16-2017 at 04:51 AM.
JotaCe is offline   Reply With Quote
Old 05-16-2017, 06:42 AM   #112
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Now that is probably going to turn into a question you really wish you hadn't asked, but the answer:

The Kindles use an "embedded" operating system.
It is made as much a part of the hardware as is possible, not something the user can easily change.
That is what an "embedded" OS is all about, small size, fast, is part of the device (not an add-on to the hardware, a part of it).

When the Kindle's system starts up (from a power-off condition, not just suspended) it goes through a "boot sequence".

Approximately:

The "bootstrap code" manufactured into the SoC devices ROM is run.
There is no changing that, the ROM is not a programmable device.
That code runs another program from a hardware determined, fixed place.
(or a short list of fixed places - a feature I will over look here)

In the case of the Kindles, a "bootstrap program" named: u-boot.
(Technically, u-boot is a multi-stage boot loader, but that point can be ignored here.)
That program is read from eMMC, which is a programmable device.
I.E: the installed copy of u-boot can be changed but normally is never changed.
Two things of interest to the developer -
u-boot can be scripted
u-boot can have its default environment changed (permanently or temporarily)

u-boot, left to its own Amazon/Lab126 provided installation, runs a single application, the Linux kernel.
In the case of the Kindles, one of two pre-installed Linux kernels.
(Kindles since the K4 are dual-boot, like having WinXP and Win10 installed on the same PC)

The Linux kernel, after a bunch of programming handsprings during its start-up, attaches the program storage filesystem, switches from system to user mode, and runs a single user mode start-up (initialization) program.
Historically named: init
As in: initialization, which is indeed what it does. It starts the user mode programs, in the case of the 5.8.x series of firmware about 105 of them, all of them multi-task.
At which point things become difficult to describe.

Ignoring the options available in the ROM boot code stage (which takes hardware changes to change options - coplate is playing with those now) . . . .

u-boot can load the program it runs (the Linux kernel) from a network connection.
Which is handy if a person wants to develop the Linux kernel for a special bit of hardware. (you don't - so ignore this stage also)

The Linux kernel can load the program filesystem it runs from a network connection.
and/or
The Linux kernel can use a (network) remote filesytem for its filesystem.
(Yes, there are technical differences in the above two choices.)

This last describe stage of power-on start-up is the one of interest to an application program meddler.
In the case of this usage on the Kindles, the two directory paths: /lib/firmware and /lib/modules MUST have the same structure and contents that the Amazon provided system images do, but other than that, a person mostly has a free hand in what is included.

How is this last choice made?
On the Kindle's command line, enter:
Code:
cat /proc/cmdline
Which will show you what the command line arguments where that the Linux kernel program (it is just a single program) was started with.
Among those command line options, you should see an:
Code:
ip=0
which turned off its search of network connections for its initial filesystem.

So point that to the network address of the filesystem image you are modifying.
If the modifications you make "brick" the Kindle, change the startup option back to
Code:
ip=0
re-boot and like magic, your Kindle is un-bricked.

Now nearly all of the above is much easier to use when you have the "Operator's Console" connected so you can diddle with each of the sequence of programs involved in the Kindle's start-up process.
The ROM code, the u-boot code and the Linux kernel code all expect the "Operator's Console" to be connected to the first serial port.

But you don't need the serial port, not if you take advantage of the fact that Kindles are dual-boot.
Installing RP installs ssh into the alternate (diags) OS.
Installing CRP adds the feature of switching between the main OS and the diags OS based on if the USB cable is connected to a PC at boot-time.

Without the USB cable connected to anything -
re-boot the Kindle and it will run the main OS (which options you have changed to run from a network system image file rather than a system image file stored in the Kindle's hardware).

With the USB cable connected to the PC -
re-boot the Kindle and it will run the diags OS (which options you have not changed - do not touch them for this use-case).
From the diags OS, you can diddle with the start-up options that (u-boot and) the main OS uses during start-up (such as the ip= option of the kernel command line).

Last edited by knc1; 05-16-2017 at 07:06 AM.
knc1 is offline   Reply With Quote
Old 05-16-2017, 07:56 AM   #113
JotaCe
Member
JotaCe doesn't litterJotaCe doesn't litter
 
Posts: 23
Karma: 126
Join Date: May 2017
Location: Madrid
Device: Kindle PW2, PW3
Wow! A great master class! Really very interesting and informative, thank you for taking the time to write it down!


But I think this is going too far for me. When I started messing with all this matter of margins, I expected it would be much easier. I have just left my loved kindle 4 where I could change margins just by editing a text file accessible from windows! Ok, I accepted the challenge of learning about SSH, editing java files, etc... but I thought that those were just some tools to do more or less the same I did in my old kindle: change a value.

Now, not only is not so easy to find which value I have to edit, but I have discovered how easy is to break my device by editing the wrong one (I never expected that would be possible just by changing a value called fonts.wordsperline.default!). Ok, I was able to recover from near disaster and I was courageous enough to try to start again (more carefully this time). But I have discovered that I cannot find where the damned margins values are (for mobi, at least), and that the way to go deeper and at the same time trying to be on the safe side (the network connection and all that stuff) is too complicated, it needs too much study, too many hours of dedication for someone like me, withouth the basic knowledge. Not worth it.

I appreciate very much all your directions, but I see that this could take much more time than I am willing to dedicate to this matter. In fact, I passed that boundary long ago: when I started, I expected to solve this in matter of minutes! It is tempting, I must confess, to try to go on, because I usually take these issues as a challenge, and I like these types of challenges, it is quite rewarding when you finally succeed. But, on the other side, I recognize that spending lots of hours learning about technical details that I will soon forget (because I will not use them anymore) just for changing a margin... is too much.

Well, the good thing is that in the last days I have begun to feel not so bad with those awful default margins. I really hate them, yes, but maybe not so much as the first day, when I changed from my old K4 with 15 pt margins to the new one with 50 pt as a minimum. Now, page after page, I'm getting used to it.

I will have to live with that!

Thanks again for your patience, knc1!


Last edited by JotaCe; 05-16-2017 at 08:01 AM.
JotaCe is offline   Reply With Quote
Old 05-16-2017, 08:19 AM   #114
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Changing the selection of font sizes IS that easy, use the:
FONT_RAMP
file in the top of visible USB storage.
(Search for that term here.)

But they did not do the same with the margin configuration.
Would be nice if they had, even as an undocumented feature as the FONT_RAMP feature is undocumented (by Amazon).

Posted on this forum is also a good solution to these sort of changes -
JBpatch
It modifies the *.jar files as the Java system loads them, rather than change them on disk.
But that tool has not been maintained and I was not able to get anyone interested in working on it when I last tried.
(I haven't written anything in Java for over twenty years, so even if I had the time .... )

Last edited by knc1; 05-16-2017 at 08:23 AM.
knc1 is offline   Reply With Quote
Old 05-16-2017, 08:34 AM   #115
JotaCe
Member
JotaCe doesn't litterJotaCe doesn't litter
 
Posts: 23
Karma: 126
Join Date: May 2017
Location: Madrid
Device: Kindle PW2, PW3
Yes, I know the FONT_RAMP solution, and the JBPatch. As I said, I have dedicated several hours to research this matter! Unfortunately, this doesn't solve my problem with the margins!

What amazes me is that the solution to the margins via jar edition is documented in a couple of threads, and nobody has reported a problem with mobis! Do all people here use azw3? Yes, I know it is a "better" format, but I like to send my books to the kindle by e-mail instead of using a cable, and I cannot do that with azw3!

This is also the reason to not going back to a previous version where JBPatch works: because I lose access to amazon, which means no wifi book transfers...

Last edited by JotaCe; 05-16-2017 at 08:37 AM.
JotaCe is offline   Reply With Quote
Old 05-16-2017, 08:56 AM   #116
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by JotaCe View Post
Yes, I know the FONT_RAMP solution, and the JBPatch. As I said, I have dedicated several hours to research this matter! Unfortunately, this doesn't solve my problem with the margins!

What amazes me is that the solution to the margins via jar edition is documented in a couple of threads, and nobody has reported a problem with mobis! Do all people here use azw3? Yes, I know it is a "better" format, but I like to send my books to the kindle by e-mail instead of using a cable, and I cannot do that with azw3!

This is also the reason to not going back to a previous version where JBPatch works: because I lose access to amazon, which means no wifi book transfers...
Now that **might** be a firmware version specific change.
Variables that once controlled all, may only control some now.

Why not a lot of trouble reports?
That could be because people are using KOreader for mobi rather than the stock reader:
https://www.mobileread.com/forums/fo...play.php?f=276

With KOreader installed, the stock reader almost becomes a "don't care" item.
(Except for the few, Amazon-only, formats.)

Last edited by knc1; 05-16-2017 at 09:04 AM.
knc1 is offline   Reply With Quote
Old 05-16-2017, 09:10 AM   #117
jhowell
Grand Sorcerer
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 6,495
Karma: 84420419
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
Quote:
Originally Posted by JotaCe View Post
Do all people here use azw3? Yes, I know it is a "better" format, but I like to send my books to the kindle by e-mail instead of using a cable, and I cannot do that with azw3!
There is a way to have personal documents delivered by Amazon over-the-air in AZW3 format.

There is a MOBI variant that contains both the old-style MOBI format and also KF8/AZW3 within the same file. It is known by Amazon as a Master MOBI. It can be created using Amazon's kindlegen or in calibre by setting the MOBI output file type to "both".

When this format is e-mailed to your account Amazon will split it and deliver the MOBI variant to older Kindles and the AZW3 to newer ones.

Edit: Be aware that AZW3 books delivered this way will show only generic cover thumbnails on the Kindle.

Last edited by jhowell; 05-16-2017 at 09:12 AM.
jhowell is offline   Reply With Quote
Old 05-16-2017, 09:57 AM   #118
JotaCe
Member
JotaCe doesn't litterJotaCe doesn't litter
 
Posts: 23
Karma: 126
Join Date: May 2017
Location: Madrid
Device: Kindle PW2, PW3
I knew about that "dual-mobi", but I never tried it. This could be an alternative solution, thank you, i'll try it.
JotaCe is offline   Reply With Quote
Old 05-17-2017, 02:29 AM   #119
JotaCe
Member
JotaCe doesn't litterJotaCe doesn't litter
 
Posts: 23
Karma: 126
Join Date: May 2017
Location: Madrid
Device: Kindle PW2, PW3
Well, after some tests, final conclusions about the margins hack (jar edition) in PW1 6.5.1.1:

The edited margins work "almost" fine with azw3, they don't work with mobi:

1. In mobi books, you can set the new margin but it is reverted to the default one (the small default one, 50 pt or close) every time you turn the page.

2. In azw3 books, if you set the new margins, they survive the page turn, but they don't survive a return to the home page. Once you change the book, or even without opening a new book but exiting the book you are reading to the home page, when you return the margins are lost and the default (small one) is set.

That is, in azw3 you must set the margins for each book, which is more or less acceptable. In mobi, you must do it for each page, which is "a little bothering"

When the margins are "automatically resetted" by the kindle, they are the same as shown in the home menu, view list. Maybe the key could be to modify also those, but I am not willing to follow this research. I just mention it here in case it could be helpful for someone in the future. I will copy these conclusions in the JBPatch thread, where the margins are also discussed, for the same reason.

Last edited by JotaCe; 05-17-2017 at 03:04 AM.
JotaCe is offline   Reply With Quote
Old 05-27-2017, 05:38 AM   #120
Analogus
Fanatic
Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.
 
Analogus's Avatar
 
Posts: 568
Karma: 2170348
Join Date: Apr 2011
Device: 2x Sony PRS-350; PRS-300 (†), Paperwhite (†), Voyage
@JotaCe:

Concerning MOBI-files. I also did struggle about the problem with this files and I could not find a solution.

I for my case stick with AZW-files. But I do not have the troubles you have. Setting margins survive every page/book/orwhatever-change.
Analogus is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Edit jars on 5.6.1.0.5 (margins, font sizes) -- and non-jb fonthack ecostin Kindle Developer's Corner 228 06-15-2017 08:28 AM
Calibre Font Configuration Plug in aterry13 Plugins 4 03-03-2013 10:14 PM
Repost - Kobo reboots when changing font sizes meandher57 Kobo Reader 1 10-04-2011 03:34 PM
Changing default font styles and sizes p3aul Calibre 26 07-12-2009 01:40 AM
Font changing sizes... rixte Bookeen 5 12-19-2007 05:58 PM


All times are GMT -4. The time now is 03:04 AM.


MobileRead.com is a privately owned, operated and funded community.