Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 06-24-2016, 09:03 AM   #76
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
Nope, a newly generated file, never written to and then read back from a flash device is null terminated.

The topic here is a file generated by erase block sized, block copies from the Kindle flash.
The current script does not consider that the last block may not be fully used.
knc1 is offline   Reply With Quote
Old 06-24-2016, 09:06 AM   #77
geekmaster
Carpe diem, c'est la vie.
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: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
Quote:
Originally Posted by knc1 View Post
Nope, a newly generated file, never written to and then read back from a flash device is null terminated.

The topic here is a file generated by erase block sized, block copies from the Kindle flash.
The current script does not consider that the last block may not be fully used.
So the checksum includes the trailing null?

I just noticed that the edit box here can be dragged (by its lower right corner) beyond the right side of the screen. Weird...

Last edited by geekmaster; 06-24-2016 at 09:11 AM.
geekmaster is offline   Reply With Quote
Advert
Old 06-24-2016, 09:11 AM   #78
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 geekmaster View Post
So the checksum includes the trailing null?

I just noticed that the edit box here can be dragged by its lower right corner and dragged right off the right side of the screen. Weird...
It contains the bytes described in the header, regardless of value.
knc1 is offline   Reply With Quote
Old 06-24-2016, 09:18 AM   #79
geekmaster
Carpe diem, c'est la vie.
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: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
Quote:
Originally Posted by knc1 View Post
It contains the bytes described in the header, regardless of value.
Okay, I will examine the header in more detail. It started as a quick "one-liner" hack that served its purpose at the time, but more work is required these days.
geekmaster is offline   Reply With Quote
Old 06-24-2016, 09:26 AM   #80
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 geekmaster View Post
Okay, I will examine the header in more detail. It started as a quick "one-liner" hack that served its purpose at the time, but more work is required these days.
Nope, it still works just as written.

It **never** passed the mkimage verify command.
And it does not matter the way it is being used, both then and now.

= = = =

Note:
It **might** break at any time in the future without notice.

The mkimage format is recursive -
Each mkimage file (segment) might contain additional mkimage segments, each with their own header.

Amazon was not using that feature when I made the checks at the time of my posting.

But they could, and should -
that is how you pass the kernel binary image, the initramfs, the device table, the initial environment - all as individual mkimage segments, wrapped inside a single mkimage file.

And if they go much new than the 3.0 kernel - they will have to.
knc1 is offline   Reply With Quote
Advert
Old 06-24-2016, 09:36 AM   #81
geekmaster
Carpe diem, c'est la vie.
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: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
Quote:
Originally Posted by knc1 View Post
Nope, it still works just as written.

It **never** passed the mkimage verify command.
And it does not matter the way it is being used, both then and now.
...
Amazon was not using that feature when I made the checks at the time of my posting.
Oh, so amazon screwed up, not me? But I still need to support compressed kernels, so I might as well try to do it right, and add cpio support too while at it.
geekmaster is offline   Reply With Quote
Old 06-24-2016, 09:43 AM   #82
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
That would not be a part of its job as I understand it -
Its job was to find and copy a uimage file from from the Kindle storage, or from an image of the Kindle storage device.

There are tools for anything else that a person might want to do to the uimage file already.
Don't try to build those into a single purpose tool that already does its job.
knc1 is offline   Reply With Quote
Old 06-24-2016, 10:21 AM   #83
geekmaster
Carpe diem, c'est la vie.
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: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
Quote:
Originally Posted by knc1 View Post
That would not be a part of its job as I understand it -
Its job was to find and copy a uimage file from from the Kindle storage, or from an image of the Kindle storage device.

There are tools for anything else that a person might want to do to the uimage file already.
Don't try to build those into a single purpose tool that already does its job.
Yeah, the unix philosophy was a bag of tools that each had a specific (or generic) purpose, with the occasional multitool tossed in. We do not need any sporks...

Perhaps this needs to be a seperate tool, though the cpio extractor was posted by Seaniko7 to my "getkernels" thread:
Quote:
Originally Posted by NiLuJe View Post
@GM: Quick braindump: if you have time to spare, double-check that the cpio extract stuff still works properly with current FW versions, I think we discussed somewhere that, at least for extracting the initramfs, it wasn't doing the job anymore.
A pair of individual tools then, but both need upgrades.

