# PROBLEM: kernel/init messages don't go to serial console

## nickbrown

I have followed the widely available Remote-Serial-Console Howto and I can happily see the bootloader (lilo) messages over the serial connection, as the initial section of lilo.conf below has been setup correctly.

I can also succesfully login into the machine over the serial connection as I've added the appropriate agetty line to my inittab file (see below).

But even though I believe I have the correct append options for the kernel in my lilo.conf file (see below) and I have the correct kernel compile options (see below) I cannot see either the kernel boot messages or inits boot messages.  "dmesg" confirms that the kernel received the "console" option (see below). It would appear however that it is not using this serial console as I still see the boot/init messages on the vga console.

Below is the output I see on the serial console. (lilo prompt, followed by load linux message then nothing until the login prompt)

Does anyone have any ideas what is wrong and how to solve this?

The problem;

```
root@localhost etc # shutdown -r now

Broadcast message from root (tts/0) (Fri Apr 25 00:24:01 2003):

The system is going down for reboot NOW!

root@localhost etc #

Session terminated, killing shell... ...killed.

nick@localhost etc $

LILO 22.3.3 boot:

Loading Gentoo......................

BIOS data check successful

localhost.(none) (Linux i686 2.4.20-gentoo-r2) 00:26:18

all your base are belong to us!

localhost login: nick

Password:

Last login: Fri Apr 25 00:22:24 on 0

nick@localhost nick
```

my /etc/lilo.conf;

```
# Start LILO global section

boot=/dev/hdc

map=/boot/System.map

lba32

prompt

default=Gentoo

timeout= 50

#vga=0x31A

serial=0,9600n8

restricted

password=123456

# End LILO global section

# Linux bootable partition config begins

        image=/boot/bzImage

        root=/dev/hdc3

        label=Gentoo

        read-only # read-only for checking

        append="console=ttyS0,9600n8r"

# Linux bootable partition config ends
```

the start of dmesg;

```
Linux version 2.4.20-gentoo-r2 (root@dhcp-158-45623) (gcc version 3.2.2) #6 Wed

Apr 23 17:10:59 BST 2003

BIOS-provided physical RAM map:

 BIOS-e820: 0000000000000000 - 00000000000a0000 (usable)

 BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)

 BIOS-e820: 0000000000100000 - 000000001f7f0000 (usable)

 BIOS-e820: 000000001f7f0000 - 000000001f7f3000 (ACPI NVS)

 BIOS-e820: 000000001f7f3000 - 000000001f800000 (ACPI data)

 BIOS-e820: 00000000ffff0000 - 0000000100000000 (reserved)

503MB LOWMEM available.

On node 0 totalpages: 129008

zone(0): 4096 pages.

zone(1): 124912 pages.

zone(2): 0 pages.

Kernel command line: auto BOOT_IMAGE=Gentoo ro root=1603 console=ttyS0,9600n8r

Initializing CPU#0

Detected 531.841 MHz processor.

Console: colour VGA+ 80x25

Calibrating delay loop... 1061.68 BogoMIPS

Memory: 507084k/516032k available (1644k kernel code, 8564k reserved, 511k data,

 104k init, 0k highmem)

Checking if this processor honours the WP bit even in supervisor mode... Ok.

Dentry cache hash table entries: 65536 (order: 7, 524288 bytes)
```

What I believe are the correct kernel compile options;

```
root@localhost linux # grep VT .config

CONFIG_VT=y

CONFIG_VT_CONSOLE=y

root@localhost linux # grep SERIAL .config

CONFIG_SERIAL=y

CONFIG_SERIAL_CONSOLE=y

# CONFIG_SERIAL_EXTENDED is not set

# CONFIG_SERIAL_NONSTANDARD is not set

# CONFIG_USB_SERIAL is not set

root@localhost linux # pwd

/usr/src/linux

root@localhost linux #
```

part of me /etc/inittab;

```
# TERMINALS

co:2345:respawn:/sbin/agetty -h -L ttyS0 9600 vt102

c1:12345:respawn:/sbin/agetty 38400 tty1 linux

c2:12345:respawn:/sbin/agetty 38400 tty2 linux

c3:12345:respawn:/sbin/agetty 38400 tty3 linux

c4:12345:respawn:/sbin/agetty 38400 tty4 linux

c5:12345:respawn:/sbin/agetty 38400 tty5 linux

c6:12345:respawn:/sbin/agetty 38400 tty6 linux
```

----------

## BonezTheGoon

Moving this thread to the duplicates forum and locking in favor of the previous topic posted here.

Please do not cross post one topic into multiple forums, please choose one forum to post it in.  Later if you would like a moderator to move the thread into another forum please PM one of us and we will be happy to help.

