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 07-01-2012, 10:23 AM   #166
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
Ah many thanks

Quote:
Originally Posted by geekmaster View Post
@twobob: Welcome to the 2600 club!


And here's a little history for the interested

http://en.wikipedia.org/wiki/Blue_box_%28phreaking%29

Cap'n crunch ftw!
twobob is offline   Reply With Quote
Old 07-01-2012, 10:52 AM   #167
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 twobob View Post


And here's a little history for the interested

http://en.wikipedia.org/wiki/Blue_box_%28phreaking%29

Cap'n crunch ftw!
Click on "club" in my text that you quoted.

Interesting to know that the first product that the "two Steves" (who founded apple computer) manufactured and sold was an illegal blue box.

But then if you study history, you find that most obscene fortunes held by famous families were begun by trading in illegal goods or services (slavery, opium trade, etc.).
geekmaster is offline   Reply With Quote
Advert
Old 08-09-2012, 09:14 AM   #168
NuPogodi
Connoisseur
NuPogodi knows the complete value of PI to the endNuPogodi knows the complete value of PI to the endNuPogodi knows the complete value of PI to the endNuPogodi knows the complete value of PI to the endNuPogodi knows the complete value of PI to the endNuPogodi knows the complete value of PI to the endNuPogodi knows the complete value of PI to the endNuPogodi knows the complete value of PI to the endNuPogodi knows the complete value of PI to the endNuPogodi knows the complete value of PI to the endNuPogodi knows the complete value of PI to the end
 
Posts: 58
Karma: 31942
Join Date: Feb 2012
Device: Kindle 3, Tolino Shine, Kobo Glo
I should apologize for a stupid question, but I'm totally confused. When I compile the simplest code with command line arguments, say
Quote:
#include "stdio.h"
#include <stdlib.h>
int main(int argc, char **argv) {
int count;
printf ("This program was called with \"%s\".\n", argv[0]);
if (argc > 1)
for (count = 1; count < argc; count++)
printf("argv[%d] = %s\n", count, argv[count]);
else
printf("The command had no other arguments.\n");
return 0;
}
and then run the compiled executable (no matter, with or without arguments) I ever obtain the same output
Quote:
This program was called with "(null)".
The command had no other arguments.
Not to say about succeeding arguments, even the first one argv[0] is somewhere lost. May you reproduce such a bug in your kindle & tcc? Have you any ideas why it happens & what should i do to solve this problem?
Thanks for any suggestions.
PS. tcc => kindle-tcc-1.6a.tar.gz, kindle3 (fw 3.0.3)
NuPogodi is offline   Reply With Quote
Old 08-12-2012, 08:00 AM   #169
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
Itś been a while but IIRC the script that GM did to call TCC in fact deals with this issue. Indeed I think I remember this from a README, but it may have a been a thread on this thingy.

In essence I think they get ditched unless specifically splattered into bin, I recall something about a limit of args as well. Sigh. Iĺl go and have a look.


EDIT: Nope, I searched every post on this thread and the info wasn´t specific to your problem, I was thinking of the args order passed for the libs.

one thing did occur though, I thought the -run was broken in this version. is not the args thing linked to -run? [-run infile args...]

anyways. perhaps GM will be able to shed light on this. apologies.

Last edited by twobob; 08-12-2012 at 08:13 AM. Reason: added reading and single possible sensible thought.
twobob is offline   Reply With Quote
Old 08-12-2012, 08:33 AM   #170
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 just used the tcc executable that lrizzo had at his web site. I do not know how he built it.

I see by modifying your program to print argc that this build of tcc does not handle command-line parameters. When tested on my K5, it shows that argc has a large negative value that changes with each run, and argv[0] is a NULL pointer.

I had not noticed that behavior before, but I had noticed that the tcc "-run" parameter did not run C programs as a script, so it has more than one bug. I suppose we need to rebuild tcc from source to see if that fixes it.

It seems to work okay for things that do not need parameters. I do not recall what "splattered into bin" thing that twobob is talking about.

Last edited by geekmaster; 08-12-2012 at 01:51 PM.
geekmaster is offline   Reply With Quote
Advert
Old 08-12-2012, 08:56 AM   #171
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
Okay well I am not 100% if it was for the emulator or the kindle but there is a version out there IIRC correctly that does support the run argument. This difference, I suspect, would fix your problem.

