Multiple rtems_io_register_name
Cedric Aubert
cedric_aubert at yahoo.fr
Thu Oct 23 07:56:00 UTC 2003
Thanks a lot for your answer and this will be very
usefull for me. :-)
Another related question, is it mandatory to the
symlink to be in the /dev directory ?
Example :
symlink ("/dev/porta", "/term0")
Thanks a lot
Cedric
--- Chris Johns <cjohns at cybertec.com.au> wrote:
> Cedric Aubert wrote:
> >
> > I want to known if it's possible and a correct
> usage
> > to do multiple rtems_io_register_name for have
> more
> > device with same major minor couple for serial
> port.
> >
> > Example, to have /dev/console and /dev/ttyS0 and
> > to the same physical serial port. If it's exist a
> more
> > beuatiful manner to do a link like this, thank to
> tell
> > me.
> >
>
> For our boards we create devices with names such as
> /dev/porta
> /dev/portb, etc that relate to the connector
> documentation and then link
> them with a 'symlink' to a logical device name, ie
> /dev/ttyS0, ie:
>
> /dev/ttyS0 -> /dev/porta
>
> The code is:
>
> status = rtems_io_register_name ("/dev/porta", 4,
> 0);
> if (status != RTEMS_SUCCESSFUL)
> rtems_fatal_error_occurred (status);
>
> status = rtems_io_register_name ("/dev/portb", 4,
> 1);
> if (status != RTEMS_SUCCESSFUL)
> rtems_fatal_error_occurred (status);
>
> if (symlink ("/dev/porta", "/dev/ttyS0") < 0)
> printf (" sfp-core target init: cannot make
> symlink to porta, %s",
> strerror (errno));
>
> if (symlink ("/dev/portb", "/dev/ttyS1") < 0)
> printf (" sfp-core target init: cannot make
> symlink to portb, %s",
> strerror (errno));
>
> --
> Chris Johns, cjohns at cybertec.com.au
>
=====
AUBERT Cedric
SDEL Controle Commande
rue Nungesser & Coli
44860 St Aignan de Grand Lieu
E-mail : cedric_aubert at yahoo.fr
Http : http://www.controle-commande.sdel.fr/
__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com
More information about the users
mailing list