tech-kern archive

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

Running Xorg with a serial console



Hello

The topic looks like it should belong to tech-x11@ but it ends up in a
kernel issue, hence I post about it here.

I try to run Xorg on an amd64 machine with a serial console. On NetBSD 
10.0, it badly fails for two reasons.

First, Xorg probes the console driver and considers a failure as 
fatal. When running on a serial console, wscons is not initialized,
and Xorg will not start. The patch below fixes that.

This first bug being addressed, the machine will experrience several
freeze while Xorg start, The console display pckbport: command timeout
This comes from pckbport_cleanup() in src/sys/dev/pckbport/pckbport.c

DDB tells me I come there trhough: that code paths: 
wsmouseopen/pms_enable/do_enable/pckbportprint
wsmouseclose/pms_disable/do_disabke/pckbportprint
wsmuxopen/pms_enable/do_enable/pckbportprint
wsmuxclose/wsmouse_mux_close/pms_disable/do_disable/pckbportprint

I understand this happens because the kernel configured this:
wsmouse0 at pms0 mux 0

And ineed, booting with "userconf disable pckbc0" works around the problem.
I wonder if we could not handle that more gracefully. Would it make sense
to check that wasons was not configured, so that we can quickly fail 
wsmouse/wsmux open operation?

--- xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bsd/bsd_init.c.orig
+++ xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bsd/bsd_init.c
@@ -192,11 +192,19 @@
                     strcat(cons_drivers, ", ");
                 }
                 strcat(cons_drivers, supported_drivers[i]);
             }
-            FatalError
-                ("%s: No console driver found\n\tSupported drivers: %s\n\t%s",
-                 "xf86OpenConsole", cons_drivers, CHECK_DRIVER_MSG);
+            /*
+             * Handle as non-fatal the case where console driver is not 
+             * present or not initialized. This can happen when the 
+             * kernel booted with a serial console. The graphic cards and
+             * input devices can still be used by Xorg while they are not
+             * tied to the console.
+             */ 
+            xf86Msg(X_WARNING,
+                "%s: No console driver found\n\tSupported drivers: %s\n\t%s\n",
+                "xf86OpenConsole", cons_drivers, CHECK_DRIVER_MSG);
+            return;
         }
         xf86Info.consoleFd = fd;
 
         switch (xf86Info.consType) {


-- 
Emmanuel Dreyfus
manu%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index