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@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