boot serial console speed

Ruslan Ermilov ru at FreeBSD.org
Sun Nov 14 02:08:14 PST 2004


On Sun, Nov 14, 2004 at 11:38:50AM +0200, Ruslan Ermilov wrote:
> On Sun, Nov 14, 2004 at 10:39:13AM +0200, Danny Braniss wrote:
> > what's the magic encantation to set the console to 38400?
> > btw, i solved my problem by just commenting out that part of the code,
> > since i rely on the bios setting it.
> > 
> > from src/sys/boot/i386/boot0/Makefile:
> > 
> > # Comm settings for boot0sio.  0xE3 => 9600 8-N-1
> > # XXX: We should create a build-tool or something to convert BOOT_CONSOLE_SPEED
> > # and BOOT_COMCONSOLE_PORT into the correct values to define on the build
> > # command line
> > BOOT_BOOT0_COMCONSOLE_SPEED?=	0xE3
> > 
> This is the value passed in the AL register to the Int 14/AH=00h
> BIOS function:
> 
> 	http://www.ctyme.com/intr/rb-0811.htm
> 
> : Bit(s) Description     (Table 00300)
> : 7-5    data rate (110,150,300,600,1200,2400,4800,9600 bps)
> : 4-3    parity (00 or 10 = none, 01 = odd, 11 = even)
> : 2      stop bits (set = 2, clear = 1)
> : 1-0    data bits (00 = 5, 01 = 6, 10 = 7, 11 = 8)
> 
> 0xE3 = 111-00-0-11 = 9600 bps, no parity, 1 stop bit, 8 data bits
> 
> But I think it's not possible to set it to anything above 9600 bps
> using this BIOS call.
> 
Attached is the patch that converts supported BOOT_COMCONSOLE_SPEED
values into corresponding BOOT_BOOT0_COMCONSOLE_SPEED.  Unsupported
BOOT_COMCONSOLE_VALUES cause the boot0sio console speed to be set
to 9600.


Cheers,
-- 
Ruslan Ermilov
ru at FreeBSD.org
FreeBSD committer
-------------- next part --------------
Index: Makefile
===================================================================
RCS file: /home/ncvs/src/sys/boot/i386/boot0/Makefile,v
retrieving revision 1.30
diff -u -r1.30 Makefile
--- Makefile	27 Aug 2004 00:18:03 -0000	1.30
+++ Makefile	14 Nov 2004 10:04:36 -0000
@@ -21,11 +21,34 @@
 # unless you are glutton for punishment.
 BOOT_BOOT0_ORG?=	0x600
 
-# Comm settings for boot0sio.  0xE3 => 9600 8-N-1
-# XXX: We should create a build-tool or something to convert BOOT_CONSOLE_SPEED
-# and BOOT_COMCONSOLE_PORT into the correct values to define on the build
-# command line
-BOOT_BOOT0_COMCONSOLE_SPEED?=	0xE3
+# Comm settings for boot0sio.
+# Bit(s) Description
+# 7-5    data rate (110,150,300,600,1200,2400,4800,9600 bps)
+# 4-3    parity (00 or 10 = none, 01 = odd, 11 = even)
+# 2      stop bits (set = 2, clear = 1)
+# 1-0    data bits (00 = 5, 01 = 6, 10 = 7, 11 = 8)
+.if !defined(BOOT_BOOT0_COMCONSOLE_SPEED)
+BOOT_COMCONSOLE_SPEED?=	9600
+.if ${BOOT_COMCONSOLE_SPEED} == 9600
+BOOT_BOOT0_COMCONSOLE_SPEED=	"7 << 5 + 3"
+.elif ${BOOT_COMCONSOLE_SPEED} == 4800
+BOOT_BOOT0_COMCONSOLE_SPEED=	"6 << 5 + 3"
+.elif ${BOOT_COMCONSOLE_SPEED} == 2400
+BOOT_BOOT0_COMCONSOLE_SPEED=	"5 << 5 + 3"
+.elif ${BOOT_COMCONSOLE_SPEED} == 1200
+BOOT_BOOT0_COMCONSOLE_SPEED=	"4 << 5 + 3"
+.elif ${BOOT_COMCONSOLE_SPEED} == 600
+BOOT_BOOT0_COMCONSOLE_SPEED=	"3 << 5 + 3"
+.elif ${BOOT_COMCONSOLE_SPEED} == 300
+BOOT_BOOT0_COMCONSOLE_SPEED=	"2 << 5 + 3"
+.elif ${BOOT_COMCONSOLE_SPEED} == 150
+BOOT_BOOT0_COMCONSOLE_SPEED=	"1 << 5 + 3"
+.elif ${BOOT_COMCONSOLE_SPEED} == 110
+BOOT_BOOT0_COMCONSOLE_SPEED=	"0 << 5 + 3"
+.else
+BOOT_BOOT0_COMCONSOLE_SPEED=	"7 << 5 + 3"
+.endif
+.endif
 
 CFLAGS+=-DFLAGS=${BOOT_BOOT0_FLAGS} \
 	-DTICKS=${BOOT_BOOT0_TICKS} \
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20041114/2d13b1be/attachment.bin


More information about the freebsd-hackers mailing list