Query in adding application in Linux - Linux

This is a discussion on Query in adding application in Linux - Linux ; Hi, I am newbie to LINUX. I have to start application development in Linux. I have a complete BSP for ARM procesor. I want to add a simple application("displaying some text") and i want to compile along with kernel and ...

+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 20 of 22

Thread: Query in adding application in Linux

  1. Query in adding application in Linux

    Hi,
    I am newbie to LINUX.
    I have to start application development in Linux.
    I have a complete BSP for ARM procesor.
    I want to add a simple application("displaying some text") and i want
    to
    compile along with kernel and port to target device.
    What i hv done is just created a separate folder name sysapps and
    created a test.c file inside that folder and make file and compile
    that test.c file separately and added to Kernel Make file in SUB_DIRS
    and i don't know where to add test.o

    Somebody help me in adding the application developed my me to Make
    file.
    Or how to compile my application along with Kernel so that my
    application runs once i load my zImage to target device.

    Is there any Link which explains in detail the "Make file" of BSP
    completely.

    Pls. help me in this issue.

    Regards,
    Kirthika


  2. Re: Query in adding application in Linux

    kracks writes:
    > I am newbie to LINUX.
    > I have to start application development in Linux.
    > I have a complete BSP for ARM procesor.
    > I want to add a simple application("displaying some text") and i want
    > to
    > compile along with kernel and port to target device.
    > What i hv done is just created a separate folder name sysapps and
    > created a test.c file inside that folder and make file and compile
    > that test.c file separately and added to Kernel Make file in SUB_DIRS
    > and i don't know where to add test.o


    Nowhere. You will need to compile your application into a separate
    executable, make this executable part of the file system on the board,
    and arrange for it to be executed after the kernel has booted.

    An easy, but fairly crude way would be to install it as
    /sbin/init. The kernel will then execute it as process #1
    automatically.

    > Is there any Link which explains in detail the "Make file" of BSP
    > completely.


    'BSP' (board support package) is a generic term, meaning, there are
    different BSPs from different vendors for different boards. Didn't you
    get any documenation with it?


  3. Re: Query in adding application in Linux

    On a sunny day (Wed, 04 Jul 2007 07:54:31 -0700) it happened kracks
    wrote in
    <1183560871.403794.245740@x35g2000prf.googlegroups. com>:

    >Hi,
    > I am newbie to LINUX.
    > I have to start application development in Linux.
    > I have a complete BSP for ARM procesor.
    > I want to add a simple application("displaying some text") and i want
    >to
    > compile along with kernel and port to target device.
    > What i hv done is just created a separate folder name sysapps and
    > created a test.c file inside that folder and make file and compile
    >that test.c file separately


    Here is an example Makefile I used this to compile my embedded nameserver
    and some other application to an embedded MIPS processor based environment.

    If you interchange the comments in the first 2 lines then you can compile
    locally and test on the PC.

    CC = gcc
    #CC = /opt/brcm/hndtools-mipsel-uclibc-3.2.3/bin/mipsel-uclibc-gcc

    CFLAGS = -O2 -Wall

    SRC1 = pfdns.c internet.c
    SRC2 = scanner.c


    OBJECT1 = pfdns.o internet.o
    OBJECT2 = scanner.o

    LIBRARY =

    all:
    $(CC) $(CFLAGS) -c $(SRC1)
    $(CC) -o pfdns $(OBJECT1) $(LIBRARY)

    $(CC) $(CFLAGS) -c $(SRC2)
    $(CC) -o scanner $(OBJECT2) $(LIBRARY)

    # Dependencies
    pfdns.o: pfdns.c pfdns.h pfdns_proto.h
    scanner.o : scanner.c pfdns.h pfdns_proto.h

    install:
    mkdir -p /usr/local/httpd/htdocs/nuclear/
    cp pfdns /usr/local/httpd/htdocs/nuclear/
    cp scanner /usr/local/httpd/htdocs/nuclear/

    clean:
    rm -f pfdns scanner *.o




    In the 'install' target you see I copy it to a web server root directory.
    From the embedded system in a writable directory I use
    wget http://myserver/nuclear/
    to get the app, do a
    chmod +x pfdns,
    then run it for test
    ../pfdns

    No kernel things need to be changed, the kernel is not
    an application.

    On an Unix system, all processes are started from init,
    Apart from run levels and all that, something your embedded system
    perhaps does not have, you can start your application
    by adding something to init (have good look at the code for init),
    and what it does.

    All depends when and how your application has to run.

    But somehow I am sure your ARM package must have some sort of manual?
    The procedures to add an application must be in there!

    Also are you developing under MSwindows?
    In such a case it may help to perhaps install cygwin, or even better
    make a partition and install a simple Linux, www.grml.org is small and
    has a C compiler.
    And use that to get some Unix experience.
    After a few years you will get the hang of it


  4. Re: Query in adding application in Linux

    On Jul 4, 9:02 pm, Jan Panteltje wrote:
    > On a sunny day (Wed, 04 Jul 2007 07:54:31 -0700) it happened kracks
    > wrote in
    > <1183560871.403794.245...@x35g2000prf.googlegroups. com>:
    >
    > >Hi,
    > > I am newbie toLINUX.
    > > I have to startapplicationdevelopmentinLinux.
    > > I have a complete BSP for ARM procesor.
    > > I want to add a simpleapplication("displaying some text") and i want
    > >to
    > > compile along with kernel and port to target device.
    > > What i hv done is just created a separate folder name sysapps and
    > > created a test.c file inside that folder and make file and compile
    > >that test.c file separately

    >
    > Here is an example Makefile I used this to compile my embedded nameserver
    > and some otherapplicationto an embedded MIPS processor based environment.
    >
    > If you interchange the comments in the first 2 lines then you can compile
    > locally and test on the PC.
    >
    > CC = gcc
    > #CC = /opt/brcm/hndtools-mipsel-uclibc-3.2.3/bin/mipsel-uclibc-gcc
    >
    > CFLAGS = -O2 -Wall
    >
    > SRC1 = pfdns.c internet.c
    > SRC2 = scanner.c
    >
    > OBJECT1 = pfdns.o internet.o
    > OBJECT2 = scanner.o
    >
    > LIBRARY =
    >
    > all:
    > $(CC) $(CFLAGS) -c $(SRC1)
    > $(CC) -o pfdns $(OBJECT1) $(LIBRARY)
    >
    > $(CC) $(CFLAGS) -c $(SRC2)
    > $(CC) -o scanner $(OBJECT2) $(LIBRARY)
    >
    > # Dependencies
    > pfdns.o: pfdns.c pfdns.h pfdns_proto.h
    > scanner.o : scanner.c pfdns.h pfdns_proto.h
    >
    > install:
    > mkdir -p /usr/local/httpd/htdocs/nuclear/
    > cp pfdns /usr/local/httpd/htdocs/nuclear/
    > cp scanner /usr/local/httpd/htdocs/nuclear/
    >
    > clean:
    > rm -f pfdns scanner *.o
    >
    > In the 'install' target you see I copy it to a web server root directory.
    > From the embedded system in a writable directory I use
    > wgethttp://myserver/nuclear/
    > to get the app, do a
    > chmod +x pfdns,
    > then run it for test
    > ./pfdns
    >
    > No kernel things need to be changed, the kernel is not
    > anapplication.
    >
    > On an Unix system, all processes are started from init,
    > Apart from run levels and all that, something your embedded system
    > perhaps does not have, you can start yourapplication
    > by adding something to init (have good look at the code for init),
    > and what it does.
    >
    > All depends when and how yourapplicationhas to run.
    >
    > But somehow I am sure your ARM package must have some sort of manual?
    > The procedures to add anapplicationmust be in there!
    >
    > Also are you developing under MSwindows?
    > In such a case it may help to perhaps install cygwin, or even better
    > make a partition and install a simpleLinux,www.grml.orgis small and
    > has a C compiler.
    > And use that to get some Unix experience.
    > After a few years you will get the hang of it


    Hi Jan Panteltje ,
    I have a simple application like this eg. test.c:
    #include
    main()
    {
    printf("Hello world");
    }

    I put this in one folder called sysapps.

    I made a make file like this as u said.

    CC = gcc

    CFLAGS = -O2 -Wall

    SRC1 = test.c

    OBJECT1 = test.o

    LIBRARY =

    all:
    $(CC) $(CFLAGS) -c $(SRC1)
    $(CC) -o pfdns $(OBJECT1) $(LIBRARY)


    # Dependencies
    test.o: test.c


    I don't understand the purpose of this line.
    #CC = /opt/brcm/hndtools-mipsel-uclibc-3.2.3/bin/mipsel-uclibc-gcc

    Further my project root is in home/ln2440(ARM processor directory)/
    kernel etc...

    My application i kept in home/ln2440 directory.

    whether i have to keep all my application in /opt directory or in home
    also i can keep.

    I am not sure about install part:

    Further where i have to install my test (which is application
    executable file) and

    Whether shall i keep in /sbin, if i keep in sbin whether my kernel,
    calls executable files in sbin.



    Further application code should start with main() or init().


    I added make file and compiled make file and i got application
    executable file.
    Once i load to target i didn't get my application running once i load
    my zImage to target device.

    install:
    Where i have to install.

    Pls. help me.

    Regards,
    Kirthika


  5. Re: Query in adding application in Linux

    On a sunny day (Thu, 05 Jul 2007 02:16:01 -0700) it happened kracks
    wrote in
    <1183626961.527603.66430@g37g2000prf.googlegroups.c om>:

    >Hi Jan Panteltje ,
    > I have a simple application like this eg. test.c:
    > #include
    > main()
    >{
    >printf("Hello world");
    >}
    >
    >I put this in one folder called sysapps.
    >
    >I made a make file like this as u said.



    >I don't understand the purpose of this line.
    >CC=gcc
    >#CC = /opt/brcm/hndtools-mipsel-uclibc-3.2.3/bin/mipsel-uclibc-gcc


    This is for my system, I develop on a Linux system, so Icompile first with gcc,
    and test on the PC, then I comment ou the fist line and uncomment the second line,
    now I compile with a MIPS version of the compiler.
    You did not answer my question if you develop on MS windows, but if you do
    I think your gcc package is already for ARM, so ignore this line.


    >Further my project root is in home/ln2440(ARM processor directory)/
    >kernel etc...
    >
    >My application i kept in home/ln2440 directory.


    OK


    >whether i have to keep all my application in /opt directory or in home
    >also i can keep.


    No, keep it where your systems documentation tells you (where it is).
    This makefile was just an example of MY system...


    > I am not sure about install part:
    >
    >Further where i have to install my test (which is application
    >executable file) and
    >
    >Whether shall i keep in /sbin, if i keep in sbin whether my kernel,
    >calls executable files in sbin.


    OK, let's suppose you call your program 'test' (just as an example OK?).
    If you wanted the embedded system to run 'test' on power up, it needs to
    execute it, so in its most simple form (I am not saying that is what it is in your system),
    the embedded system needs to execute path_to_your_application/test
    For 'test' to execute it must have the executable flag set, in this case for the root user,
    chmod +x test
    Will set that flag.
    You need some Unix knowledge, there are _thousands_ of commands like this...
    Anyways in the above EXAMPLE you need to modify the system startup code, so add a section that
    executes 'test',


    >Further application code should start with main() or init().


    No, C applications always start with 'main()'.

    init is a program on the embeded system that starts all other processes.
    I dunno where init is located on you system, on mine it is in /sbin/init
    As init itself is an executable, you will have to find init,c on your embedded system,
    and look at its code.

    On my embedded system there is a directory 'rc'.
    In that directory there is init.c, rc.c, services.c, etc..
    If I look at rc.c I see it starts all services (calls a routine start_services() ).
    In start_services (it is in services.c surprize) you COULD add something like (as I did):

    /* starts telnet daemon */
    int start_telnetd(void)
    {
    int ret;

    chdir("/");
    ret = eval("telnetd");
    chdir("/");

    dprintf("done\n");
    return ret;
    }


    And in start_services I added:

    int start_services(void)
    {
    start_httpd(); /* webserver */
    start_telnetd(); /* telnet daemon */
    .........


    THIS IS JUST AN EXAMPLE RIGHT NOT WHAT YOU SHOULD TYPE ;-)

    Now there are some problems here, as your 'test' is no daemon, and only prints to stdout,
    But I hope now you know where to look.

    On the other hand, if you just wanted to run 'test' on the embedded system, then 3 things
    need to happen:
    1) you need to somehow upload 'test' to the embeded system in a writable directory (try /tmp ).
    2) you need to make sure it is executable (chmod +x test )
    3) you need to start it ( /tmp/test )

    The above 3 requires a usable connection from the PC to the embedded system, either via a serial
    link or telnet, one via any port using netcat, or wget and a webserver on the PC.

    There are too many possibilities, so I cannot say what works for you, but it must be in your
    embedded system docs.

    Does this answer your question?
    How about ansering if you use MS windows or Linux on the PC?

  6. Re: Query in adding application in Linux

    On Jul 5, 3:27 pm, Jan Panteltje wrote:
    > On a sunny day (Thu, 05 Jul 2007 02:16:01 -0700) it happened kracks
    > wrote in
    > <1183626961.527603.66...@g37g2000prf.googlegroups.c om>:
    >
    > >Hi Jan Panteltje ,
    > > I have a simple application like this eg. test.c:
    > > #include
    > > main()
    > >{
    > >printf("Hello world");
    > >}

    >
    > >I put this in one folder called sysapps.

    >
    > >I made a make file like this as u said.
    > >I don't understand the purpose of this line.
    > >CC=gcc
    > >#CC = /opt/brcm/hndtools-mipsel-uclibc-3.2.3/bin/mipsel-uclibc-gcc

    >
    > This is for my system, I develop on a Linux system, so Icompile first with gcc,
    > and test on the PC, then I comment ou the fist line and uncomment the second line,
    > now I compile with a MIPS version of the compiler.
    > You did not answer my question if you develop on MS windows, but if you do
    > I think your gcc package is already for ARM, so ignore this line.
    >
    > >Further my project root is in home/ln2440(ARM processor directory)/
    > >kernel etc...

    >
    > >My application i kept in home/ln2440 directory.

    >
    > OK
    >
    > >whether i have to keep all my application in /opt directory or in home
    > >also i can keep.

    >
    > No, keep it where your systems documentation tells you (where it is).
    > This makefile was just an example of MY system...
    >
    > > I am not sure about install part:

    >
    > >Further where i have to install my test (which is application
    > >executable file) and

    >
    > >Whether shall i keep in /sbin, if i keep in sbin whether my kernel,
    > >calls executable files in sbin.

    >
    > OK, let's suppose you call your program 'test' (just as an example OK?).
    > If you wanted the embedded system to run 'test' on power up, it needs to
    > execute it, so in its most simple form (I am not saying that is what it is in your system),
    > the embedded system needs to execute path_to_your_application/test
    > For 'test' to execute it must have the executable flag set, in this case for the root user,
    > chmod +x test
    > Will set that flag.
    > You need some Unix knowledge, there are _thousands_ of commands like this...
    > Anyways in the above EXAMPLE you need to modify the system startup code, so add a section that
    > executes 'test',
    >
    > >Further application code should start with main() or init().

    >
    > No, C applications always start with 'main()'.
    >
    > init is a program on the embeded system that starts all other processes.
    > I dunno where init is located on you system, on mine it is in /sbin/init
    > As init itself is an executable, you will have to find init,c on your embedded system,
    > and look at its code.
    >
    > On my embedded system there is a directory 'rc'.
    > In that directory there is init.c, rc.c, services.c, etc..
    > If I look at rc.c I see it starts all services (calls a routine start_services() ).
    > In start_services (it is in services.c surprize) you COULD add something like (as I did):
    >
    > /* starts telnet daemon */
    > int start_telnetd(void)
    > {
    > int ret;
    >
    > chdir("/");
    > ret = eval("telnetd");
    > chdir("/");
    >
    > dprintf("done\n");
    > return ret;
    >
    > }
    >
    > And in start_services I added:
    >
    > int start_services(void)
    > {
    > start_httpd(); /* webserver */
    > start_telnetd(); /* telnet daemon */
    > ........
    >
    > THIS IS JUST AN EXAMPLE RIGHT NOT WHAT YOU SHOULD TYPE ;-)
    >
    > Now there are some problems here, as your 'test' is no daemon, and only prints to stdout,
    > But I hope now you know where to look.
    >
    > On the other hand, if you just wanted to run 'test' on the embedded system, then 3 things
    > need to happen:
    > 1) you need to somehow upload 'test' to the embeded system in a writable directory (try /tmp ).
    > 2) you need to make sure it is executable (chmod +x test )
    > 3) you need to start it ( /tmp/test )
    >
    > The above 3 requires a usable connection from the PC to the embedded system, either via a serial
    > link or telnet, one via any port using netcat, or wget and a webserver on the PC.
    >
    > There are too many possibilities, so I cannot say what works for you, but it must be in your
    > embedded system docs.
    >
    > Does this answer your question?
    > How about ansering if you use MS windows or Linux on the PC?


    Hi Janpanteltje,

    I am having LINUX in my PC.
    I still couldn't port my application to my target board.
    I have a doubt whether kernel has to compile both application and OS.
    How executable file for the application runs once kernel is up in
    the target device.
    Whether I have to go the command prompt for the target board and
    configure it.
    But i want my application to run once kernel is up in the target
    board.
    How to do this?


    Hi Rainer Weikusat,
    I am have difficulty in making my application to run in target
    device.
    I have executable file of an application and i kept in /sbin

    Pls. help me in this issue:
    How to make my application to be executable part of the file system
    on the board, and arrange for it to be executed after the kernel has
    booted.

    I want my application to run once kernel is up in the target device.
    Whether i have to go the command prompt for the target board and
    configure it.

    Pls. help.



    Regards
    Kirthika




  7. Re: Query in adding application in Linux

    On a sunny day (Sat, 07 Jul 2007 02:41:57 -0700) it happened kracks
    wrote in
    <1183801317.406476.86400@a26g2000pre.googlegroups.c om>:

    >> On my embedded system there is a directory 'rc'.
    >> In that directory there is init.c, rc.c, services.c, etc..
    >> If I look at rc.c I see it starts all services (calls a routine start_services() ).
    >> In start_services (it is in services.c surprize) you COULD add something like (as I did):
    >>
    >> /* starts telnet daemon */
    >> int start_telnetd(void)
    >> {
    >> int ret;
    >>
    >> chdir("/");
    >> ret = eval("telnetd");
    >> chdir("/");
    >>
    >> dprintf("done\n");
    >> return ret;
    >>
    >> }
    >>
    >> And in start_services I added:
    >>
    >> int start_services(void)
    >> {
    >> start_httpd(); /* webserver */
    >> start_telnetd(); /* telnet daemon */
    >> ........
    >>
    >> THIS IS JUST AN EXAMPLE RIGHT NOT WHAT YOU SHOULD TYPE ;-)
    >>
    >> Now there are some problems here, as your 'test' is no daemon, and only prints to stdout,
    >> But I hope now you know where to look.
    >>
    >> On the other hand, if you just wanted to run 'test' on the embedded system, then 3 things
    >> need to happen:
    >> 1) you need to somehow upload 'test' to the embeded system in a writable directory (try /tmp ).
    >> 2) you need to make sure it is executable (chmod +x test )
    >> 3) you need to start it ( /tmp/test )
    >>
    >> The above 3 requires a usable connection from the PC to the embedded system, either via a serial
    >> link or telnet, one via any port using netcat, or wget and a webserver on the PC.
    >>
    >> There are too many possibilities, so I cannot say what works for you, but it must be in your
    >> embedded system docs.
    >>
    >> Does this answer your question?
    >> How about ansering if you use MS windows or Linux on the PC?

    >
    >Hi Janpanteltje,
    >
    > I am having LINUX in my PC.


    Good, that makes some things simpler.

    > I still couldn't port my application to my target board.


    I dunno if you just recompile the whole directory tree with kernel and
    all application and then send it to the target?
    I get the impression you do.
    In such a case add the application somewhere in the tree ..../my-application.c,
    and have it compile with the rest, and make sure the executable ends
    up in the path (that is where the shell will search) or specify the full path
    to it in the init related files (like I describes in my case in rc/*

    > I have a doubt whether kernel has to compile both application and OS.


    Compiler compiles both kernel _and_ applications.
    Once the kernel is compiled you only worry about the applications, unless you
    need to reconfigure the kernel.

    > How executable file for the application runs once kernel is up in
    >the target device.
    > Whether I have to go the command prompt for the target board and
    >configure it.
    > But i want my application to run once kernel is up in the target
    >board.
    > How to do this?


    I just described that, see text above.

    Hope you get it working, it actually is not difficult.
    Have a very good look how some _other_ application that is already there, is processed
    by the scripts you use.

  8. Re: Query in adding application in Linux

    On Jul 7, 5:11 pm, Jan Panteltje wrote:
    > On a sunny day (Sat, 07 Jul 2007 02:41:57 -0700) it happened kracks
    > wrote in
    > <1183801317.406476.86...@a26g2000pre.googlegroups.c om>:
    >
    >
    >
    >
    >
    > >> On my embedded system there is a directory 'rc'.
    > >> In that directory there is init.c, rc.c, services.c, etc..
    > >> If I look at rc.c I see it starts all services (calls a routine start_services() ).
    > >> In start_services (it is in services.c surprize) you COULD add something like (as I did):

    >
    > >> /* starts telnet daemon */
    > >> int start_telnetd(void)
    > >> {
    > >> int ret;

    >
    > >> chdir("/");
    > >> ret = eval("telnetd");
    > >> chdir("/");

    >
    > >> dprintf("done\n");
    > >> return ret;

    >
    > >> }

    >
    > >> And in start_services I added:

    >
    > >> int start_services(void)
    > >> {
    > >> start_httpd(); /* webserver */
    > >> start_telnetd(); /* telnet daemon */
    > >> ........

    >
    > >> THIS IS JUST AN EXAMPLE RIGHT NOT WHAT YOU SHOULD TYPE ;-)

    >
    > >> Now there are some problems here, as your 'test' is no daemon, and only prints to stdout,
    > >> But I hope now you know where to look.

    >
    > >> On the other hand, if you just wanted to run 'test' on the embedded system, then 3 things
    > >> need to happen:
    > >> 1) you need to somehow upload 'test' to the embeded system in a writable directory (try /tmp ).
    > >> 2) you need to make sure it is executable (chmod +x test )
    > >> 3) you need to start it ( /tmp/test )

    >
    > >> The above 3 requires a usable connection from the PC to the embedded system, either via a serial
    > >> link or telnet, one via any port using netcat, or wget and a webserver on the PC.

    >
    > >> There are too many possibilities, so I cannot say what works for you, but it must be in your
    > >> embedded system docs.

    >
    > >> Does this answer your question?
    > >> How about ansering if you use MS windows or Linux on the PC?

    >
    > >Hi Janpanteltje,

    >
    > > I am having LINUX in my PC.

    >
    > Good, that makes some things simpler.
    >
    > > I still couldn't port my application to my target board.

    >
    > I dunno if you just recompile the whole directory tree with kernel and
    > all application and then send it to the target?
    > I get the impression you do.
    > In such a case add the application somewhere in the tree ..../my-application.c,
    > and have it compile with the rest, and make sure the executable ends
    > up in the path (that is where the shell will search) or specify the full path
    > to it in the init related files (like I describes in my case in rc/*
    >
    > > I have a doubt whether kernel has to compile both application and OS.

    >
    > Compiler compiles both kernel _and_ applications.
    > Once the kernel is compiled you only worry about the applications, unless you
    > need to reconfigure the kernel.
    >
    > > How executable file for the application runs once kernel is up in
    > >the target device.
    > > Whether I have to go the command prompt for the target board and
    > >configure it.
    > > But i want my application to run once kernel is up in the target
    > >board.
    > > How to do this?

    >
    > I just described that, see text above.
    >
    > Hope you get it working, it actually is not difficult.
    > Have a very good look how some _other_ application that is already there, is processed
    > by the scripts you use.- Hide quoted text -
    >
    > - Show quoted text -


    Hi Janpanteltje,
    I have another doubt.
    Whether i have to add my application to file system and compile
    my file
    system. (File system in my case is ramdisk_2410.gz)
    and boot to target device. I saw one example where they added
    application to
    file system. They compiled file system and they booted file
    system to target
    device.

    Shall i add to file system. Is it correct.


    Pls. suggest me.

    Regards,
    Kirthika







  9. Re: Query in adding application in Linux

    On a sunny day (Sat, 07 Jul 2007 22:52:09 -0700) it happened kracks
    wrote in
    <1183873929.128541.238830@d30g2000prg.googlegroups. com>:

    >Hi Janpanteltje,
    > I have another doubt.
    > Whether i have to add my application to file system and compile
    >my file
    > system. (File system in my case is ramdisk_2410.gz)
    > and boot to target device. I saw one example where they added
    >application to
    > file system. They compiled file system and they booted file
    >system to target
    > device.
    >
    > Shall i add to file system. Is it correct.


    I think this is probably the best way in your case.
    Also check how that application is started in your system,
    and try doing it the same way.
    Or do you have some serial link or telnet so you can start it from the PC?

  10. Re: Query in adding application in Linux

    On Jul 8, 3:50 pm, Jan Panteltje wrote:
    > On a sunny day (Sat, 07 Jul 2007 22:52:09 -0700) it happened kracks
    > wrote in
    > <1183873929.128541.238...@d30g2000prg.googlegroups. com>:
    >
    > >Hi Janpanteltje,
    > > I have another doubt.
    > > Whether i have to add myapplicationto file system and compile
    > >my file
    > > system. (File system in my case is ramdisk_2410.gz)
    > > and boot to target device. I saw one example where they added
    > >applicationto
    > > file system. They compiled file system and they booted file
    > >system to target
    > > device.

    >
    > > Shall i add to file system. Is it correct.

    >
    > I think this is probably the best way in your case.
    > Also check how thatapplicationis started in your system,
    > and try doing it the same way.
    > Or do you have some serial link or telnet so you can start it from the PC?


    Hi,
    I added application to root file system and my
    application(helloworld) exists in target board at /usr/sbin.
    But i couldn't execute it.

    I tried chmod +x helloworld.

    chmod also exists in my target system.

    But my kernel is not executing application once my kernel is up.
    "It says Syntax error"
    I have another bootp.sh in my file.
    I hv difficulty in compiling with kernel...

    I will try.Tell me some suggestions.

    Regards,
    Kirthika


  11. Re: Query in adding application in Linux

    On Jul 8, 7:34 pm, svnat...@gmail.com wrote:
    > On Jul 8, 3:50 pm, Jan Panteltje wrote:
    >
    >
    >
    >
    >
    > > On a sunny day (Sat, 07 Jul 2007 22:52:09 -0700) it happened kracks
    > > wrote in
    > > <1183873929.128541.238...@d30g2000prg.googlegroups. com>:

    >
    > > >Hi Janpanteltje,
    > > > I have another doubt.
    > > > Whether i have to add myapplicationto file system and compile
    > > >my file
    > > > system. (File system in my case is ramdisk_2410.gz)
    > > > and boot to target device. I saw one example where they added
    > > >applicationto
    > > > file system. They compiled file system and they booted file
    > > >system to target
    > > > device.

    >
    > > > Shall i add to file system. Is it correct.

    >
    > > I think this is probably the best way in your case.
    > > Also check how thatapplicationis started in your system,
    > > and try doing it the same way.
    > > Or do you have some serial link or telnet so you can start it from the PC?

    >
    > Hi,
    > I addedapplicationto root file system and myapplication(helloworld) exists in target board at /usr/sbin.
    > But i couldn't execute it.
    >
    > I tried chmod +x helloworld.
    >
    > chmod also exists in my target system.
    >
    > But my kernel is not executingapplicationonce my kernel is up.
    > "It says Syntax error"
    > I have another bootp.sh in my file.
    > I hv difficulty in compiling with kernel...
    >
    > I will try.Tell me some suggestions.
    >
    > Regards,
    > Kirthika- Hide quoted text -
    >
    > - Show quoted text -


    Hi,
    I added application to root file system and my
    application(helloworld) exists in target board at /usr/sbin.
    But i couldn't execute it.

    I tried chmod +x helloworld.


    chmod also exists in my target system.


    But my kernel is not executing application once my kernel is up.
    "It says Syntax error"
    I have another bootp.sh in my file.
    I hv difficulty in compiling with kernel...


    I will try.Tell me some suggestions.


    Regards,
    Kirthika


  12. Re: Query in adding application in Linux

    On a sunny day (Sun, 08 Jul 2007 07:34:36 -0700) it happened
    svnatraj@gmail.com wrote in
    <1183905276.249105.86580@g37g2000prf.googlegroups.c om>:

    >Hi,
    > I added application to root file system and my
    >application(helloworld) exists in target board at /usr/sbin.
    > But i couldn't execute it.
    >
    > I tried chmod +x helloworld.


    As root (you likely are on your embedded system):
    ~ # chmod -x test
    ~ # ls -l test
    -rw-r--r-- 1 root root 7401 2007-07-05 21:14 test

    ~ # chmod +x test
    ~ # ls -l test
    -rwxr-xr-x 1 root root 7401 2007-07-05 21:14 test*

    See the difference? The 'x' stands for executable, root, other users.
    First check with
    ls -l /usr/sbin/helloworld
    if the executable flags are set.


    If a program is already in /usr/sbin and if it is a read only filesystem then you cannot
    change the flags more, it must be done _before_ you upload your system, or:
    cp /usr/sbin /tmp/
    chmod +x /tmp/helloworld
    # test
    /tmp/helloworld

    Do you execute from a shell script?
    The shell script should start with:

    #!/bin/sh
    /usr/sbin/helloworld



  13. Re: Query in adding application in Linux

    On Jul 8, 8:47 pm, Jan Panteltje wrote:
    > On a sunny day (Sun, 08 Jul 2007 07:34:36 -0700) it happened
    > svnat...@gmail.com wrote in
    > <1183905276.249105.86...@g37g2000prf.googlegroups.c om>:
    >
    > >Hi,
    > > I added application to root file system and my
    > >application(helloworld) exists in target board at /usr/sbin.
    > > But i couldn't execute it.

    >
    > > I tried chmod +x helloworld.

    >
    > As root (you likely are on your embedded system):
    > ~ # chmod -x test
    > ~ # ls -l test
    > -rw-r--r-- 1 root root 7401 2007-07-05 21:14 test
    >
    > ~ # chmod +x test
    > ~ # ls -l test
    > -rwxr-xr-x 1 root root 7401 2007-07-05 21:14 test*
    >
    > See the difference? The 'x' stands for executable, root, other users.
    > First check with
    > ls -l /usr/sbin/helloworld
    > if the executable flags are set.
    >
    > If a program is already in /usr/sbin and if it is a read only filesystem then you cannot
    > change the flags more, it must be done _before_ you upload your system, or:
    > cp /usr/sbin /tmp/
    > chmod +x /tmp/helloworld
    > # test
    > /tmp/helloworld
    >
    > Do you execute from a shell script?
    > The shell script should start with:
    >
    > #!/bin/sh
    > /usr/sbin/helloworld


    Hi Janpanteltje,
    I have a doubt whether i have to create any shell script file for
    running from shell
    prompt.

    Whether i have to do anything from make file.

    When i give ls -l hellotest in command prompt of target board it
    says.
    rw-r--r--
    Its read only file.
    And Permission denied.

    My Make file looks like this.

    USE_UCLIBC=1

    INSTDIR = $(prefix)/bin
    INSTMODE = 0755

    PROGS = hellotest

    SRCS = hellotest.c

    OBJS = hellotest.o

    CFLAGS += -Wall

    all: $(PROGS)

    $(PROGS): $(OBJS)
    $(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@

    install: $(PROGS)
    $(INSTALL) -d $(INSTDIR)
    $(INSTALL) -m $(INSTMODE) $(PROGS) $(INSTDIR)

    clean:
    rm -rf $(PROGS) *.o core


    My hellotest.c file is
    #include
    main()
    {
    printf("Flower World\n");
    }

    I just gave make all
    It builds hellotest executable file
    And i installed in rootfile system location
    /rootfs/usr/sbin.

    Where i have to give the command for executing from shell prompt of
    target device.
    #!/bin/sh.

    Suggest me.

    Regards
    Kirthika






  14. Re: Query in adding application in Linux

    kracks wrote:
    > On Jul 8, 8:47 pm, Jan Panteltje wrote:
    > > On a sunny day (Sun, 08 Jul 2007 07:34:36 -0700) it happened
    > > svnat...@gmail.com wrote in
    > > <1183905276.249105.86...@g37g2000prf.googlegroups.c om>:
    > >
    > > >Hi,
    > > > I added application to root file system and my
    > > >application(helloworld) exists in target board at /usr/sbin.
    > > > But i couldn't execute it.

    > >
    > > > I tried chmod +x helloworld.

    > >
    > > As root (you likely are on your embedded system):
    > > ~ # chmod -x test
    > > ~ # ls -l test
    > > -rw-r--r-- 1 root root 7401 2007-07-05 21:14 test
    > >
    > > ~ # chmod +x test
    > > ~ # ls -l test
    > > -rwxr-xr-x 1 root root 7401 2007-07-05 21:14 test*
    > >
    > > See the difference? The 'x' stands for executable, root, other users.
    > > First check with
    > > ls -l /usr/sbin/helloworld
    > > if the executable flags are set.
    > >
    > > If a program is already in /usr/sbin and if it is a read only filesystem then you cannot
    > > change the flags more, it must be done _before_ you upload your system, or:
    > > cp /usr/sbin /tmp/
    > > chmod +x /tmp/helloworld
    > > # test
    > > /tmp/helloworld
    > >
    > > Do you execute from a shell script?
    > > The shell script should start with:
    > >
    > > #!/bin/sh
    > > /usr/sbin/helloworld


    > Hi Janpanteltje,
    > I have a doubt whether i have to create any shell script file for
    > running from shell
    > prompt.


    > Whether i have to do anything from make file.


    > When i give ls -l hellotest in command prompt of target board it
    > says.
    > rw-r--r--
    > Its read only file.
    > And Permission denied.


    As Jan already told you then you can't run the program. If you're on
    the target system _and_ the file system isn't mounted read-only then
    you can change the permissions via the command

    chmod +x /usr/sbin/helloword

    But if the file system is mounted read-only the command can't do
    anything since changing the permission bits of the file requires
    that they also can be written to the file system. You should see
    easily if this is the case since then you will get an error
    message and, if you look at the permissions, they are unchanged.
    In that case you have to make sure that you set the permissions
    correctly _before_ you upload the contents of the file system to
    your target machine.

    > My Make file looks like this.


    > USE_UCLIBC=1


    What is that supposed to do?

    > INSTDIR = $(prefix)/bin
    > INSTMODE = 0755


    > PROGS = hellotest


    > SRCS = hellotest.c


    > OBJS = hellotest.o


    > CFLAGS += -Wall


    Better make that

    > CFLAGS += -W -Wall


    since '-Wall' doesn't cover all warnings despite what the name
    of the flag may seem to indicate, to get all you need also '-W'.

    > all: $(PROGS)


    > $(PROGS): $(OBJS)
    > $(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@


    I hope very much that 'CC' is set so that it points to the
    compiler for the target machine and not the normal compiler
    for the machine you're compiling on.

    > install: $(PROGS)
    > $(INSTALL) -d $(INSTDIR)
    > $(INSTALL) -m $(INSTMODE) $(PROGS) $(INSTDIR)


    > clean:
    > rm -rf $(PROGS) *.o core



    > My hellotest.c file is
    > #include
    > main()


    Better make that

    int main( void )

    since main() is always supposed to return an int (at least on
    hosted systems) and you aren't passing any arguments to main().

    > {
    > printf("Flower World\n");


    And here add

    return 0;

    > }


    > I just gave make all
    > It builds hellotest executable file
    > And i installed in rootfile system location
    > /rootfs/usr/sbin.


    That can't have happend via your Makefile since there you install
    in the directory '$(prefix)/bin', so whatever 'prefix' is set to
    the program can't end up in '/rootfs/usr/sbin' (of course unless
    /rootfs/usr/bin' is a symbolic link to '/rootfs/usr/sbin').

    > Where i have to give the command for executing from shell prompt of
    > target device.
    > #!/bin/sh.


    This question doesn't make sense. If you have a shell prompt (and
    the permissions for the program are set correctly) then you can
    simply type

    /usr/sbin/helloworld

    to run your program.

    Only if you don't want to start it from the shell prompt but, for
    example, want to run automatically while the system is coming up,
    then you could create a script like

    #!/bin/sh.
    test -x /usr/sbin/helloworld && /usr/sbin/helloworld

    to run the program if it exists and has the permissions set
    correctly. This script then would go to '/etc/init.d/' and
    you would have to organize that it's run at the correct
    moment during the boot procedure by creating a symbolic link
    to the script in the directory '/etc/init.d/rc*.d/' or
    '/etc/rc*.d/' (depending on which distrobution you're using
    and where the '*' has to be replaced by the run level the
    script is to be execured in.

    Regards, Jens
    --
    \ Jens Thoms Toerring ___ jt@toerring.de
    \__________________________ http://toerring.de

  15. Re: Query in adding application in Linux

    On a sunny day (Sun, 08 Jul 2007 22:44:57 -0700) it happened kracks
    wrote in
    <1183959897.713342.115210@x35g2000prf.googlegroups. com>:

    >Hi Janpanteltje,
    > I have a doubt whether i have to create any shell script file for
    >running from shell
    > prompt.


    You do not need to.


    > Whether i have to do anything from make file.
    >
    > When i give ls -l hellotest in command prompt of target board it
    >says.
    > rw-r--r--
    > Its read only file.
    > And Permission denied.


    Yes, it will not work that way.

    But as I pointed out you can still test it this way:
    cp hellotest /tmp
    chmod +x /tmp/hellotest
    /tmp/hellotest

    Please try it


    >My Make file looks like this.


    I see nothing wrong with the makefile, the INSTMODE is executable.
    Something seems to be changing the mode for hellotest AFTER the make file is executed!
    There must be some more scripts.


  16. Re: Query in adding application in Linux

    On Jul 9, 3:24 pm, Jan Panteltje wrote:
    > On a sunny day (Sun, 08 Jul 2007 22:44:57 -0700) it happened kracks
    > wrote in
    > <1183959897.713342.115...@x35g2000prf.googlegroups. com>:
    >
    > >Hi Janpanteltje,
    > > I have a doubt whether i have to create any shellscriptfilefor
    > >running from shell
    > > prompt.

    >
    > You do not need to.
    >
    > > Whether i have to do anything from makefile.

    >
    > > When i give ls -l hellotest in command prompt of target board it
    > >says.
    > > rw-r--r--
    > > Its read onlyfile.
    > > And Permission denied.

    >
    > Yes, it will not work that way.
    >
    > But as I pointed out you can still test it this way:
    > cp hellotest /tmp
    > chmod +x /tmp/hellotest
    > /tmp/hellotest
    >
    > Please try it
    >
    > >My Makefilelooks like this.

    >
    > I see nothing wrong with the makefile, the INSTMODE is executable.
    > Something seems to be changing the mode for hellotest AFTER the makefileis executed!
    > There must be some more scripts.


    Hi Janpanteltje,
    I got my application running from shell prompt.
    Thanks a lot for your support even though i asked very basic
    questions.

    I am just trying to make my application to run once my kernel us up.


    Regards,
    Kirthika.





  17. Re: Query in adding application in Linux

    On Jul 9, 3:24 pm, Jan Panteltje wrote:
    > On a sunny day (Sun, 08 Jul 2007 22:44:57 -0700) it happened kracks
    > wrote in
    > <1183959897.713342.115...@x35g2000prf.googlegroups. com>:
    >
    > >Hi Janpanteltje,
    > > I have a doubt whether i have to create any shellscriptfilefor
    > >running from shell
    > > prompt.

    >
    > You do not need to.
    >
    > > Whether i have to do anything from makefile.

    >
    > > When i give ls -l hellotest in command prompt of target board it
    > >says.
    > > rw-r--r--
    > > Its read onlyfile.
    > > And Permission denied.

    >
    > Yes, it will not work that way.
    >
    > But as I pointed out you can still test it this way:
    > cp hellotest /tmp
    > chmod +x /tmp/hellotest
    > /tmp/hellotest
    >
    > Please try it
    >
    > >My Makefilelooks like this.

    >
    > I see nothing wrong with the makefile, the INSTMODE is executable.
    > Something seems to be changing the mode for hellotest AFTER the makefileis executed!
    > There must be some more scripts.


    Hi Jens Thoms Toerring,

    I am not sure whether i have to compile my shell script.


    I created shell script like this.

    #!/bin/sh.
    test -x /usr/sbin/helloworld && /usr/sbin/helloworld

    How to make my script to go to '/etc/init.d/' .
    I don't have any rc. files in my file system. in /etc/


    Regards,
    Kirthika








  18. Re: Query in adding application in Linux

    kracks wrote:
    > I am not sure whether i have to compile my shell script.


    No, shell scripts don't get compiled, they get interpreted
    by the shell.

    > I created shell script like this.


    > #!/bin/sh.
    > test -x /usr/sbin/helloworld && /usr/sbin/helloworld


    > How to make my script to go to '/etc/init.d/' .
    > I don't have any rc. files in my file system. in /etc/


    If you have a /etc/init.d/ directory then you probably
    will have to copy your script there and create a symbolic
    link to it in one of the /etc/init.d/rc*.d subdirectories
    (where '*' is number standing for the run-level the script
    is to be executed for), with the symbolic link typically
    having a name line 'S++helloworld' (with '++' being a two-
    digit number that indicates the sequence the scripts
    linked by the symbolic links in the directory are to be
    executed). Alteratively, if you have a file like
    '/etc/init.d/boot.local' then you could simply put the
    command for starting your program in there. But the de-
    tails will depend a bit on which distro you're using,
    you better try to find the documentation about the
    boot process for it and read it carefully.

    Regards, Jens
    --
    \ Jens Thoms Toerring ___ jt@toerring.de
    \__________________________ http://toerring.de

  19. Re: Query in adding application in Linux

    On a sunny day (Wed, 11 Jul 2007 12:01:29 -0000) it happened kracks
    wrote in
    <1184155289.490597.63080@o11g2000prd.googlegroups.c om>:

    >> > When i give ls -l hellotest in command prompt of target board it
    >> >says.
    >> > rw-r--r--
    >> > Its read onlyfile.
    >> > And Permission denied.


    >> I see nothing wrong with the makefile, the INSTMODE is executable.
    >> Something seems to be changing the mode for hellotest AFTER the makefileis executed!
    >> There must be some more scripts.

    >


    >Hi Janpanteltje,
    > I got my application running from shell prompt.
    > Thanks a lot for your support even though i asked very basic
    >questions.
    >
    >I am just trying to make my application to run once my kernel us up.



    You will have to find somehow what is changing the mode to '-x' on your 'hellotest'.
    It must be something (script) that runs after the Makefile.
    Check anyways if waht Make does creates an executable, then check what install does to
    it, it should still be executable.


  20. Re: Query in adding application in Linux

    On Jul 11, 7:44 pm, Jan Panteltje wrote:
    > On a sunny day (Wed, 11 Jul 2007 12:01:29 -0000) it happened kracks
    > wrote in
    > <1184155289.490597.63...@o11g2000prd.googlegroups.c om>:
    >
    > >> > When i give ls -l hellotest in command prompt of target board it
    > >> >says.
    > >> > rw-r--r--
    > >> > Its read onlyfile.
    > >> > And Permission denied.
    > >> I see nothing wrong with the makefile, the INSTMODE is executable.
    > >> Something seems to be changing the mode for hellotest AFTER the makefileis executed!
    > >> There must be some more scripts.

    >
    > >Hi Janpanteltje,
    > > I got my application running from shell prompt.
    > > Thanks a lot for your support even though i asked very basic
    > >questions.

    >
    > >I am just trying to make my application to run once my kernel us up.

    >
    > You will have to find somehow what is changing the mode to '-x' on your 'hellotest'.
    > It must be something (script) that runs after the Makefile.
    > Check anyways if waht Make does creates an executable, then check what install does to
    > it, it should still be executable.


    Hi,
    Thanks to Janpantelyje and JensToms Toerring
    I added simple application to rootfilesystem and my application runs
    once kernel
    is up.

    My next thing is adding SQL server to my target device as an
    application.
    I have SQL server which i downloaded from net.
    But its for PC. And further the Make file there is for PC
    application.
    How can i load SQL server to my target board ie.for ARM processor.
    How can i compile it for ARM.
    Shall i get Make file for ARM processor.
    i have another doubt.
    How much MB will be compiled version of SQL server for ARM processor



    Shall i get compiled version of SQL server for ARM processor.
    Is there any website which give compiled version of SQL server for
    ARM processor.
    If i get i will move to Root file system.

    In some cases i add some application or libraries to root file system
    of target device it says "
    "Not enough space in RAMDISK"
    How can i increase the size of root file system?

    Suggest me in resolving this issue.


    Regards,
    Kirthika







+ Reply to Thread
Page 1 of 2 1 2 LastLast