From: Andy Greenhalgh <andy.greenhalgh@bazaar.uklinux.net>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] for 2.4.9 console driver: user defined terminal answerbacks
Date: Sun, 14 Oct 2001 11:39:33 +0100 [thread overview]
Message-ID: <3BC96B65.AA83D3C2@localhost.localdomain> (raw)
I've put together a simple patch for the console driver of the 2.4.9
kernel
(listed below). The same patch can also be applied to the 2.2.17 kernel
but
I guess that's becoming less relevant. The patch enables what I believe
to
be correct vt102 answerback behaviour i.e. an answerback string of up to
20
characters in response to ascii ENQ (0x05). Later DEC terminals would
respond to an answerback request of \E[c if I remember rightly, however
I
have tried to remain faithful to the philosophy of providing a vt102
emulation. In truth I did patch this as well, but took it out after
succumbing to a puritanical whim. The answerback is user defined by
setting
the top most string in the kernel function key string table:
func_table[255]. This kernel data structure can be accessed by the
existing
console_ioctl interface. In practice users can set the answerback by the
use
of loadkeys (string F246).
All errors are of course my own and confident though I am, I would
suggest
you initially proceed with caution as I can not accept liability for any
untoward consequences :-(. Also, please CC any responses as
unfortunately I
am not subscribed to this mail list due to the limitations of eking out
an
existence on a humble dial-up connection.
Best wishes
Andy
--- console.c_orig_ Sun Sep 2 13:53:20 2001
+++ console.c Sun Sep 2 14:26:17 2001
@@ -113,7 +113,7 @@
* (such as cursor movement) and should not be displayed as a
* glyph unless the disp_ctrl mode is explicitly enabled.
*/
-#define CTRL_ACTION 0x0d00ff81
+#define CTRL_ACTION 0x0d00ffa1
#define CTRL_ALWAYS 0x0800f501 /* Cannot be overridden by disp_ctrl */
/*
@@ -1148,6 +1148,23 @@
respond_string(VT102ID, tty);
}
+/* User defined answerback: string F246 in loadkeys
+ Truncated at 20 chars for correct vt102 behavior */
+static inline void answerback(struct tty_struct * tty)
+{
+ char buf[21];
+
+ if (func_table[255]) {
+ if (strlen(func_table[255]) > 20) {
+ strncpy(buf, func_table[255], 20);
+ buf[20] = '\0';
+ respond_string(buf, tty);
+ }
+ else
+ respond_string(func_table[255], tty);
+ }
+}
+
void mouse_report(struct tty_struct * tty, int butt, int mrx, int mry)
{
char buf[8];
@@ -1430,6 +1447,9 @@
*/
switch (c) {
case 0:
+ return;
+ case 5:
+ answerback(tty);
return;
case 7:
if (bell_duration)
--
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
The beer-cooled computer does not harm the ozone layer.
-- John M. Ford, a.k.a. Dr. Mike
[If I can read my notes from the Ask Dr. Mike session at Baycon, I
believe he added that the beer-cooled computer uses "Forget Only
Memory". Ed.]
andy.greenhalgh@bazaar.uklinux.net
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
reply other threads:[~2001-10-14 10:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3BC96B65.AA83D3C2@localhost.localdomain \
--to=andy.greenhalgh@bazaar.uklinux.net \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox