bug-hurd
[Top][All Lists]
Advanced

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

Re: term & user space console


From: Roland McGrath
Subject: Re: term & user space console
Date: Sat, 2 Feb 2002 19:42:23 -0500 (EST)

> Well, ok, I did that (of course, tioctl_tiocgeta takes the arguments a bit
> differently, but that's easy), although I don't know why you set raw mode
> explicitely.

Because you don't want the underlying tty to do ICANON processing and so forth.

> Just two issues: What about CSTOP and/or CSIZE, do I handle it the way it
> is done for Mach devices?

I don't understand the question.  These are serial hardware settings that
should be passed down directly just like the speed.

> And do I update the termstate to match reality, eg do I go back and do a
> tiocgeta and (re)set the speeds?

Yes, I think you should do that.  Particular hardware or particular drivers
will support a certain subset of possible speeds, and it's reasonable for
them to either round your request to the closest one they support or ignore
a change they can't support.  Then you want to report back to the user what
the underyling device is really doing.

> I am prety ignorant to the details of all those control bits, if it is not
> easy to give a definite answer to this I will just leave it out for now as
> they are not required by anything I want to do with the code anyway.

You don't really need to think about the specific meanings of the bits.
Generally speaking, the bits that translate into something passed directly
to the device in devio should be passed down directly to an underyling
tioctl-supporting io port.

> The last piece of unconsidered code is this snipped from devio that is
> run after the device is opened.  Do we have to do anything like that, too?
> 
>       device_get_status (phys_device, TTY_STATUS,
>                          (dev_status_t)&ttystat, &count);
>       ttystat.tt_breakc = 0;
>       ttystat.tt_flags = TF_ANYP | TF_LITOUT | TF_NOHANG | TF_HUPCLS;
>       device_set_status (phys_device, TTY_STATUS,
>                          (dev_status_t)&ttystat, TTY_STATUS_COUNT);

This is directly equivalent to the tioctl calls you cited earlier in your
message.  That set of TF_* bits is basically the same semantically as what
cfmakeraw does for the termios bits.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]