Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#103328 - 07/07/2002 16:20 Developing programs on the empeg
andym
carpal tunnel

Registered: 17/01/2002
Posts: 3995
Loc: Manchester UK
I've finally decided that I can no longer resist the urge to start programming on the empeg. Now this VFDlib thing has appeared there's no reason not to try. My only problem is very rudementary knowledge of linux. My C/C++ isn't too bad but it's from a windows standpoint. Does anyone have a HOWTO for cross-compiling on an x86 for the empeg? Any info would be gratefully recieved. I did a quick search but didn't really turn anything up.
_________________________
Cheers,

Andy M

Top
#103329 - 07/07/2002 17:34 Re: Developing programs on the empeg [Re: andym]
Shonky
pooh-bah

Registered: 12/01/2002
Posts: 2009
Loc: Brisbane, Australia
Have a read of this thread first

Try and compile a hijack kernel first. If you can do that (it's not very hard) you're on your way. There wasn't really anything in one spot that I found until I wrote my part of this thread. Look for my step by step post, but read the entire thread top to bottom.

Mine was all done on a Redhat 7.2 box. If you want to try a Windows development environment it will be a lot harder.

That should get you started at least.
_________________________
Christian
#40104192 120Gb (no longer in my E36 M3, won't fit the E46 M3)

Top
#103330 - 08/07/2002 05:44 Re: Developing programs on the empeg [Re: Shonky]
andym
carpal tunnel

Registered: 17/01/2002
Posts: 3995
Loc: Manchester UK
Just a quickie, what's a $PATH ? I keep reading I should set this, but where do I set this?
_________________________
Cheers,

Andy M

Top
#103331 - 08/07/2002 06:27 Re: Developing programs on the empeg [Re: andym]
Draghtnod
journeyman

Registered: 03/02/2002
Posts: 71
type
echo $PATH
in command line to see whats in $PATH

type
PATH="blabla"
to set $PATH to blabla

type
PATH="/your-path:$PATH"
to add an path..
get it?

greez
Draghi

Top
#103332 - 08/07/2002 07:38 Re: Developing programs on the empeg [Re: andym]
snoopstah
enthusiast

Registered: 07/01/2002
Posts: 337
Loc: Squamish, BC
As an addendum, a path is a list of directories that the machine will look in when you type a command into the shell - many programs are stored in a /bin directory, so if you add that directory to your path, you can run programs in there just by typing the name of the program, rather than the full location of it.

$PATH is simply a variable used to store the list of directories that will be searched.

HTH,

A.
_________________________
Empeg Mk2a 128G with amber lit buttons kit - #30102490

PhotoVancouver | Squamish, BC Webcam | Personal Website

Top
#103333 - 08/07/2002 07:51 Re: Developing programs on the empeg [Re: snoopstah]
andym
carpal tunnel

Registered: 17/01/2002
Posts: 3995
Loc: Manchester UK
I've had a look through the readme file and this is what it says:

To use this stuff, modify your PATH variable as follows:

export PATH="/usr/local/armtools-empeg/bin:$PATH"


But be careful: don't include this on your PATH when building non-Empeg stuff,
because the cc1 executable will get confused.


Could some kind soul explain that to me in english? I'm assuming it's something I need to type
before I try and compile something.

P.S. I found a scrolling text program which binds to a hijack menu. Once i've compiled it, where do I put so it starts with the player.
_________________________
Cheers,

Andy M

Top
#103334 - 08/07/2002 08:12 Re: Developing programs on the empeg [Re: andym]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
This means that once you've downloaded and installed the empeg toolchain onto your Linux system, you need to modify the path so that when you try to build empeg programs, the build system can find the compiler. Again, the PATH is used to find programs whose locations are not explicitly given on the command line.

In addition, the thing about cc1 is that, while the vast majority of the empeg toolchain programs will be given names like arm-empeg-linux-gcc, the cc1 program will not get that prefix. cc1 is, IIRC, the engine that does most of the compiling work, while the other binaries are, more or less, wrappers around it. The problem being that your real system compiler could potentially get confused about which cc1 binary to use and start trying to build weird non-functional Frankenstein-like binaries for your system.

However, I'm guessing that since you're totally in the dark about all of this, that you probably don't have a Linux box to be doing all of this on. It seems like one of the empeg guys had built something very similar up for Windows and had posted instructions on this board somewhere, but I don't now remember precisely who it was or exactly how to find those instructions.
_________________________
Bitt Faulk

Top
#103335 - 08/07/2002 08:23 Re: Developing programs on the empeg [Re: wfaulk]
andym
carpal tunnel

Registered: 17/01/2002
Posts: 3995
Loc: Manchester UK
No, I do have a linux box, I built it last weekend, it runs Suse 8.0 and so far I've managed to download the toolkit file, extract it and put it in the right place.

At the moment, all I'm doing with my linux box is running my Hauppauge card! I would like to do something a little more interesting, hence the empeg programs.
_________________________
Cheers,

Andy M

Top
#103336 - 08/07/2002 08:35 Re: Developing programs on the empeg [Re: andym]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
Okay. Fair enough. Assuming that you're running a Korn-type shell (that is, ksh, pdksh, bash, or zsh), type exactly what it shows: ``export PATH=/usr/local/armtools-empeg/bin:$PATH''. If you're running the Bourne shell (sh), you'll need to change that to ``PATH=/usr/local/armtools-empeg/bin:$PATH; export PATH''. If you're running a C-Shell-type shell (csh, tcsh), you'll need to change that to ``setenv PATH /usr/local/armtools-empeg/bin:$PATH''.

After you've done that, you can compile stuff with the binaries that exist in that directory. All of them have the prefix arm-empeg-linux-, but otherwise are known by their fairly well-known names; gcc is the C compiler, ld is the linker, etc.
_________________________
Bitt Faulk

Top
#103337 - 08/07/2002 08:54 Re: Developing programs on the empeg [Re: wfaulk]
andym
carpal tunnel

Registered: 17/01/2002
Posts: 3995
Loc: Manchester UK
Once I've finished compiling do I have to type anything to get back the original state it was in before I issued the path command?

P.S. Thanks for your help!
_________________________
Cheers,

Andy M

Top
#103338 - 08/07/2002 10:07 Re: Developing programs on the empeg [Re: andym]
tms13
old hand

Registered: 30/07/2001
Posts: 1115
Loc: Lochcarron and Edinburgh
In reply to:

Once I've finished compiling do I have to type anything to get back the original state it was in before I issued the path command?


You could, but I find it easier and safer to start one shell (in its own xterm if I'm using X, or on its own virtual console), set its environment up, use it for compiling, then simply quit it (using "exit") when I'm done. If you don't use a seperate terminal window or console, it's easiest to start a new sub-shell (by typing "bash", or your preferred shell's name), and leave it when you're done. The hard bit is remembering which shell you're leaving at which level.

I suppose one could "bash; echo Exited arm-linux-path shell" to get some feedback as to which level you have left when you type "exit"; it's not something I've tried myself.
_________________________
Toby Speight
030103016 (80GB Mk2a, blue)
030102806 (0GB Mk2a, blue)

Top
#103339 - 08/07/2002 12:21 Re: Developing programs on the empeg [Re: tms13]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
Some programmers I've dealt with in the past wrote a tiny script to start a new shell and change their prompt so that it was readily apparent which state they were in.

Edit: I also still contend that bash is awful. Just my two (unqualified) cents.


Edited by wfaulk (08/07/2002 12:23)
_________________________
Bitt Faulk

Top
#103340 - 08/07/2002 13:24 Re: Developing programs on the empeg [Re: wfaulk]
andym
carpal tunnel

Registered: 17/01/2002
Posts: 3995
Loc: Manchester UK
After about 5 minutes of playing about I got my empeg to go beep! This means I've sucessfully compiled and linked an executeable which I could then upload and execute on the empeg (had to learn about chmod in the process). But it works!!!!!!!!!!!!

Thankyou to all those wonderful people out there who helped point me in the right direction. My only other question is, I have the source to the scroller demo in the VFD lib thread. Once compiled, how do I install it on the empeg. I assume it has to be run on startup or something like that, can anyone help on that?
_________________________
Cheers,

Andy M

Top
#103341 - 09/07/2002 03:29 Re: Developing programs on the empeg [Re: andym]
andym
carpal tunnel

Registered: 17/01/2002
Posts: 3995
Loc: Manchester UK
Not that any of your care I'm sure, but I've just managed to compile and run a hijack userland app. So I've now got the vfdlib scroller demo by johnmcd3. Which is nice....
_________________________
Cheers,

Andy M

Top