Remote Serial Console HOWTO
Prev Chapter 10. Configuring a kernel to support serial console Next

10.3. Linux kernel version 2.2

The later Linux 2.2 kernels use the same build parameters and parameter syntax as the Linux version 2.4 kernels.

For earlier kernels see the article by Francesco Conti in issue 36 of Linux Journal published in April 1997.

This article included some patches for the kernel, which have been extended in the notes below to use a broader range of serial port speeds.

Choose to use the serial console by adding a couple of #defines at the start of /usr/src/linux/drivers/char/console.c :

#define CONFIG_SERIAL_ECHO
#define SERIAL_ECHO_PORT 0x3f8  /* COM1 port address */

Alternatively, to use ttyS1 use these lines:

#define CONFIG_SERIAL_ECHO
#define SERIAL_ECHO_PORT 0x2f8  /* COM2 port address */

The kernel assumes a serial link speed of 9600 bps . If you are using a differing bit rate then find these two lines:

serial_echo_outb(0x00, UART_DLM); /* 9600 baud */
serial_echo_outb(0x0c, UART_DLL);

and change 0x0c to one of the values in Table 10-1 .

Table 10-1. IBM-PC/AT serial port bit rates and their bit-clock divisors

Bit Rate Divisor
115200 bps 0x01
57600 bps 0x02
38400 bps 0x03
19200 bps 0x06
9600 bps 0x0c
4800 bps 0x18
2400 bps 0x30
1200 bps 0x60

Prev Home Next
Linux kernel version 2.4 Up Serial cabling