trouble with application programe of serial port (use bsp of pc386)

zhoupeng zpeng563 at 126.com
Thu Feb 16 13:29:17 UTC 2012


Hello guys,

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.

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.

rtems_device_driver
tty_read(rtems_device_major_number major,
             rtems_device_minor_number minor,
             void                      *arg)
{
  return rtems_termios_read (arg);
} /* tty_read */

rtems_status_code
rtems_termios_read (void *arg)
{
 rtems_libio_rw_args_t *args = arg;
 struct rtems_termios_tty *tty = args->iop->data1;
 uint32_t   count = args->count;
 char      *buffer = args->buffer;
 rtems_status_code sc; 

...}

we can find a important arguements *arg , it's a pointer point to a struct .This struct have three member ,they are

args->iop->data1 \ args->count \ args->buffer

who know their funcations??? I believe in application programe ,we have to provide these arguements!

Can you provide a test programe of serial port with this drive in bsp of pc386.?

Thanks so much!

Best wish!

zhoupeng
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20120216/608d0765/attachment.html>


More information about the users mailing list