Index: trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrint.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrint.asm	(revision 97)
+++ trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrint.asm	(revision 98)
@@ -326,9 +326,11 @@
 ;		CF:		Set since menu event was handled successfully
 ;	Corrupts registers:
-;		AX, DI
+;		AX
 ;--------------------------------------------------------------------
 ALIGN JUMP_ALIGN
 BootMenuPrint_NullTerminatedStringFromCSSIandSetCF:
+	push	di
 	CALL_DISPLAY_LIBRARY PrintNullTerminatedStringFromCSSI
+	pop		di
 	stc
 	ret
Index: trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm	(revision 97)
+++ trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm	(revision 98)
@@ -17,9 +17,7 @@
 ;		All (not segments)
 ;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
 DetectDrives_FromAllIDEControllers:
 	call	RamVars_GetIdeControllerCountToCX
 	mov		bp, ROMVARS.ideVars0			; CS:BP now points to first IDEVARS
-ALIGN JUMP_ALIGN
 .DriveDetectLoop:
 	call	DetectDrives_WithIDEVARS		; Detect Master and Slave
@@ -42,16 +40,13 @@
 ;		AX, BX, DX, SI, DI
 ;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
 DetectDrives_WithIDEVARS:
 	push	cx
 	mov		ax, g_szMaster
-	call	DetectPrint_StartDetectWithMasterOrSlaveStringInAXandIdeVarsInCSBP
-	call	DetectDrives_DetectMasterDrive		; Detect and create DPT + BOOTNFO
-	call	DetectPrint_DriveNameOrNotFound		; Print found or not found string
+	mov		bh, MASK_IDE_DRVHD_SET								; Select Master drive
+	call	StartDetectionWithDriveSelectByteInBHandStringInAX	; Detect and create DPT + BOOTNFO
 
 	mov		ax, g_szSlave
-	call	DetectPrint_StartDetectWithMasterOrSlaveStringInAXandIdeVarsInCSBP
-	call	DetectDrives_DetectSlaveDrive
-	call	DetectPrint_DriveNameOrNotFound
+	mov		bh, MASK_IDE_DRVHD_SET | FLG_IDE_DRVHD_DRV
+	call	StartDetectionWithDriveSelectByteInBHandStringInAX
 	pop		cx
 	ret
@@ -59,32 +54,7 @@
 
 ;--------------------------------------------------------------------
-; Detects IDE Master or Slave drive.
-;
-; DetectDrives_DetectMasterDrive
-; DetectDrives_DetectSlaveDrive
+; StartDetectionWithDriveSelectByteInBHandStringInAX
 ;	Parameters:
-;		CS:BP:	Ptr to IDEVARS
-;		DS:		RAMVARS segment
-;		ES:		Zero (BDA segment)
-;	Returns:
-;		ES:BX:	Ptr to BOOTNFO (if successful)
-;		CF:		Cleared if drive detected successfully
-;				Set if any drive not found or other error
-;	Corrupts registers:
-;		AX, CX, DX, SI, DI
-;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
-DetectDrives_DetectMasterDrive:
-	mov		bh, MASK_IDE_DRVHD_SET		; Select Master drive
-	SKIP2B	ax							; mov ax, <next instruction>
-DetectDrives_DetectSlaveDrive:
-	mov		bh, MASK_IDE_DRVHD_SET | FLG_IDE_DRVHD_DRV
-	; Fall to DetectDrives_StartDetection
-
-;--------------------------------------------------------------------
-; Detects IDE Master or Slave drive.
-;
-; DetectDrives_StartDetection
-;	Parameters:
+;		AX:		Offset to "Master" or "Slave" string
 ;		BH:		Drive Select byte for Drive and Head Register
 ;		CS:BP:	Ptr to IDEVARS for the drive
@@ -92,23 +62,19 @@
 ;		ES:		Zero (BDA segment)
 ;	Returns:
-;		ES:BX:	Ptr to BOOTNFO (if successful)
-;		CF:		Cleared if drive detected successfully
-;				Set if any drive not found or other error
+;		Nothing
 ;	Corrupts registers:
-;		AX, CX, DX, SI, DI
+;		AX, BX, CX, DX, SI, DI
 ;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
-DetectDrives_StartDetection:
-	call	DetectDrives_ReadAtaInfoFromDrive	; Assume hard disk
-	jnc		SHORT DetectDrives_CreateBiosTablesForHardDisk
-	call	DetectDrives_ReadAtapiInfoFromDrive	; Assume CD-ROM
-	jnc		SHORT DetectDrives_CreateBiosTablesForCDROM
-	ret
+StartDetectionWithDriveSelectByteInBHandStringInAX:
+	call	DetectPrint_StartDetectWithMasterOrSlaveStringInAXandIdeVarsInCSBP
+	call	ReadAtaInfoFromDrive	; Assume hard disk
+	jnc		SHORT CreateBiosTablesForHardDisk
+	;call	ReadAtapiInfoFromDrive	; Assume CD-ROM (not yet implemented)
+	;jnc	SHORT _CreateBiosTablesForCDROM
+	jmp		DetectPrint_DriveNotFound
 
 
 ;--------------------------------------------------------------------
-; Reads ATA information from the drive (for hard disks).
-;
-; DetectDrives_ReadAtaInfoFromDrive
+; ReadAtaInfoFromDrive
 ;	Parameters:
 ;		BH:		Drive Select byte for Drive and Head Register
@@ -123,6 +89,5 @@
 ;		AX, BL, CX, DX, DI
 ;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