Last edited by geekmaster; 06-24-2016 at 10:25 AM.
geekmaster is offline   Reply With Quote
Old 09-23-2016, 04:39 PM   #84
zxczxc
Addict
zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.
 
Posts: 229
Karma: 136002
Join Date: Apr 2013
Device: PW
Ok, just to write somewhere - I have no idea how this happened.
I was happily testing my app I'm just about to share, it was basically finished.

As I have done many times, I sent the 'reboot' command via ssh.
Actually, maybe this happened because I:
Code:
insmod hid.ko 
insmod usbhid.ko
and didn't remove them before reboot, and kept my usb device connected?

I just looked down at my kindle and I see the diagnostics menu, "MUSCAT_WFO"...
Pretty fun, before it seems not possible to exit, it just puts me back in.

How can I get out?

I'm worried lol, I do not want to open this up and have to do any serial stuff.
Maybe if I installed some rescue pack this would be easier - I didn't install it yet because I haven't modified any system files so I thought I would be ok...

I hope it's good news, I'll read this thread.

Thanks

--
I clicked "Reboot or Disable Diags".
Reboot keeps me in diags.
It prints "EXIT DIAGS please use serial port".

Ok, now I clicked Disable diags and... the kindle seems to be booting up normally.

It's ok now... wow, any input into how this happened?

--

I remember when testing some of the hardware (it was cool to see) - I remember it saying 'deleting waveform', what was that? Nothing bad I hope...?

Last edited by zxczxc; 09-23-2016 at 04:47 PM.
zxczxc is offline   Reply With Quote
Old 09-23-2016, 05:30 PM   #85
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
The only effect that will have is if you want to use the e-ink screen.
Every e-ink screen has a calibration (waveform) file.

Remove all USB attachements, re-boot it (again), let it go to sleep and tell us how the screensaver looks.
Black and White or does it have clearly defined grayscale values.

During start-up, the process may (??should??) replace the calibration file.

= = = =

In answer to the question you almost had to post here, the part of this thread you wanted was the part about getting it to accept:
PHP Code:
fastboot set bootmode main 
Or about something similar (in this thread - which is about recovering an "Erase All" victim).
Use the 'search thread' tool and those words as keywords.
I may not have it quite correct, but something very like that is in here.

Last edited by knc1; 09-23-2016 at 05:43 PM.
knc1 is offline   Reply With Quote
Old 09-23-2016, 06:57 PM   #86
zxczxc
Addict
zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.
 
Posts: 229
Karma: 136002
Join Date: Apr 2013
Device: PW
Quote:
Originally Posted by knc1 View Post
The only effect that will have is if you want to use the e-ink screen.
Every e-ink screen has a calibration (waveform) file.

Remove all USB attachements, re-boot it (again), let it go to sleep and tell us how the screensaver looks.
Black and White or does it have clearly defined grayscale values.

During start-up, the process may (??should??) replace the calibration file.

= = = =

In answer to the question you almost had to post here, the part of this thread you wanted was the part about getting it to accept:
PHP Code:
fastboot set bootmode main 
Or about something similar (in this thread - which is about recovering an "Erase All" victim).
Use the 'search thread' tool and those words as keywords.
I may not have it quite correct, but something very like that is in here.
Thanks, the kindle seems ok once it booted.
I think I saw grayscale, not just 1black+1white, I think it would be apparent.
Yes, the kindle logo that shows on boot up, that is greyscale, that looked fine.


I say the kindle seems ok... well... it may just be the otg adaptor... maybe it got a little dirty?
Since my little input device/keyboard isn't being recognized properly...
I check /dev/input/ and sometimes I see the usb device there, sometimes not.
The kindle power led flashes on maybe every so often, like every 20 seconds.
Weird graphical glitches, I did a few reboots, I tried to open a book and it didn't open, the book (in list view) was highlighted black (that's normal before it opens) and it stayed black, I could press another book and it too highlighted black, I had about 4 books highlighted. Then I got a message box saying application error, I pressed ok and it seemed to be ok again.

