OpenBSD Journal

What's New in 4.3: Serial Console Improvements

Contributed by merdely on from the cereal-install dept.

Ken Westerback (krw@) submitted this explanation of the new serial console changes in 4.3:

Prior to 4.3 there was limited support for the automatic configuration of serial consoles during the install process. The install script for i386 and amd64 offered the user the chance to automatically enable the first serial device found in the dmesg as a serial port.

Ken continues below.

Then David Gwynne (dlg@) got a newish Sun sparc64 box whose serial console speed was 115200 and thus did not work with the default /etc/ttys 'console' entry which specified a speed of 9600. After this bit him, dlg@ expressed an interest in having the speed of the serial console automatically detected and set in the installed /etc/ttys. Theo pointed out that stty(1) was on the install media and 'stty speed' would reveal the speed of the console being used to install. As a result the install script (install.sh) was changed so that it used 'stty speed' to detect the speed of the console being used to install, and modified the 'console' entry of the installed /etc/ttys appropriately. The modification is only done if the 'console' entry is 'on' in /etc/ttys.

This modification made dlg@ happy.

After some thought it was realized that this meant serial consoles now 'just work' on all architectures that make use of the 'console' entry. i.e. all of our architectures except i386, amd64, macppc, alpha and zaurus.

Theo then pointed out that the dmesg on all architectures should have a line that specifies the serial console device, e.g. 'pccom0: console' on i386. It turned out that this wasn't quite true but some quick work by Miod Vallat (miod@) and Mark Kettenis (kettenis@) among others made it so. Then it was noticed that the /etc/ttys entries had unnecessarily diverged in their 'getty' fields. miod@ modified them to all use '... std.9600', give or take a speed or two.

With this done, it was possible to re-do the serial console logic used for i386/amd64 and offer it to alpha, macppc, and zaurus. This generalization even shrank the install scripts.

As a result, on 4.3 most architectures have serial consoles that 'just work'. The others now offer the chance to configure a device as a serial console if a serial device is discovered in the dmesg. The default choice of device and speed will the the current console or the first serial device found, and the default speed will be current console speed, or '9600'.

More "New in 4.3" features to come...

(Comments are closed)


