MrPorkPi
Posts: 2
Joined: Wed May 30, 2012 3:57 pm

Experienced application developer with zero linux knowledge.

Wed May 30, 2012 4:14 pm

Hi All,

So excited to have received my Rasperry Pi board, got it up and running, had a tinker, sorted out issues (such as manually configuring network settings and getting my display working - at least so I can see the screen - all sorted thanks to google) and can't wait to get started on some of the wonderful ideas and projects I have in mind...

So I'm an experienced software developer of some 20 years with a number of published titles to my name. My experience has been predominantly with developing for games console, windows, mac, mobile phone platforms etc and writing low level device firmware... I have never used linux in my life! I did fiddle around with Unix on Silicon Graphics machines in the past, but that was some 15 years ago now.

So where do I start? I've googled linux development, skimmed over the forums and finding a common problem in that there's far too much wood to see the trees.

What would be really useful is if someone can give me some pointers to development environments, command line tools etc, useful (and appropriate) web articles or books to purchase to get me started.

I'm quite happy developing in any language (though some would require me to learn them first) but my preferred choice would be a c based language (c / c++ / c# / objective-c) as then I can potentially reuse lots of library code I've created over the years.

Ultimately I have specific project ideas I wish to use the board for, and ultimately I would like to create an SDCard image that boots and jumps straight into my application which is full screen, graphically rich and is the only "user percievable" application running. Obviously I have a lot to learn before I get anywhere near this, but some useful pointers to get me started would be very much appreciated.

Thanks,
Rich

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5331
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Experienced application developer with zero linux knowle

Wed May 30, 2012 4:35 pm

Have a look at /op/vc/src/hello_pi
for some example C code that buils and runs on the Pi, and should get you goind.

hello_triangle would be a good starting point for a full screen graphically rich application.

robthebloke
Posts: 8
Joined: Fri Mar 09, 2012 1:30 pm

Re: Experienced application developer with zero linux knowle

Wed May 30, 2012 10:21 pm

Ex Sgi user, also with published titles to my name ;)

Linux isn't *that* different to irix really - nothing's really changed in 20 years! Totally obvious programming points: use g++ instead of cc; the 'ar' command makes libs; use -shared to make dso's; get reacquainted with makefiles; and remember to make heavy use of the command line and custom build scripts/tools! There are some other build systems apart from make, scons being one of the more popular ones (probably the best bet). For version control, nothings really any different.... SVN/CVS/Mecurial/Git/Whatever. I've heard a rumour that Tortoise works on the Pi, although I can't confirm that.

For profiling you can use gprof. For debugging use gdb either from the command line, or via an IDE (eg Qt creator).

Speaking of IDEs, you're pretty much going to be looking at Qt creator (very good for knocking up quick GUI based apps, although it's also a fairly decent IDE), or eclipse (I suspect this might be a little sluggish on the Pi? Mind you, Qt creator will probably be sluggish too!). Unlike the project pages in MSVC, you'll be mainly managing build configs in a makefile-like way for the most part.

For graphics work, you'll be wanting to get acquainted with OpenGLES. As I understand things, there is a binary blob for the broadcom GLES implementation, which is what you're going to need to get an app running without linux in the way. It doesn't look trivial, but you might want to start watching the progress of this thread.

For joypads, there is a standard linux joystick lib that supports stuff like the xbox 360 joypad. You'll be wanting to test that out, by trying to get the 'jscal' exe installed (if it isn't already). If you can figure that out, the joypads will be working ;) Obviously the code for the linux joystick lib is available, should you want to know how to communicate to a joypad over USB without linux ;)

For audio, you'll be wanting to brush up on OpenSLES. I've not looked into this much yet myself, but I'm imagining there will be a similar binary blob problem to OpenGLES to be solved here.

For maths libs, either use your own, or go for something like glm. There aren't any floating point SIMD intrinsics available, so any naive FPU based maths library will do. There are some very basic integer DSP instructions that provide 4x8bit or 2x16bit SIMD units, but don't get too excited! Useful for DSP work, but of limited use elsewhere. The __fabs and __sqrtf intrinsics might come in handy though ;)

Personally I don't tend to spend too much time actually developing on linux (I'll get burned alive for this I know!). I usually just use MSVC on a windows box, with the source either on a shared drive, shared folder, or simply via VCS commit/update. Once the equivalent code is running on windows, it's usually just a case of fixing g++ build errors. It's a little harder with the Pi due to endian differences, but by the sounds of it you've dealt with that before!

If I'm working soley on linux, I don't usually use much more than g++, gdb, make, gprof, svn, and a set of custom bash/ruby/python scripts to automate the build process.

The command prompt will have a little start up script (~/.bashrc if you're using bash) which is worth editing to hell to set paths for custom tools & dso's (PATH + LD_LIBRARY_PATH). It's also extremely useful to set a load of command aliases, and various other environment variables, etc.

It's also worth having a little browse through the man pages for g++, ar, ld, pwd, gdb, cp, cd, rm, mkdir, make, grep, alias, .... just to refresh your memory ;)

Hopefully that gives you a couple of google search terms to start with! ;)

p.s. Synergy is a really useful app for sharing a keyboard + mouse between 2 computers which might come in handy to de-clutter your desk if you've not seen it before.

MrPorkPi
Posts: 2
Joined: Wed May 30, 2012 3:57 pm

Re: Experienced application developer with zero linux knowle

Thu May 31, 2012 10:51 am

Thanks folks, loads of useful stuff there to start looking into. I found the samples mentioned (didn't even know they were there!) and I've examined the hello triangle, built and run it which is a good start and somewhere to start experimenting from.

Defintely would prefer to develop on a PC/Mac where I have all my custom tools available to me and then run the code remotely - I'll look into setting something up for this, perhaps running linux in a virtual box for compilation and testing and using XCode or MSVC for editing - set up some kind of custom scripts to return build errors etc, then finally build code onto the pi itself. I have used Eclipse before but I don't really like it.

USB is something I defintely need to look into as I have a couple of HID based custom devices that I will need to be able to read and write input and output reports to - so the gamepad source will probably be a good starting point for investigating that too.

I already extensively use SVN through all my projects but I would handle this on the development machine (whether that be PC or Mac) rather than on the Pi itself.

Synergy sounds interesting as I'm currently swapping my USB dongle for my keyboard/mouse back and forth between my Pi and PC :?

Again, many thanks for the reply, that's exactly the kind of information I was after! ;)

Return to “General programming discussion”