From d9d5c6d6b74aaa2f2f9c921becaab7c8668b8662 Mon Sep 17 00:00:00 2001 From: jhb Date: Wed, 24 Nov 2004 15:39:04 +0000 Subject: - If the COMSPEED is set to 0, then don't try to initialize the serial port and assume that the BIOS has set it up for us. This allows folks with a serial-aware BIOS to set the BIOS to speeds above 9600 and allow boot0 to just use the existing settings. - Purge some gratuitous cpp comments as per style(9). Submitted by: Danny Braniss danny at cs dot huji dot ac dot il (1) MFC after: 1 month --- sys/boot/i386/boot0/boot0.S | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'sys/boot') diff --git a/sys/boot/i386/boot0/boot0.S b/sys/boot/i386/boot0/boot0.S index 7b957ad..de3ed54 100644 --- a/sys/boot/i386/boot0/boot0.S +++ b/sys/boot/i386/boot0/boot0.S @@ -19,7 +19,7 @@ /* A 512-byte boot manager. */ #ifdef SIO /* ... using a serial console on COM1. */ -#endif /* SIO */ +#endif .set NHRDRV,0x475 # Number of hard drives .set ORIGIN,0x600 # Execution address @@ -92,13 +92,13 @@ start: cld # String ops inc jmp main-LOAD+ORIGIN # To relocated code main: -#ifdef SIO +#if defined(SIO) && COMSPEED != 0 /* * Initialize the serial port. bioscom preserves the driver number in DX. */ movw COMSPEED,%ax # defined by Makefile callw bioscom -#endif /* SIO */ +#endif /* * Check what flags were loaded with us, specifically if a predefined drive * number should be used. If what the bios gives us is bad, use the '0' in @@ -235,18 +235,18 @@ main.11: xorb %ah,%ah # BIOS: Get int $0x16 # keypress movb %ah,%al # Scan code -#else /* SIO */ +#else movb $0x02,%ah # BIOS: Receive call bioscom -#endif /* SIO */ +#endif /* * If it's CR act as if timed out. */ #ifndef SIO cmpb $KEY_ENTER,%al # Enter pressed? -#else /* SIO */ +#else cmpb $ASCII_CR,%al # Enter pressed? -#endif /* SIO */ +#endif je main.9 # Yes /* * Otherwise check if legal. If not ask again. @@ -256,9 +256,9 @@ main.11: cmpb $0x4,%al # F1..F5? jna main.12 # Yes subb $(KEY_1 - KEY_F1),%al # Less #1 scan code -#else /* SIO */ +#else subb $'1',%al # Less '1' ascii character -#endif /* SIO */ +#endif cmpb $0x4,%al # #1..#5? ja main.10 # No /* @@ -326,7 +326,7 @@ putkey: #ifndef SIO movb $'F',%al # Display callw putchr # 'F' -#endif /* SIO */ +#endif movb $'1',%al # Prepare addb %dl,%al # digit jmp putstr.1 # Display the rest -- cgit v1.1