Comments
  1. By Anonymous Coward (169.244.143.114) on

    "This generalization even shrank the install scripts."
    I love improvements that make things smaller and more simple. This is so often the case with OpenBSD.

    Complexity is the enemy.

    Comments
    1. By Anonymous Coward (213.221.123.174) on

      > "This generalization even shrank the install scripts."
      > I love improvements that make things smaller and more simple. This is so often the case with OpenBSD.
      >
      > Complexity is the enemy.

      Jupp.. I remember that once a driver was rewritten wich supported afterwards more devices and was even smaler. :-)

      And OT: Even it's not related to "serial" consoles: The FAQ about clearing the screen on i386/AMD64 after logout may needs to get updated. Maybe it's just me and my friend but the instructions don't seam to have any effect anymore. I updated a FW and noticed that (I didn't backup'ed the /etc/getty*) but maybe I did something wrong.

      Comments
      1. By Tony (83.168.236.15) on

        > ... The FAQ about clearing the screen on i386/AMD64 after logout may needs to get updated. Maybe it's just me and my friend but the instructions don't seam to have any effect anymore. I updated a FW and noticed that (I didn't backup'ed the /etc/getty*) but maybe I did something wrong.

        I confirm it does not work.

    2. By Anonymous Coward (85.19.140.12) on

      > I love improvements that make things smaller and more simple. This is
      > so often the case with OpenBSD.

      That is why I love OpenBSD. I used Debian on my desktop before, but now I use OpenBSD. Personally I don't see a great deal of changes between every release (except for cool CD-set covers and the new song, plus dozens of small changes, new devices being supported and a new tool or two), and that is what makes OpenBSD the OS it is. Small, incremental, changes. Or, as they say, "evolutionary rather than revolutionary". It is an OS I can trust.

  2. By Matthew Dempsky (2001:470:805a:1:21b:63ff:feca:36df) on

    This sounds very cool. Just this morning I was playing with IPMI on one of our PowerEdge SC1435 to do serial-over-lan, and now I'll have to see if I can use it to remotely install OpenBSD. :-)

    It's always nice to hear stories about these little improvements that I would probably have otherwise missed.

  3. By Dean (75.166.167.135) on

    So how does one use a USB Serial- controller to manage the boot?
    On a Dell Optiplex GX260 -i386
    I have one that shows up as:
    uplcom0 at uhub3
    port 2 "Prolific Technology Inc. USB-Serial Controller D" rev 1.10/3.00 addr 2
    ucom0 at uplcom0

    I can talk through it after booting up using:

    cu -l cuaU0

    But when I boot up I see the line pc0 com0 and if I try:
    set tty com0 I get output if I am connected to the seriai port on the Dell
    with the USB Serial controller in:
    set tty com1 nothing
    set tty cuaU0 nothing

    on the laptop at the end of the cable.

    What sort of tricks are there for using it to capture the inital bootup?
    And even more, what if I boot from a USB drive, and want to capture using a USB Serial converter, since some newer ones don't have any serial ports.?

    Comments
    1. By Brad (2001:470:8802:3:216:41ff:fe17:6933) brad at comstyle dot com on

      > So how does one use a USB Serial- controller to manage the boot?
      > On a Dell Optiplex GX260 -i386
      > I have one that shows up as:
      > uplcom0 at uhub3
      > port 2 "Prolific Technology Inc. USB-Serial Controller D" rev 1.10/3.00 addr 2
      > ucom0 at uplcom0
      >
      > I can talk through it after booting up using:
      >
      > cu -l cuaU0
      >
      > But when I boot up I see the line pc0 com0 and if I try:
      > set tty com0 I get output if I am connected to the seriai port on the Dell
      > with the USB Serial controller in:
      > set tty com1 nothing
      > set tty cuaU0 nothing
      >
      > on the laptop at the end of the cable.
      >
      > What sort of tricks are there for using it to capture the inital bootup?
      > And even more, what if I boot from a USB drive, and want to capture using a USB Serial converter, since some newer ones don't have any serial ports.?

      This is not possible. Only with real serial ports.

      Comments
      1. By robot (209.180.254.41) on

        > > since some newer ones don't have any serial ports.?
        >
        > This is not possible. Only with real serial ports.

        That explains why I couldn't get it to work for me either, my DellE521 doesn't have any real serial ports, and it hangs part way through a test boot. Makes it hard to diagnose.

  4. By jared spiegel (70.101.0.7) jrrs@ice-nine.org on

    what could be the next improvement? having i386 stage one boot loader work with more than just 9600? i've tried fricking with the code (there's a function that just returns '9600' when called, but changing it to, say, 57600, didn't do anything noticable after recompile boot and reinst bootloader) and i get nowhere. i'm down with 9600, but sometimes it sucks a bit. tho maybe it's my fault and it should be as simple as changing the output of that function and i'm doing something wrong.

  5. By jared spiegel (70.101.0.7) jrrs@ice-nine.org on

    ^^ like, so 'boot>' shows up and you can type things to it. everything after 'boot>' i get with other speeds by 'stty com0 blahblah' just fine, but the prompt itself i have never seen with anything but 9600

    Comments
    1. By Cereal Offender (218.214.194.113) on

      > ^^ like, so 'boot>' shows up and you can type things to it. everything after 'boot>' i get with other speeds by 'stty com0 blahblah' just fine, but the prompt itself i have never seen with anything but 9600

      Isn't this a function of the hardware/BIOS at boot time?

      Soekris devices have a BIOS command to set the boot baudrate and the Commell motherboards allow serial access to the BIOS screen provided you asked for it in a BIOS setting.

      After that OpenBSD Just Works (TM) and all that is needed is to set the same baudrate in the question at the end of the first phase of the install process.

      What makes the gear you are talking about any different?

  6. By Anonymous Coward (24.222.223.104) on

    I sounds as though it may be possible to modify the install script so that installation could actually take place via a serial console (if so desired). Is this possible?

    Comments
    1. By Anonymous Coward (67.191.230.222) on

      > I sounds as though it may be possible to modify the install script so that installation could actually take place via a serial console (if so desired). Is this possible?
      >

      Yes

Latest Articles

Credits

Copyright © - Daniel Hartmeier. All rights reserved. Articles and comments are copyright their respective authors, submission implies license to publish on this web site. Contents of the archive prior to as well as images and HTML templates were copied from the fabulous original deadly.org with Jose's and Jim's kind permission. This journal runs as CGI with httpd(8) on OpenBSD, the source code is BSD licensed. undeadly \Un*dead"ly\, a. Not subject to death; immortal. [Obs.]