Re: Serial Console mini HOWTO

Ulrich Windl (Ulrich.Windl@rz.uni-regensburg.de)
Thu, 2 May 1996 12:28:11 +0200


On 1 May 96 at 19:46, Larry McVoy wrote:

> I suffered to get this to work, you shouldn't have to. There is a patch below
> that you need to apply, I'll ship it to Linus too.
[...]
>
> *** 3.91/init/main.c Tue Apr 16 00:27:09 1996
> --- linux/init/main.c Tue Apr 30 11:30:10 1996
> ***************
> *** 57,62 ****
> --- 57,63 ----
> extern long pci_init(long, long);
> extern void sysctl_init(void);
>
> + extern void console_setup(char *str, int *ints);
> extern void no_scroll(char *str, int *ints);
> extern void swap_setup(char *str, int *ints);
> extern void buff_setup(char *str, int *ints);
> ***************
> *** 213,218 ****
> --- 221,227 ----
> } bootsetups[] = {
> { "reserve=", reserve_setup },
> { "profile=", profile_setup },
> + { "console=", console_setup },
> #ifdef CONFIG_BLK_DEV_RAM
> { "ramdisk_start=", ramdisk_start_setup },
> { "load_ramdisk=", load_ramdisk },
>
> *** old/drivers/char/console.c Wed Mar 20 01:39:51 1996
> --- linux/drivers/char/console.c Wed May 1 00:43:16 1996
> ***************
> *** 183,188 ****
> --- 183,189 ----
> static long blank_origin, blank__origin, unblank_origin;
>
>
> + #define CONFIG_SERIAL_ECHO
> #ifdef CONFIG_SERIAL_ECHO
>
> #include <linux/serial_reg.h>
> ***************
> *** 190,201 ****
> extern int serial_echo_init (int base);
> extern int serial_echo_print (const char *s);
>
> - /*
> - * this defines the address for the port to which printk echoing is done
> - * when CONFIG_SERIAL_ECHO is defined
> - */
> - #define SERIAL_ECHO_PORT 0x3f8 /* COM1 */
> -
> static int serial_echo_port = 0;
>
> #define serial_echo_outb(v,a) outb((v),(a)+serial_echo_port)
> ***************
> *** 292,302 ****
> --- 287,309 ----
> comstat = serial_echo_inb(UART_RX); /* COM? RBR */
> serial_echo_outb(0x00, UART_IER); /* Disable all interrupts */
>
> + printk("Serial console on ttyS%d\n", base == 0x2f8 ? 0 : 1);

I'm not sure whether this is always correct. I can change port
addresses in BIOS. What about more that two serial ports?

Ulrich