Import 2.2.8pre2
[davej-history.git] / Documentation / serial-console.txt
blob2894b8008110f039d71a746abd1af6a75b86fb8e
1                        Linux Serial Console
3 It is possible to specify multiple devices for console output. You can
4 define a new kernel command line option to select which device(s) to
5 use for console output.
7 The format of this option is:
9         console=device,options
11         device:         tty0 for the foreground virtual console
12                         ttyX for any other virtual console
13                         ttySx for a serial port
15         options:        depend on the driver. For the serial port this
16                         defines the baudrate/parity/bits of the port,
17                         in the format BBBBPN, where BBBB is the speed,
18                         P is parity (n/o/e), and N is bits. Default is
19                         9600n8. The maximum baudrate is 115200.
21 You can specify multiple console= options on the kernel command line.
22 Output will appear on all of them. The last device will be used when
23 you open /dev/console. So, for example:
25         console=ttyS1,9600 console=tty0
27 defines that opening /dev/console will get you the current foreground
28 virtual console, and kernel messages will appear on both the VGA
29 console and the 2nd serial port (ttyS1 or COM2) at 9600 baud.
31 Note that you can only define one console per device type (serial, video).
33 If no console device is specified, the first device found capable of
34 acting as a system console will be used. At this time, the system
35 first looks for a VGA card and then for a serial port. So if you don't
36 have a VGA card in your system the first serial port will automatically
37 become the console.
39 You will need to create a new device to use /dev/console. The official
40 /dev/console is now character device 5,1.
42 Here's an example that will use /dev/ttyS1 (COM2) as the console.
43 Replace the sample values as needed.
45 1. Create /dev/console (real console) and /dev/tty0 (master virtual
46    console):
48    cd /dev
49    rm -f console tty0
50    mknod -m 622 console c 5 1
51    mknod -m 622 tty0 c 4 0
53 2. LILO can also take input from a serial device. This is a very
54    useful option. To tell LILO to use the serial port:
55    In lilo.conf (global section): 
57    serial  = 1,9600n8 (ttyS1, 9600 bd, no parity, 8 bits)
59 3. Adjust to kernel flags for the new kernel,
60    again in lilo.conf (kernel section)
62    append = "console=ttyS1,9600" 
64 4. Init and /etc/ioctl.save
66    Sysvinit remembers its stty settings in a file in /etc, called
67    `/etc/ioctl.save'. REMOVE THIS FILE before using the serial
68    console for the first time, because otherwise init will probably
69    set the baudrate to 38400 (baudrate of the virtual console).
71 5. /dev/console and X
72    Programs that want to do something with the virtual console usually
73    open /dev/console. If you have created the new /dev/console device,
74    and your console is NOT the virtual console some programs will fail.
75    Those are programs that want to access the VT interface, and use
76    /dev/console instead of /dev/tty0. Some of those programs are:
78    Xfree86, svgalib, gpm, SVGATextMode
80    I have binary patched the above mentioned programs to use "tty0"
81    instead of "console".  This will be reported to the maintainers of
82    said programs.
84    Note that if you boot without a console= option (or with
85    console=/dev/tty0), /dev/console is the same as /dev/tty0. In that
86    case everything will still work.
88 6. Thanks
90    Thanks to Geert Uytterhoeven <Geert.Uytterhoeven@cs.kuleuven.ac.be>
91    for porting the patches from 2.1.4x to 2.1.6x for taking care of
92    the integration of these patches into m68k, ppc and alpha.
94 Miquel van Smoorenburg <miquels@cistron.nl>, 21-Mar-1998