diff -u -r /usr/src/redhat/BUILD/aboot-0.5/Makefile aboot-0.5/Makefile --- /usr/src/redhat/BUILD/aboot-0.5/Makefile Wed Sep 1 08:32:29 1999 +++ aboot-0.5/Makefile Wed Sep 1 09:58:49 1999 @@ -49,6 +49,7 @@ head.o aboot.o cons.o utils.o \ zip/misc.o zip/unzip.o zip/inflate.o LIBS = lib/libaboot.a +OBJSTRIP = tools/objstrip all: diskboot diff -u -r /usr/src/redhat/BUILD/aboot-0.5/cons.c aboot-0.5/cons.c --- /usr/src/redhat/BUILD/aboot-0.5/cons.c Mon Jun 24 18:45:20 1996 +++ aboot-0.5/cons.c Wed Sep 1 11:32:54 1999 @@ -15,18 +15,35 @@ long -cons_puts(const char *str, long len) +cons_puts(const char *str) { - long remaining, written; + long total_written = 0; - for (remaining = len; remaining; remaining -= written) { - written = dispatch(CCB_PUTS, cons_dev, str, remaining); - if (written < 0) { - halt(); /* better than random crash... */ + /* Expand \n to \r\n as we go. */ + + while (*str) { + long len; + const char *e = str; + + if (*str == '\n') { + if (dispatch(CCB_PUTS, cons_dev, "\r", 1) < 0) + halt(); /* better than random crash... */ + ++e; + } + + e = strchr(e, '\n') ? : strchr(e, '\0'); + len = e - str; + + while (len > 0) { + long written = dispatch(CCB_PUTS, cons_dev, str, len); + if (written < 0) + halt(); /* better than random crash... */ + len -= written & 0xffffffff; + str += written & 0xffffffff; + total_written = total_written + written; } - str += written; } - return len; + return total_written; } void @@ -36,7 +53,7 @@ buf[0] = c; buf[1] = 0; - cons_puts(buf,1); + cons_puts(buf); } int diff -u -r /usr/src/redhat/BUILD/aboot-0.5/disk.c aboot-0.5/disk.c --- /usr/src/redhat/BUILD/aboot-0.5/disk.c Wed Sep 1 08:32:29 1999 +++ aboot-0.5/disk.c Fri Aug 20 03:57:33 1999 @@ -440,8 +440,9 @@ if (get_default_args(fs, buf, opt) >= 0) break; opt = 'i'; /* failed---ask user */ - } else if (opt == 'i' || opt == 'h' || opt == '?') { - if (opt == 'h' || opt == '?') { + } else if (opt == 'i' || opt == 'I' || + opt == 'h' || opt == 'H' || opt == '?') { + if (opt == 'h' || opt == 'H' || opt == '?') { if (!fs) { fs = mount_fs(dev, part); if (!fs) { diff -u -r /usr/src/redhat/BUILD/aboot-0.5/include/cons.h aboot-0.5/include/cons.h --- /usr/src/redhat/BUILD/aboot-0.5/include/cons.h Mon Oct 30 20:43:53 1995 +++ aboot-0.5/include/cons.h Sun Jun 20 23:47:29 1999 @@ -3,7 +3,7 @@ extern long cons_dev; /* console device */ -extern long cons_puts (const char *str, long len); +extern long cons_puts (const char *str); extern long cons_getenv (long index, char *envval, long maxlen); extern long cons_open (const char *devname); extern long cons_close (long dev); diff -u -r /usr/src/redhat/BUILD/aboot-0.5/net.c aboot-0.5/net.c --- /usr/src/redhat/BUILD/aboot-0.5/net.c Tue Jul 2 21:49:01 1996 +++ aboot-0.5/net.c Wed Sep 1 09:33:03 1999 @@ -79,7 +79,7 @@ if (nbytes <= 0) kernel_args[0] = '\0'; - while (kernel_args[0] == 'i' && !kernel_args[1]) { + while ((kernel_args[0] == 'i' || kernel_args[0] == 'I') && !kernel_args[1]) { printf("Enter kernel arguments:\n"); printf("aboot> "); getline(kernel_args, sizeof(kernel_args)); diff -u -r /usr/src/redhat/BUILD/aboot-0.5/utils.c aboot-0.5/utils.c --- /usr/src/redhat/BUILD/aboot-0.5/utils.c Sat May 11 02:28:07 1996 +++ aboot-0.5/utils.c Wed Sep 1 11:30:16 1999 @@ -19,32 +19,13 @@ { static char buf[1024]; va_list args; - long len, num_lf; - char *src, *dst; + long len; va_start(args, fmt); len = vsprintf(buf, fmt, args); va_end(args); - /* count number of linefeeds in string: */ - - num_lf = 0; - for (src = buf; *src; ++src) { - if (*src == '\n') { - ++num_lf; - } - } - - if (num_lf) { - /* expand each linefeed into carriage-return/linefeed: */ - for (dst = src + num_lf; src >= buf; ) { - if (*src == '\n') { - *dst-- = '\r'; - } - *dst-- = *src--; - } - } - return cons_puts(buf, len + num_lf); + return cons_puts(buf); }