Project

General

Profile

Actions

Bug #6834

closed

GRUB tries to use nonexistent serial port

Added by Robert Mustacchi over 6 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Category:
bootloader
Start date:
2016-03-29
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

In serial_hw_init(), GRUB will happily try to use the port even if the address is 0. Since serial_hw_get_port() returns the firmware's port address which is 0 to indicate no port, we need to fail in that case.

We also don't properly fail if the firmware lies to us, which means we'll happily use a nonexistent port with a valid address. In either case, we'll usually end up in the delay loop in serial_hw_put() for every single character.

Instead, we need to do two things, at minimum: first, fail on port 0; second, write and read back the UART's scratch register and verify the contents, failing if they don't match. This is what asy(7d) does.

There's a second enhancement that's really needed here, which is to have GRUB support an "all-consoles" option that will send output to and accept input from every working serial port. Without this but with the above changes, there's no fallback if the unit specified in the configuration file does not exist/work. That will be covered by a separate RFE.

Actions #1

Updated by Electric Monk over 6 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 5626beece2e5dedec7197ecf325cfaa1854a6c2e

commit  5626beece2e5dedec7197ecf325cfaa1854a6c2e
Author: Keith M Wesolowski <wesolows@foobazco.org>
Date:   2016-04-08T20:26:43.000Z

    6834 GRUB tries to use nonexistent serial port
    6835 GRUB should allow multiple serial consoles
    Reviewed by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
    Approved by: Richard Lowe <richlowe@richlowe.net>

Actions

Also available in: Atom PDF