[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Another gensh2 questions



Radzislaw Galler wrote:
> 
> Ralf Corsepius wrote:
> >
> > Radzislaw Galler wrote:
> > >

> > > It is hardcoded somewhere. I have just simply exchanged the order of
> > > driver entries in bsp.h
> > > back to the official:
> > >
> > > #define CONSOLE_DRIVER_TABLE_ENTRY \
> > >   BSP_CONSOLE_DRIVER_TABLE_ENTRY,\
> > >   { console_initialize, console_open, console_close, \
> > >       console_read, console_write, console_control }\
> > >
> > > And  now read/write to /dev/console calls  procedures defined by
> > > BSP_CONSOLE_DRIVER_ENTRY. console_open, console_read etc. are never
> > > called.
> > They are called, if you use sh/shared/console.c. You must not call
> > your console functions/entry points console_* for this to remain
> > functional. Also the console_* functions must be inserted after the
> > BSP_CONSOLE_DRIVER_TABLE_ENTRY.
> 
> Another missunderstanding. I meant: scanf/printf never call it - not me.
They should.

> When I debugged scanf/printf call it never hit console_read/write.
> Instead it called sh_sci_read/write. 
Depends on your driver's setup.

> I still don't understand why
> console_* functions should be inserted after
> BSP_CONSOLE_DRIVER_TABLE_ENTRY. 
Another try: sh/shared/console.c contains code to redirect calls to
console_[initialize|read|..] to another device.

When starting RTEMS, it's device setup sequentially works off the
driver table (calls each device's initizalize function) and
registers each device it finds in the device driver table array. 
console_initialize looks up the other device by name (e.g.
"/dev/null"). This name only is available, when the other device has
been registered before.

> > Something like
> > #define BSP_MY_DRIVER_TABLE_ENTRY \
> > { my_init, my_open, ... }
> >
> > and
> > #define BSP_CONSOLE_DRIVER_TABLE_ENTRY \
> > BSP_MY_DRIVER_TABLE_ENTRY
> >
> > should do.
> >
> > (cf. how to switch between sci and devnull in bsp.h)
> 
> Which is almost exactly what I did - I put the console driver (with
> standard names) in the begining of driver table.
I forgot to mention BSP_CONSOLE_DEVNAME, may-be you need to modify
this, too.

> Maybe it wasn't obvious that I also modified other console_* procedures
> to work my way (i.e. use termios).
Wrt. this, termios should be just a wrapper around the actual
driver's code.

Ralf
-- 
Ralf Corsepius 
Forschungsinstitut fuer Anwendungsorientierte Wissensverarbeitung
(FAW)
Helmholtzstr. 16, 89081 Ulm, Germany     Tel: +49/731/501-8690
mailto:corsepiu at faw.uni-ulm.de           FAX: +49/731/501-999  
http://www.faw.uni-ulm.de