Subject: multiuser X 4.1.0
To: None <netbsd-users@netbsd.org>
From: Wojciech Puchar <wojtek@wojtek.3miasto.net>
List: netbsd-users
Date: 09/02/2001 13:54:15
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

--0-2005422453-999431655=:750
Content-Type: TEXT/PLAIN; charset=US-ASCII

after few days of hacking (99% trying to understand XFree code, 1% actual
coding) i've almost made XFree 4.1.0 working multiuser with 2 gfx cards, 2
keyboards, 2 mice (tested with 3 too).

the only problem is that X doesn't work well with "wskbd" protocol and
it simply interpretes keycodes bad when /dev/wskbd1 (or 2) is not
connected to wsdisplay. when it is connected everything goes to first
display, none to second.

when trying to wsconscfg -k 1 ;wsconscfg -d -k 1 ; start X it sometimes
work right but in most cases no because after few seconds after wconscfg
-d or closing wskbd1 i've got such message in kernel:

Sep  1 22:19:22 wojtek /netbsd: uhub0: port error, restarting port 1
Sep  1 22:19:22 wojtek /netbsd: ukbd0: at uhub0 port 1 (addr 2) disconnected
Sep  1 22:19:22 wojtek /netbsd: wskbd1 detached
Sep  1 22:19:22 wojtek /netbsd: ukbd0 detached
Sep  1 22:19:25 wojtek /netbsd: ukbd0 at uhub0 port 1 configuration 1 interface 0
Sep  1 22:19:25 wojtek /netbsd:
Sep  1 22:19:25 wojtek /netbsd: ukbd0: CHICONY Keyboard NT68P81, rev 1.00/0.01, addr 2, iclass 3/1
Sep  1 22:19:25 wojtek /netbsd: wskbd1 at ukbd0

i haven't such errors with Mac USB keyboard but i can't lend it this
moment. what's wrong?

keyboard is the only thing left now to make multiuser X fully working
my XF86Config in attachment. source patch below:

--- ./xc/config/cf/xf86site.def.old	Sun Sep  2 13:34:47 2001
+++ ./xc/config/cf/xf86site.def	Mon Aug 27 18:49:43 2001
@@ -47,16 +47,7 @@
 #define HasGcc2ForCplusplus	YES
  */

-/*
- * The default optimisation flags for GCC 2.x.  -fno-strength-reduce is
- * here to work around a bug in -O2 for GCC 2.x on i386 platforms.
- * If you are using a version that doesn't have this bug, you can
- * uncomment the following line, and remove '-fno-strength-reduce'
- * If you are building binaries for a 486, it may be beneficial to add
- * -m486
- *
-#define DefaultGcc2i386Opt	-O2 -fno-strength-reduce
- */
+#define DefaultGcc2i386Opt	-O2 -march=pentiumpro -pipe

 /*
  * This allows the GCC warning flags to be set.  The default is shown here.
@@ -196,13 +187,7 @@
 #define XF86SetupUsesStaticTcl	NO
  */

-/*
- * Build a server that dynamically loads the modules by setting
- * this to YES.  This defaults to YES on most platforms.  A static server
- * can be built by setting this to NO.
- *
 #define DoLoadableServer	NO
- */

 /*
  * Build dlopen() style modules instead of the standard loader modules.
--- ./xc/programs/Xserver/hw/xfree86/common/xf86Privstr.h.old	Mon Aug 27 22:24:22 2001
+++ ./xc/programs/Xserver/hw/xfree86/common/xf86Privstr.h	Mon Aug 27 22:24:54 2001
@@ -166,6 +166,7 @@
 #define SYSCONS		   8
 #define PCVT		  16
 #define WSCONS		  32
+#define	NOCONS		  64
 #endif

 /* Values of xf86Info.mouseFlags */
--- ./xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c.old	Sun Sep  2 10:07:21 2001
+++ ./xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c	Sun Sep  2 10:08:05 2001
@@ -534,9 +534,11 @@
 #ifdef DEBUG
     ErrorF("pciIoAccessDisable: 0x%05lx\n", *(PCITAG *)arg);
 #endif
+#if 0
     ((pciArg*)arg)->ctrl &= ~SETBITS;
     ((pciArg*)arg)->func(((pciArg*)arg)->tag, PCI_CMD_STAT_REG,
 			 ((pciArg*)arg)->ctrl);
+#endif
 }

 #undef SETBITS
@@ -558,9 +560,11 @@
 #ifdef DEBUG
     ErrorF("pciIo_MemAccessDisable: 0x%05lx\n", *(PCITAG *)arg);
 #endif
+#if 0
     ((pciArg*)arg)->ctrl &= ~SETBITS;
     ((pciArg*)arg)->func(((pciArg*)arg)->tag, PCI_CMD_STAT_REG,
 			 ((pciArg*)arg)->ctrl);
+#endif
 }

 #undef SETBITS
@@ -582,9 +586,11 @@
 #ifdef DEBUG
     ErrorF("pciMemAccessDisable: 0x%05lx\n", *(PCITAG *)arg);
 #endif
+#if 0
     ((pciArg*)arg)->ctrl &= ~SETBITS;
     ((pciArg*)arg)->func(((pciArg*)arg)->tag, PCI_CMD_STAT_REG,
 			 ((pciArg*)arg)->ctrl);
+#endif
 }
 #undef SETBITS

--- ./xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_init.c.old	Mon Aug 27 22:12:00 2001
+++ ./xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_init.c	Sun Sep  2 12:44:47 2001
@@ -75,6 +75,7 @@
   "Check your kernel's console driver configuration and /dev entries"

 static char *supported_drivers[] = {
+	"non-primary display",
 #ifdef PCCONS_SUPPORT
 	"pccons (with X support)",
 #endif
@@ -100,6 +101,8 @@

 typedef int (*xf86ConsOpen_t)(void);

+static int xf86OpenNocons(void);
+
 #ifdef PCCONS_SUPPORT
 static int xf86OpenPccons(void);
 #endif /* PCCONS_SUPPORT */
@@ -123,6 +126,7 @@
  * pcvt or syscons might succesfully probe as pccons.)
  */
 static xf86ConsOpen_t xf86ConsTab[] = {
+    xf86OpenNocons,
 #ifdef PCVT_SUPPORT
     xf86OpenPcvt,
 #endif
@@ -304,6 +308,16 @@
     return;
 }

+static int
+xf86OpenNocons() {
+
+ if(VTnum == 1000) {
+ 	xf86Info.consType = NOCONS;
+	xf86Msg(X_PROBED, "Disabling VT handling code\n");
+ 	return(xf86Info.kbdFd);
+ } else
+ 	return(-1);
+}

 #ifdef PCCONS_SUPPORT

@@ -672,6 +686,11 @@
 		KeepTty = TRUE;
 		return(1);
 	}
+	if ((argv[i][0] == 'n') && (argv[i][1] == 'o') && (argv[i][2] == 'v') && (argv[i][3] == 't')) {
+		VTnum = 1000;
+		KeepTty = TRUE;
+		return(1);}
+
 #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
 	if ((argv[i][0] == 'v') && (argv[i][1] == 't'))
 	{


--0-2005422453-999431655=:750
Content-Type: TEXT/PLAIN; charset=US-ASCII; name=XF86Config
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.NEB.4.33.0109021354150.750@wojtek.3miasto.net>
Content-Description: 
Content-Disposition: attachment; filename=XF86Config

U2VjdGlvbiAiU2VydmVyTGF5b3V0Ig0KCUlkZW50aWZpZXIgICAgICJtYWlu
Ig0KCVNjcmVlbiAgICAgIDAgICJTY3JlZW4wIiAwIDANCglJbnB1dERldmlj
ZSAgICAiTW91c2UwIiAiQ29yZVBvaW50ZXIiDQoJSW5wdXREZXZpY2UgICAg
IktleWJvYXJkMCIgIkNvcmVLZXlib2FyZCINCkVuZFNlY3Rpb24NCg0KU2Vj
dGlvbiAiU2VydmVyTGF5b3V0Ig0KCUlkZW50aWZpZXIgICAgICJleHRyYTEi
DQoJU2NyZWVuICAgICAgMCAgIlNjcmVlbjEiIDAgMA0KCUlucHV0RGV2aWNl
ICAgICJNb3VzZTEiICJDb3JlUG9pbnRlciINCglJbnB1dERldmljZSAgICAi
S2V5Ym9hcmQxIiAiQ29yZUtleWJvYXJkIg0KRW5kU2VjdGlvbg0KDQpTZWN0
aW9uICJTZXJ2ZXJGbGFncyINCglPcHRpb24gIkJsYW5rVGltZSIgIjIiDQoJ
T3B0aW9uICJTdGFuZGJ5dGltZSIgIjUiDQoJT3B0aW9uICJTdXNwZW5kVGlt
ZSIgIjEwIg0KCU9wdGlvbiAiT2ZmVGltZSIgIjAiDQpFbmRTZWN0aW9uDQoN
ClNlY3Rpb24gIk1vZHVsZSINCglTdWJTZWN0aW9uICJJbnQxMCINCgkJT3B0
aW9uICJOb0lOVDEwIiAiVHJ1ZSINCglFbmRTZWN0aW9uDQpFbmRTZWN0aW9u
DQoNClNlY3Rpb24gIkZpbGVzIg0KCVJnYlBhdGggICAgICAiL3Vzci9YMTFS
Ni9saWIvWDExL3JnYiINCiAgICAgICAgRm9udFBhdGggICAiL3Vzci9sb2Nh
bC9saWIvNzVkcGlfcGwiDQogICAgICAgIEZvbnRQYXRoICAgIi91c3IvbG9j
YWwvbGliLzEwMGRwaV9wbCINCiAgICAgICAgRm9udFBhdGggICAiL3Vzci9s
b2NhbC9saWIvNzVkcGlfcGw6dW5zY2FsZWQiDQogICAgICAgIEZvbnRQYXRo
ICAgIi91c3IvbG9jYWwvbGliLzEwMGRwaV9wbDp1bnNjYWxlZCINCiAgICAg
ICAgRm9udFBhdGggICAiL3Vzci9sb2NhbC9saWIvbWlzY19wbCINCglGb250
UGF0aCAgICAgIi91c3IvWDExUjYvbGliL1gxMS9mb250cy9taXNjLyINCglG
b250UGF0aCAgICAgIi91c3IvWDExUjYvbGliL1gxMS9mb250cy9TcGVlZG8v
Ig0KCUZvbnRQYXRoICAgICAiL3Vzci9YMTFSNi9saWIvWDExL2ZvbnRzL1R5
cGUxLyINCglGb250UGF0aCAgICAgIi91c3IvWDExUjYvbGliL1gxMS9mb250
cy9DSUQvIg0KCUZvbnRQYXRoICAgICAiL3Vzci9YMTFSNi9saWIvWDExL2Zv
bnRzLzc1ZHBpLyINCglGb250UGF0aCAgICAgIi91c3IvWDExUjYvbGliL1gx
MS9mb250cy8xMDBkcGkvIg0KRW5kU2VjdGlvbg0KDQpTZWN0aW9uICJNb2R1
bGUiDQpFbmRTZWN0aW9uDQoNClNlY3Rpb24gIklucHV0RGV2aWNlIg0KCUlk
ZW50aWZpZXIgICJLZXlib2FyZDAiDQoJRHJpdmVyICAgICAgImtleWJvYXJk
Ig0KCU9wdGlvbiAgICAgICJYa2JSdWxlcyIgInhmcmVlODYiDQoJT3B0aW9u
ICAgICAgIlhrYk1vZGVsIiAicGMxMDIiDQoJT3B0aW9uICAgICAgIlhrYkxh
eW91dCIgInBsIg0KRW5kU2VjdGlvbg0KDQpTZWN0aW9uICJJbnB1dERldmlj
ZSINCglJZGVudGlmaWVyICAiS2V5Ym9hcmQxIg0KCURyaXZlciAgICAgICJr
ZXlib2FyZCINCglPcHRpb24JIlByb3RvY29sIiAid3N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