Thanks,

BonezTheGoon

----------

## BonezTheGoon

Per nickbrown's request I am moving this thread into Hardware and Laptops from the Duplicates forum and I will move the other thread linked above that is currently in Hardware and Laptops from there to Duplicate Threads.  I am unlocking this thread and will lock the other given there is more complete and current information in this thread (according to nickbrown.)

Regards,

BonezTheGoon

----------

## SmegTheLight

I also had a LOT of problem trying to get serial ONLY console to work.

There is a lot of conflicting info out there too.

It is now working for me - BUT many things cause it to not work.. Sometimes it works on some hardware, and not on others.

Here is what I suggest :

1) Get it working with a plain vanilla kernel WITHOUT VT console selected.  This will force the kernel to put out to the serial port.  Also make this the bare minimum that you need from the kernel to make your machine run (No ACPI, No PPP, No Netfilter, etc..)

This will prove that everything else your are doing is working (Lilo, etc.).  

For me, patches to the Frame Buffer code in the Gentoo (and Wolk) kernels prevented the serial console from working.

2) On the kernel line (Grub, Lilo, etc.) I only needed "console=ttyS0,9600" (plus all your regular settings)

Some guides and papers have you put it in twice with an upper and lower case "console".. ie  "CONSOLE=" and "console="..

I am using it now, and it is working with only the line above (plus regular settings, root=, etc..)

3) After you prove that it works, put back the VT Support

```

CONFIG_VT=y

CONFIG_VT_CONSOLE=y 

```

4) If that works, try the gentoo kernel again.. Chances are that is where it will STOP working for you.  I wound up having to make my own custom kernel with just what I wanted in it (Vanilla + Preemp, etc.)

In short, it can and does work.. I currently have not a shred of info going out the video port - it all goes to com1 at 9600 baud.  It is for an embedded app and I don't want all the diag crap spewing out for the customer to see.

----------

## nickbrown

 *SmegTheLight wrote:*   

> 
> 
> 3) After you prove that it works, put back the VT Support
> 
> ```
> ...

 

I left my config exactly as it was, execpt, as you suggested, I turned these both off. 

```

# CONFIG_VT is not set

```

And then the serial console worked fine. So it would appear the VT console stuff does infact break the serial console support.

This looks like a serious bug in the kernel. I'm not sure if its specific to the gentoo kernel, but I've raised a bug report for it any how.

This needs to be fixed, as I'd really like to have virtual terminals (and thus graphics) while also being able to use the  serial console for monitoring etc.

----------

## BonezTheGoon

Please post your bug report in this thread so that others can find it easily should they need to check on it or submit information regarding it.

Thanks,

BonezTheGoon

----------

## SmegTheLight

I am pretty sure that the bug is related to something related to frame buffer support patches not in the standard kernel (as of 2.4.20).  

Well, "pretty sure" might be a bit strong..  I was very tired, and had be flying through unfamiliar kernel code at warp speed for an entire weekend trying to ressolve this problem.  I didn't document my discoveries, and all that remains in my mind is a gut feeling that it was the Frame Buffer stuff.  It is as if the console= iine is getting ignored.

When I compile a plain vanilla standard kernel, I can have both the VT and serial support turned on.  Turning off the VT in the popular "Patched" kernels simply forces the kernel to have no other choice (and / or bypasses the patched buggy code)

With that I started adding in the patches I needed (Scheduler, O(1), MPPE/MPPC, IPSEC, etc).  It's all good now.  None of those patches messed it up.  I now have my framebuffer graphics, plain old penguin logo, and serial ONLY kernel messages.  I even have an agetty running on VT2 and VT3.  VT1 is consumed by my GDK-Framebuffer app.

----------

## nickbrown

See bug report;

https://bugs.gentoo.org/show_bug.cgi?id=20025

----------

## pfeifer

has nothing to do with framebuffer patches.

you can get the patch to fix from the bug report nickbrown lists above. i have attached the fix there. it'll be in the pfeifer/gentoo-sources in the next day. i will retro it to gentoo-sources-2.4.20-r2/r3 and pfeifer-sources-2.4.20_pre8 for now.

Regards,

Jay Pfeifer

Gentoo Linux Developer

Core System/Kernel

----------

## SmegTheLight

Yeah, I was watching the bugthread.

It was awhile ago for me when I was debugging it.  It was probably a lot of coincidences all combining to lead me to belive it had to do with the fb patches.

(I was also having a lot of problems with fb logos, etc.. at the time).

I wonder what other code is/was failing because of -O3 ?   :Wink: 

----------

