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-19-2014, 09:35 AM   #1
juul
Junior Member
juul began at the beginning.
 
Posts: 3
Karma: 10
Join Date: May 2014
Device: kindle 4NT
Kindle 4 NT custom kernel

I've been trying to compile a custom kernel for my Kindle 4 NT (black edition) but have run into some problems.

I used the latest crosstool-ng with NiLuJe's ct-ng-kindle-config and the amazon 2.6.31 kindle 4.1.1 kernel release (with a few missing header files added from newer releases).

I used the kernel config from /proc/config.gz from the running kernel from the kindle with the only change being that I disabled initramfs by setting CONFIG_INITRAMFS_SOURCE="".

I have a serial console connection and when i use kexec to load my custom kernel, i don't get anything after the "Bye!" line. This is all I get:

Code:
[root@kindle us]# ./kexec -e
MX50 Accessory shutdown
MXC Watchdog # 0 shutdown
Starting new kernel
Bye!
After a few minutes the kindle reboots.

I'm not sure if the kernel is not loading correctly, or if somehow console output is not working.

Could it be because I'm using the wrong crosstool-ng config? Should i be using ct-ng-kindle5-config instead?

I know it's a problem with my custom kernel image, because I do get serial console output after loading the original kindle kernel (dumped with the getgernels script) using kexec.

Any ideas / suggestions would be greatly appreciated.
juul is offline   Reply With Quote
Old 05-19-2014, 10:19 AM   #2
juul
Junior Member
juul began at the beginning.
 
Posts: 3
Karma: 10
Join Date: May 2014
Device: kindle 4NT
Solved!

I managed to solve the problem. It was definitely the cross-compiler. I switched to the gcc-4.6-arm-linux-gnueabihf (hard float) compiler available through the debian repository as described by christian-hoff (scroll down to "Compiling Kinde 5 kernel").

If anyone has any idea why the hard float compiler works while the soft float compiler fails to produce a bootable image, I'd be very interested!

Also, if someone has a crosstool-ng config file that is known to work for compiling kindle 4 kernels, I'd really like a copy of that
juul is offline   Reply With Quote
Advert
Old 05-19-2014, 10:51 AM   #3
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
Check the Debian source package for that compiler -
You will probably find it includes patches, different than those you may have applied with crosstool-ng.

*AND*
You never mentioned what compiler version (and source) you built with crosstool-ng - -
So we may be comparing Apples to Oranges.

- - - -

PS: crosstool-ng is deprecated, use current release of Buildroot (and the 'make toolchain') command if you want to continue building your own cross-toolchain.

- - - -

Hard Float vs. Soft Float **should not** make a difference for building the Linux kernel (it does not reference external libraries).

But it will make a big difference when you start building userland firmware.
knc1 is offline   Reply With Quote
Old 05-19-2014, 01:31 PM   #4
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 Kindles have a relatively old version of (soft float) glibc installed.

It is possible to run more than one version of glibc, including one that lives outside of /lib (say, in: */extensions/system/lib) on a Linux system.
See the overview here: https://bitbucket.org/twobob/kual-system
I.E: If you need a (modern) hard float libc for your Kindle applications.

Overview (including how to build for a non-/lib path):
http://stackoverflow.com/questions/8...-a-single-host

The tool for editing the related fields in an ELF binary:
http://nixos.org/patchelf.html
(Nit: watch out, that option is "--dynamic-linker" with two (2) leading "--")

- - - - -

I am adding this post, because usually a "custom kernel" is not the final goal of most posters.

Last edited by knc1; 05-19-2014 at 01:40 PM.
knc1 is offline   Reply With Quote
Old 05-19-2014, 01:41 PM   #5
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
And yeah, for my own stuff, it's the kindle5 config that's appropriate for the K4, the K3 (kindle) one is a monstrosity requiring a bit of hoop-jumping even when targeting the K3 .

That said, I only ever compiled userland stuff with those, so, no guarantee that it'll actually work, but on the paper it's 'better' .

If your kernel is trying to load the default modules, and not those you built yourself, then a clash in GCC version used to build the two might cause an issue. OTOH, I can't recall the TC used by Amazon for the K4, but that should be easy to track down.

@knc1: I'm still seeing active dev on ct-ng :?

Last edited by NiLuJe; 05-19-2014 at 01:45 PM.
NiLuJe is offline   Reply With Quote
Advert
Old 05-19-2014, 01:51 PM   #6
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 NiLuJe View Post
@knc1: I'm still seeing active dev on ct-ng :?
Yeah, it will probably die a very slow death.

But the author is also a developer on the Buildroot project, and he just didn't think he had enough time available to work on both it and his own project.
So he was the 'lead' in pulling crosstool-ng out of Buildroot and introducing the new (package based) method of building external toolchains in Buildroot.

- - - - -

and if the folks at uClibc don't get their act together, it is going to get dropped also.
knc1 is offline   Reply With Quote
Old 05-19-2014, 09:51 PM   #7
juul
Junior Member
juul began at the beginning.
 
Posts: 3
Karma: 10
Join Date: May 2014
Device: kindle 4NT
Thanks knc1 and NiLuJe! I will look at buildroot instead if that's where the development is happening and I will definitely check the debian source package for the working compiler. Someone recommended that I look at the yocto project. I don't really know much about it. Is anyone here using that?
juul is offline   Reply With Quote
Old 05-19-2014, 11:35 PM   #8
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 Debian distribution is a bit light-weight when it comes to touch screen oriented applications.

The yocto project (which is for touch screen devices (phones) ) is another source of applications.

I think twobob has used/re-used/abused/mangled/ported/etc stuff from the yocto project.

- - - -

We (twobob and I) have done some rather extreme things to/for Kindles - mostly not for the code or application - but to encourage people to open their minds to the possibilities.

The Kindle Touch is probably still the only e-book reader with an end-user configurable, speaker independent, voice recognition system (all twobob's doing, I just cheered him on).

And the Kindles are probable the only e-book readers that can run IBM-360 mainframe operating systems and programs (including the program development toolchain).

So if you have a 360-Cobol application that you simple MUST run on your Kindle -
we got what you need posted here (and/or in public repositories linked to from here).

Last edited by knc1; 05-19-2014 at 11:46 PM.
knc1 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
Glo Getting WiFi to work with a custom kernel on Glo a3nm Kobo Developer's Corner 3 Today 04:27 PM
[Custom Kernel] Next/Prev page using any buttons seaniko7 Kindle Developer's Corner 30 07-05-2018 12:22 PM
running custom kernel on kobo sergeyvl12 Kobo Developer's Corner 3 11-06-2013 07:57 AM
Custom kernel for Kindle 3 yifanlu Kindle Developer's Corner 61 07-06-2013 11:58 AM
Custom kernel in Kindle 4 NT? zatix Kindle Developer's Corner 1 02-27-2012 09:09 AM


All times are GMT -4. The time now is 09:14 PM.


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