Here is the preamble https://www.mobileread.com/forums/sho...1&postcount=73 and here is the final thing https://www.mobileread.com/forums/sho...7&postcount=76

As is mentioned in the post though:

Quote:
Edit:
What some users probably need is a build of this with SYSROOT=/mnt/us included in the configure; maybe even add /mnt/us/lib and /mnt/us/include into the tcc-static search paths. But those are documented options in the ./configure --help file and now anyone can do it with these two posts.
And perhaps more significantly

Quote:
Code:
(armv6l:1) /home/tinycc # gcc --static --static-libgcc -o tcc-static tcc.o libtcc.a -lm -ldl
(armv6l:1) /home/tinycc # ldd tcc-static
    not a dynamic executable
(armv6l:1) /home/tinycc # strip --strip-unneeded tcc-static
Which disables the functioning of libdl but if you can live without the -run option ...
(The -run option causes this tcc-static to hang, it would take a bit of further tweaking to make -run work while libdl was statically linked).
so there may be some cooking involved

HTH.

@GM like I said. I was wrong.

Last edited by twobob; 08-12-2012 at 09:03 AM. Reason: added extra toughness
twobob is offline   Reply With Quote
Old 08-12-2012, 08:58 AM   #172
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
Hmm...
The static build dynamic link of tcc-next-unreleased posted in the DIT-KeK thread:

Code:
(armv6l:1) /home # tcc -run un.c
This program was called with "un.c".
The command had no other arguments.
(armv6l:1) /home # tcc -run un.c junk
This program was called with "un.c".
argv[-1094246539] = argv[%d] = %s
But that build has some strange ideas about the standard libraries, the posted code needs to be changed to run under the DIY-KeK build:
Code:
(armv6l:1) /home # cat un.c
/* #include "stdio.h" */
/* #include <stdlib.h> */
int main(int argc, char **argv) {
int count;
printf ("This program was called with \"%s\".\n", argv[0]);
if (argc > 1)
for (count = 1; count < argc; count++)
printf("argv[%d] = %s\n", count, argv[count]);
else
printf("The command had no other arguments.\n");
return 0;
}
That first line change - I don't know why the author was expecting stdio.h to be in the current directory ;
The second line change - That is part of the changes required for tcc-next-release.

I haven't looked to see if it is an error in tcc or an intended feature to have (some) of the standard libraries built-in and blow up if the external libraries are used.

Last edited by knc1; 08-12-2012 at 09:02 AM.
knc1 is offline   Reply With Quote
Old 08-12-2012, 09:01 AM   #173
NuPogodi
Connoisseur
NuPogodi knows the complete value of PI to the endNuPogodi knows the complete value of PI to the endNuPogodi knows the complete value of PI to the endNuPogodi knows the complete value of PI to the endNuPogodi knows the complete value of PI to the endNuPogodi knows the complete value of PI to the endNuPogodi knows the complete value of PI to the endNuPogodi knows the complete value of PI to the endNuPogodi knows the complete value of PI to the endNuPogodi knows the complete value of PI to the endNuPogodi knows the complete value of PI to the end
 
Posts: 58
Karma: 31942
Join Date: Feb 2012
Device: Kindle 3, Tolino Shine, Kobo Glo
Quote:
Originally Posted by geekmaster View Post
I see by modifying your program to print argc that this build of tcc does not handle command-line parameters. When tested on my K5, it shows that argc has a large negative value that changes with each run, and argv[0] is a NULL pointer.
twobob, geekmaster: Thanks for info. Despite it does not immediately solve a problem, it allows me at least to understand that the mentioned bug is reproducible and has nothing to do with my outdated firmware.
Well, I'll try to use config-file to send some parameters for my program(s) and to hope that someone could recover argv-feature. Unfortunately, my skills are not enough to do it by myself.
NuPogodi is offline   Reply With Quote
Old 08-12-2012, 09:05 AM   #174
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
There are step-by-step directions in the DIY-KeK thread where tcc is posted.
All you have to do is follow the build instructions, only substitute cross-compile for glibc rather than do the native build under emulation for uClibc.

You might want to follow the DIY-KeK thread, where work is currently underway to provide a glibc based emulator image for building dynamically linked Kindle stuff.

The static build of tcc-next-unreleased does not implement the -run option due to the known problems of using libdl from a static build.

