Index: trunk/XTIDE_Universal_BIOS/Inc/RomVars.inc
===================================================================
--- trunk/XTIDE_Universal_BIOS/Inc/RomVars.inc	(revision 194)
+++ trunk/XTIDE_Universal_BIOS/Inc/RomVars.inc	(revision 196)
@@ -45,10 +45,15 @@
 ; Controller specific variables
 struc IDEVARS
-	.wPort				resb	2	; IDE Base Port for Command Block (usual) Registers
-	.wPortCtrl			resb	2	; IDE Base Port for Control Block Registers
-	.bDevice			resb	1	; Device type
-	.bIRQ				resb	1	; Interrupt Request Number
-	.drvParamsMaster	resb	DRVPARAMS_size
-	.drvParamsSlave		resb	DRVPARAMS_size
+	.wPort:									; IDE Base Port for Command Block (usual) Registers
+	.bSerialCOMDigit			resb	1	; Serial Device COM Port digit 
+	.bSerialPackedPortAndBaud 	resb	1	; Serial Device packed port and baud
+
+	.wPortCtrl:								; IDE Base Port for Control Block Registers
+	.wSerialPackedPrintBaud		resb	2	; Serial Device packed baud rate for printing
+
+	.bDevice					resb	1	; Device type
+	.bIRQ						resb	1	; Interrupt Request Number
+	.drvParamsMaster			resb	DRVPARAMS_size
+	.drvParamsSlave				resb	DRVPARAMS_size
 endstruc
 
Index: trunk/XTIDE_Universal_BIOS/Src/Device/Serial/SerialCommand.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Device/Serial/SerialCommand.asm	(revision 194)
+++ trunk/XTIDE_Universal_BIOS/Src/Device/Serial/SerialCommand.asm	(revision 196)
@@ -40,5 +40,7 @@
 SerialCommand_UART_scratch						EQU		7
 
+; note that the actual StaringPoint port address is not achievable (results in 0 which triggers auto detect)
 SerialCommand_PackedPortAndBaud_StartingPort	EQU		240h
+		
 SerialCommand_PackedPortAndBaud_PortMask		EQU		0fch    ; upper 6 bits - 240h through 438h
 SerialCommand_PackedPortAndBaud_BaudMask		EQU		3       ; lower 2 bits - 4 baud rates
@@ -125,5 +127,5 @@
 		and		dl, SerialCommand_PackedPortAndBaud_PortMask
 		mov		dh, 0
-		shl		dx, 1
+		shl		dx, 1			; port offset already x4, needs one more shift to be x8
 		add		dx, SerialCommand_PackedPortAndBaud_StartingPort
 
@@ -499,7 +501,6 @@
 SerialCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH:
 
-		mov		dx,[cs:bp+IDEVARS.wPortCtrl]
-		inc		dx
-		dec		dx
+		mov		dl,[cs:bp+IDEVARS.bSerialPackedPortAndBaud]
+		test	dl,dl
 		jz		SerialCommand_AutoSerial
 
@@ -542,7 +543,8 @@
 ;
 
-SerialCommand_ScanPortAddresses:  db  0b8h, 0f8h, 0bch, 0bah, 0fah, 0beh, 0feh, 0
-; Corresponds to I/O port:             3f8,  2f8,  3e8,  2e8,  2f0,  3e0,  2e0,  260,  368,  268,  360,  270
-; COM Assignments:                       1,    2,    3,    4,    5,    6,    7,    8,    9,   10,   11,   12
+SerialCommand_ScanPortAddresses:     db  0b8h, 0f8h, 0bch, 0bah, 0fah, 0beh, 0feh, 0
+; Corresponds to I/O port:                3f8,  2f8,  3e8,  2e8,  2f0,  3e0,  2e0,  260,  368,  268,  360,  270
+; COM Assignments:                          1,    2,    3,    4,    5,    6,    7,    8,    9,   10,   11,   12
+; Corresponds to Packed I/O port (hex):    37,   17,   35,   15,   16,   34,   14,    4,   25,    5,   24,    6		
 
 ALIGN JUMP_ALIGN
Index: trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm	(revision 194)
+++ trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm	(revision 196)
@@ -21,5 +21,11 @@
 	mov		bp, ROMVARS.ideVars0			; CS:BP now points to first IDEVARS
 .DriveDetectLoop:
