Linux MS DOS discussions
 help / color / mirror / Atom feed
* Re: non-privileged raw keyboard
       [not found] ` <Pine.LNX.4.21.0204040205400.17205-100000@pg5.enm.bris.ac.uk>
@ 2002-04-07 16:34   ` Witold Filipczyk
  2002-04-07 17:52     ` Bart Oldeman
  0 siblings, 1 reply; 3+ messages in thread
From: Witold Filipczyk @ 2002-04-07 16:34 UTC (permalink / raw)
  To: linux-msdos

[-- Attachment #1: Type: text/plain, Size: 1897 bytes --]

On Thu, Apr 04, 2002 at 02:30:24AM +0100, Bart Oldeman wrote:
> On Thu, 4 Apr 2002, Bart Oldeman wrote:
> 
> > There exist a few possibilities and work arounds.
> > b) use $_rawkeyboard=(1) or the -k option. This requires (suid)root for
> > dosemu.bin, bypasses the terminal and passes keystrokes directly (use
> > ctrl+alt+fkey to switch consoles) or
> 
> and then I suddenly realized that you DON'T need to be root to be able to
> use the raw keyboard, but dosemu enforced that, in my opinion
> unnecessarily.
> 
> Here's the patch for dosemu-1.1.3; 
> for 1.0.2.1:
> ignore first chunk
> second chunk is for src/base/keyboard/keyb_clients.c
> third chunk should apply
> 
> note that raw keyboard is linux console only, not eg. ssh, telnet or
> xterm. I am also not sure whether this works on every linux kernel and in 
> all configurations.
Second part - video doesn't work for me.
/dev/mem can't write errno 13 (something like this)
(I use SVGATextMode).
My proposal of this patch is in attachment (keyboard only)

> --- src/plugin/keyboard/keyb_clients.c.old	Thu Apr  4 02:00:53 2002
> +++ src/plugin/keyboard/keyb_clients.c	Thu Apr  4 02:01:10 2002
> @@ -188,7 +188,7 @@
>     }
>     else 
>  #endif
> -   if (config.usesX || (config.console_keyb && can_do_root_stuff))  {
> +   if (config.usesX || config.console_keyb)  {
>        if (config.usesX || config.console)
>           Keyboard = &Keyboard_raw;
>        else {
> --- src/env/video/vc.c.old	Thu Apr  4 01:49:50 2002
> +++ src/env/video/vc.c	Thu Apr  4 01:50:13 2002
> @@ -136,7 +136,7 @@
>      c_printf("major = %d minor = %d\n",
>  	    major, minor);
>      /* console major num is 4, minor 64 is the first serial line */
> -    if (can_do_root_stuff && (major == 4) && (minor < 64)) {
> +    if ((major == 4) && (minor < 64)) {
>         scr_state.console_no = minor;
>         config.console=1;
>      }
> 

Witold Filipczyk

[-- Attachment #2: dosemu-rawkeyboard-console.patch --]
[-- Type: text/plain, Size: 587 bytes --]

--- src/base/keyboard/keyb_clients.c.old	Sun Mar 11 14:27:25 2001
+++ src/base/keyboard/keyb_clients.c	Sun Apr  7 18:09:53 2002
@@ -188,13 +188,13 @@
    }
    else 
 #endif
-   if (config.usesX || (config.console_keyb && can_do_root_stuff))  {
-      if (config.usesX || config.console)
+   if (config.usesX || config.console_keyb)  {
+/*      if (config.usesX || config.console) */
          Keyboard = &Keyboard_raw;
-      else {
+/*      else {
 	 Keyboard = &Keyboard_slang;
          config.console_keyb=0;
-      }
+      } */
    }
    else {
       Keyboard = &Keyboard_slang;

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: non-privileged raw keyboard
  2002-04-07 16:34   ` non-privileged raw keyboard Witold Filipczyk
@ 2002-04-07 17:52     ` Bart Oldeman
  2002-04-07 19:13       ` Witold Filipczyk
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Oldeman @ 2002-04-07 17:52 UTC (permalink / raw)
  To: Witold Filipczyk; +Cc: linux-msdos

On Sun, 7 Apr 2002, Witold Filipczyk wrote:

> Second part - video doesn't work for me.
> /dev/mem can't write errno 13 (something like this)
> (I use SVGATextMode).
> My proposal of this patch is in attachment (keyboard only)

This was a bug, which was only exposed by my changes.
It depended on the setting of $_console: $_console is a protected
setting. But there is/was confusion between config.console and
config.console_video: $_console sets config.console_video and not
config.console. config.console is set if certain ioctls find out that we
are running on the console. I don't completely understand this but the
following should fix your problem as well:

--- src/base/init/config.c.old	Sun Apr  7 18:42:14 2002
+++ src/base/init/config.c	Sun Apr  7 18:43:05 2002
@@ -741,7 +741,7 @@
 	config.emuretrace = 0;	/* already emulated */
     }
     else {
-	if (!can_do_root_stuff && config.console) {
+	if (!can_do_root_stuff && config.console_video) {
 	    /* force use of Slang-terminal on console too */
 	    config.console = config.console_video = config.vga = config.graphics = 0;
 	    config.cardtype = 0;

and I prefer this (+ my complete earlier patch) to your solution;)

IMHO the member config.console should be eliminated here to avoid
further confusion but let's do that later.
Please let me know if this helps you too.

Bart


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: non-privileged raw keyboard
  2002-04-07 17:52     ` Bart Oldeman
@ 2002-04-07 19:13       ` Witold Filipczyk
  0 siblings, 0 replies; 3+ messages in thread
From: Witold Filipczyk @ 2002-04-07 19:13 UTC (permalink / raw)
  To: linux-msdos

On Sun, Apr 07, 2002 at 06:52:13PM +0100, Bart Oldeman wrote:
> On Sun, 7 Apr 2002, Witold Filipczyk wrote:
> 
> > Second part - video doesn't work for me.
> > /dev/mem can't write errno 13 (something like this)
> > (I use SVGATextMode).
> > My proposal of this patch is in attachment (keyboard only)
> 
> This was a bug, which was only exposed by my changes.
> It depended on the setting of $_console: $_console is a protected
> setting. But there is/was confusion between config.console and
> config.console_video: $_console sets config.console_video and not
> config.console. config.console is set if certain ioctls find out that we
> are running on the console. I don't completely understand this but the
> following should fix your problem as well:
> 
> --- src/base/init/config.c.old	Sun Apr  7 18:42:14 2002
> +++ src/base/init/config.c	Sun Apr  7 18:43:05 2002
> @@ -741,7 +741,7 @@
>  	config.emuretrace = 0;	/* already emulated */
>      }
>      else {
> -	if (!can_do_root_stuff && config.console) {
> +	if (!can_do_root_stuff && config.console_video) {
>  	    /* force use of Slang-terminal on console too */
>  	    config.console = config.console_video = config.vga = config.graphics = 0;
>  	    config.cardtype = 0;
> 
> and I prefer this (+ my complete earlier patch) to your solution;)
> 
> IMHO the member config.console should be eliminated here to avoid
> further confusion but let's do that later.
> Please let me know if this helps you too.

Now, works fine.
WF

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-04-07 19:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <Pine.LNX.4.21.0204040045290.17033-100000@pg5.enm.bris.ac.uk>
     [not found] ` <Pine.LNX.4.21.0204040205400.17205-100000@pg5.enm.bris.ac.uk>
2002-04-07 16:34   ` non-privileged raw keyboard Witold Filipczyk
2002-04-07 17:52     ` Bart Oldeman
2002-04-07 19:13       ` Witold Filipczyk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox