Subject: Re: multiuser X 4.1.0
To: None <port-i386@netbsd.org>
From: Matthias Pfaller <leo@lethe.dachau.marco.de>
List: port-i386
Date: 09/05/2001 08:46:40
In article <Pine.NEB.4.33.0109021345580.750-200000@wojtek.3miasto.net>,
	wojtek@wojtek.3miasto.net (Wojciech Puchar) writes:
> keyboard is the only thing left now to make multiuser X fully working
> my XF86Config in attachment. source patch below:

I made a similar patch to get rid of the console association, but I hadn't
found about the pci issues so far. My patch only touches one file. It adds
a "-noconsole" option to the server. Together with your patch to xf86pciBus.c
and

	pckbc0	at isa? 			# PC keyboard controller
	pckbd0	at pckbc0 slot 0		# PC keyboard
	pckbd1	at pckbc0 slot 1		# PC keyboard
	wskbd0	at pckbd0 console ? mux 1
	wskbd1	at pckbd1 console ? mux 3

	# USB Mice
	ums*	at uhub? port ? configuration ? interface ?
	wsmouse0	at ums? mux 0
	wsmouse1	at ums? mux 2
	wsmouse2	at ums? mux 4

	# USB Keyboards
	ukbd*	at uhub? port ? configuration ? interface ?
	wskbd2	at ukbd? console ? mux 5
	pseudo-device	wsmux	6		# mouse & keyboard multiplexor pseudo-devices

in my config file I was able to run two X servers with two graphic
boards and two keyboards on my machine. I still have to get some USB
mice. For the first tests I just run without mice. Connecting a second
keyboard to the mouseport worked like a charm. It looks like the X server
will not work with the raw keyboard devices. I had to specify the mux devices
in XF86Config.

Regards, Matthias

--- bsd_init.c	Fri Aug 10 12:17:16 2001
+++ /tmp/bsd_init.c	Tue Sep  4 17:00:13 2001
@@ -34,6 +34,7 @@
 #include "xf86_OSlib.h"
 
 static Bool KeepTty = FALSE;
+static Bool NoConsole = FALSE;
 static int devConsoleFd = -1;
 static int VTnum = -1;
 static int initialVT = -1;
@@ -173,11 +174,20 @@
 	}
 
 	/* detect which driver we are running on */
+	if (NoConsole)
+	{
+		xf86Info.consType = WSCONS;
+		xf86Msg(X_PROBED, "Using wscons NoConsole driver\n");
+		fd = xf86Info.kbdFd;
+	}
+	else
+	{
 	for (driver = xf86ConsTab; *driver; driver++)
 	{
 	    if ((fd = (*driver)()) >= 0)
 		break;
 	}
+	}
 
 	/* Check that a supported console driver was found */
 	if (fd < 0)
@@ -685,6 +695,12 @@
 		return(1);
 	}
 #endif /* SYSCONS_SUPPORT || PCVT_SUPPORT */
+
+	if (!strcmp(argv[i], "-noconsole"))
+	{
+		NoConsole = TRUE;
+		return(1);
+	}
 	return(0);
 }
 
@@ -696,5 +712,7 @@
 #endif /* SYSCONS_SUPPORT || PCVT_SUPPORT */
 	ErrorF("-keeptty               ");
 	ErrorF("don't detach controlling tty (for debugging only)\n");
+	ErrorF("-noconsole             ");
+	ErrorF("don't attach to a console\n");
 	return;
 }
--- xf86pciBus.c	Fri Aug 10 12:15:44 2001
+++ /tmp/xf86pciBus.c	Tue Sep  4 17:02:01 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
 
@@ -3141,4 +3147,3 @@
     else
 	pciWriteLong(tag, PCI_CMD_STAT_REG, temp & ~PCI_CMD_MASTER_ENABLE);
 }
-
-- 
Matthias Pfaller                            Software Entwicklung
marco Systemanalyse und Entwicklung GmbH    Tel   +49 8131 5161-41
Hans-Böckler-Str. 2, D 85221 Dachau         Fax   +49 8131 5161-66
http://www.marco.de/                        Email leo@dachau.marco.de