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 11-10-2017, 07:45 PM   #61
coplate
Guru
coplate ought to be getting tired of karma fortunes by now.coplate ought to be getting tired of karma fortunes by now.coplate ought to be getting tired of karma fortunes by now.coplate ought to be getting tired of karma fortunes by now.coplate ought to be getting tired of karma fortunes by now.coplate ought to be getting tired of karma fortunes by now.coplate ought to be getting tired of karma fortunes by now.coplate ought to be getting tired of karma fortunes by now.coplate ought to be getting tired of karma fortunes by now.coplate ought to be getting tired of karma fortunes by now.coplate ought to be getting tired of karma fortunes by now.
 
Posts: 645
Karma: 1888888
Join Date: Jun 2009
Device: prs-505, Kindle Keyboard 3g, PW3
The amazon 5.9.22 instruction on how to build the cross compiler did not work on my Windows 10 Bash install. I think the toolsets have problems with 'PATH' variabl that contains parentheses.

So I used the same cmpiler from 5.8.1 that I used on my PW3

** This will be a work in progress until it is finished.

I may try to use the one amazon recommends again, now that I know about theis PATH issue, 'bit-bake / yocto?'

UNTAR THE FILES WITH LINUX, not windows, there are files with the same name, with case sensitive issues

  1. Download the Paperwhite 5.8.1 source from amazon
  2. grab the tar.gz build_linaro-gcc_4.8.3.tar.gz
  3. Download the Paperwhite 5.89.2 source from amazon
  4. grab the tar.gz linux-4.1.15.tar.gz
  5. Extract those to your computer
  6. Build the linaro compiler using the 'BUILD_HOW-TO.txt' in the package
    • The howto will explain a lot of dependencies you need to install
    • I change the PREFIX in the makefile to '$(HOME)/kindle/opt/cross-gcc-linaro'
    • I also edited the Makefile to have a hardcoded PATH, insted of
      Code:
      export PATH=$(BUILD_SYSROOT)$(SYSROOT)/../bin:$(PATH); \
    • In the howto, the last step you need to follow for this part is 'Install the Kernel Headers'
      1. apt install bison curl flex tar libgmp-dev libmpfr-dev libmpc-dev bc build-essentials etc, etc
      2. make
        • This takes a very long time
      3. mkdir -p $HOME/kindle/opt
      4. tar -C $HOME/kindle/opt -xzf cross-arm-linux-gnueabi-gcc-linaro-4.8-2014.04.tar.gz
      5. tar -C $HOME/kindle/opt/cross-gcc-linaro/arm-linux-gnueabi -xzf khdrs.tar.gz
  7. The 5.9.2 linux 4.1.15 does not have a build howto, so I just had to figure it out
    • make ARCH=arm CROSS_COMPILE=$HOME/kindle/opt/cross-gcc-linaro/bin/arm-linux-gnueabi- imx_v7_zelda_defconfig
      • This is fast
    • make ARCH=arm CROSS_COMPILE=$HOME/kindle/opt/cross-gcc-linaro/bin/arm-linux-gnueabi-
      • This takes a very long time

Amazon source download page: https://www.amazon.com/gp/help/custo...deId=200203720



Making the linux kernel is only necessary for the kernel modules, the programs can be built just by installing that linaro cross compiler.

This is my makefile for Kernel modules
Code:
export ARCH:=arm
export CROSS_COMPILE:=/home/osboxes/kindle/opt/cross-gcc-linaro/bin/arm-linux-gnueabi-

#obj-m := hello-2.o
#obj-m := evdev_mouse.o
#obj-m := ev_mdc.o
obj-m := tkbd.o

KDIR := /home/osboxes/kindle/gplrelease/linux-4.1.15

PWD := $(shell pwd)


EXTRA_CFLAGS := -I$(src)/drivers/


default:
	$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
clean:
	$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) clean




This is my makefile for programs
Code:
# i used amazon's own toolchain, from kindle fw sources
CROSS_COMPILE = /home/osboxes/kindle/opt/cross-gcc-linaro/bin/arm-linux-gnueabi-
CFLAGS = 
LDFLAGS =
SRC = tpoint.c
OUT = tpoint.lix

# -print-search-dirs

kindle: $(SRC)
	$(CROSS_COMPILE)gcc -DBUILD_KINDLE $(SRC) -o $(OUT) $(CFLAGS) $(LDFLAGS)

host: $(SRC)
	gcc -DBUILD_KINDLE $(SRC) -o $(OUT) $(CFLAGS) $(LDFLAGS)

clean:
	rm $(OUT)

Notes:

there is a missing include statment somewhere. the file exists but the compiler wont find it - while compiling the kernel:
** Woops, I forgot that linux was case sensitive, thats why it wasnt working.


net/ipv4/netfilter/ipt_ECN.c:20:42: fatal error: linux/netfilter_ipv4/ipt_ECN.h: No such file or directory
Code:
#include <linux/netfilter_ipv4/ipt_ECN.h>
I changed it to :
Code:
#include <ipt_ecn.h>

Last edited by coplate; 11-10-2017 at 09:00 PM.
coplate is offline   Reply With Quote
Old 11-10-2017, 08:50 PM   #62
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:
I may try to use the one amazon recommends again, now that I know about theis PATH issue, 'bit-bake / yocto?'
BuildRoot(.org)
knc1 is offline   Reply With Quote
Advert
Old 04-17-2023, 06:31 PM   #63
luketheduke
Connoisseur
luketheduke knows what's going on.luketheduke knows what's going on.luketheduke knows what's going on.luketheduke knows what's going on.luketheduke knows what's going on.luketheduke knows what's going on.luketheduke knows what's going on.luketheduke knows what's going on.luketheduke knows what's going on.luketheduke knows what's going on.luketheduke knows what's going on.
 
luketheduke's Avatar
 
Posts: 86
Karma: 25554
Join Date: Sep 2022
Device: PW3, PW2, KT2, 2xKT, 2xK3G
I know this thread is old, but anyone who successfully completed the steps in method one, could you possibly share your resulting "armdisk.img" file?

I'd do it myself, but I'm having problems with mirrors and such.

Thanks.
luketheduke is offline   Reply With Quote
Reply

Tags
cross compile, debian, source


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Kindle Voyage 5.6.2.1 Serial Jailbreak Step-by-Step noismaster Kindle Developer's Corner 72 11-08-2021 08:04 PM
Mac OSX: Idiot-Proof Font Scaling Fix [Step-by-step] Jelbee Kobo Reader 2 06-14-2010 12:16 PM
Step by step instructions for font changing (Polish) Jabberwock Sony Reader 2 09-04-2007 06:21 PM


All times are GMT -4. The time now is 06:00 PM.


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