Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Mar 1996 20:24:39 -0800 (PST)
From:      "Doug Ambrisko" <ambrisko@ambrisko.roble.com>
To:        freebsd-current@freebsd.org
Subject:   Dual biosboot patches
Message-ID:  <199603210424.UAA13939@freebsd.ambrisko.com>

next in thread | raw e-mail | index | archive | help
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 >=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199603210424.UAA13939>