bug-hurd
[Top][All Lists]
Advanced

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

Re: term & user space console


From: Thomas Bushnell, BSG
Subject: Re: term & user space console
Date: 18 Dec 2001 13:36:47 -0800
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

Marcus Brinkmann <Marcus.Brinkmann@ruhr-uni-bochum.de> writes:

> For reference, here is the structure that defines the bottom half.
> For example, there is suspend_physical_output() which supposedly implements
> STOP, and start_output(), which resumes it (but does other things as well).

First, the canonical implementation is devio.c.

> /* Functions a bottom half defines */
> struct bottomhalf
> {
>   void (*start_output) (void);

Output works by queueing characters on the output queue and then
calling start_output.  The assumption is that the bottom half will
send out characters on its own from that point, until the output queue
is empty.  Similarly, if output has been suspended, then when it gets
resumed, start_output will be called.  Note that this function is
responsible for checking USER_OUTPUT_SUSP.

>   void (*set_break) (void);

Stop carrier on the line.

>   void (*clear_break) (void);

Reassert carrier on the line.

>   void (*abandon_physical_output) (void);

This is called when output queues are being flushed.  But there may be
pending output which is sitting in a device buffer or other place
lower down than the terminal's output queue; so this is called to
flush whatever other such things may be going on.

>   void (*suspend_physical_output) (void);

Similarly here, when output is being suspended, there may be pending
output sitting lower down; this call should do its best to try and
suspend its further sending.

This is a pattern: some things the terminal program itself can handle,
other things must be passed "lower down".  Both flushing and
suspension work that way; flushing flushes the output queue and calls
abandon_physical_output; suspension sets USER_OUTPUT_SUSP and calls
suspend_physical_output.  [It is the lower half's responsibility to
implement USER_OUTPUT_SUSP.]

>   int (*pending_output_size) (void);

Again, this should try and figure out how many characters are lower
down (besides the output queue) and report back.  Mach has no
interface to fetch this information, so devio can't do much.

>   void (*notice_input_flushed) (void);

This is called to notify the bottom half when an input flush has
occurred.  It is necessary to support pty packet mode.

>   error_t (*assert_dtr) (void);

Turn on DTR.

>   void (*desert_dtr) (void);

Turn off DTR.

>   void (*set_bits) (void);

Set physical state (byte size, parity, speed).

>   void (*mdmctl) (int, int);

Set modem control bits.

>   int (*mdmstate) (void);

Fetch modem control bits.





reply via email to

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