Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12746 Discussions

using prebuilt binaries in applications

Altera_Forum
Honored Contributor II
1,277 Views

http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/unsure.gif  

I doownloaded the linux kernel and filesystem into my altera stratix board. 

There i was able to create a e2fs filesystem in the compact flash using commands through the serial port. 

What i wanted to know is if i want to call these prebuitl binary functions like  

"fdisk", "mke2fs",etc 

from my application directly(i.e.as function calls) how do i do it? 

Is it possible.
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
549 Views

You might like to look into the "system" function, and "exec" and friends. However, if you find that your application mostly just runs other programs you could probably replace it with a shell script (or maybe even perl script: does perl run on these systems yet?). Excerpt from the system manpage: 

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

synopsis 

    # include <stdlib.h> 

 

    int system(const char *string); 

 

description 

    system()  executes  a command specified in string by calling /bin/sh -c string, and returns after the command has been completed.  During execution 

    of the command, SIGCHLD will be blocked, and SIGINT and SIGQUIT will be ignored.[/b] 

--- Quote End ---  

 

 

HTH.
0 Kudos
Reply