-	mov		si,g_szDetect
+	mov		si, g_szDetect
+%ifdef MODULE_SERIAL
+	cmp		byte [cs:bp+IDEVARS.bDevice], DEVICE_SERIAL_PORT
+	jnz		.DriveNotSerial
+	mov		si, g_szDetectCOM
+.DriveNotSerial:
+%endif
 	call	.DetectDrives_WithIDEVARS		; Detect Master and Slave
 	add		bp, BYTE IDEVARS_size			; Point to next IDEVARS
@@ -30,5 +36,5 @@
  	jz		.done
 	mov		bp, ROMVARS.ideVarsSerialAuto
-	mov		si,g_szSerial
+	mov		si, g_szDetectCOMAuto
 ;;; fall-through		
 %else
@@ -52,11 +58,11 @@
 .DetectDrives_WithIDEVARS:
 	push	cx
-		
-	push	si
+
+	push	si		
 	mov		ax, g_szMaster
 	mov		bh, MASK_DRVNHEAD_SET								; Select Master drive
 	call	StartDetectionWithDriveSelectByteInBHandStringInAX	; Detect and create DPT + BOOTNFO
 	pop		si
-		
+
 	mov		ax, g_szSlave
 	mov		bh, MASK_DRVNHEAD_SET | FLG_DRVNHEAD_DRV
@@ -112,5 +118,5 @@
 	;call	ReadAtapiInfoFromDrive		; Assume CD-ROM
 	;jnc	SHORT _CreateBiosTablesForCDROM
-	jmp		DetectPrint_DriveNotFound
+	jmp		short DetectDrives_DriveNotFound
 
 
@@ -130,7 +136,19 @@
 CreateBiosTablesForHardDisk:
 	call	CreateDPT_FromAtaInformation
-	jc		SHORT .InvalidAtaInfo
+	jc		SHORT DetectDrives_DriveNotFound
 	call	BootInfo_CreateForHardDisk
-	jmp		DetectPrint_DriveNameFromBootnfoInESBX
-.InvalidAtaInfo:
-	jmp		DetectPrint_DriveNotFound
+	jmp		short DetectPrint_DriveNameFromBootnfoInESBX
+
+;--------------------------------------------------------------------
+; DetectDrives_DriveNotFound
+;	Parameters:
+;		Nothing
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, SI
+;--------------------------------------------------------------------
+DetectDrives_DriveNotFound:		
+	mov		si, g_szNotFound
+	jmp		BootMenuPrint_NullTerminatedStringFromCSSIandSetCF		
+
Index: trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm	(revision 194)
+++ trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm	(revision 196)
@@ -36,13 +36,40 @@
 ;		Nothing
 ;	Corrupts registers:
-;		AX, SI, DI
+;		AX, SI, DI, CX
 ;--------------------------------------------------------------------
 DetectPrint_StartDetectWithMasterOrSlaveStringInAXandIdeVarsInCSBP:
 	push	bp
 	mov		di, [cs:bp+IDEVARS.wPort]
+%ifdef MODULE_SERIAL
+	mov		cx, [cs:bp+IDEVARS.wSerialPackedPrintBaud]
+%endif
+		
 	mov		bp, sp
-	push	ax							; Push "Master" or "Slave"
-	push	di							; Push port number
-	jmp		DetectPrint_BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay
+
+	push 	ax							; Push "Master" or "Slave"
+		
+	push	di							; Push Port address or COM port number
+
+%ifdef MODULE_SERIAL
+;
+; Baud rate is packed into one word:
+;    High order 6 bits: number to add to '0' to get postfix character ('0' or 'K')
+;    Low order 10 bits:	binary number to display (960, 240, 38, or 115)
+;          To get 9600:	'0'<<10 + 960
+;          To get 2400:	'0'<<10 + 240
+;          To get 38K:	('K'-'0')<<10 + 38
+;          To get 115K:	('K'-'0')<<10 + 115
+;
+	mov		ax,cx						; Unpack baud rate number
+	and		ax,03ffh
+	push	ax
+
+	mov		al,ch						; Unpack baud rate postfix ('0' or 'K')
+	eSHR_IM	al,2
+	add		al,'0'
+	push	ax
+%endif
+						
+	jmp		short DetectPrint_BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay	
 
 
@@ -70,14 +97,3 @@
 
 
-;--------------------------------------------------------------------
-; DetectPrint_DriveNotFound
-;	Parameters:
-;		Nothing
-;	Returns:
-;		Nothing
-;	Corrupts registers:
-;		AX, SI
-;--------------------------------------------------------------------
-DetectPrint_DriveNotFound:
-	mov		si, g_szNotFound
-	jmp		BootMenuPrint_NullTerminatedStringFromCSSIandSetCF
+
Index: trunk/XTIDE_Universal_BIOS/Src/Strings.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Strings.asm	(revision 194)
+++ trunk/XTIDE_Universal_BIOS/Src/Strings.asm	(revision 196)
@@ -11,9 +11,11 @@
 ; POST drive detection strings
 g_szRomAt:		db	"%s @ %x",LF,CR,NULL
