Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20704 Discussions

port a file to ecos

Altera_Forum
Honored Contributor II
1,413 Views

hi guys, 

 

 

 

 

 

 

I'am working with real time operating system Ecos .I need to port a file to this Rtos and run Ecos.  

 

 

 

 

 

 

 

 

so how can i add this file (from ubuntu ) to Rtos Ecos. ? 

 

 

Waiting for your guidance. 

thank you . 

 

 

 

 

 

 

-1down votefavorite (http://stackoverflow.com/questions/43215243/porting-exisiting-file-to-ecos?noredirect=1#

 

 

I am working with real time operating system Ecos 

 

 

 

 

0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
299 Views

You can have a look at the ecos manual (http://www.ecoscentric.com/ecospro/doc/html/user-guide/index.html) and especially chapter 2, "programming with eCos". It shows how to compile sample applications, and from there you can compile your own.

0 Kudos
Altera_Forum
Honored Contributor II
299 Views

I work on the ecos operating system, I want to run it on the virtual machine qemu (pc_rltk8139: architecture x86), I downloaded and installed then I started with a small code c "Hello word", which Has worked well. 

 

Then, I develop a code c on the synthetic Linux target (Ubuntu). All the code that I created in c works well on ubuntu, i tried to do the same work on my qemu machine and transferred it to ecos wich it did not work. My code includes a copy program that requires loading data from two text files. An input file(entree.txt) contains data that will be copied to the other output file(sortie.txt). My problem is that I do not know how to integrate my files into an appropriate file system image and how to integrate it into the eCos image. 

 

Code c: 

# include <stdio.h> 

# include <stdlib.h> 

# define ENTREE "/home/amine/ecos/eCos-on-QEMU/entree.txt" 

# define SORTIE "/home/amine/ecos/eCos-on-QEMU/sortie.txt" 

 

int main(void) 

FILE *f_in, *f_out; 

int c; 

 

if ((f_in = fopen(ENTREE,"r")) == NULL) 

fprintf(stderr, "\nErreur: Impossible de lire le fichier 111 %s\n",ENTREE); 

return(EXIT_FAILURE); 

if ((f_out = fopen(SORTIE,"w")) == NULL) 

fprintf(stderr, "\nErreur: Impossible d'ecrire dans le fichier 222 %s\n",  

SORTIE); 

return(EXIT_FAILURE); 

while ((c = fgetc(f_in)) != EOF) 

fputc(c, f_out); 

printf("copie correcte\n"); 

fclose(f_in); 

fclose(f_out); 

return(EXIT_SUCCESS); 

 

output message : 

Erreur: Impossible de lire le fichier 111 /home/amine/ecos/eCos-on-QEMU/entree.txt 

 

issue : 

how to port files to ecos 

 

waiting for your guidance. 

thank you
0 Kudos
Altera_Forum
Honored Contributor II
299 Views

This forum is about Altera components, and you can find a few people that can help with the Nios 2 port of eCos, but I'm afraid I don't have any experience with the i386 version. You'll probably have to look for an eCos generic forum instead of this one.

0 Kudos
Reply