[coreboot] [PATCH] xcshell: serial shell for early debugging

Michael Gold mgold at ncf.ca
Tue Jul 14 11:23:11 CEST 2009


I've been working on some code to ensure I can debug a system even if
coreboot fails to boot an OS.  The attached patch adds this code to the
tree:
  - serialprobe watches the serial port for about a second, and boots
    the system normally unless 32 consecutive null bytes are seen.
  - xcshell allows the CPU to be controlled via the serial port, using
    a binary protocol.

The code assembles to about 1 KB, so it can be left in an image for
emergency use.  It's also modular in case someone wants to use it with
something other than a serial port.

xcsinterp.inc describes the protocol, and xccmd.inc describes the
command set.

Signed-off-by: Michael Gold <mgold at ncf.ca>
---
It should possible to jump to the 'xcshell' or 'serialprobe' symbol
(with the return address in ESP) as soon as the serial port is
configured and the CPU is executing 32-bit code (e.g., after
console_init in auto.c).  I'm using these lines in my mainboard's
Config.lb to include the code:
  mainboardinit arch/i386/xcshell/jmp_xccmd_end.inc
  mainboardinit arch/i386/xcshell/serialprobe.inc
  mainboardinit arch/i386/xcshell/io_serial.inc
  mainboardinit arch/i386/xcshell/xcsinterp.inc
  mainboardinit arch/i386/xcshell/xccmd.inc

I'm not sure whether there's anything that needs to be added, but
suggestions are welcome.  I'm hoping the command set is sufficient to
initialise RAM, though so far I've only tested cache-as-RAM mode
(which just seems to work for data, not code).

-- Michael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xcshell.diff
Type: text/x-diff
Size: 23813 bytes
Desc: not available
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20090714/cdd2f366/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20090714/cdd2f366/attachment.sig>


More information about the coreboot mailing list