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-10-2016, 06:48 PM   #1
knc1
Ex-Helpdesk Addict
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: 12,219
Karma: 12451693
Join Date: Feb 2012
Location: Central Texas
Device: No PW2, KV, KOA
[K1]: Firmware examination

(from v-1.2 ...)

Our first look, something well known:
Code:
core2quad arm-k1 $ cd bin
core2quad bin $ ls -l
total 612
-rwsr-sr-x 1 mszick mszick 620140 2008-03-30 19:14 busybox
It was brand new, eight years ago, approximately e-reader stone-age.
A quick summary:
Code:
core2quad bin $ file *
busybox: setuid setgid ELF 32-bit LSB executable, ARM, version 1, statically linked, for GNU/Linux 2.0.0, stripped
About what was expected, and it is at least little endian.
Try for a bit more detail:
Code:
core2quad bin $ readelf -a busybox | less
ELF Header:
  Magic:   7f 45 4c 46 01 01 01 61 00 00 00 00 00 00 00 00 
  Class:                             ELF32
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            ARM
  ABI Version:                       0
  Type:                              EXEC (Executable file)
  Machine:                           ARM
  Version:                           0x1
  Entry point address:               0x80d0
  Start of program headers:          52 (bytes into file)
  Start of section headers:          619540 (bytes into file)
  Flags:                             0x202, has entry point, GNU EABI, software FP
  Size of this header:               52 (bytes)
  Size of program headers:           32 (bytes)
  Number of program headers:         3
  Size of section headers:           40 (bytes)
  Number of section headers:         15
  Section header string table index: 14
- - - -
Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x000000 0x00008000 0x00008000 0x94b64 0x94b64 R E 0x8000
  LOAD           0x094b64 0x000a4b64 0x000a4b64 0x02840 0x2317c RW  0x8000
  NOTE           0x0000a0 0x000080a0 0x000080a0 0x00020 0x00020 R   0x10
- - - -
Notes at offset 0x000000a0 with length 0x00000020:
  Owner                 Data size       Description
  GNU                  0x00000010       NT_GNU_ABI_TAG (ABI version tag)
    OS: Linux, ABI: 2.0.0
Note: The load address and alignment (this happens to be configured the same as a 'bare metal' executable).
Other than that, a fairly common sort of (early) Linux file.
Let's see if it will talk to us:
Code:
core2quad bin $ ./busybox
BusyBox v1.01 (2008.03.31-00:04+0000) multi-call binary

Usage: busybox [function] [arguments]...
   or: [function] [arguments]...

    BusyBox is a multi-call binary that combines many common Unix
    utilities into a single executable.  Most people will create a
    link to busybox for each function they wish to use and BusyBox
    will act like whatever it was invoked as!

