Skip to contentSkip to conversation

default terminals on i386-pc / i386-ieee1275

PATCH In review Robert Millan 2 participants 3 messages Nov 12, 2008 – Nov 22, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 default terminals on i386-pc / i386-ieee1275

Hi,

I think it would be good to make at_keyboard the default input terminal on i386-ieee1275, after the kernel has loaded (via grub-mkconfig). The AT keyboard is the only choice on OLPC anyway, and avoids ofconsole bugs (this used to be the old behaviour before the terminal split).

Also, I think it would be good to make vga_text the default output terminal on i386-pc, provided that gfxterm auto-setup (in grub-mkconfig.in) wasn't possible. BIOS output is occasionally buggy (seen in a recent thread), and this way we avoid problems.

See attached patch.

Signature · 5 lines
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."

2008-11-12 Robert Millan <[email protected]>

* util/grub.d/00_header.in: Default input terminal to at_keyboard for i386-ieee1275, and default output terminal to vga_text on i386-pc.

grub.d/00_header.in +14 -0
Index: util/grub.d/00_header.in
===================================================================
@@ -22,6 +22,8 @@ prefix=@prefix@
 exec_prefix=@exec_prefix@
 libdir=@libdir@
 grub_prefix=`echo /boot/grub | sed ${transform}`
+target_cpu=@target_cpu@
+platform=@platform@
 
 . ${libdir}/grub/grub-mkconfig_lib
 
@@ -40,6 +42,18 @@ set default=${GRUB_DEFAULT}
 set timeout=${GRUB_TIMEOUT}
 EOF
 
+# Platform-specific overrides
+case ${target_cpu}-${platform} in
+  i386-ieee1275)
+    # AT keyboard is the only choice on OLPC anyway.
+    GRUB_TERMINAL_INPUT=${GRUB_TERMINAL_INPUT:-at_keyboard}
+  ;;
+  i386-pc)
+    # Garanteed to work (and sometimes avoids BIOS bugs)
+    GRUB_TERMINAL_OUTPUT=${GRUB_TERMINAL_OUTPUT:-vga_text}
+  ;;
+esac
+
 case ${GRUB_TERMINAL_INPUT}:${GRUB_TERMINAL_OUTPUT} in
   serial:* | *:serial)
     if ! test -e ${grub_prefix}/serial.mod ; then
#1 lore raw
Quoted 11 lines · Robert Millan

Hi,

I think it would be good to make at_keyboard the default input terminal on i386-ieee1275, after the kernel has loaded (via grub-mkconfig). The AT keyboard is the only choice on OLPC anyway, and avoids ofconsole bugs (this used to be the old behaviour before the terminal split).

Also, I think it would be good to make vga_text the default output terminal on i386-pc, provided that gfxterm auto-setup (in grub-mkconfig.in) wasn't possible. BIOS output is occasionally buggy (seen in a recent thread), and this way we avoid problems.

And how does this work with USB keyboards that would be supported by BIOS if configured so... ?

#2 lore raw
Quoted 8 lines · Vesa Jääskeläinen
Quoted 7 lines · Robert Millan

Hi,

I think it would be good to make at_keyboard the default input terminal on i386-ieee1275, after the kernel has loaded (via grub-mkconfig). The AT keyboard is the only choice on OLPC anyway, and avoids ofconsole bugs (this used to be the old behaviour before the terminal split).

Quoted 7 lines
Quoted 4 lines

Also, I think it would be good to make vga_text the default output terminal on i386-pc, provided that gfxterm auto-setup (in grub-mkconfig.in) wasn't possible. BIOS output is occasionally buggy (seen in a recent thread), and this way we avoid problems.

And how does this work with USB keyboards that would be supported by BIOS if configured so... ?

On i386-ieee1275, this doesn't really happen, because OFW shuts down USB when handing control to GRUB. Note that using at_keyboard was the existing behaviour up untill recently (it reverted to ofconsole because of the terminal split).

On PC/BIOS, my proposed change would only affect terminal output.

Signature · 5 lines
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."