tech-kern archive

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

Re: Cnmagic support for wscons



On Tue, Jan 17, 2017 at 04:26:48 +1100, Nathanial Sloss wrote:

> On Mon, 16 Jan 2017 00:44:02 Valery Ushakov wrote:
> > On Sun, Jan 15, 2017 at 13:30:15 +0100, Martin Husemann wrote:
> > > On Sun, Jan 15, 2017 at 01:59:06PM +1100, Nathanial Sloss wrote:
> > > > Mapping KS_Cmd_Debugger would also work but I'm unsure as to how
> > > > to do this without using wskbd key sequences in the magic.
> > > 
> > > I don't understand - if you just assing KS_Cmd_Debugger somewhere,
> > > why would you need cnmagic?
> > 
> > Exactly.  You need cnmagic(9) for detecting debugger _sequence_
> > in-band like in serial console.
> > 
> > Your patch doesn't provide any documentation or an accompaning
> > description, so I'm not sure what exactly it does, e.g. what should
> > cnmagic value look like for wskbd? 
> 
> I've put an example in the updated man page for both a wskbd command
> and regular text.

| +sysctl variable must be prefixed by \\001 for normal characters and/or
| +control codes.
| +Alternatively it can be prefixed by \\002 for wskbd commands.
[...]
| +The default cnmagic is \\002\\040\\0364 which on most platforms is
| +<Ctrl>-<Alt>-<Esc>
| +the wskbd command for
| +.Xr ddb 4 .

- How does \040\0364 (0x20 0xf4) correspond to <Ctrl><Alt><Esc>?

- Does the fact that KS_Cmd_Debugger is defined as 0xf420 have
  anything to do with it?

- If so, why the byte order is little endian?

- KS_Cmd_Debugger becomes a meaningless placeholder - you will have it
  mapped by default but you can set cnmagic to something else

> > But in general it's not even
> > entirely clear to me what a semantic of cnmagic(9) for wskbd could be.
> > Should it use individual key-presseses as the basic input stream it
> > parses?  If yes, you will lose the ability to use, e.g., *both*
> > C-A-Esc and A-C-Esc _chords_ to break into debuger, because with
> > wskbd(4) keyboard mapping they are the same _chords_, but with
> > cnmagic(9) they are different _sequences_.
> 
> That's why I have two different prefixes one for wskbd commands and
> another for regular text.

- What if one wants to use a mixture of them?

- What happens if you specify in cnmaigc the sequence of individual
  keys that map (at wskbd level) to a KS_Cmd_*?


> > I'd also say that the very fact that the patch doesn't use
> > cn_check_magic(9) indicates in some sense that it probably does not
> > implement "cnmagic support for wscons". :)
> 
> Please see:
> 
> ftp://ftp.netbsd.org/pub/NetBSD/misc/nat/cnmagic.v2.diff
> 
> It now uses cn_check magic instead of the custom ws_check_magic which was 
> based on cn_check_magic.

I still intensly dislike the very idea behind this patch.  I don't
think it's meaningful or useful to bolt cnmagic onto wskbd.  Yes, I
can theoretically imagine the possibility that someone somewhere might
need a wskbd sequence to break into the debugger that for some reason
cannot be expressed with just mapping KS_Cmd_Debugger.  I'd estimate
the probablity of that be to just slighly more than that someone
somewhere will find it useful to be able to express morse code support
in wskbd mappings :).

You PR states the motivation as:

| wscons does not support cn_magic - setting hw.cnmagic has no effect.

So just drop hw.cnmagic sysctl node if the console doesn't support it.

-uwe


Home | Main Index | Thread Index | Old Index