[PATCH] Read the protocol used by /dev/gpmdata on Linux

Hello,

I had a problem on my system, where gpm is configured to use my PS/2
mouse (using /dev/psaux and ps2 protocol). SDL assumes that gpm always
uses msc protocol, which is wrong.

The device protocol is given on the command line (’-t protocol’) and the
repeater (where SDL reads its data) can use a different protocol
(’-Rprotocol’ yes, no space).

Here is a patch that parses the gpm command line to retrieve the
protocol currently used by the repeater. At least, it works for me.–
Patrice Mandin
WWW: http://membres.lycos.fr/pmandin/
Programmeur Linux, Atari
Sp?cialit?: D?veloppement, jeux
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed…
Name: gpmmouse.diff
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20050624/f1c91ed3/attachment.txt

Here is a patch that parses the gpm command line to retrieve the
protocol currently used by the repeater. At least, it works for me.

Oh dear this is broken, and it was broken before too.

The command line data can be swapped out at any time.
When this happens, you can’t read it.

If you need to know if /dev/gpmdata works, just try it
and check for errors.On Fri, 2005-06-24 at 10:59 +0200, Patrice Mandin wrote:

Le Fri, 24 Jun 2005 11:53:15 -0400
Albert Cahalan a ?crit:

The command line data can be swapped out at any time.
When this happens, you can’t read it.

If you need to know if /dev/gpmdata works, just try it
and check for errors.

So, maybe we should parse /etc/gpm.conf for type and repeat_type fields?
It should be quite easy to do.–
Patrice Mandin
WWW: http://membres.lycos.fr/pmandin/
Programmeur Linux, Atari
Sp?cialit?: D?veloppement, jeux

Le Fri, 24 Jun 2005 11:53:15 -0400
Albert Cahalan a ?crit:

The command line data can be swapped out at any time.
When this happens, you can’t read it.

If the command line data can not be read reliably via /proc, how do 'ps’
and ‘top’ read and display the list of processes and their command line?–
Patrice Mandin
WWW: http://membres.lycos.fr/pmandin/
Programmeur Linux, Atari
Sp?cialit?: D?veloppement, jeux

They don’t, reliably. When they can not read the command line,
they print up to 15 characters of the filename in brackets.

So if you had /usr/local/bin/this-is-my-executable being run
with argv={“foo”,“bar”,“baz”,0} the “ps -eo comm,args” command
would produce:

status: swapped out
result: this-is-my-exec [this-is-my-exec]

status: in memory
result: this-is-my-exec foo bar baz

Also, if it’s a zombie, " " gets added to the end.On Sat, 2005-06-25 at 00:09 +0200, Patrice Mandin wrote:

Le Fri, 24 Jun 2005 11:53:15 -0400
Albert Cahalan a ?crit:

The command line data can be swapped out at any time.
When this happens, you can’t read it.

If the command line data can not be read reliably via /proc, how do 'ps’
and ‘top’ read and display the list of processes and their command line?

If the command line data can not be read reliably via /proc, how do 'ps’
and ‘top’ read and display the list of processes and their command line?

They don’t, reliably. When they can not read the command line,
they print up to 15 characters of the filename in brackets.

So are we in agreement to drop the existing gpm patch? Is there a better
way to determine the protocol?

–ryan.

Le Thu, 08 Sep 2005 03:51:07 -0400
"Ryan C. Gordon" a ?crit:

So are we in agreement to drop the existing gpm patch? Is there a
better way to determine the protocol?

Well, I think we could use the libgpm library. It should solve most
problems with gpm support.–
Patrice Mandin
WWW: http://pmandin.atari.org/
Programmeur Linux, Atari
Sp?cialit?: D?veloppement, jeux

  • Patrice Mandin <mandin.patrice at wanadoo.fr> wrote:
> > So are we in agreement to drop the existing gpm patch? Is there a > > better way to determine the protocol? > > Well, I think we could use the libgpm library. It should solve most > problems with gpm support.

Seems the really cleanest way to me.
libgpm is the implementation of the gpm protocol/client, and so I
don’t see any reason, why we should need another implementation,
which of course has to be maintained too - would be redundant work.

cu–

Enrico Weigelt == metux IT service

phone: +49 36207 519931 www: http://www.metux.de/
fax: +49 36207 519932 email: contact at metux.de
cellphone: +49 174 7066481

– DSL ab 0 Euro. – statische IP – UUCP – Hosting – Webshops –

But isn’t libgpm under the GPL license? (I’m at work right now, so I
can’t confirm) Is it okay for a LGPL library like SDL to link to it?
Won’t it break the “lesser” terms of the LGPL.?On 9/8/05, Enrico Weigelt wrote:

  • Patrice Mandin <mandin.patrice at wanadoo.fr> wrote:

Well, I think we could use the libgpm library. It should solve most
problems with gpm support.

Seems the really cleanest way to me.
libgpm is the implementation of the gpm protocol/client, and so I
don’t see any reason, why we should need another implementation,
which of course has to be maintained too - would be redundant work.

Le Thu, 8 Sep 2005 09:30:26 -0400
Simon Roby <simon.roby at gmail.com> a ?crit:

But isn’t libgpm under the GPL license? (I’m at work right now, so I
can’t confirm) Is it okay for a LGPL library like SDL to link to it?
Won’t it break the “lesser” terms of the LGPL.?

We could make libgpm dynamically loaded (like arts and esd audio
support), so support could be added even when target system does not
have it.–
Patrice Mandin
WWW: http://pmandin.atari.org/
Programmeur Linux, Atari
Sp?cialit?: D?veloppement, jeux

  • Patrice Mandin <mandin.patrice at wanadoo.fr> wrote:

Le Thu, 8 Sep 2005 09:30:26 -0400
Simon Roby <simon.roby at gmail.com> a ?crit:

But isn’t libgpm under the GPL license? (I’m at work right now, so I
can’t confirm) Is it okay for a LGPL library like SDL to link to it?
Won’t it break the “lesser” terms of the LGPL.?

We could make libgpm dynamically loaded (like arts and esd audio
support), so support could be added even when target system does not
have it.

No, that’s nonse.

Why not just ask the gpm folks if they would release libgpm under
LGPL ? They’re probably not against this, but have it under GPL just
historically since gpm was always GPL and there never was a single
reason to change it, yet.

cu–

Enrico Weigelt == metux IT service

phone: +49 36207 519931 www: http://www.metux.de/
fax: +49 36207 519932 email: contact at metux.de
cellphone: +49 174 7066481

– DSL ab 0 Euro. – statische IP – UUCP – Hosting – Webshops –