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 05-06-2016, 11:48 AM   #31
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
I hate struggling with toolchains. Not my cup of tea. If somebody can give me some useful hints about compiling WORKING binaries for the PXA255 in the K1, please do so. Thanks.
geekmaster is offline   Reply With Quote
Old 05-06-2016, 12:45 PM   #32
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
I tried building gcc from the amazon source code for my K1, but it errored out during the compile -- perhaps a configuration error. So I tried another prebuilt toolchain:
https://github.com/samsheff/Amazon-K...ross-Toolchain

However, a "hello world" built with that segfaults on my K1. Windows toolchains are much more backwards compatible. Why does linux need a specific flavor of a specific version of a toolchain (and even with specific flags, for kernel builds)? How do sane people figure out which specific set of options?

There is too much to read and too little time. And as I said, the tcc for kindles creates code that also does not work on my K1. What is so different about an armv5 that all the existing kindle binaries either are not recognized as executable, or get "illegal instruction", or segfault? I need to put this aside for a bit, and go outdoors before it starts snowing again...
geekmaster is offline   Reply With Quote
Advert
Old 05-06-2016, 01:08 PM   #33
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 usual suspect is the difference in how un-aligned accesses are handle ARMv5 and ARMvLater.

Use only aligned accesses to work-around the problem.
Hmm...
There should be compiler flags to 'fix' your source code for you during compile.
knc1 is offline   Reply With Quote
Old 05-06-2016, 01:14 PM   #34
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
I tested my hello.c built with the PXA255 toolchain (supposedly compatible with the K1), and it ran fine in my K5. So it I *can* compile code that works on the K1, perhaps it will also work on later kindles without recompiling? I hope so... But then I will need to recompile ALL the hacks I want to support, so they can run on "all the kindles"...

So, yeah, now I need to learn enough ins and outs about "compiler flags", eh? I never had these problems on windows, though I was fond of building everything with vc6 for win98 (so it would work on "all the windows boxen")...

Time to find the LOWEST COMMON DENOMINATOR toolchain that can support all the kindles (with the exception of kernel modules, which I also plan to build when I have *time* to get compatible toolchains working for each specific kernel version, and with all the right flags and options set)...

I am not a happy camper right now, and I am not getting an younger burning time trying unsuccessfully to build apps from source. Even COBOL was easier than THIS! And yes, some of my COBOL programs were dynamically loading tcclib.dll (to be compliant with LGPL), and they used tcc to compile and run C scripts (used as search filters). Even that was easier than this...

But at least now I have a toolchain that I can use to compile my kindle video player (with sound support). I want gmplay to support the K1 2-bit video as well (4 pixels per byte). When I have time, I want to try pumping sound out the accessory port pads on the bottom of most kindles, and also perhaps out the power LEDs. A photocell connected to amplified speakers would not be so bad, for kindle sound, would it? But the accessory power pads can drive an LED reading light, so they ought to be able to drive a small speaker or headphones, I think...

Last edited by geekmaster; 05-06-2016 at 04:04 PM.
geekmaster is offline   Reply With Quote
Old 05-06-2016, 03:44 PM   #35
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
Your looking at it, the K1 is the lowest common denominator.
Everything else is ARMv6 or ARMv7 (both of which run ARMv5 code).
knc1 is offline   Reply With Quote
Advert
Old 05-06-2016, 04:06 PM   #36
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
Your looking at it, the K1 is the lowest common denominator.
Everything else is ARMv6 or ARMv7 (both of which run ARMv5 code).
Now if I could just find or build a toolchain that works on the K1 PXA255 (unlike the toolchains that were SUPPOSED to support this processor but failed when I tested them). It would also be nice if tcc could be tweaked to work on it too...
geekmaster is offline   Reply With Quote
Old 05-06-2016, 04:22 PM   #37
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
I tried adding -march=armv5 to the gcc command line. Still not working. Not sure what to try next...
geekmaster is offline   Reply With Quote
Old 05-06-2016, 04:36 PM   #38
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
-mtune=xscale -mno-unaligned-access
Ref: https://gcc.gnu.org/onlinedocs/gcc-4...ml#ARM-Options

Last edited by knc1; 05-06-2016 at 04:39 PM.
knc1 is offline   Reply With Quote
Old 05-06-2016, 04:42 PM   #39
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
The older gcc versions that were supposed to support the PXA255 processor did not support -mfloat-abi=softfp. I tried building with the latest gcc in my recent linux mint, with -march=armv5 and -mfloat-abi=softfp, but still not working.