-DetectDrives_ReadAtaInfoFromDrive:
+ReadAtaInfoFromDrive:
 	mov		bl, [cs:bp+IDEVARS.bBusType]; Load BUS type
 	mov		dx, [cs:bp+IDEVARS.wPort]	; Load IDE Base Port address
@@ -134,7 +99,5 @@
 
 ;--------------------------------------------------------------------
-; Creates all BIOS tables for detected hard disk.
-;
-; DetectDrives_CreateBiosTablesForHardDisk
+; CreateBiosTablesForHardDisk
 ;	Parameters:
 ;		BH:		Drive Select byte for Drive and Head Register
@@ -142,64 +105,15 @@
 ;		ES:SI	Ptr to ATA information for the drive
 ;		DS:		RAMVARS segment
+;		ES:		BDA/Bootnfo segment
 ;	Returns:
-;		ES:BX:	Ptr to BOOTNFO (if successful)
-;		CF:		Cleared if BIOS tables created succesfully
-;				Set if any error
+;		Nothing
 ;	Corrupts registers:
-;		AX, CX, DX, SI, DI
+;		AX, BX, CX, DX, SI, DI
 ;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
-DetectDrives_CreateBiosTablesForHardDisk:
+CreateBiosTablesForHardDisk:
 	call	CreateDPT_FromAtaInformation
 	jc		SHORT .InvalidAtaInfo
 	call	BootInfo_CreateForHardDisk
-	;jc		SHORT .InvalidAtaInfo
-	; Call to search for BIOS partitions goes here
-	;clc
+	jmp		DetectPrint_DriveNameFromBootnfoInESBX
 .InvalidAtaInfo:
-	ret
-
-
-;--------------------------------------------------------------------
-; Reads ATAPI information from the drive (for CD/DVD-ROMs).
-;
-; DetectDrives_ReadAtapiInfoFromDrive
-;	Parameters:
-;		BH:		Drive Select byte for Drive and Head Register
-;		CS:BP:	Ptr to IDEVARS for the drive
-;		DS:		RAMVARS segment
-;		ES:		Zero (BDA segment)
-;	Returns:
-;		ES:SI	Ptr to ATAPI information (read with IDENTIFY PACKET DEVICE command)
-;		CF:		Cleared if ATAPI-information read successfully
-;				Set if any error
-;	Corrupts registers:
-;		AX, BL, CX, DX, DI
-;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
-DetectDrives_ReadAtapiInfoFromDrive:
-	;stc
-	;ret
-	; Fall through to DetectDrives_CreateBiosTablesForCDROM
-
-
-;--------------------------------------------------------------------
-; Creates all BIOS tables for detected CD/DVD-ROM.
-;
-; DetectDrives_CreateBiosTablesForCDROM
-;	Parameters:
-;		BH:		Drive Select byte for Drive and Head Register
-;		CS:BP:	Ptr to IDEVARS for the drive
-;		ES:SI	Ptr to ATAPI information for the drive
-;		DS:		RAMVARS segment
-;	Returns:
-;		ES:BX:	Ptr to BOOTNFO (if successful)
-;		CF:		Cleared if BIOS tables created succesfully
-;				Set if any error
-;	Corrupts registers:
-;		AX, CX, DX, SI, DI
-;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
-DetectDrives_CreateBiosTablesForCDROM:
-	stc
-	ret
+	jmp		DetectPrint_DriveNotFound
Index: trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm	(revision 97)
+++ trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm	(revision 98)
@@ -46,12 +46,7 @@
 
 ;--------------------------------------------------------------------
-; Displays Detected Drive Name from BOOTVARS or
-; drive not found string if no drive was found.
-;
-; DetectPrint_DriveNameOrNotFound
+; DetectPrint_DriveNameFromBootnfoInESBX
 ;	Parameters:
 ;		ES:BX:	Ptr to BOOTNFO (if drive found)
-;		CF:		Cleared if drive found
-;				Set it drive not found
 ;	Returns:
 ;		Nothing
@@ -59,7 +54,6 @@
 ;		AX, SI
 ;--------------------------------------------------------------------
-DetectPrint_DriveNameOrNotFound:
+DetectPrint_DriveNameFromBootnfoInESBX:
 	push	di
-	jc		SHORT .PrintDriveNotFound
 	push	bx
 
@@ -73,7 +67,15 @@
 	ret
 
-.PrintDriveNotFound:
+
+;--------------------------------------------------------------------
+; DetectPrint_DriveNotFound
+;	Parameters:
+;		Nothing
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		AX, SI
+;--------------------------------------------------------------------
+DetectPrint_DriveNotFound:
 	mov		si, g_szNotFound
-	call	BootMenuPrint_NullTerminatedStringFromCSSIandSetCF
-	pop		di
-	ret
+	jmp		BootMenuPrint_NullTerminatedStringFromCSSIandSetCF
Index: trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm	(revision 97)
+++ trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm	(revision 98)
@@ -74,8 +74,8 @@
 	call	Interrupts_InitializeInterruptVectors
 	call	DetectDrives_FromAllIDEControllers
-	; Fall to .StoreDptPointersToBDA
+	; Fall to .StoreDptPointersToIntVectors
 
 ;--------------------------------------------------------------------
-; .StoreDptPointersToBDA
+; .StoreDptPointersToIntVectors
 ;	Parameters:
 ;		DS:		RAMVARS segment
@@ -86,5 +86,5 @@
 ;		DX, DI
 ;--------------------------------------------------------------------
-.StoreDptPointersToBDA:
+.StoreDptPointersToIntVectors:
 	mov		dl, 80h
 	call	FindDPT_ForDriveNumber	; DPT to DS:DI
