Serial console baudrate

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
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?


Re: Serial console baudrate

Quoted text here. Click to load it

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 www.tldp.org:

http://www.tldp.org/HOWTO/Remote-Serial-Console-HOWTO /

Quoted text here. Click to load it

I don't understand the question.

Quoted text here. Click to load it

--
Grant Edwards                   grante             Yow!  YOW!! Everybody out
                                  at               of the GENETIC POOL!
We've slightly trimmed the long signature. Click to see the full one.
Re: Serial console baudrate

Quoted text here. Click to load it
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.

Quoted text here. Click to load it

I'll have to play with the grub settings.
Quoted text here. Click to load it
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?


Re: Serial console baudrate

Quoted text here. Click to load it

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???
We've slightly trimmed the long signature. Click to see the full one.
Re: Serial console baudrate

Quoted text here. Click to load it

Look at the HOWTO again. My copy says:

------------------------------snip------------------------------
Example 5-4. Complete GRUB configuration, modified for serial console


default=0
timeout10%
password --md5 $1$wwmIq64O$2vofKBDL9vZKeJyaKwIeT.
serial --unit=0 --speed96%00 --word=8 --parity=no --stop=1
terminal --timeout10% 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------------------------------

Quoted text here. Click to load it

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?"?
We've slightly trimmed the long signature. Click to see the full one.
Re: Serial console baudrate



Quoted text here. Click to load it
s
Quoted text here. Click to load it
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.






Re: Serial console baudrate

Quoted text here. Click to load it
console=ttyS0,9600n8 s
Quoted text here. Click to load it


Please look carefully at the example above.  

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

   serial --unit=0 --speed96%00 --word=8 --parity=no --stop=1
   terminal --timeout10% serial console

Quoted text here. Click to load it

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.

Quoted text here. Click to load it

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
We've slightly trimmed the long signature. Click to see the full one.
Re: Serial console baudrate
Quoted text here. Click to load it

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.
Quoted text here. Click to load it
"Error", "Bad command", etc.


Re: Serial console baudrate

Quoted text here. Click to load it

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
We've slightly trimmed the long signature. Click to see the full one.
Re: Serial console baudrate
default=0
timeout=5
serial --unit=0 --speed96%00 --word=8 --parity=no --stop=1
terminal --timeout10% 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


Re: Serial console baudrate
Quoted text here. Click to load it
console=ttyS0,19200n8
Quoted text here. Click to load it

Right.


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

Quoted text here. Click to load it

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.

Quoted text here. Click to load it

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

Quoted text here. Click to load it

--
Grant Edwards                   grante             Yow!  The entire CHINESE
                                  at               WOMEN'S VOLLEYBALL TEAM all
We've slightly trimmed the long signature. Click to see the full one.

Site Timeline