Any idea what flags (and/or gcc versions) I should use, so I can support the armv5 K1 instead of just armv7+ processors?
geekmaster is offline   Reply With Quote
Old 05-06-2016, 04:52 PM   #40
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
My NSLU2 is an Intel Xscale IXP420 device -
I have a complete, self-hosting, install of Debian on it -
I know, I set it up to build the entire install from source (it took 3 or 4 days IIRC).
So it is possible.

Didn't you once tell me you had an NSLU-2 also?
Use it to native compile your code for Xscale under NSLU2/Debian.

Xscale is really, really old - I can only guess beyond what I have already posted.

Note: The XScale architecture is based on the ARMv5TE ISA without the floating point instructions.
Ref: https://en.wikipedia.org/wiki/XScale

Last edited by knc1; 05-06-2016 at 04:56 PM.
knc1 is offline   Reply With Quote
Old 05-06-2016, 10:35 PM   #41
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
Google for a Debian/Arm/qemu-static chroot - -
The is fairly well documented, you have a choice of directions.
The one I found easiest to follow is:
https://wiki.debian.org/ArmHardFloatChroot
Modifying names and things to use the ARMel and the NSLU2 xScale tar-ball in your case.

I have several of those installed and they each worked the first time tried.
Notes:
For the i.MX6 touchscreen devices (they all are) - Debian Jessie is a good match to the system libraries. I haven't found a problem yet.

For the K1 - I think you will be stuck with Debian 3 to get a decent match with the installed system libraries.

Then, since the NSLU2/Debian tar-ball is still posted, run that in your qemu chroot (emulation on a current desktop will be a lot faster than the NSLU2 is ).
https://www.cyrius.com/debian/nslu2/

Note that the Debian 3 tar-bar is still posted there (or linked to from there).

Trivia: The Peter Korsgaard mentioned there is now the lead maintainer of BuildRoot.
knc1 is offline   Reply With Quote
Old 05-07-2016, 12:21 AM   #42
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:
The original Linksys software is running in big endian mode, including the RedBoot bootloader. Debian only supports little endian mode on ARM. Therefore the kernel has to switch the processor into little endian mode at startup (in arch/arm/boot/compressed/little-endian.S). The kernel image furthermore needs to be byteswapped before upload as it is loaded into memory by RedBoot running in big endian mode, but needs to be read by the Linux kernel running in little endian mode.
Gee, that sounds like fun...
Quote:
When the script finishes you should have an armv5b-softfloat-linux-gcc in /opt/crosstool/armv5b-softfloat-linux/gcc-3.3.4-glibc-2.2.5/bin/. Alternatively you can download a precompiled version of it: crosstool-armv5b-softfloat-gcc-3.3.4-glibc-2.2.5.tar.gz (40M)
Hmm... I have not tried THAT toolchain yet...
Quote:
The kernel for running Debian on the NSLU2 is based on a standard 2.6.11.12 kernel.org kernel with some additional patches. The kernel patch is based on the work done by the OpenSlug team with a few patches to run in little endian mode.
The K1 is running kernel "2.6.10-lab126", so no kernel modules without some vermagic futzing...

Last edited by geekmaster; 05-07-2016 at 12:27 AM.
geekmaster is offline   Reply With Quote
Old 05-07-2016, 08:25 AM   #43
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
I don't recall any of what you quoted - mine "just worked".
knc1 is offline   Reply With Quote
Old 05-07-2016, 09:32 AM   #44
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
I don't recall any of what you quoted - mine "just worked".
Those quotes were from a link on the page you linked. Sadly, that armv5b toolchain also built code that does not work on my k1 (not found and/or segfault issues).

I noticed that tcc configure supports options for armv4 (and also cross compiling). Time to play with that for a bit, though I will still need a real gcc...

I am not sure why we seem to need a unique toolchain for each device we intend to support. There MUST be some compile flags to set to generate armv4 code on a modern device -- I feel like such a noob slogging in this toolchain muckery (too much time in the mainframe COBOL and MS windows development worlds).
geekmaster is offline   Reply With Quote
Old 05-07-2016, 09:39 AM   #45
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
I am thinking strange thoughts -- would it make ANY sense to run qemu on my K1 so it can support apps compiled for newer arm processors? Nah...
geekmaster is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
geekmaster vacation geekmaster Kindle Developer's Corner 2 03-19-2012 09:18 PM


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


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