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
This commit is contained in:
parent
f987d8d1d6
commit
fa662cc9b2
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user