Serial offender

There comes a time in every budding kernel developer’s life that he has to debug a mysterious lockup, and nothing will do but a serial console. Well, for my future recollections, here’s how to set it up:

  1. Get out your handy pl2303-based usb to serial adapter, because chances are good your laptop doesn’t have a serial port
  2. Build your kernel with CONFIG_USB_SERIAL_CONSOLE=y
  3. Add to your kernel command line: console=ttyUSB0,115200 console=tty0
  4. Hook your computer up to the other computer via a null-modem cable (man, these are pricey these days, $30 for something no one still uses?)
  5. Set up minicom to use your serial port, say ttyS0, at 115200 baud, 8N1, and turn off all the modem init strings
  6. Don’t bother futzing with getty, you only need it if you want to also allow logins over serial. For logging, it’s unnecessary


Now, start minicom on computer 2 and reboot your computer under test. If all goes well, you’ll capture a panic on the serial console. If all goes poorly (my case), you’ll have a lockup with no oops. The usual thing to try in this case is adding “nmi_watchdog=1” to the command line, which will use the non-maskable interrupt to break into any frozen code. Also, if you have CONFIG_DETECT_SOFTLOCKUP set, hopefully after 60 seconds or so you’ll get a soft lockup warning.

In my case, I still have a hard lock with no output. Ho hum.