Serial console baudrate

Sep 13, 2003 10 Replies

My i586 embedded board supports a serial console for port0. When I tried using it, I found the following.



During bootup, the baudrate for this port changes at least 3 times. The bios sets it to 19200 which lasts from powerup thru the grub menu, and up until the kernel image is loaded. Once the kernel starts, the baud rate is changed to 9600 which lasts thru the kernel & network setup until just before the login prompt. At this point, the baud setting in inittab is applied.



Now when I do #reboot , it looks like the baud rate is again changed since there are some messages missing that I normally see on a crt. Can anyone verify these different baud rate regions? Have I missed any?



You can specify the baud rate to be used in all three phases: grub, kernel, getty. I recommend setting them all the same. I usually use 115200 baud.

Read the "remote serial console howto" at

formatting link

formatting link

I don't understand the question.

Grant Edwards grante Yow! YOW!! Everybody out at of the GENETIC POOL! visi.com

I'll change what I can, but there is no way to change the baud rate selected by bios, so I either match everything to 19200, or live with not seeing the bios screen.

I'll have to play with the grub settings.

On the serial console, I just see the 'rebooting now!' message, yet on the regular console, I will see three or four more messages having to do with halting, and cleaning up log files. My guess is that the kernel has once again changed the baud back to 9600 just before shutdown. Maybe this is all normal and forseeable if you understand the mechanics of it all, but I expected the getty settings to remain until shutdown.

I realize I won't always see output on the serial console for certain rate mismatches, so have I missed some other players in this 'musical chairs' baud rate game?

That's not the proper syntax for telling the kernel to do serial console. Read the HOWTO more closely.

Grant Edwards grante Yow! Did I say I was a at sardine? Or a bus??? visi.com

Look at the HOWTO aga------------------------------snip------------------------------ Example 5-4. Complete GRUB configuration, modified for serial console

default=0 timeout=10 password --md5 $1$wwmIq64O$2vofKBDL9vZKeJyaKwIeT. serial --unit=0 --speed=9600 --word=8 --parity=no --stop=1 terminal --timeout=10 serial console title Red Hat Linux (2.4.9-21) root (hd0,0) kernel /vmlinuz-2.4.9-21 ro root=/dev/hda6 console=tty0 console=ttyS0,9600n8 initrd /initrd-2.4.9-21.img title Red Hat Linux (2.4.9-21) single user mode lock root (hd0,0) kernel /vmlinuz-2.4.9-21 ro root=/dev/hda6 console=tty0 console=ttyS0,9600n8 s initrd /initrd-2.4.9-21.img

------------------------------snip------------------------------

Nope. Compare the example I snipped from the HOWTO with your GRUB configuration file. To get the kernel to use the serial port for a console you need to add "console=ttyS0,9600n8" to the "kenel" line. You can change the 9600 to anything you want.

Grant Edwards grante Yow! .. Do you like at "TENDER VITTLES?"? visi.com

s

I saw this before. It seems to be outdated. There is no console command in GRUB, or in the manual. If I try using the grub menu to add a console parameter, it just laughs.

Aside from the serial console HOWTO, where can I read about what parameters the kernel accepts and what the syntax is? I want to verify this before I waste another hour.

console=ttyS0,9600n8 s

Please look carefully at the example above.

The relevent GRUB commands are "serial" and "terminal":

serial --unit=0 --speed=9600 --word=8 --parity=no --stop=1 terminal --timeout=10 serial console

I don't know what you mean by "use the grub menu to add a console parameter". Nor do I know what you mean by grub laoughing.

The HOWTO is correct. I've done this many times... most recently about three days ago.

You use the "serial" and "terminal" grub commands to tell grub to user the serial port.

You pass the "console=********" parameter to the kernel, to tell it what to do:

kernel /vmlinuz-2.4.9-21 ro root=/dev/hda6 console=tty0 console=ttyS0,9600n8

Grant Edwards grante Yow! Here I am in the at POSTERIOR OLFACTORY LOBULE visi.com but I don't see CARL SAGAN anywhere!!

default=0 timeout=5 serial --unit=0 --speed=9600 --word=8 --parity=no --stop=1 terminal --timeout=10 serial console title TimeSys Linux root (hd0,0) kernel /boot/bzImageLB700 ro root=/dev/hda1 console=tty0 console=ttyS0,19200n8

OK, now I see. The above grub.conf really does work. The kernel line really has nothing to do with grub. It must be just a string of characters passed to the kernel. I also thought that tty0 and ttyS0 would have to be changed to something like tts/0, and they dont. It does not work quite as expected, since the serial console does not see the bios screen now (ha!), but you have once again shown me something new. thanks

The grub interactive menu you enter by hitting 'e' or 'c' when the grub screen appears. You can look at the memory map, and alter some of the boot options this way without editing the grub.conf file. As I have learned, you cannot add a console= parameter this way.

Nor do I know what you mean by grub laoughing.

"Error", "Bad command", etc.

console=ttyS0,19200n8

Right.

Exactly! The commands to grub and the commands to the kernel are two (almost) unrelated things.

Nope. The kernel isn't accessing the devices using the filesystem they way normal apps do later in the process. The kernel just has some hard-wired strings that it knows mean "the first virtual console" and "the first serial port".

However, when you set up /etc/inittab to run a getty on the serial port you will need to use the proper "filesystem" name for the device.

I've never used a BIOS that did serial, so I can't help there...

Grant Edwards grante Yow! The entire CHINESE at WOMEN'S VOLLEYBALL TEAM all visi.com share ONE personality -- and have since BIRTH!!

Interesting. I'll have to try that sometime. I've used it to change other stuff, but I don't think I've ever tried to use that method to add a "console" command.

Grant Edwards grante Yow! I want to TAKE IT at HOME and DRESS IT UP in visi.com HOT PANTS!!

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required