They might just be coincidences... I will do more testing tomorrow!

--
Although any idea how this happened? Entering diags is easy?
I'm just thankful my device didn't need to be opened
zxczxc is offline   Reply With Quote
Old 09-23-2016, 08:00 PM   #87
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
Any failure of the first u-boot load and run attempt and u-boot will attempt to run the alternate system (which is diags).

From what you are working on - you probably have some sort of kernel module load error or such during start-up.

You really need some sort of fall-back plan for recovery during testing system firmware changes.
Best way is the "pro-way" - netboot the experimental stuff -
or
Second best way - load and boot from memory.

Both of which require using the serial port.
Something worth learning.

Your writing and/or changing kernel level code.
Not the same as user-land coding -
user-land code problems are well controlled, kernel level, not at all. Fatal errors there are fatal.

You never want to write to flash memory experimental code on an embedded device.
That is only a good way to shoot yourself in the foot.

Last edited by knc1; 09-23-2016 at 08:09 PM.
knc1 is offline   Reply With Quote
Old 09-24-2016, 04:03 AM   #88
zxczxc
Addict
zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.
 
Posts: 229
Karma: 136002
Join Date: Apr 2013
Device: PW
Thanks for the advice!
The only risky thing I guess I do is insmod hid.ko + usbhid.ko and rmmod them when stopping.

All the program is is just checking for key presses from the otg usb device.

Anyway, I would like to improve my soldering skills! Maybe one day, I'll find some practice/junk stuff that isn't working anymore and play.
zxczxc is offline   Reply With Quote
Old 09-24-2016, 04:28 AM   #89
zxczxc
Addict
zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.zxczxc knows how many angels can dance on the head of a pin.
 
Posts: 229
Karma: 136002
Join Date: Apr 2013
Device: PW
Ok, there IS something strange.
I assumed it was a coincidence, maybe the otg adapter I use is cheap (yes) and fragile (maybe) - and that is why my it is not showing in /dev/input anymore, not consistently.
Maybe even that diags fried it, etc.

So I tried my other otg adaptor, and it's exact the same problem.

I'm very certain this can only be because of when it went into diags...
because before it was flawless and perfect.
---
Huh, I rebooted whilst keeping the usb in, and not rmmod'ing hid and usbhid - I'm back in diags. I guess that is how I got here.


--
Whilst in diags, I did the hallsensor test (it checks if the cover is closed, to see if the device will sleep ok).
I am pretty sure last time I did it, and from the text on the screen, the LED was OFF, until the cover got close.
But this time, the led blinks every 3 seconds or so... even when there is no cover attached.

Last edited by zxczxc; 09-24-2016 at 04:35 AM.
zxczxc is offline   Reply With Quote
Old 09-24-2016, 08:46 AM   #90
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 zxczxc View Post
- - - -
Anyway, I would like to improve my soldering skills! Maybe one day, I'll find some practice/junk stuff that isn't working anymore and play.
The "serial ... for dummies" (no insult intended, just the re-use of a popular line of book titles) thread has either in-line or links to ways of connecting the serial port that does not require hot soldering skills.

Amazon / Lab126 did not make it easy on the devices newer than the K3.

Note: All models K4 and up to, but not including the KOA use the same connector pin-out.
And there are a lot of "used, not working, for parts" Kindles on the market (and often working much better than the seller realizes once a person familar with the devices spends some time on them).

Last edited by knc1; 09-24-2016 at 08:50 AM.
knc1 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PW3 - First Look knc1 Kindle Developer's Corner 23 02-03-2018 05:54 PM
PW1 vs PW3 apastuszak Amazon Kindle 8 12-10-2015 05:51 PM
Duokan on PW3? Feitosa Amazon Kindle 8 07-30-2015 10:34 AM
Firmware Update Firmware of PW3 Grey Ram Amazon Kindle 5 07-10-2015 03:25 PM
Need help to unbrick KV dhfmd Kindle Developer's Corner 5 03-04-2015 03:58 PM


All times are GMT -4. The time now is 10:58 AM.


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