Currently defined functions:
    [, addgroup, adduser, adjtimex, ash, awk, basename, bunzip2, busybox, bzcat, cat, chgrp, chmod, chown, chroot,
    clear, cmp, cp, crond, crontab, cut, date, dd, delgroup, deluser, df, dirname, dmesg, du, echo, env, expr,
    false, fdisk, fgrep, find, freeramdisk, getty, grep, gunzip, gzip, halt, head, hexdump, hostname, hwclock,
    id, ifconfig, ifdown, ifup, init, install, ip, ipaddr, iplink, iproute, kill, killall, klogd, linuxrc, ln,
    logger, login, logname, logread, losetup, ls, makedevs, md5sum, mkdir, mknod, mktemp, more, mount, mv, nc,
    netstat, passwd, pidof, ping, pipe_progress, pivot_root, printf, pwd, rdate, readlink, realpath, reboot,
    renice, reset, rm, rmdir, route, run-parts, sed, seq, sh, sleep, sort, start-stop-daemon, strings, stty,
    su, sulogin, sync, sysctl, syslogd, tail, tar, tee, telnet, test, time, touch, tr, traceroute, true, tty,
    udhcpc, umount, uname, uniq, uptime, usleep, vi, wc, wget, which, who, whoami, xargs, yes, zcat

core2quad bin $
Again, about what one would expect.

(For the curious reader, "core2quad" is the name of my development machine, an Intel x86_64, here running in 32-bit mode.
And yes, I didn't photoshop the above, my i686 Linux install does run ARM code just fine.
I couldn't do much here if it didn't. )

= = = =

@geekmaster - first test - duplicate the above.
It is statically linked, it should run anywhere on the K1 that you put it.

copy /bin/busybox to ??? <wherever> you are trying to run your compiled code from (sd card, usb storage, whatever) -
then with that as the current working directory, do
./busybox
see if it will talk to you from that location on your K1.

I.E: We **know** this thing works, make sure it works for you also.
This first test is to eliminate any funky file system options that might be keeping your code from running properly (or at all).

Last edited by knc1; 05-10-2016 at 07:01 PM.
knc1 is offline   Reply With Quote
Old 05-10-2016, 08:20 PM   #2
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,430
Karma: 10764602
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
Quote:
Originally Posted by knc1 View Post
@geekmaster - first test - duplicate the above.
It is statically linked, it should run anywhere on the K1 that you put it.

copy /bin/busybox to ??? <wherever> you are trying to run your compiled code from (sd card, usb storage, whatever) -
then with that as the current working directory, do
./busybox
see if it will talk to you from that location on your K1.

I.E: We **know** this thing works, make sure it works for you also.
This first test is to eliminate any funky file system options that might be keeping your code from running properly (or at all).
I had no problem running K1 code in my qemu chroot. The problem is strictly inside the K1, where the only thing I can run is code built for the K1 (such as copied from /bin to /mnt/us, or from a firmware update rootfs), as I mentioned yesterday:
Quote:
Originally Posted by geekmaster View Post
... And the ONLY binary code that runs on it is code I copied from the rootfs. Even static compiled code using the /lib copied from the K1 fails (either "not found", or segfault), as I mentioned previously. ...
Scripts run fine, and I have even successfully adapted some "eink animation" scripts of mine for the K1. I partially ported "titty" (tiny TTY emulator) but it does not display anything (yet) -- more to do.

Though code compiled with "lenny" libs in my qemu chroot runs in that chroot, code compiled using libs copied from the K1 fails in the chroot (and in the kindle). I really do want to run something custom on my K1, and not just stuff lab126 compiled for my K1...

And thanks for looking at the K1 file system. I am anxious to try something on my K1 that was compiled from outside lab126 (such as a "Hello World" program).

Last edited by geekmaster; 05-10-2016 at 08:31 PM.
geekmaster is offline   Reply With Quote
Old 05-10-2016, 09:50 PM   #3
knc1
Ex-Helpdesk Addict
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: 12,219
Karma: 12451693
Join Date: Feb 2012
Location: Central Texas
Device: No PW2, KV, KOA
That is a lot of words, but I can't find the answer to my question -

Can you copy /bin/busybox to the file system location where you can not get **YOUR COMPILED** code to run?

And if that is so, what location?

= = = =

I am trying to help but don't "go imtmp" on me.
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
Free (nook/Kindle/iTunes/DRM-free) Christianish [Xtian Faith Re-Examination Critique] ATDrake Deals, Freebies, and Resources (No Self-Promotion) 1 12-02-2016 03:26 PM
Free (nook/Kindle/iTunes/DRM-free) Pursuit of the Holy [Xtian Spiritual Examination] ATDrake Deals, Freebies, and Resources (No Self-Promotion) 0 05-22-2015 03:29 PM
Free (nook/Kindle/ePub/DRM-free) Relearning Jesus [Xtian Faith Re-Examination Advice] ATDrake Deals, Freebies, and Resources (No Self-Promotion) 1 02-27-2015 08:16 AM
Free (nook/Kindle/iTunes/DRM-free) Let God Change Your Life [Xtian Faith Examination] ATDrake Deals, Freebies, and Resources (No Self-Promotion) 0 01-15-2015 03:11 AM
Remove Kindle books for examination curiousgeorge Amazon Kindle 2 03-12-2013 11:24 AM


All times are GMT -4. The time now is 09:02 AM.


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