From owner-freebsd-hackers Thu Aug 13 21:32:27 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id VAA17446 for freebsd-hackers-outgoing; Thu, 13 Aug 1998 21:32:27 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from mail.camalott.com (mail.camalott.com [208.203.140.2]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id VAA17411 for ; Thu, 13 Aug 1998 21:32:10 -0700 (PDT) (envelope-from joelh@gnu.org) Received: from detlev.UUCP (tex-47.camalott.com [208.229.74.47]) by mail.camalott.com (8.8.7/8.8.5) with ESMTP id XAA11006; Thu, 13 Aug 1998 23:33:00 -0500 Received: (from joelh@localhost) by detlev.UUCP (8.9.1/8.9.1) id XAA00473; Thu, 13 Aug 1998 23:30:37 -0500 (CDT) (envelope-from joelh) Date: Thu, 13 Aug 1998 23:30:37 -0500 (CDT) Message-Id: <199808140430.XAA00473@detlev.UUCP> To: freebsd-hackers@FreeBSD.ORG Subject: Patch: Booting with -v From: Joel Ray Holveck Reply-to: joelh@gnu.org Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Okay, I've finally found my round tuit (it was in the square hole, natch). This means that I finally wrote the patch to allow -v (and other flags) to be in the /boot.config (yay!). In the process of saving a few bytes, I did change the boot message bit that says "internal", "internal/dual", "serial", or "serial/dual" to read just "internal", "serial", or "dual". Is the distinction between serial/dual and internal/dual in that message a useful one? Enclosed is the patch to /sys/i386/boot/biosboot/boot.c (against -current sources); I've tested it a total of once. Caveat emptor, and vivat hacker, and all that. If nobody has any objections, I'll submit a pr on this (after a little stylistic cleanup and a manpage change). But I would appreciate people looking over it and trying it out before I submit a patch that will leave every third system unbootable. Send results-- good, bad or indifferent-- to me personally. Again: This has been tested only once. Although I don't see any reason it should fail, be sure that you have a boot and fixit floppy and your old boot2 handy. Happy hacking, joelh -----cut here----- *** boot.c-orig Thu Aug 13 23:18:19 1998 --- boot.c Thu Aug 13 22:23:49 1998 *************** *** 86,91 **** --- 86,92 ---- boot(int drive) { int ret; + int cfg_loadflags = 0; /* Pick up the story from the Bios on geometry of disks */ *************** *** 142,177 **** name = "kernel"; if (boot_config[0] != '\0') { printf("boot.config: %s", boot_config); ! getbootdev(boot_config, &loadflags); if (openrd() != 0) name = "kernel"; } loadstart: /* print this all each time.. (saves space to do so) */ /* If we have looped, use the previous entries as defaults */ ! printf("\r \n>> FreeBSD BOOT @ 0x%x: %d/%d k of memory, %s%s console\n" ! "Boot default: %d:%s(%d,%c)%s\n" "%s\n" "boot: ", ouraddr, bootinfo.bi_basemem, bootinfo.bi_extmem, (loadflags & RB_SERIAL) ? "serial" : "internal", - (loadflags & RB_DUAL) ? "/dual" : "", dosdev & 0x7f, devs[maj], unit, 'a' + part, name ? name : "*specify_a_kernel_name*", boot_help); ! /* ! * Ignore flags from previous attempted boot, if any. ! * XXX this is now too strict. Settings given in boot.config should ! * not be changed. ! */ ! loadflags &= (RB_DUAL | RB_SERIAL); ! /* * Be paranoid and make doubly sure that the input buffer is empty. */ if (loadflags & (RB_DUAL | RB_SERIAL)) init_serial(); if (!gets(linebuf)) putchar('\n'); --- 143,177 ---- name = "kernel"; if (boot_config[0] != '\0') { printf("boot.config: %s", boot_config); ! getbootdev(boot_config, &cfg_loadflags); if (openrd() != 0) name = "kernel"; } loadstart: + /* Ignore flags from previous attempted boot, if any. */ + loadflags = cfg_loadflags; + /* print this all each time.. (saves space to do so) */ /* If we have looped, use the previous entries as defaults */ ! printf("\r \n>> FreeBSD BOOT @ 0x%x: %d/%d k of memory, %s console\n" ! "Boot default: %d:%s(%d,%c)%s (flags 0x%x)\n" "%s\n" "boot: ", ouraddr, bootinfo.bi_basemem, bootinfo.bi_extmem, + (loadflags & RB_DUAL) ? "dual" : (loadflags & RB_SERIAL) ? "serial" : "internal", dosdev & 0x7f, devs[maj], unit, 'a' + part, name ? name : "*specify_a_kernel_name*", + loadflags, boot_help); ! #if 0 /* * Be paranoid and make doubly sure that the input buffer is empty. */ if (loadflags & (RB_DUAL | RB_SERIAL)) init_serial(); + #endif if (!gets(linebuf)) putchar('\n'); *************** *** 376,382 **** char *p; /* Copy the flags to save some bytes. */ ! f = *howto; c = *ptr; for (;;) { --- 376,382 ---- char *p; /* Copy the flags to save some bytes. */ ! f = *howto & (RB_DUAL | RB_SERIAL | RB_PROBEKBD); c = *ptr; for (;;) { -----cut here----- -- Joel Ray Holveck - joelh@gnu.org - http://www.wp.com/piquan Fourth law of programming: Anything that can go wrong wi sendmail: segmentation violation - core dumped To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message