Last edited by knc1; 08-12-2012 at 09:09 AM.
knc1 is offline   Reply With Quote
Old 08-12-2012, 09:07 AM   #175
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
^This

Quote:
Originally Posted by knc1 View Post
There are step-by-step directions in the DIY-KeK thread where tcc is posted.
All you have to do is follow the build instructions, only substitute cross-compile for glibc rather than do the native build under emulation for uClibc.

You might want to follow the DIY-KeK thread, where work is currently underway to provide a glibc based emulator image for building dynamically linked Kindle stuff.

The static build of tcc-next-unreleased does not implement the -run option due to the known problems of using libdl from a static build.
^This

Last edited by twobob; 08-12-2012 at 09:15 AM. Reason: relevant quote
twobob is offline   Reply With Quote
Old 08-12-2012, 09:35 AM   #176
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 twobob View Post
^This
Thanks. I tried building it from source a couple of times without success. Rob Landley (et al) were discussing building tcc to run on x86 with arm code generation, then building using that to build tcc again for arm executable tcc with arm code generation. They mentioned something about wrong floating-point endianness, requiring yet another build cycle to fix that. The threads at gnu.org leave a lot of unanswered questions, and any download links to compiled binaries are now dead.

I will check out the knc1 posts... Thanks.
geekmaster is offline   Reply With Quote
Old 08-12-2012, 09:36 AM   #177
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
There are step-by-step directions in the DIY-KeK thread where tcc is posted.
All you have to do is follow the build instructions, only substitute cross-compile for glibc rather than do the native build under emulation for uClibc.

You might want to follow the DIY-KeK thread, where work is currently underway to provide a glibc based emulator image for building dynamically linked Kindle stuff.

The static build of tcc-next-unreleased does not implement the -run option due to the known problems of using libdl from a static build.
Thanks for the info. I will check this out when I get some more free time.
geekmaster is offline   Reply With Quote
Old 08-12-2012, 09:42 AM   #178
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
There are step-by-step directions in the DIY-KeK thread where tcc is posted.
All you have to do is follow the build instructions, only substitute cross-compile for glibc rather than do the native build under emulation for uClibc.

You might want to follow the DIY-KeK thread, where work is currently underway to provide a glibc based emulator image for building dynamically linked Kindle stuff.

The static build of tcc-next-unreleased does not implement the -run option due to the known problems of using libdl from a static build.
Thanks. I got the static tcc from here:
https://www.mobileread.com/forums/sho....php?p=2150107

If it builds programs that handle command line parms (better than the lrizzo build used now), I will repackage it into the first post in this thread.
geekmaster is offline   Reply With Quote
Old 08-12-2012, 09:45 AM   #179
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 geekmaster View Post
Thanks for the info. I will check this out when I get some more free time.
Duh...
Check your post history for posts in that thread.

You replied to the suggestion about the next Kindle build including SYSROOT=/mnt/us in its configuration.

Ah, there, that will trigger your memory on this subject.
Too many subjects, too many posts, not enough time == "Life".

I, like all the rest of the hobbyists here, only work on what interests us at the moment.
All we need here is for someone (else) to get interested in doing it (a glibc build).
knc1 is offline   Reply With Quote
Old 08-12-2012, 09:57 AM   #180
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 ran it on my K5, and the ELF binary it built references uclibc (and will not run on the kindle). It may run in the QEMU environment, but needs a rebuild to work in the kindle.

Regarding memory triggers, my mind is so full of so many WORK projects right now that I cannot remember which is part of what. I have not been thinking about kindle stuff much lately. I need more time.

I have more than 3333 posts of my own here, and I cannot even remember half of those. My memory just is not what it used to be. I need a memory upgrade. This one is full.
geekmaster is offline   Reply With Quote
Reply

Tags
tcc, tinycc


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
geekmaster simple touchscreen script support hack geekmaster Kindle Developer's Corner 12 04-21-2021 11:38 PM
Very simple guide to reading newspapers on the kindle, please? :) Pismire Amazon Kindle 7 06-01-2012 11:26 PM
Free (Kindle/Nook/ChristianBook) The Invitation: A Simple Guide to the Bible arcadata Deals and Resources (No Self-Promotion or Affiliate Links) 4 08-22-2011 01:05 PM
Simple guide to choosing a Creative Commons license for your work Bob Russell News 0 12-26-2006 11:10 AM


All times are GMT -4. The time now is 04:40 AM.


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