Difference between revisions of "Serial console"

From coreboot
Jump to: navigation, search
(GRUB2)
(3 intermediate revisions by the same user not shown)
Line 61: Line 61:
  
 
to send debug output to both the serial console on COM1 '''and''' to VGA.
 
to send debug output to both the serial console on COM1 '''and''' to VGA.
 +
 +
if you use grub2 you can add it to GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub
 +
 +
Then regenrate the grub config:
 +
For debian, ubuntu, trisquel:
 +
sudo update-grub2
 +
for arch, parabola:
 +
grub-mkconfig -o /boot/grub/grub.cfg
  
 
== Linux login prompt ==
 
== Linux login prompt ==
Line 70: Line 78:
 
Change '''ttyS0''' to '''ttyS1''' for COM2.
 
Change '''ttyS0''' to '''ttyS1''' for COM2.
  
 +
 +
=== ubuntu, trisquel based ===
 +
Create a file called /etc/init/ttyS0.conf containing the following:
 +
# ttyS0 - getty
 +
#
 +
# This service maintains a getty on ttyS0 from the point the system is
 +
# started until it is shut down again.
 +
 +
start on stopped rc or RUNLEVEL=[2345]
 +
stop on runlevel [!2345]
 +
 +
respawn
 +
exec /sbin/getty -L 115200 ttyS0 vt102
 +
 +
Then do
 +
sudo start ttyS0
 +
 +
= Notes =
 +
While serial is the most supported console(support in coreboot,seabios,serialice,ipxe,memtest etc...) it's not available on every hardware anymore, some recent devices like the Lenovo X201 or the Chromebook pixel lack a serial port...
  
 
{{PD-self}}
 
{{PD-self}}
  
 
__NOTOC__
 
__NOTOC__

Revision as of 18:05, 5 June 2013

Supported Serial Ports

SuperI/O with integrated UARTs

coreboot supports a variety of SuperI/O chips with UART functionality. If your mainboard has a serial port built-in, you can use it with no or minimal changes.

PCIe/Mini PCIe based serial cards

Experimental coreboot and libpayload support is available for the StarTech MPEX2S952 card. Those cards are available at Amazon for around 60 USD. In order to use the card for romstage debugging, minimal setup of the PCIe bridge and the MPEX2S952 have to be added to romstage.c, otherwise the card is only available after the resource allocator has been running.

USB to Serial Converters

USB to serial converters are not supported by coreboot at this time.


Enabling Serial Console

In order to get serial console output from various components of your system special options may be needed. This page tries to give a short description of how to use these options.

coreboot

In coreboot you have to set up serial console support during configuration. Enable Console--> Serial port console output. You will be able to choose the UART and baud rate settings in the same menu.

FILO

FILO picks up coreboot's serial console configuration, if compiled with serial console support.

GRUB legacy

In your boot/grub/menu.lst add the following:

serial --unit=0 --speed=115200
terminal --timeout=15 serial console

Change --unit=0 to --unit=1 for the second serial port (COM2).

GRUB2

The usual way to get serial is to have the following in /etc/default/grub:

GRUB_TERMINAL_INPUT="console serial"
GRUB_TERMINAL_OUTPUT="console serial"
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"

But that depend on having console(and so graphics) working(if console fails serial isn't tried), so adding the following to the end of /etc/grub.d/40_custom

serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1
terminal_input --append  serial
terminal_output --append serial
set timeout=1
play 480 440 1

Then regenrate the grub config: For debian, ubuntu, trisquel:

sudo update-grub2

for arch, parabola:

grub-mkconfig -o /boot/grub/grub.cfg

Linux kernel command line

Add

console=ttyS0,115200 console=tty0

to send debug output to both the serial console on COM1 and to VGA.

if you use grub2 you can add it to GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub

Then regenrate the grub config: For debian, ubuntu, trisquel:

sudo update-grub2

for arch, parabola:

grub-mkconfig -o /boot/grub/grub.cfg

Linux login prompt

In /etc/inittab add/enable a line like this:

T0:23:respawn:/sbin/getty -L ttyS0 115200 vt100

Change ttyS0 to ttyS1 for COM2.


ubuntu, trisquel based

Create a file called /etc/init/ttyS0.conf containing the following:

# ttyS0 - getty
#
# This service maintains a getty on ttyS0 from the point the system is
# started until it is shut down again.

start on stopped rc or RUNLEVEL=[2345]
stop on runlevel [!2345]

respawn
exec /sbin/getty -L 115200 ttyS0 vt102

Then do

sudo start ttyS0

Notes

While serial is the most supported console(support in coreboot,seabios,serialice,ipxe,memtest etc...) it's not available on every hardware anymore, some recent devices like the Lenovo X201 or the Chromebook pixel lack a serial port...

Public domain I, the copyright holder of this work, hereby release it into the public domain. This applies worldwide.

In case this is not legally possible:
I grant anyone the right to use this work for any purpose, without any conditions, unless such conditions are required by law.