summaryrefslogtreecommitdiffstats
path: root/sys/boot/sparc64/loader
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2004-04-04 05:24:13 +0000
committermarcel <marcel@FreeBSD.org>2004-04-04 05:24:13 +0000
commite7ecc9ae6fa53a6265a39660488788930d937f62 (patch)
tree091c264f3a9a6caaeb85cb1b5f40000e1d8f844c /sys/boot/sparc64/loader
parentb64f06a33fc10f92f2dd77c94e67cfaeeff6b980 (diff)
downloadFreeBSD-src-e7ecc9ae6fa53a6265a39660488788930d937f62.zip
FreeBSD-src-e7ecc9ae6fa53a6265a39660488788930d937f62.tar.gz
To quote the submitter:
"...If "keyboard" is the selected input-device and "screen" the output-device (both via /options) but the keyboard is unplugged, OF automatically switches to ttya for the console, it even prints a line telling so on "screen". Solaris respects this behaviour and uses ttya as the console in this case and people probably expect FreeBSD to do the same (it's also very handy to temporarily switch consoles)..." "...I changed the comparison of the console device with "ttya" || "ttyb" to "tty" because on AXe boards all 4 onboard UARTs end in SUB-D connectors (ttya and ttyb being 16550 and ttyc and ttyd a SAB82532) and there's no Sun keyboard connector (but PS/2). If one plugs a serial card in a box there also can be more than just ttya and ttyb available for a console..." Submitted by: Marius Strobl <marius@alchemy.franken.de> Has no doubt that the change is correct: marcel
Diffstat (limited to 'sys/boot/sparc64/loader')
-rw-r--r--sys/boot/sparc64/loader/metadata.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/sys/boot/sparc64/loader/metadata.c b/sys/boot/sparc64/loader/metadata.c
index cfb9879..6a9506c 100644
--- a/sys/boot/sparc64/loader/metadata.c
+++ b/sys/boot/sparc64/loader/metadata.c
@@ -69,7 +69,7 @@ static struct
int
md_getboothowto(char *kargs)
{
- char buf[32];
+ char buf[32], buf2[32];
phandle_t options;
char *cp;
int howto;
@@ -131,9 +131,21 @@ md_getboothowto(char *kargs)
if (getenv(howto_names[i].ev) != NULL)
howto |= howto_names[i].mask;
options = OF_finddevice("/options");
- OF_getprop(options, "output-device", buf, sizeof(buf));
- if (strcmp(buf, "ttya") == 0 || strcmp(buf, "ttyb") == 0)
+ OF_getprop(options, "input-device", buf, sizeof(buf));
+ OF_getprop(options, "output-device", buf2, sizeof(buf2));
+ if (strncmp(buf, "tty", sizeof("tty") - 1) == 0 && strncmp(buf2, "tty",
+ sizeof("tty") - 1) == 0)
+ howto |= RB_SERIAL;
+ else if (strcmp(buf, "keyboard") == 0 && strcmp(buf2, "screen") == 0) {
+ phandle_t chosen;
+ ihandle_t stdin, stdout;
+
+ chosen = OF_finddevice("/chosen");
+ OF_getprop(chosen, "stdin", &stdin, sizeof(stdin));
+ OF_getprop(chosen, "stdout", &stdout, sizeof(stdout));
+ if (OF_instance_to_package(stdin) == OF_instance_to_package(stdout))
howto |= RB_SERIAL;
+ }
return(howto);
}
OpenPOWER on IntegriCloud