Forum Discussion

3 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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.