<div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial"><DIV>
<P class="MsoNormal">Hello guys,</P>
<P class="MsoNormal"><o:p>I am a student. Now i have take part in a project which is based on x86 cpu. So i study BSP of PC386. Precently,i want to write a application program of serial port. Because,the BSP of PC386 is provide the serial port driver. So we can use the serial port driver directly.</o:p></P>
<P class="MsoNormal"><o:p>The soruce code of this drive programe include tty_drv.c\ termios.c\ uart.c... Before i write the application programe , i made a analysis about this driver. Let's look some code whic is come out of these files.</o:p></P>
<P class="MsoNormal"><o:p></o:p></P><SPAN style="COLOR: #0000ff">
<P class="MsoNormal"><o:p>rtems_device_driver<BR>tty_read(rtems_device_major_number major,<BR> rtems_device_minor_number minor,<BR> void *arg)<BR>{<BR> return rtems_termios_read (arg);<BR>} /* tty_read */</o:p></P>
<P class="MsoNormal"><o:p>rtems_status_code<BR>rtems_termios_read (void *arg)<BR>{<BR> rtems_libio_rw_args_t *args = arg;<BR> struct rtems_termios_tty *tty = args->iop->data1;<BR> uint32_t count = args->count;<BR> char *buffer = args->buffer;<BR> rtems_status_code sc;</o:p><o:p> </o:p></P>
<P class="MsoNormal"><o:p>...</o:p><o:p>}</o:p></P></SPAN>
<P class="MsoNormal"><o:p><SPAN style="COLOR: #0000ff"></SPAN>we can find a important arguements <SPAN style="FONT-SIZE: 32px; COLOR: #ff0000">*arg </SPAN>, <SPAN style="COLOR: #ff0000">it's a pointer point to a struct .This struct have three member</SPAN> ,they are </o:p></P>
<P class="MsoNormal"><o:p>args->iop->data1 \ args->count \ args->buffer </o:p></P>
<P class="MsoNormal"><o:p><SPAN style="FONT-SIZE: 24px"></SPAN><SPAN style="FONT-SIZE: 24px"><SPAN style="COLOR: #ff0000"></SPAN><SPAN style="COLOR: #000000">who know their funcations??? I believe in application programe ,we have to provide these arguements!</SPAN></SPAN></o:p></P>
<P class="MsoNormal"><o:p><SPAN style="FONT-SIZE: 24px; COLOR: #000000"></SPAN><SPAN style="FONT-SIZE: 24px"></SPAN><SPAN style="COLOR: #00ff00"><SPAN style="FONT-SIZE: 24px"></SPAN></SPAN><SPAN style="COLOR: #ff0000"><SPAN style="FONT-SIZE: 24px">Can you provide a test programe of serial port with this drive in bsp of pc386.? </SPAN></SPAN></o:p></P>
<P class="MsoNormal"><o:p style="FONT-SIZE: 24px; COLOR: #ff0000"></o:p><o:p><SPAN style="FONT-SIZE: 24px; COLOR: #ff0000"></SPAN>Thanks so much!<o:p></o:p></o:p></P>
<P class="MsoNormal">Best wish!</P>
<P class="MsoNormal">zhoupeng</P></DIV></div><br><br><span title="neteasefooter"><span id="netease_mail_footer"></span></span>