Module Name: src Committed By: mlelstv Date: Sat Nov 9 12:43:12 UTC 2024
Modified Files: src/sys/arch/i386/stand/pxeboot: main.c Log Message: Support baudrate in consdev command. To generate a diff of this commit: cvs rdiff -u -r1.32 -r1.33 src/sys/arch/i386/stand/pxeboot/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/i386/stand/pxeboot/main.c diff -u src/sys/arch/i386/stand/pxeboot/main.c:1.32 src/sys/arch/i386/stand/pxeboot/main.c:1.33 --- src/sys/arch/i386/stand/pxeboot/main.c:1.32 Tue Sep 7 11:41:32 2021 +++ src/sys/arch/i386/stand/pxeboot/main.c Sat Nov 9 12:43:12 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.32 2021/09/07 11:41:32 nia Exp $ */ +/* $NetBSD: main.c,v 1.33 2024/11/09 12:43:12 mlelstv Exp $ */ /* * Copyright (c) 1996 @@ -187,7 +187,7 @@ command_help(char *arg) printf("commands are:\n" "boot [filename] [-acdsqv]\n" " (ex. \"netbsd.old -s\"\n" - "consdev {pc|com[0123]|com[0123]kbd|auto}\n" + "consdev {pc|{com[0123]|com[0123]kbd|auto}[,{speed}]}\n" "vesa {modenum|on|off|enabled|disabled|list}\n" "multiboot [filename] [<args>]\n" "modules {on|off|enabled|disabled}\n" @@ -239,17 +239,36 @@ void command_consdev(char *arg) { const struct cons_devs *cdp; - + char *sep; + int speed; + + sep = strchr(arg, ','); + if (sep != NULL) + *sep++ = '\0'; + for (cdp = cons_devs; cdp->name; cdp++) { - if (!strcmp(arg, cdp->name)) { - initio(cdp->tag); - clearit(); - print_bootcfg_banner(bootprog_name, bootprog_rev); - return; - } - } + if (strcmp(arg, cdp->name) != 0) + continue; + + if (sep != NULL) { + if (cdp->tag == CONSDEV_PC) + goto error; + + speed = atoi(sep); + if (speed < 0) + goto error; + boot_params.bp_conspeed = speed; + } + + initio(cdp->tag); + clearit(); + print_bootcfg_banner(bootprog_name, bootprog_rev); + return; + } +error: printf("invalid console device.\n"); } + void command_modules(char *arg) {