mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Cedric Roux <sed@free.fr>
To: linux-kernel@vger.kernel.org
Subject: /dev/vcs or /dev/tty local colormap retrieving
Date: Fri, 27 Feb 2009 15:28:04 +0100 (CET)	[thread overview]
Message-ID: <20354297.220251235744884040.JavaMail.root@spooler2-g27.priv.proxad.net> (raw)

Hi linux kernel hackers,

I have a problem.
I want to retrieve the current colormap of a given tty.

/dev/vcsX (or /dev/vcsaX) don't dump the colormap
of the given tty through their read() interface.

The GIO_CMAP ioctl call only returns the current *default*
colormap, which is not what I want, since someone may
send terminal commands to modify the colormap of a
specific tty.

(I am working with EGA/VGA text virtual terminals,
source code in drivers/char/vt.c)

I will do my own private hack to dump the colormap,
but maybe it might be useful for other people as
well, so I send you an email to know if you
are interested.

If yes, what is the prefered way (according to
your internal design policy) to do that?

I think about several methods:
1 - dump the 48 bytes of the colormap at the
    end of read(/dev/vcsaX), so after the screen
    content. Obviously, userland programs that
    don't take into account the dimensions of
    the console may behave strangely after this
    modification, but it's the simplest IMHO,
2 - create a new /dev/vcspX device. Some minor
    number after 191 are still available for
    major 7 c mode. It would pollute /dev,
    but why not,
3 - have a new ioctl, preferably on /dev/vcsaX
    or /dev/vcsX, but might also be available
    for /dev/ttyX (/dev/vcsaX seems more
    natural, because this device already exports
    attributes of characters).

We might also want a write access, why not?
And maybe also get the cursor shape (I didn't
check for that because I don't need it, so it
might already be done somewhere).

If you think this feature is useful, I will
send a patch in a few days.

So, well, that's it.
If it appears that I didn't read the sources
carefully enough and if the feature I want
is already there, I apologize. In which case,
please direct me to the correct source file.

Take care and happy hacking,
Cédric.

             reply	other threads:[~2009-02-27 14:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-27 14:28 Cedric Roux [this message]
2009-02-27 15:26 ` Alan Cox

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=20354297.220251235744884040.JavaMail.root@spooler2-g27.priv.proxad.net \
    --to=sed@free.fr \
    --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

all inboxes | Powered by JetHome®