Page 1 of 1

Setup for own development

Posted: Sun Aug 16, 2015 5:14 pm
by hogi
Hello SamyGo developers,

I've been browsing the SamyGo forum for quite some time now and I'm excited about all these interesting apps that have been released in the last couple of months.
Now I want to start developing on my own, but I don't really know how to begin, since the wiki seems to be outdated and I can't find anything on the forum itself. That's where I hope you can provide some help to me and possibly other peoples who are interessted. :)

First of all, I guess I would need to have a running toolchain. What is necessary to compile the source files into .so files that i can load with samyGOso?
Is there a list of necessary tools/libraries I would have to install on a new Linux pc? From my understanding this would be independent of the actual TV model (E/F/H) and its processor, right?
My first goal would be to use the provided source files within some released applications and to successfully compile them myself.

Second question is about the "function calls", like

Code: Select all

const int (*SdDisplay_CaptureScreenE)(int *CDSize, unsigned char *buffer, int *CaptureInfo); 
...
(const void*)"_Z23SdDisplay_CaptureScreenP8SdSize_tPhP23SdDisplay_CaptureInfo_t"
Where can I find some information, on what functions are available and how to properly call them? Also, is there a system behind the "weird" naming?

Thanks alot in advance!
Best regards,
hogi

Re: Setup for own development

Posted: Sun Aug 16, 2015 5:44 pm
by bobiturboto
For f toolchain, search in docker hub for samygo. I have created that image for oscam compilation but can be used for any other.

Re: Setup for own development

Posted: Sun Aug 16, 2015 6:31 pm
by sectroyer
hogi wrote: What is necessary to compile the source files into .so files that i can load with samyGOso?
ARM Compiler is enough :) You can download some specific toolchain from samygo: Toolchains
hogi wrote: Where can I find some information, on what functions are available and how to properly call them? Also, is there a system behind the "weird" naming?
Well basically read sources if it's NOT in sources you have to reverse it yourself using IDA or any other tool :)

Re: Setup for own development

Posted: Sun Aug 16, 2015 9:57 pm
by hogi
thank you both!
I will try my best with these answers :)
Though I have two more questions right away.


1. Which of these toolchains should I use? What's the difference and does it matter which one I choose for creating .so files?
sectroyer wrote:You can download some specific toolchain from samygo: Toolchains
2. Many of the apps provided in this forum use the same template for the makefile.
Like the one included in libAlert (download/file.php?id=5802).
The first 2 lines refer to some config files which are not included. What's in them and how can I get them too?

Code: Select all

-include ../toolchain.conf
-include ../install.conf
Thanks for any input! :D

Re: Setup for own development

Posted: Sun Aug 16, 2015 11:07 pm
by zoelechat
hogi wrote:1. Which of these toolchains should I use? What's the difference and does it matter which one I choose for creating .so
I personnally use none of them, but one more generic arm from Sourcery CodeBench: arm-none-linux-gnueabi which has the advantage to work from B to H series. Otherwise, in SamyGO stuff I'd say arm-v7a8v3r1-linux-gnueabi is amongst the "right" ones for (at least) E/F/H...
hogi wrote:

Code: Select all

-include ../toolchain.conf
-include ../install.conf
These lines are remnants of sectroyer's environment and might be useful in case you use several toolchains (mips etc..). You can ignore them like I do because I don't have these files :)
Just put your toolchain/bin in path, export CC=toolchain-gcc, make, done.

Btw, about reversing, look for IDA with decompiler, it helps ;)

Re: Setup for own development

Posted: Mon Aug 17, 2015 5:04 am
by sectroyer
hogi wrote: 2. Many of the apps provided in this forum use the same template for the makefile.
Like the one included in libAlert (download/file.php?id=5802).
The first 2 lines refer to some config files which are not included. What's in them and how can I get them too?

Code: Select all

-include ../toolchain.conf
-include ../install.conf
As zoelechat already said they are NOT required. I don't use install.conf at all and toolchain.conf I use for cross compilation and/or for flags specific for my board for example:

Code: Select all

CFLAGS+=-D_GNU_SOURCE -U_FORTIFY_SOURCE
:)

Re: Setup for own development

Posted: Mon Aug 17, 2015 6:45 pm
by hogi
Thanks again! :)
I have a working setup now. I'm using arm-none-linux-gnueabi on a virtual Ubuntu PC.
I tested my setup with the source code of several of the release apps and everythings works fine.

Now the hard part (reverse engineering) begins ;)