Content-Length: 365808 | pFad | https://github.com/freebsd/freebsd-src/commit/d9d5c6d

2E - If the COMSPEED is set to 0, then don't try to initialize the seria… · freebsd/freebsd-src@d9d5c6d · GitHub
Skip to content

Commit d9d5c6d

Browse files
committed
- 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
1 parent d211cd0 commit d9d5c6d

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

sys/boot/i386/boot0/boot0.S

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
/* A 512-byte boot manager. */
2020
#ifdef SIO
2121
/* ... using a serial console on COM1. */
22-
#endif /* SIO */
22+
#endif
2323

2424
.set NHRDRV,0x475 # Number of hard drives
2525
.set ORIGIN,0x600 # Execution address
@@ -92,13 +92,13 @@ start: cld # String ops inc
9292
jmp main-LOAD+ORIGIN # To relocated code
9393

9494
main:
95-
#ifdef SIO
95+
#if defined(SIO) && COMSPEED != 0
9696
/*
9797
* Initialize the serial port. bioscom preserves the driver number in DX.
9898
*/
9999
movw COMSPEED,%ax # defined by Makefile
100100
callw bioscom
101-
#endif /* SIO */
101+
#endif
102102
/*
103103
* Check what flags were loaded with us, specifically if a predefined drive
104104
* number should be used. If what the bios gives us is bad, use the '0' in
@@ -235,18 +235,18 @@ main.11:
235235
xorb %ah,%ah # BIOS: Get
236236
int $0x16 # keypress
237237
movb %ah,%al # Scan code
238-
#else /* SIO */
238+
#else
239239
movb $0x02,%ah # BIOS: Receive
240240
call bioscom
241-
#endif /* SIO */
241+
#endif
242242
/*
243243
* If it's CR act as if timed out.
244244
*/
245245
#ifndef SIO
246246
cmpb $KEY_ENTER,%al # Enter pressed?
247-
#else /* SIO */
247+
#else
248248
cmpb $ASCII_CR,%al # Enter pressed?
249-
#endif /* SIO */
249+
#endif
250250
je main.9 # Yes
251251
/*
252252
* Otherwise check if legal. If not ask again.
@@ -256,9 +256,9 @@ main.11:
256256
cmpb $0x4,%al # F1..F5?
257257
jna main.12 # Yes
258258
subb $(KEY_1 - KEY_F1),%al # Less #1 scan code
259-
#else /* SIO */
259+
#else
260260
subb $'1',%al # Less '1' ascii character
261-
#endif /* SIO */
261+
#endif
262262
cmpb $0x4,%al # #1..#5?
263263
ja main.10 # No
264264
/*
@@ -326,7 +326,7 @@ putkey:
326326
#ifndef SIO
327327
movb $'F',%al # Display
328328
callw putchr # 'F'
329-
#endif /* SIO */
329+
#endif
330330
movb $'1',%al # Prepare
331331
addb %dl,%al # digit
332332
jmp putstr.1 # Display the rest

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/freebsd/freebsd-src/commit/d9d5c6d

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy