View Single Post
Old 07-23-2012, 07:50 AM   #463
geekmaster
Всё гениальное просто.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 5,069
Karma: 6789001
Join Date: Nov 2011
Location: Щедрость не имеет пределов.
Device: *.*
Quote:
Originally Posted by ixtab View Post
I think I got it. This was a bitch to figure out, but in the end, it's actually quite simple.
...
There is a 64-byte header, containing information about the name and the size. But the size concerns the payload, which comes after the header.

The grand and simple conclusion: getkernels.sh has to consider 64 more bytes (before the rounding), and all is well.

@geekmaster: would you please update the getkernels.sh script accordingly?
Thanks for figuring this out! I am sure glad that kernel images made with getkernels worked as well as they did for as long as they did for as many people as they did. But of course, it is time to redo them with the extra 64 bytes. Sorry about that. It will be fixed today. We need to redo all the kernels in the first post too. Unfortunately, we need to do them from a 32MB mmcblk0 image file, or from REAL virgin kindle (NOT from kindles that have been flashed back from a newer to older kernel). I will see what I can find.

Regarding the condensed/obfuscated code: It really IS true that I can understand code faster and easier when more of it fits on the screen within my field of view with no scrolling. I grew up in the days of 80x25 text screens and programmers such as myself often coded in that style, so it sort of IS my "native language". Adapting to "fluffy" whitespace-riddled code just never worked for me very well. And comments that say something OBVIOUS that is already clear in the code just waste space without adding anything useful. I do add comments where I think they are needed (such as variable definitions, and important code that is otherwise not clear).

EDIT: Part of the apparent "obfuscation" in the getkernels script was that earlier versions scanned for kernel images, in case they moved to another start address in the future. To fix a glitch in version 1.2, 1.3 just used hard-coded start offsets, but the of the OLD (now mosly obsolete) code was left in the script (accidentally complicating/obfuscating it).

EDIT2: Some kernels may be okay (if the 64-byte header fit inside the last written block after padding to the 1K blocksize. I will check them and replace any that may be missing up to 64 bytes at the end.

Last edited by geekmaster; 07-23-2012 at 10:40 AM.
geekmaster is offline   Reply With Quote