Hi Wendell, <br><br>thanks for your reply.<br><br><div class="gmail_quote">On Tue, Nov 23, 2010 at 11:04 AM, Wendell Pereira da Silva <span dir="ltr"><<a href="mailto:wendell.silva@compsisnet.com.br">wendell.silva@compsisnet.com.br</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div link="blue" vlink="purple" lang="PT-BR">
<div>
<p class="MsoNormal"><font color="navy" size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy;">Hi Jeferson,</span></font></p>
<p class="MsoNormal"><font color="navy" size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<p class="MsoNormal"><font color="navy" size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy;" lang="EN-US">Note that “/dev/ttyS0”
in the QEMU is not the same path registered by the pc586 (pc386 variant) BSP.</span></font></p>
<p class="MsoNormal"><font color="navy" size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy;" lang="EN-US">Do you have tried “/dev/ttyS1”?</span></font></p></div></div></blockquote><div><br>
Yes, I tried with "/dev/ttyS1" and the same problem happens. I also tested the serial port in the host and it is ok. <br><br>Any idea? <br><br>Rest regards,<br>Jeferson.<br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div link="blue" vlink="purple" lang="PT-BR"><div>
<p class="MsoNormal"><font color="navy" size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy;" lang="EN-US"> </span></font></p>
<p class="MsoNormal"><font color="navy" size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy;" lang="EN-US">Best regards,</span></font></p>
<p class="MsoNormal"><font color="navy" size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy;" lang="EN-US"> </span></font></p>
<p class="MsoNormal"><font color="navy" size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy;" lang="EN-US">Wendell.</span></font></p>
<p class="MsoNormal"><font color="navy" size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial; color: navy;" lang="EN-US"> </span></font></p>
<div>
<div class="MsoNormal" style="text-align: center;" align="center"><font size="3" face="Times New Roman"><span style="font-size: 12pt;">
<hr align="center" size="2" width="100%">
</span></font></div>
<p class="MsoNormal"><b><font size="2" face="Tahoma"><span style="font-size: 10pt; font-family: Tahoma; font-weight: bold;">De:</span></font></b><font size="2" face="Tahoma"><span style="font-size: 10pt; font-family: Tahoma;">
<a href="mailto:rtems-users-bounces@rtems.org" target="_blank">rtems-users-bounces@rtems.org</a> [mailto:<a href="mailto:rtems-users-bounces@rtems.org" target="_blank">rtems-users-bounces@rtems.org</a>] <b><span style="font-weight: bold;">Em nome de </span></b>Jeferson Luiz Rodrigues Souza<br>
<b><span style="font-weight: bold;">Enviada em:</span></b> terça-feira, 23 de
novembro de 2010 06:50<br>
<b><span style="font-weight: bold;">Para:</span></b> <a href="mailto:rtems-users@rtems.org" target="_blank">rtems-users@rtems.org</a><br>
<b><span style="font-weight: bold;">Assunto:</span></b> Serial device access with
qemu!</span></font></p>
</div><div><div></div><div class="h5">
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size: 12pt;"> </span></font></p>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size: 12pt;">Hi everyone,<br>
<br>
I am trying to access a serial port in RTEMS 4.9.4 using a pc586 bsp. However,
when I execute the application using qemu the code cannot open the device, and
the perror() function presents the following message: "No such file or directory".
It seems that RTEMS did not initialize a properly driver to handle serial
device. Is it right?<br>
<br>
The qemu command line is:<br>
<br>
sudo qemu -serial "/dev/ttyS0" -fda floppy.img -boot a<br>
<br>
I made a search in this list and I found references about serial port access
but nothing to help in my case. Could anyone help me or point me some
documentation about serial port access in RTEMS?<br>
<br>
The code used in the test is presented below. I do not have some experience
with RTEMS and I do not know the source of this problem.<br>
<br>
Thanks,<br>
jefecomp.<br>
<br>
<br>
</span></font><font size="2"><span style="font-size: 10pt;">#include
<signal.h><br>
#include <stdlib.h><br>
#include <stdio.h><br>
#include <pthread.h><br>
#include <uart.h><br>
#include <termios.h><br>
#include<sched.h><br>
#include <bsp.h><br>
#include <fcntl.h><br>
#include <sys/types.h><br>
#include <sys/stat.h><br>
<br>
#define CONFIGURE_INIT<br>
#include <rtems.h><br>
<br>
<br>
void *POSIX_Init();</span></font><br>
<br>
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER<br>
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER<br>
#define CONFIGURE_APPLICATIONS_NEEDS_RTC_DRIVER<br>
#define CONFIGURE_MICROSECONDS_PER_TICK 1000<br>
<br>
#define CONFIGURE_MAXIMUM_POSIX_THREADS 10<br>
#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10<br>
#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 10<br>
#define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES 10<br>
#define CONFIGURE_MAXIMUM_POSIX_TIMERS 10<br>
#define CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS 40<br>
#define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES 10<br>
#define CONFIGURE_POSIX_INIT_THREAD_TABLE<br>
#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 5<br>
#define CONFIGURE_NUMBER_OF_TERMIOS_PORTS 3<br>
#include<rtems/confdefs.h><br>
<br>
void *POSIX_Init()<br>
{<br>
printf("Serial Port Test!!!\n");<br>
<br>
char buffer[255];<br>
int bytesRead;<br>
int serial_fp = open("/dev/ttyS0",O_RDONLY);<br>
<br>
printf("SERIAL_FP = %i\n",serial_fp);<br>
<br>
if(serial_fp < 0)<br>
{<br>
printf("FAILURE TO OPEN SERIAL
PORT\n");<br>
perror(serial_fp);<br>
exit(-1);<br>
}<br>
<br>
//write(serial_fp,buffer,strlen(buffer)+1);<br>
bytesRead = read(serial_fp, buffer, 255);<br>
<br>
<br>
if(bytesRead < 0)<br>
{<br>
printf("Problems in the read of
Serial Port");<br>
close(serial_fp);<br>
exit(1);<br>
}<br>
else<br>
buffer[bytesRead] = 0;<br>
<br>
<br>
printf(buffer);<br>
<br>
close(serial_fp);<br>
exit(0);<br>
}</p>
</div></div></div>
</div>
</blockquote></div><br>