sysctl debug.kdb.enter=1 but wrong console

Hi,
PXE, NFS root, all nice and shiny, now when cu -s 115200 -l /dev/cuaU0 I see perfectly working console.
But... now when I do sysctl debug.kdb.enter=1 it nicely enters the debugger but only on a physically connected console (+ USB keyboard). It just works there. But...

What I want to achieve though, is to have the debugger running on the ttyU0 (USB <=> RS-232 <=> USB in my case).
Code:
root@:~ # cat /boot/loader.conf
boot_multicons="YES"
boot_serial="YES"
comconsole_speed="115200"
#console="comconsole,efi"
console="comconsole"

TTY configured as:
Code:
ttyU0   "/usr/libexec/getty 3wire.115200"       vt100   on secure

Remark 1. Does not work regardless efi present or not.
Remark 2. For some reason, I need to have both the display + the keyboard attached to the machine. I just want to tell the kernel not to use them for ddb.
 
Is it even possible to have ttyU0 (USB => RS-232) in the kern.console? Thinking about too late USB initialization...

Currently:
Code:
kern.console: uart,ttyv0,gdb,/uart,ttyv0,gdb,
 
Is it even possible to have ttyU0 (USB => RS-232) in the kern.console? Thinking about too late USB initialization...
No, it's not.
You can have a terminal that way (i.e., run getty on it), but not a system a console.
 
No, it's not.
You can have a terminal that way (i.e., run getty on it), but not a system a console.
Thank you. This confirms my suspicion. Out of curiosity, e.g. for boards like Intel NUC, is there any way how to get a system console? Obviously there's no COM header as occasionally is on bigger boards these days.
 
there is some code in /sys/dev/usb/usb_serial.c that looks like it should support a console but seems broken
(or at least i don't understand how it should work)
C:
        if ((ucom_cons_softc == NULL) &&
            (ssc->sc_unit == ucom_cons_unit) &&
            (sc->sc_subunit == ucom_cons_subunit)) {
                DPRINTF("unit %d subunit %d is console",
                    ssc->sc_unit, sc->sc_subunit);

                ucom_cons_softc = sc;

                tty_init_console(tp, ucom_cons_baud);

                UCOM_MTX_LOCK(ucom_cons_softc);
                ucom_cons_rx_low = 0;
                ucom_cons_rx_high = 0;
                ucom_cons_tx_low = 0;
                ucom_cons_tx_high = 0;
                sc->sc_flag |= UCOM_FLAG_CONSOLE;
                ucom_open(ucom_cons_softc->sc_tty);
                ucom_param(ucom_cons_softc->sc_tty, &tp->t_termios_init_in);
                UCOM_MTX_UNLOCK(ucom_cons_softc);
        }

        if ((ssc->sc_flag & UCOM_FLAG_DEVICE_MODE) != 0 &&
            ucom_device_mode_console > 0 &&
            ucom_cons_softc == NULL) {
                struct consdev *cp;

                cp = malloc(sizeof(struct consdev), M_USBDEV,
                    M_WAITOK|M_ZERO);
                cp->cn_ops = &ucom_cnops;
                cp->cn_arg = NULL;
                cp->cn_pri = CN_NORMAL;
                strlcpy(cp->cn_name, "tty", sizeof(cp->cn_name));
                strlcat(cp->cn_name, buf, sizeof(cp->cn_name));

                sc->sc_consdev = cp;

                cnadd(cp);
        }
the second if which calls cnadd (adds dev to console list -- which allows it to be set with conscontrol) will never execute if the first if is executed first because ucom_cons_softc wont be NULL
also UCOM_FLAG_DEVICE_MODE is not set and will only be set by code from umodem.c ???
 
the second if which calls cnadd (adds dev to console list -- which allows it to be set with conscontrol) will never execute if the first if is executed first because ucom_cons_softc wont be NULL
also UCOM_FLAG_DEVICE_MODE is not set and will only be set by code from umodem.c ???
It might be by design that only umodem was picked and allowed to call cnadd()... security reasons?
 
it makes no sense to me. why you would allow a modem to be console and not a local device. i think the code is just missing from uXXcom devices
 
ok, i kinda got it
it only works when your pc is in gadget mode like when you connect the raspberry pi zero with an otg usb cable. and it appears like a serial device to the other host
then the umodem on the pi which is in "usb device mode" will act as a console
 
Btw, as for modern consumer desktop boards, some boards have dedicated COM headers. For those without COM headers, are PCIe RS-232 expansion cards gonna provide system console access with no issues?
 
see this thread
for nuc and the likes there are mini pcie and m.2 pcie 2 serial boards but they seem expensive
 
Back
Top