-g_szMaster:		db	"Master",NULL
-g_szSlave:		db	"Slave ",NULL
-g_szDetect:		db	"IDE %s at %x: ",NULL			; IDE Master at 1F0h:
-g_szSerial:		db	"Serial Port %s: ",NULL
 
+g_szMaster:				db	"IDE Master at ",NULL 
+g_szSlave:				db	"IDE Slave  at ",NULL
+g_szDetect:				db	"%s%x: ",NULL					   ; IDE Master at 1F0h:
+g_szDetectCOM:			db  "%sCOM%c/%u%c: ",NULL              ; IDE Master at COM1/115K:		
+g_szDetectCOMAuto:		db  "%sCOM Detect: ",NULL			   ; IDE Master at COM Detect:
+				
 ; Boot loader strings
 g_szTryToBoot:			db	"Booting from %s %x",ANGLE_QUOTE_RIGHT,"%x",LF,CR,NULL
Index: trunk/XTIDE_Universal_BIOS/Src/StringsCompress.pl
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/StringsCompress.pl	(revision 194)
+++ trunk/XTIDE_Universal_BIOS/Src/StringsCompress.pl	(revision 196)
@@ -175,5 +175,5 @@
 {
 	$translate_index[$translate{$f}] = $f;
-	$used{$f} || print "translate $f unused\n";
+	$used{$f} || die "translate $f unused\n";
 	$translate{$f} <= 31 || die $translate{$f}.": translate codes must be below 32";
 }
Index: trunk/XTIDE_Universal_BIOS/Src/StringsCompressed.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/StringsCompressed.asm	(revision 194)
+++ trunk/XTIDE_Universal_BIOS/Src/StringsCompressed.asm	(revision 196)
@@ -22,19 +22,24 @@
           		  db	 34h,  20h, 0c6h,  39h,  1bh                                  ; compressed
 
