Developing application for linux

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Hi all. This is my first project on linux.
I am gathering information on my project.

**In brief we are implementing an SNMP client on linux kernel. The
hardware is a powerPC based system with two 10/100 Ethernet ports and a
RS232 Serial port.

Can somebody tell me how to develop an application for linux.

I have questions like
- is the application a *.c file that is compiled with the kernel to
form an image.
- OR it is some form of an object file such that the kernel is
configured to run after booting.

I would also like to know the tools in general required to develop such
application.


Re: Developing application for linux

Quoted text here. Click to load it

No.


Yes.


Host computer (most probably running Linux), target computer
(running Linux), cross toolchain, editor, CVS, etc.

--
Grant Edwards                   grante             Yow!  I put aside my
                                  at               copy of "BOWLING WORLD"
We've slightly trimmed the long signature. Click to see the full one.
Re: Developing application for linux

Quoted text here. Click to load it

No.

You build an ELF executable (not an object file). The kernel knows
absolutely nothing about your executable. You simply run that exe
just like you would run 'date' or 'ls'.

True, you can make starting that executable be a part of an 'rc'
script, which is started by the 'init' process, which is started
by the kernel. But it's a long way from "kernel is configured to
run after booting".

Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.

Re: Developing application for linux
Quoted text here. Click to load it

ELF executables are object files.

Quoted text here. Click to load it

That depends on its name.  If you name it 'init', then the
kernel _does_ know about it.

Quoted text here. Click to load it

Really? I thought there was a way to tell the kernel what
program to run if you wanted to run someting other than
/sbin/init.

--
Grant Edwards                   grante             Yow!  Yow! STYROFOAM...
                                  at              
We've slightly trimmed the long signature. Click to see the full one.
Re: Developing application for linux
Thanks guys. So this is what I understand. I can use Code Warrior to
create an elf object. As I am using MPC875 as my CPU.

But I am still not clear on how to configure my kernel to start the
application. ppbly I may sound very naive in asking this nut I am still
not clear from the correspondence. Like how do I edit/modify the rc
scripts. Some sort of readme or some links for starters might help.


Re: Developing application for linux

Quoted text here. Click to load it

With an editor?

Assuming your target is configured to run "init", you can simply
add a line like this:

  1:2345:respawn:/path/to/your/app <args>

to your /etc/inittab.

Read about "init" and "normal" rc initialization here:
http://www.uwsg.iu.edu/UAU/boot/init.html

Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.

Re: Developing application for linux

Quoted text here. Click to load it

Well, here's what you find if you search Amazon.com for
"embedded linux":

(Amazon.com product link shortened)
(Amazon.com product link shortened)
(Amazon.com product link shortened)
(Amazon.com product link shortened)
(Amazon.com product link shortened)

The first two (the O'Reilly book and Hollabaugh's book are both
good. Rubini & Corbet is also a must if you have to support any
custom hardware.  The New Riders books is OK as well.  The
other one I haven't looked at.

--
Grant Edwards                   grante             Yow!  My CODE of ETHICS
                                  at               is vacationing at famed
We've slightly trimmed the long signature. Click to see the full one.

Site Timeline