<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix"><br>
      I've solved my problem using code changes<br>
      <br>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:47;">diff --git
        a/c/src/lib/libbsp/i386/shared/comm/uart.c
        b/c/src/lib/libbsp/i386/shared/comm/uart.c</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:48;">index 3c4d42a..3552fe6 100644</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:49;">---
        a/c/src/lib/libbsp/i386/shared/comm/uart.c</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:50;">+++
        b/c/src/lib/libbsp/i386/shared/comm/uart.c</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:51;">@@ -568,12 +568,13 @@
        BSP_uart_termios_read_com2(int uart)</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:52;"> ssize_t</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:53;"> BSP_uart_termios_write_com1(int minor,
        const char *buf, size_t len)</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:54;"> {</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:55;">+ if(len <= 0)</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:56;">+ {</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:57;">+ return 0;</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:58;">+ }</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:59;"> assert(buf != NULL);</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:60;"> </p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:61;">- if(len <= 0)</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:62;">- {</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:63;">- return 0;</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:64;">- }</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:65;">+</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:66;"> </p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:67;"> /* If there TX buffer is busy - something
        is royally screwed up */</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:68;"> assert((uread(BSP_UART_COM1, LSR) &
        THRE) != 0);</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:69;">@@ -602,13 +603,13 @@
        BSP_uart_termios_write_com1(int minor, const char *buf, size_t
        len)</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:70;"> ssize_t</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:71;"> BSP_uart_termios_write_com2(int minor,
        const char *buf, size_t len)</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:72;"> {</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:73;">- assert(buf != NULL);</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:74;">+</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:75;"> </p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:76;"> if(len <= 0)</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:77;"> {</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:78;"> return 0;</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:79;"> }</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:80;">-</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:81;">+ assert(buf != NULL);</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:82;"> /* If there TX buffer is busy - something
        is royally screwed up */</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:83;"> assert((uread(BSP_UART_COM2, LSR) &
        THRE) != 0);</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
        margin-right:0px; -qt-block-indent:0; text-indent:0px;
        -qt-user-state:84;"> </p>
      <br>
      <br>
      <br>
      Is it alright? <br>
      <br>
      <br>
      On 28.09.2014 19:19, Wendell Silva wrote:<br>
    </div>
    <blockquote
cite="mid:CAF69O75M+Jg72Vdxo7s4MUG-9q4H3W58k0zmWs35viKSBfQJNA@mail.gmail.com"
      type="cite">
      <div dir="ltr">Have you tried:
        <div>  qemu-system-i386 -serial <a class="moz-txt-link-freetext" href="file:/tmp/1.txt">file:/tmp/1.txt</a> -serial
          <a class="moz-txt-link-freetext" href="file:/tmp/2.txt">file:/tmp/2.txt</a> -kernel ...</div>
        <div><br>
        </div>
        <div>Or open ttyS1 instead?</div>
        <div><br>
        </div>
        <div>--Wendell.</div>
        <div><br>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">2014-09-28 4:52 GMT-03:00 Олег Мороз <span
            dir="ltr"><<a moz-do-not-send="true"
              href="mailto:oleg.moroz@mcc.vniiem.ru" target="_blank">oleg.moroz@mcc.vniiem.ru</a>></span>:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello
            everyone, i'm trying to develop RTEMS app using QEMU VM. How
            can i use virtual serial device for two side data exchange
            between VM and host machine. I'm trying to use it in that
            way:<br>
            <br>
            <br>
            <br>
            #include <bsp.h> /* for device driver prototypes */<br>
            <br>
            #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 20<br>
            #define CONFIGURE_APPLICATION_EXTRA_DRIVERS 
            TTY2_DRIVER_TABLE_ENTRY<br>
            #define CONFIGURE_APPLICATION_NEEDS_LIBBLOCK<br>
            #define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM<br>
            #define CONFIGURE_NUMBER_OF_TERMIOS_PORTS 6<br>
            <br>
            #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER<br>
            #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER<br>
            .....<br>
            <br>
            <br>
            then in my app i'm trying to open /dev/ttyS2 device<br>
            <br>
              unsigned char data[4] = {1,2,3,4};<br>
              int f =open("/dev/ttyS2", O_RDWR | O_NOCTTY | _FNDELAY);<br>
              if (f>0)<br>
              {<br>
                  printf("write data %d\n",write(f,data,4));<br>
              }<br>
            <br>
            then start QEMU<br>
            qemu-system-i386 -serial <a class="moz-txt-link-freetext" href="file:/tmp/1.txt">file:/tmp/1.txt</a> -kernel
            zvezda_shell.exe<br>
            <br>
            <br>
            In QEMU shell i've seen<br>
            Device: /dev/ttyS2 initialized.<br>
            write data 4<br>
            <br>
            But in fact file /tmp/1.txt has no data. How can i solve it
            and use QEMU -serial for both side data exchange?<br>
            _______________________________________________<br>
            devel mailing list<br>
            <a moz-do-not-send="true" href="mailto:devel@rtems.org"
              target="_blank">devel@rtems.org</a><br>
            <a moz-do-not-send="true"
              href="http://lists.rtems.org/mailman/listinfo/devel"
              target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
  </body>
</html>