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

Re: gpm, USB mouse, Linux 2.4.4



>>>>> "Daniel" == Daniel Martin <dtmartin24@home.com> writes:

    Daniel> Actually, /dev/tty0 _is_ your active console; /dev/tty0 is
    Daniel> another way of accessing the currently active screen, as
    Daniel> opposed to, for example, /dev/tty3 which is the third
    Daniel> console whether or not it's active.  And that ioctl is to
    Daniel> be expected:

Ok, I thought it might be something like that.

    Daniel> cush:~$ grep KDGETMODE /usr/include/linux/kd.h #define
    Daniel> KDGETMODE 0x4B3B /* get current mode */ cush:~$ perl -e
    Daniel> 'print hex(shift),"\n";' 0x4B3B 19259

    Daniel> And then the console_ioctl man page says in part:

    Daniel>        KDGETMODE Get text/graphics mode.  argp points to a
    Daniel> long which is set to one of the above values.

    Daniel> (The "above values" are 0 for text and 1 for graphics
    Daniel> mode)

Sounds fine to me. Thanks for the detailed explanation.

    Daniel> Now, as to whether or not the triple closing is normal, I
    Daniel> can't tell you as my box is currently 50 miles away so
    Daniel> restarting gpm and then moving the console-connected mouse
    Daniel> is a bit difficult at the moment.

;-)

    Daniel> The obvious question now (for me at least), is whether or
    Daniel> not that ioctl is returning the correct values to gpm -
    Daniel> that is, maybe gpm thinks that it's in graphics mode even
    Daniel> when it isn't.  I'd try a short test program, such as:
    Daniel> perl -e 'open(F,"</dev/tty0");ioctl(F,19259,$a);print
    Daniel> unpack("b",$a),"\n";' (run as root, of course) and then
    Daniel> see that you get 0 when in text mode and 1 when in X.  On
    Daniel> my (2.2 series kernel) that perl line works as expected.

Seems OK to me... The perl script returns 0, as expected at a text
mode console.

Here is a sample of the ltrace listing (sorry, I have no idea where to
stop and where to start, so I will just pick a spot at random ;-). It
all looks the same anyway, except for the read call )

20692 read(0, "EOF", 1)                           = 1
20692 select(2, 0x0805b200, 0, 0, 0xbffffc0c)     = 1
20692 open("/dev/tty0", 0, 00)                    = 4
20692 ioctl(4, 19259, 0xbffffc18)                 = 0
20692 close(4)                                    = 0
20692 read(0, "8", 1)                             = 1
20692 select(2, 0x0805b200, 0, 0, 0xbffffc0c)     = 1
20692 open("/dev/tty0", 0, 00)                    = 4
20692 ioctl(4, 19259, 0xbffffc18)                 = 0
20692 close(4)                                    = 0
20692 read(0, "\371", 1)                          = 1
20692 select(2, 0x0805b200, 0, 0, 0xbffffc0c)     = 1
20692 open("/dev/tty0", 0, 00)                    = 4
20692 ioctl(4, 19259, 0xbffffc18)                 = 0
20692 close(4)                                    = 0
20692 read(0, "\376", 1)                          = 1
20692 select(2, 0x0805b200, 0, 0, 0xbffffc0c)     = 1
-- 
Brian May <bam@debian.org>



Reply to: