From owner-freebsd-current Wed Mar 20 20:31:07 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id UAA08155 for current-outgoing; Wed, 20 Mar 1996 20:31:07 -0800 (PST) Received: from ambrisko.roble.com (ambrisko@netcom5.netcom.com [192.100.81.113]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id UAA08098 for ; Wed, 20 Mar 1996 20:30:56 -0800 (PST) Received: from freebsd.ambrisko.com (freebsd [1.1.1.1]) by ambrisko.roble.com (8.6.12/8.6.9) with ESMTP id UAA24134 for ; Wed, 20 Mar 1996 20:25:56 -0800 Received: (from ambrisko@localhost) by freebsd.ambrisko.com (8.6.12/8.6.9) id UAA13939 for freebsd-current@freebsd.org; Wed, 20 Mar 1996 20:24:40 -0800 Message-Id: <199603210424.UAA13939@freebsd.ambrisko.com> Subject: Dual biosboot patches To: freebsd-current@freebsd.org Date: Wed, 20 Mar 1996 20:24:39 -0800 (PST) From: "Doug Ambrisko" X-Mailer: ELM [version 2.4 PL25 ME8b] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Here are the patches to support the bios boot prompt messages on both the serial and graphics console at the same time. Input and output is echoed to both devices. At this time no probe is done for com1 which could be a problem. This code should work okay with a mouse on COM1 since it filters out any non-printable ascii characters. Doug A. *** Makefile Fri Mar 8 01:43:54 1996 --- makefile Sun Mar 17 19:27:24 1996 *************** *** 3,10 **** PROG= boot # Order is very important on the SRCS line for this prog ! SRCS= start.S table.c boot2.S boot.c asm.S bios.S serial.S ! SRCS+= probe_keyboard.c io.c disk.c sys.c BINDIR= /usr/mdec BINMODE= 444 --- 3,10 ---- PROG= boot # Order is very important on the SRCS line for this prog ! SRCS= start.S table.c boot2.S boot.c asm.S bios.S serial.S ! SRCS+= probe_keyboard.c io.c disk.c sys.c BINDIR= /usr/mdec BINMODE= 444 *************** *** 15,20 **** --- 15,21 ---- # Probe the keyboard and use the serial console if the keyboard isn't found. #CFLAGS+= -DPROBE_KEYBOARD + CFLAGS+= -DDUAL_PROMPT # Force use of the serial console (after probing the keyboard if # PROBE_KEYBOARD is defined). *** boot.c Fri Mar 8 01:43:54 1996 --- boot.mod.c Sun Mar 17 21:40:41 1996 *************** *** 75,80 **** --- 75,83 ---- { int ret; + #ifdef DUAL_PROMPT + init_serial(); + #endif #ifdef PROBE_KEYBOARD if (probe_keyboard()) { init_serial(); *** io.c Fri Mar 8 01:43:54 1996 --- io.mod.c Sun Mar 17 21:35:49 1996 *************** *** 121,126 **** --- 121,134 ---- void putchar(int c) { + #ifdef DUAL_PROMPT + if (c == '\n') { + serial_putc('\r'); + putc('\r'); + } + serial_putc(c); + putc(c); + #else if (c == '\n') { if (loadflags & RB_SERIAL) serial_putc('\r'); *************** *** 131,136 **** --- 139,145 ---- serial_putc(c); else putc(c); + #endif } int *************** *** 139,145 **** int c; loop: ! if ((c = ((loadflags & RB_SERIAL) ? serial_getc() : getc())) == '\r') c = '\n'; if (c == '\b') { if (in_buf != 0) { --- 148,168 ---- int c; loop: ! #ifdef DUAL_PROMPT ! if(serial_ischar()){ ! c=serial_getc(); ! /* ignore bad characters that may come from the mouse */ ! if (!( (c>=32 && c<=127) || ! c == '\n' || c == '\r' || c == 8 )) goto loop; ! } else if(ischar()) { ! c=getc(); ! } else { ! goto loop; ! } ! #else ! c = ((loadflags & RB_SERIAL) ? serial_getc() : getc()) ! #endif ! if (c == '\r') c = '\n'; if (c == '\b') { if (in_buf != 0) { *************** *** 199,205 **** --- 222,232 ---- for (initial_bios_tick = bios_tick; bios_tick - initial_bios_tick < BOOTWAIT / BIOS_TICK_MS;) #endif + #ifdef DUAL_PROMPT + if (serial_ischar() || ischar()) + #else if ((loadflags & RB_SERIAL) ? serial_ischar() : ischar()) + #endif for (;;) { switch(*ptr = getchar(ptr - buf) & 0xff) { case '\n': *************** *** 217,223 **** --- 244,254 ---- #error "TIMEOUT without BOOTWAIT" #endif for (initial_bios_tick = bios_tick;;) { + #ifdef DUAL_PROMPT + if (serial_ischar() || ischar()) + #else if ((loadflags & RB_SERIAL) ? + #endif serial_ischar() : ischar()) break; if (bios_tick - initial_bios_tick >=