![]() |
#1 |
Kindle Dissector
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 662
Karma: 475607
Join Date: Jul 2010
Device: Amazon Kindle 3
|
Compiling the Linux Kernel for the Kindle
After three days and tons of googleing, I've compiled, set up, and installed the kernel for Kindle. Directions as follows:
Part 1: Prerequisites
Part 2: Compiling the kernel
Part 3: Installing on Kindle
Code:
mv /mnt/us/linux-2.6.22.19-lab126.tar.gz /mnt/us/modules.dep /mnt/us/uImage /tmp mv /lib/modules /lib/modules.old cd /tmp & tar xvzf /tmp/linux-2.6.22.19-lab126.tar.gz mv lib/modules /lib/ chmod 644 modules.dep mv modules.dep /lib/modules/2.6.22.19-lab126/ /test/flashtools/update-kernel-both uImage sync shutdown -r now
Source: Myself (http://www.yifanlu.com/2010/07/26/ha...ng-the-kernel/) EDIT: Deleted question, inserted directions Last edited by yifanlu; 07-26-2010 at 05:07 PM. Reason: Deleted question, inserted directions |
![]() |
![]() |
![]() |
#2 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047190
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
Haven't tried.
One fun thing to try would be the ethernet+mass storage combo gadget USB driver. (Not sure it was there @ 2.6.22 though, but that shouldn't be too messy to backport). |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Kindle Dissector
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 662
Karma: 475607
Join Date: Jul 2010
Device: Amazon Kindle 3
|
Ok, I almost have the kernel compiled (amazon adds some extra files (I don't know what yet) to the initramfs that isn't included with the source, in order to get them, I need a copy of Kindle's current kernel). Anyways, bigger question, how do I get the kernel to load after compiling it? Do I HAVE to do a serial connection and give it to uBoot, or can something be done within shell to load it?
|
![]() |
![]() |
![]() |
#4 | |||||||
Kindle Dissector
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 662
Karma: 475607
Join Date: Jul 2010
Device: Amazon Kindle 3
|
In case anyone wants to compile the kernel, here's what you have to do (I might do a big write up one day, but for now):
I'm assuming you're a developer or linux hacker and have all the usual development tools and dev packages installed and knows how to compile stuff. 1. Get a cross compiler for ARM, you can compile your own with Amazon's provided source (gcc, libc, binutils, etc), or install a pre-compiled one: http://www.codesourcery.com/sgpp/lite/arm 2. Get uboot-mkimage from any repository 3. Set to compile for Kindle's MX3 arch, do the following command Quote:
Look for Quote:
Quote:
Quote:
Quote:
Quote:
9. do Quote:
Last edited by yifanlu; 07-25-2010 at 10:27 PM. |
|||||||
![]() |
![]() |
![]() |
#5 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047190
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
Not sure. I seem to remember that they're stored in a dedicated partition, and that there's two (maybe three?) different kernels (one for the recovery/update process). But you'd better check yourself
![]() I guess a usbnet shell should be enough to extract the current initramfs, but, yeah, it's probably safer to have a serial console available in case things don't go as planned ![]() |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Kindle Dissector
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 662
Karma: 475607
Join Date: Jul 2010
Device: Amazon Kindle 3
|
Ok, I got it, kernel compiled into correct format and flashed.
|
![]() |
![]() |
![]() |
#7 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047190
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
Nice! Thanks for the info
![]() |
![]() |
![]() |
![]() |
#8 |
Addict
![]() ![]() ![]() Posts: 367
Karma: 228
Join Date: Jan 2010
Device: Aztak Mentor
|
How can you add wifi support via a kernel compilation? Does the hardware support it? Just wondering...
|
![]() |
![]() |
![]() |
#9 | |
Kindle Dissector
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 662
Karma: 475607
Join Date: Jul 2010
Device: Amazon Kindle 3
|
So, yea, after dumping messages, I see "Linux version 2.6.22.19-lab126 (root@ubuntu) (gcc version 4.4.1 (Sourcery G++ Lite 2010q1-202) ) #1 PREEMPT Sun Jul 25 12:25:32 UTC 2010"
Yeah, my kernel is loaded! Then Quote:
@zetareticuli, before compiling the kernel, if you do "make menuconfig", you get a screen with everything you want supported. However, it has to work with the hardware, and so far I only see USB ports and a mini pci-e port (for the wwan). So, let's say I have a custom WWAN card that I want to use on the kindle. I select it in menuconfig, and install it, then the kindle will see it. Last edited by yifanlu; 07-25-2010 at 10:26 PM. |
|
![]() |
![]() |
![]() |
#10 |
Kindle Dissector
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 662
Karma: 475607
Join Date: Jul 2010
Device: Amazon Kindle 3
|
Ugh, I need to restore the original kernel before installing the new one. Can someone give me. Quick guide to kindle firmware tool? I understand it's something like this:
1) create. .sh file 2) add other files 3) use tool with m option However, what do I name the sh file? Last edited by yifanlu; 07-26-2010 at 11:14 AM. |
![]() |
![]() |
![]() |
#11 |
Addict
![]() ![]() ![]() Posts: 367
Karma: 228
Join Date: Jan 2010
Device: Aztak Mentor
|
Yifanlu, thanks for the info. I wouldn't mind collaborating with you on these projects but I have to get a Kindle first. Which one do you have?
|
![]() |
![]() |
![]() |
#12 |
Kindle Dissector
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 662
Karma: 475607
Join Date: Jul 2010
Device: Amazon Kindle 3
|
|
![]() |
![]() |
![]() |
#13 |
Addict
![]() ![]() ![]() Posts: 367
Karma: 228
Join Date: Jan 2010
Device: Aztak Mentor
|
Alright. So I just bought a refurbished Kindle 2 to start testing all this. One thing that I really want to work on is the addition of a virtual SD card. With a virtual SD card, there would be little need for a real SD port. You just mount the virtual SD card that would read from, say, a web folder. Also, I would like to create a better PDF viewer. Something as close as possible to the PDF viewers that run on personal PCs.
|
![]() |
![]() |
![]() |
#14 | |
Kindle Dissector
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 662
Karma: 475607
Join Date: Jul 2010
Device: Amazon Kindle 3
|
Quote:
|
|
![]() |
![]() |
![]() |
#15 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047190
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
@yifanlu: I guess you can extract the latest default kernel from the official update file, if you haven't got a backup.
As for the packer, the shell script don't need to have a specific name, AFAICT, the update tool run *every* sh file in the binfile, sequentially (ie. 0000-patches.sh, then 5555-kernel.sh). @zetareticuli: Also, unless you're using a custom SIM, that would, again, break Amazon's terms, because you're hijacking the 3G connexion. And, btw, you don't need to touch the kernel to do 'virtual' (userland) mounts, Fuse is installed (and used by Amazon). Last edited by NiLuJe; 07-26-2010 at 01:49 PM. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Downgrade Kindle 3.x Kernel to 3.0.2 (on linux k3flasher) to provide forensic 3.3 | twobob | Kindle Developer's Corner | 45 | 02-26-2013 08:32 PM |
PRS-T1 How-to: Compiling the kernel and kernel modules | altruizine | Sony Reader Dev Corner | 9 | 09-03-2012 09:12 PM |
iLiad Linux Kernel flashing to iliad | atmel | iRex Developer's Corner | 1 | 11-20-2007 09:55 AM |
iLiad Linux kernel update! | atmel | iRex Developer's Corner | 4 | 11-12-2007 11:06 AM |
iLiad Linux 2.6 Kernel Port for the Iliad | CommanderROR | iRex Developer's Corner | 6 | 08-21-2007 08:33 AM |