-g_szMaster:		; db	"Master",NULL
-           		; db	 4dh,  61h,  73h,  74h,  65h,  72h,  00h    ; uncompressed
-           		  db	 53h,  67h,  79h,  7ah,  6bh, 0b8h          ; compressed
-
-g_szSlave:		; db	"Slave ",NULL
-          		; db	 53h,  6ch,  61h,  76h,  65h,  20h,  00h    ; uncompressed
-          		  db	 59h,  72h,  67h,  7ch,  6bh,  00h          ; compressed
-
-g_szDetect:		; db	"IDE %s at %x: ",NULL			; IDE Master at 1F0h:
-           		; db	 49h,  44h,  45h,  20h,  25h,  73h,  20h,  61h,  74h,  20h,  25h,  78h,  3ah,  20h,  00h    ; uncompressed
-           		  db	 4fh,  4ah, 0cbh,  34h,  20h,  67h, 0fah,  39h,  40h,  00h                                  ; compressed
-
-g_szSerial:		; db	"Serial Port %s: ",NULL
-           		; db	 53h,  65h,  72h,  69h,  61h,  6ch,  20h,  50h,  6fh,  72h,  74h,  20h,  25h,  73h,  3ah,  20h,  00h    ; uncompressed
-           		  db	 59h,  6bh,  78h,  6fh,  67h, 0f2h,  56h,  75h,  78h, 0fah,  34h,  40h,  00h                            ; compressed
+
+g_szMaster:				; db	"IDE Master at ",NULL 
+           				; db	 49h,  44h,  45h,  20h,  4dh,  61h,  73h,  74h,  65h,  72h,  20h,  61h,  74h,  20h,  00h    ; uncompressed
+           				  db	 4fh,  4ah, 0cbh,  53h,  67h,  79h,  7ah,  6bh, 0f8h,  67h,  7ah,  00h                      ; compressed
+
+g_szSlave:				; db	"IDE Slave  at ",NULL
+          				; db	 49h,  44h,  45h,  20h,  53h,  6ch,  61h,  76h,  65h,  20h,  20h,  61h,  74h,  20h,  00h    ; uncompressed
+          				  db	 4fh,  4ah, 0cbh,  59h,  72h,  67h,  7ch, 0ebh,  20h,  67h,  7ah,  00h                      ; compressed
+
+g_szDetect:				; db	"%s%x: ",NULL					   ; IDE Master at 1F0h:
+           				; db	 25h,  73h,  25h,  78h,  3ah,  20h,  00h    ; uncompressed
+           				  db	 34h,  39h,  40h,  00h                      ; compressed
+
+g_szDetectCOM:			; db  "%sCOM%c/%u%c: ",NULL              ; IDE Master at COM1/115K:		
+              			; db   25h,  73h,  43h,  4fh,  4dh,  25h,  63h,  2fh,  25h,  75h,  25h,  63h,  3ah,  20h,  00h    ; uncompressed
+              			  db   34h,  49h,  55h,  53h,  35h,  2ah,  37h,  35h,  40h,  00h                                  ; compressed
+
+g_szDetectCOMAuto:		; db  "%sCOM Detect: ",NULL			   ; IDE Master at COM Detect:
+                  		; db   25h,  73h,  43h,  4fh,  4dh,  20h,  44h,  65h,  74h,  65h,  63h,  74h,  3ah,  20h,  00h    ; uncompressed
+                  		  db   34h,  49h,  55h, 0d3h,  4ah,  6bh,  7ah,  6bh,  69h,  7ah,  40h,  00h                      ; compressed
 
 
@@ -310,17 +315,17 @@
 ;; format usage stats
 ;; A:4
+;; c:8
+;; s:15
 ;; 2-u:1
+;; u:6
 ;; 5-u:3
+;; 2-I:1
 ;; x:6
 ;; 5-x:1
-;; s:14
 ;; nl:6
-;; 2-I:1
-;; c:6
-;; u:5
 ;; total format: 10
 
 ;; alphabet usage stats
-;; 58,::3
+;; 58,::4
 ;; 59,;:
 ;; 60,<:
@@ -331,21 +336,21 @@
 ;; 65,A:3
 ;; 66,B:11
-;; 67,C:3
-;; 68,D:10
-;; 69,E:3
+;; 67,C:5
+;; 68,D:12
+;; 69,E:4
 ;; 70,F:3
 ;; 71,G:
 ;; 72,H:4
-;; 73,I:2
+;; 73,I:3
 ;; 74,J:
 ;; 75,K:
 ;; 76,L:3
-;; 77,M:2
+;; 77,M:4
 ;; 78,N:
-;; 79,O:1
-;; 80,P:2
+;; 79,O:3
+;; 80,P:1
 ;; 81,Q:1
 ;; 82,R:4
-;; 83,S:7
+;; 83,S:6
 ;; 84,T:
 ;; 85,U:1
@@ -363,22 +368,22 @@
 ;; 97,a:7
 ;; 98,b:
-;; 99,c:4
+;; 99,c:5
 ;; 100,d:4
-;; 101,e:10
+;; 101,e:11
 ;; 102,f:2
 ;; 103,g:2
 ;; 104,h:
-;; 105,i:12
+;; 105,i:11
 ;; 106,j:
 ;; 107,k:4
-;; 108,l:5
+;; 108,l:4
 ;; 109,m:1
 ;; 110,n:9
-;; 111,o:18
+;; 111,o:17
 ;; 112,p:3
 ;; 113,q:
-;; 114,r:13
+;; 114,r:11
 ;; 115,s:6
-;; 116,t:11
+;; 116,t:13
 ;; 117,u:2
 ;; 118,v:2
