From 7f3d2452320394dccd35802fb6ca523094e5ef8a Mon Sep 17 00:00:00 2001 From: rnordier Date: Sun, 10 Jan 1999 14:48:05 +0000 Subject: [PATCH] Use etc/make.conf settings for serial port and speed. Submitted by: rvb Reviewed by: bde --- sys/boot/i386/boot2/Makefile | 11 ++++++----- sys/boot/i386/boot2/sio.S | 4 ++-- sys/boot/i386/boot2/sio.s | 4 ++-- sys/boot/i386/gptboot/Makefile | 11 ++++++----- sys/boot/i386/libi386/Makefile | 8 +++++++- sys/boot/i386/libi386/comconsole.c | 6 +++++- 6 files changed, 28 insertions(+), 16 deletions(-) diff --git a/sys/boot/i386/boot2/Makefile b/sys/boot/i386/boot2/Makefile index d3711b0afb1..2b581ec521c 100644 --- a/sys/boot/i386/boot2/Makefile +++ b/sys/boot/i386/boot2/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.9 1998/11/05 20:52:25 rnordier Exp $ +# $Id: Makefile,v 1.10 1998/11/08 15:36:34 rnordier Exp $ PROG= boot2 NOMAN= @@ -11,9 +11,9 @@ CLEANFILES+= boot1 boot1.out boot1.o \ M4?= m4 -B2SIOPRT?= 0x3f8 +BOOT_COMCONSOLE_PORT?= 0x3f8 +BOOT_COMCONSOLE_SPEED?= 9600 B2SIOFMT?= 0x3 -B2SIODIV?= 0xc .if exists(${.OBJDIR}/../btx) BTX= ${.OBJDIR}/../btx @@ -62,8 +62,9 @@ boot2.out: boot2.o sio.o ${BTX}/lib/crt0.o boot2.o sio.o sio.o: sio.s - (cd ${.CURDIR}; ${M4} -DSIOPRT=${B2SIOPRT} \ - -DSIOFMT=${B2SIOFMT} -DSIODIV=${B2SIODIV} sio.s) | \ + (cd ${.CURDIR}; ${M4} -DSIOPRT=${BOOT_COMCONSOLE_PORT} \ + -DSIOFMT=${B2SIOFMT} \ + -DSIOSPD=${BOOT_COMCONSOLE_SPEED} sio.s) | \ ${AS} ${AFLAGS} -o ${.TARGET} install: diff --git a/sys/boot/i386/boot2/sio.S b/sys/boot/i386/boot2/sio.S index bc68bf5a469..92237b852b7 100644 --- a/sys/boot/i386/boot2/sio.S +++ b/sys/boot/i386/boot2/sio.S @@ -13,11 +13,11 @@ # purpose. # -# $Id: sio.s,v 1.1 1998/10/15 20:04:21 rnordier Exp $ +# $Id: sio.s,v 1.2 1998/10/20 20:20:48 rnordier Exp $ .set SIO_PRT,SIOPRT # Base port .set SIO_FMT,SIOFMT # 8N1 - .set SIO_DIV,SIODIV # 115200 / BPS + .set SIO_DIV,(115200/SIOSPD) # 115200 / SPD .globl sio_init .globl sio_flush diff --git a/sys/boot/i386/boot2/sio.s b/sys/boot/i386/boot2/sio.s index bc68bf5a469..92237b852b7 100644 --- a/sys/boot/i386/boot2/sio.s +++ b/sys/boot/i386/boot2/sio.s @@ -13,11 +13,11 @@ # purpose. # -# $Id: sio.s,v 1.1 1998/10/15 20:04:21 rnordier Exp $ +# $Id: sio.s,v 1.2 1998/10/20 20:20:48 rnordier Exp $ .set SIO_PRT,SIOPRT # Base port .set SIO_FMT,SIOFMT # 8N1 - .set SIO_DIV,SIODIV # 115200 / BPS + .set SIO_DIV,(115200/SIOSPD) # 115200 / SPD .globl sio_init .globl sio_flush diff --git a/sys/boot/i386/gptboot/Makefile b/sys/boot/i386/gptboot/Makefile index d3711b0afb1..2b581ec521c 100644 --- a/sys/boot/i386/gptboot/Makefile +++ b/sys/boot/i386/gptboot/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.9 1998/11/05 20:52:25 rnordier Exp $ +# $Id: Makefile,v 1.10 1998/11/08 15:36:34 rnordier Exp $ PROG= boot2 NOMAN= @@ -11,9 +11,9 @@ CLEANFILES+= boot1 boot1.out boot1.o \ M4?= m4 -B2SIOPRT?= 0x3f8 +BOOT_COMCONSOLE_PORT?= 0x3f8 +BOOT_COMCONSOLE_SPEED?= 9600 B2SIOFMT?= 0x3 -B2SIODIV?= 0xc .if exists(${.OBJDIR}/../btx) BTX= ${.OBJDIR}/../btx @@ -62,8 +62,9 @@ boot2.out: boot2.o sio.o ${BTX}/lib/crt0.o boot2.o sio.o sio.o: sio.s - (cd ${.CURDIR}; ${M4} -DSIOPRT=${B2SIOPRT} \ - -DSIOFMT=${B2SIOFMT} -DSIODIV=${B2SIODIV} sio.s) | \ + (cd ${.CURDIR}; ${M4} -DSIOPRT=${BOOT_COMCONSOLE_PORT} \ + -DSIOFMT=${B2SIOFMT} \ + -DSIOSPD=${BOOT_COMCONSOLE_SPEED} sio.s) | \ ${AS} ${AFLAGS} -o ${.TARGET} install: diff --git a/sys/boot/i386/libi386/Makefile b/sys/boot/i386/libi386/Makefile index e1276fee882..2cfd2e34595 100644 --- a/sys/boot/i386/libi386/Makefile +++ b/sys/boot/i386/libi386/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.11 1998/10/23 22:29:08 msmith Exp $ +# $Id: Makefile,v 1.12 1998/12/22 11:51:25 abial Exp $ # LIB= i386 NOPIC= @@ -13,6 +13,12 @@ SRCS= aout_freebsd.c biosdisk.c biosmem.c biospnp.c biospci.c \ CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../btx/lib \ -I${.CURDIR}/../../.. -I. +BOOT_COMCONSOLE_PORT?= 0x3f8 +CFLAGS+= -DCOMPORT=${BOOT_COMCONSOLE_PORT} + +BOOT_COMCONSOLE_SPEED?= 9600 +CFLAGS+= -DCOMSPEED=${BOOT_COMCONSOLE_SPEED} + # Make the disk code more talkative #CFLAGS+= -DDISK_DEBUG diff --git a/sys/boot/i386/libi386/comconsole.c b/sys/boot/i386/libi386/comconsole.c index b530eebd88a..7b35d1dce8c 100644 --- a/sys/boot/i386/libi386/comconsole.c +++ b/sys/boot/i386/libi386/comconsole.c @@ -22,7 +22,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: comconsole.c,v 1.4 1998/10/11 10:05:13 peter Exp $ + * $Id: comconsole.c,v 1.5 1998/11/22 07:59:16 rnordier Exp $ */ #include @@ -54,8 +54,12 @@ #define COMC_TXWAIT 0x40000 /* transmit timeout */ #define COMC_BPS(x) (115200 / (x)) /* speed to DLAB divisor */ +#ifndef COMPORT #define COMPORT 0x3f8 +#endif +#ifndef COMSPEED #define COMSPEED 9600 +#endif static void comc_probe(struct console *cp); static int comc_init(int arg); -- 2.45.2