Sio & Puc memory mapped
Bruce Evans
bde at zeta.org.au
Sun May 16 05:01:36 PDT 2004
On Sun, 16 May 2004, Roman Kurakin wrote:
> Marcel Moolenaar:
> [...]
>
> ><patch>
> >--- asytest.c~ Fri May 14 11:50:10 2004
> >+++ asytest.c Sat May 15 11:31:03 2004
> >@@ -152,6 +152,7 @@
> > }
> >
> > opt = chan[i].old_options;
> >+ cfmakeraw (&opt);
> > cfsetspeed (&opt, baud);
> > opt.c_cflag = CREAD | CS8;
> > opt.c_lflag &= ~ICANON;
> > ...
>
> >The first (the cfmakeraw() insertion) may be related to uart(4) not
> >setting proper defaults, but may also be related to uart(4) setting
> >different *valid* defaults. The second is a genuine test program bug
> >
> The only I can say that this test works fine with sio(4), cx(4),
> and under linux kernels before 2.6 with serial. So this requires
> additional investigation.
Programs certainly need to initialize all of the termios state that
they care about, but the uart driver uses poorly chosen defaults which
can't be changed at runtime and are particularly unsuitable for simple
test programs. The only fundamentally broken thing in the uart driver's
defaults is that they have echos enabled, so an echo war results if 2
ports driven by the uart driver are connected and one of them happens
to send a character before an ioctl can be done to set a useable state.
Bruce
More information about the freebsd-current
mailing list