Index: trunk/bootcode/regular/debug.asm
===================================================================
--- trunk/bootcode/regular/debug.asm	(revision 110)
+++ trunk/bootcode/regular/debug.asm	(revision 111)
@@ -108,5 +108,5 @@
 ; Dump the geometry.
 ;
-IF  0
+IF 0
 DEBUG_DumpGeo   Proc
         pushf
@@ -168,5 +168,5 @@
 ; Dump the internal partition table.
 ;
-IF  0
+IF 0
 DEBUG_DumpIPT   Proc
         pushf
@@ -194,5 +194,5 @@
 ; Dump the new  partitions table.
 ;
-IF  0
+IF 0
 DEBUG_DumpNewPartTable  Proc
         pushf
@@ -218,5 +218,5 @@
 ; Dump the partition pointers table.
 ;
-IF  0
+IF 0
 DEBUG_DumpPartitionPointers     Proc
         pushf
@@ -249,5 +249,5 @@
 ; Dump the partition x-ref table.
 ;
-IF  0
+IF 0
 xrt     db  10,'XrefTable:',10,0
 DEBUG_DumpPartitionXref     Proc
@@ -283,5 +283,5 @@
 ; Dump the dl-feature drive-letters.
 ;
-IF  0
+IF 0
 ddl     db  10,'Driveletters:',10,0
 DEBUG_DumpDriveLetters      Proc
@@ -326,5 +326,5 @@
 ; Dump some disk information.
 ;
-IF  1
+IF 0
 ddi     db  10,'DumpDiskInfo:',10,0
 DEBUG_DumpDiskInfo          Proc
@@ -375,5 +375,5 @@
 ; Dump the lvm volume drive-letters.
 ;
-IF  0
+IF 0
 dvl     db  10,'VolumeLetters:',10,0
 DEBUG_DumpVolumeLetters     Proc
@@ -408,5 +408,5 @@
 ; Dump the registers and flags.
 ;
-IF  1
+IF 1
 regAX   db  'AX:',0
 regBX   db  ' BX:',0
@@ -562,5 +562,5 @@
 ; Dump CHS values.
 ;
-IF  0
+IF 0
 DEBUG_DumpCHS   Proc    Near
         pushf
@@ -607,5 +607,5 @@
 ; Dump BSS.
 ;
-IF  0
+IF 0
 DEBUG_DumpBSSSectors    Proc    Near
         pushf
@@ -648,5 +648,5 @@
 ; Dump 6-bit packed hide partition table.
 ;
-IF  0
+IF 0
 DEBUG_DumpHidePartTables    Proc    Near
         pushf
@@ -697,5 +697,5 @@
 ; if its 'IF' directive is 0.
 ;
-IF  1
+IF 1
 DEBUG_Test  Proc
     pushf
@@ -764,5 +764,5 @@
 ; Test the simple 32-bit math functions.
 ;
-IF  0
+IF 0
 db_testmul32   db "## TEST MUL32 ##",10,0
 DEBUG_Test_MATH_Mul32   Proc    Near
@@ -852,5 +852,5 @@
 ; Test the bitfield routines.
 ;
-IF  0
+IF 0
 DEBUG_TestBitFieldFunctions Proc
         pushf
@@ -947,5 +947,5 @@
 ; Dump information before the partition is booted.
 ;
-IF  0
+IF 0
 DEBUG_Dump2     Proc  Near
         pushf
@@ -1042,5 +1042,5 @@
 dbp     db  '>---------->> DebugProbe: ',0
 DEBUG_Probe     Proc
-IF  0
+IF 0
         push    bp
         mov     bp,sp
@@ -1071,5 +1071,5 @@
 ; Toggle display of debug video page.
 ;
-IF  0
+IF 0
 DEBUG_DebugScreenToggle Proc
         pushf
@@ -1219,9 +1219,8 @@
 ; is enabled.
 ;
-dlra    db  10,'LVM_DoLetterReassignment: ',0
+;~ dlra    db  10,'LVM_DoLetterReassignment: ',0
 ptetb   db  10,'Partition Table Entry to boot',10,0
 bios_reg    db  10,'Registers passed by BIOS:',10,0
 ;~ diopmbr db  10,'DriveIO_ProtectMBR',10,0
-dioss   db  10,'DriveIO_SaveSector',10,0
 
 
Index: trunk/bootcode/regular/driveio.asm
===================================================================
--- trunk/bootcode/regular/driveio.asm	(revision 110)
+++ trunk/bootcode/regular/driveio.asm	(revision 111)
@@ -58,4 +58,24 @@
 ;  Those are originally loaded on startup and will NOT get reloaded.
 DriveIO_LoadConfiguration   Proc Near   Uses ax bx cx dx es
+
+IFDEF   AUX_DEBUG
+        IF 0
+        pushf
+        pusha
+            push    si
+            mov     si, offset $+5
+            jmp     @F
+            db      10,'DriveIO_LoadConfiguration:',10,0
+            @@:
+            call    AuxIO_Print
+            pop     si
+            ;~ call    DEBUG_DumpRegisters
+            ;~ call    AuxIO_DumpParagraph
+            ;~ call    AuxIO_TeletypeNL
+        popa
+        popf
+        ENDIF
+ENDIF
+
         mov     ax, cs
         mov     es, ax
@@ -73,4 +93,24 @@
 
 DriveIO_SaveConfiguration   Proc Near   Uses ax bx cx dx ds es si
+
+IFDEF   AUX_DEBUG
+        IF 0
+        pushf
+        pusha
+            push    si
+            mov     si, offset $+5
+            jmp     @F
+            db      10,'DriveIO_SaveConfiguration:',10,0
+            @@:
+            call    AuxIO_Print
+            pop     si
+            ;~ call    DEBUG_DumpRegisters
+            ;~ call    AuxIO_DumpParagraph
+            ;~ call    AuxIO_TeletypeNL
+        popa
+        popf
+        ENDIF
+ENDIF
+
         mov     ax, cs
         mov     ds, ax
@@ -238,4 +278,22 @@
 ;           Ugly, need to cleanup.
 DriveIO_LVMAdjustToInfoSector   Proc Near
+
+IFDEF   AUX_DEBUG
+        IF 0
+        pusha
+            push    si
+            mov     si, offset $+5
+            jmp     @F
+            db      10,'DriveIO_LVMAdjustToInfoSector:',10,0
+            @@:
+            call    AuxIO_Print
+            pop     si
+            call    DEBUG_DumpRegisters
+            ;~ call    AuxIO_DumpParagraph
+            ;~ call    AuxIO_TeletypeNL
+        popa
+        ENDIF
+ENDIF
+
         push    cx                      ; Save Cyl/Sec part
         xor     ch,ch                   ; Clear low Cyl part
@@ -258,4 +316,20 @@
         or      cl,63                   ; Adjust CHS part   !FIX ME for > 63!   !! FIX HUGE DRIVE !!
 
+IFDEF   AUX_DEBUG
+        IF 0
+        pusha
+            push    si
+            mov     si, offset $+5
+            jmp     @F
+            db      10,'adjusted',10,0
+            @@:
+            call    AuxIO_Print
+            pop     si
+            call    DEBUG_DumpRegisters
+            ;~ call    AuxIO_DumpParagraph
+            ;~ call    AuxIO_TeletypeNL
+        popa
+        ENDIF
+ENDIF
 
         ret
@@ -326,4 +400,24 @@
 ; #########################################################################
 DriveIO_SavePartition   Proc Near  Uses ax bx cx dx si
+
+IFDEF   AUX_DEBUG
+        IF 0
+        pushf
+        pusha
+            push    si
+            mov     si, offset $+5
+            jmp     @F
+            db      10,'DriveIO_SavePartition:',10,0
+            @@:
+            call    AuxIO_Print
+            pop     si
+            ;~ call    DEBUG_DumpRegisters
+            ;~ call    AuxIO_DumpParagraph
+            ;~ call    AuxIO_TeletypeNL
+        popa
+        popf
+        ENDIF
+ENDIF
+
         mov     ax, wptr cs:[CurPartition_Location+0]
         mov     bx, wptr cs:[CurPartition_Location+2]
@@ -356,4 +450,24 @@
 ; Keeps DS:SI for caller, sets carry if valid LVM sector encountered
 DriveIO_LoadLVMSector   Proc Near  Uses ax bx cx dx
+
+IFDEF   AUX_DEBUG
+        IF 0
+        pushf
+        pusha
+            push    si
+            mov     si, offset $+5
+            jmp     @F
+            db      10,'DriveIO_LoadLVMSector:',10,0
+            @@:
+            call    AuxIO_Print
+            pop     si
+            ;~ call    DEBUG_DumpRegisters
+            ;~ call    AuxIO_DumpParagraph
+            ;~ call    AuxIO_TeletypeNL
+        popa
+        popf
+        ENDIF
+ENDIF
+
         test    byte ptr [CFG_IgnoreLVM], 1            ; We are supposed to ignore LVM, so
         jnz     DIOLLVMS_NoLVMSector          ;  don't load but declare as bad!
@@ -402,4 +516,24 @@
 ; Keeps DS:SI for caller, saves at anytime w/o checks (!)
 DriveIO_SaveLVMSector   Proc Near  Uses ax bx cx dx
+
+IFDEF   AUX_DEBUG
+        IF 0
+        pushf
+        pusha
+            push    si
+            mov     si, offset $+5
+            jmp     @F
+            db      10,'DriveIO_SaveLVMSector:',10,0
+            @@:
+            call    AuxIO_Print
+            pop     si
+            ;~ call    DEBUG_DumpRegisters
+            ;~ call    AuxIO_DumpParagraph
+            ;~ call    AuxIO_TeletypeNL
+        popa
+        popf
+        ENDIF
+ENDIF
+
         test    byte ptr [CFG_IgnoreLVM], 1            ; We are supposed to ignore LVM, so
         jnz     DIOSLVMS_SevereError          ;  don't save at anytime (security!)
@@ -476,4 +610,23 @@
 DriveIO_LoadSector      Proc Near  Uses ax bx cx dx ds si es di
 
+IFDEF   AUX_DEBUG
+        IF 0
+        pushf
+        pusha
+            push    si
+            mov     si, offset $+5
+            jmp     @F
+            db      10,'DriveIO_LoadSector:',10,0
+            @@:
+            call    AuxIO_Print
+            pop     si
+            ;~ call    DEBUG_DumpRegisters
+            ;~ call    AuxIO_DumpParagraph
+            ;~ call    AuxIO_TeletypeNL
+        popa
+        popf
+        ENDIF
+ENDIF
+
         ; Is the drive not a harddrive?
         cmp     dl, 80h
@@ -494,6 +647,25 @@
         cmp     bptr cs:[LBASwitchTable+di], bl
         jbe     DIOLS_UseExtension
+
     DIOLS_UseNormal:
-        mov     di, 3
+
+IFDEF   AUX_DEBUG
+        IF 0
+        pusha
+            push    si
+            mov     si, offset $+5
+            jmp     @F
+            db      10,'DriveIO_ReadSectorCHS:',10,0
+            @@:
+            call    AuxIO_Print
+            pop     si
+            call    DEBUG_DumpRegisters
+            call    AuxIO_DumpParagraph
+            call    AuxIO_TeletypeNL
+        popa
+        ENDIF
+ENDIF
+
+        mov     di, 3                      ; retry count
     DIOLS_ErrorLoop:
         push    ds
@@ -503,5 +675,5 @@
         int     13h
         jnc     DIOLS_Success
-        dec     di
+        dec     di                         ; decrement retry count
         jnz     DIOLS_ErrorLoop
 
@@ -552,4 +724,23 @@
 DriveIO_ReadSectorLBA       Proc Near  Uses bx cx dx si di ds es
 
+IFDEF   AUX_DEBUG
+        IF 0
+        pushf
+        pusha
+            push    si
+            mov     si, offset $+5
+            jmp     @F
+            db      10,'DriveIO_ReadSectorLBA:',10,0
+            @@:
+            call    AuxIO_Print
+            pop     si
+            call    DEBUG_DumpRegisters
+            call    AuxIO_DumpParagraph
+            call    AuxIO_TeletypeNL
+        popa
+        popf
+        ENDIF
+ENDIF
+
         ; One sector to read
         mov     cs:[INT13X_DAP_NumBlocks], 1
@@ -602,4 +793,21 @@
 ;##############################################################################
 DriveIO_WriteSectorLBA      Proc Near  Uses bx cx dx si di ds es
+
+IFDEF   AUX_DEBUG
+        IF 0
+        pusha
+            push    si
+            mov     si, offset $+5
+            jmp     @F
+            db      10,'DriveIO_WriteSectorLBA:',10,0
+            @@:
+            call    AuxIO_Print
+            pop     si
+            call    DEBUG_DumpRegisters
+            call    AuxIO_DumpParagraph
+            call    AuxIO_TeletypeNL
+        popa
+        ENDIF
+ENDIF
 
         ; Mask reserved bits for wrte flags -- should check version here
@@ -794,4 +1002,22 @@
 DriveIO_SaveSector              Proc Near  Uses ax bx cx dx ds si es di
 
+IFDEF   AUX_DEBUG
+        IF 0
+        pushf
+        pusha
+            push    si
+            mov     si, offset $+5
+            jmp     @F
+            db      10,'DriveIO_SaveSector:',10,0
+            @@:
+            call    AuxIO_Print
+            pop     si
+            ;~ call    DEBUG_DumpRegisters
+            ;~ call    AuxIO_DumpParagraph
+            ;~ call    AuxIO_TeletypeNL
+        popa
+        popf
+        ENDIF
+ENDIF
 
     ;!
@@ -808,25 +1034,4 @@
         inc cx
         xor dh,dh
-        ENDIF
-    ENDIF
-
-
-    ;!
-    ;! DEBUG_BLOCK
-    ;! Check what is being written to disk.
-    ;! Uncomment below to activate.
-    ;!
-    __DIO_SS_DMP__  EQU
-    IFDEF   AUX_DEBUG
-        IFDEF   __DIO_SS_DMP__
-        pusha
-        push    si
-        mov     si,offset [dioss]
-        call    AuxIO_Print
-        pop     si
-        call    DEBUG_DumpRegisters
-        call    AuxIO_DumpSector
-        call    AuxIO_TeletypeNL
-        popa
         ENDIF
     ENDIF
@@ -904,5 +1109,23 @@
 
     DIOSS_UseNormal:
-        mov     di, 3
+
+IFDEF   AUX_DEBUG
+        IF 0
+        pusha
+            push    si
+            mov     si, offset $+5
+            jmp     @F
+            db      10,'DriveIO_WriteSectorCHS:',10,0
+            @@:
+            call    AuxIO_Print
+            pop     si
+            call    DEBUG_DumpRegisters
+            call    AuxIO_DumpParagraph
+            call    AuxIO_TeletypeNL
+        popa
+        ENDIF
+ENDIF
+
+        mov     di, 3                      ; retry count
     DIOSS_ErrorLoop:
         push    ds
@@ -912,5 +1135,5 @@
         int     13h
         jnc     DIOSS_Success
-        dec     di
+        dec     di                         ; decrement retry count
         jnz     DIOSS_ErrorLoop
         call    MBR_SaveError
@@ -967,20 +1190,25 @@
 ; Loads sector at [LVMSector] !
 DriveIO_LoadMasterLVMSector     Proc  Near
-        pusha
-
-        ;~ mov      si,offset db_lmlvm
-        ;~ call     AuxIO_Print
-
-        ;~ ; Physical disk
-        ;~ mov     al,'<'
-        ;~ call    VideoIO_PrintSingleChar
-        ;~ mov     al,dl
-        ;~ call    VideoIO_PrintHexByte
-        ;~ mov     al,'>'
-        ;~ call    VideoIO_PrintSingleChar
-;~
-        ;~ call    AuxIO_TeletypeHexByte
-        ;~ call    AuxIO_TeletypeNL
-
+
+IFDEF   AUX_DEBUG
+        IF 0
+        pushf
+        pusha
+            push    si
+            mov     si, offset $+5
+            jmp     @F
+            db      10,'DriveIO_LoadMasterLVMSector:',10,0
+            @@:
+            call    AuxIO_Print
+            pop     si
+            ;~ call    DEBUG_DumpRegisters
+            ;~ call    AuxIO_DumpParagraph
+            ;~ call    AuxIO_TeletypeNL
+        popa
+        popf
+        ENDIF
+ENDIF
+
+        pusha
 
         ; Loop over the sector-translation table,
@@ -1000,9 +1228,9 @@
         ; Get the sector-number of the next possible LVM sector (255,127,63)
         ; using the translation table and the counter as the index
-        mov     bx,offset secs_per_track_table
-        mov     ax,cx
-        dec     ax
-        xlatb
-        dec     al
+        mov     bx,offset [secs_per_track_table]
+        mov     ax,cx   ; 1-based index to sec_per_track_table
+        dec     ax      ; Adjust to 0-based
+        xlatb           ; Get the (well known) SPT
+        dec     al      ; Minus 1 for LVM-record
 
         ;
@@ -1012,19 +1240,24 @@
         ;
 
-        ;~ push    ax
-        ;~ push    ax
-        ;~ mov     al,'$'
-        ;~ call    VideoIO_PrintSingleChar
-        ;~ pop     ax
-        ;~ call    VideoIO_PrintHexByte
-        ;~ mov     al,'$'
-        ;~ call    VideoIO_PrintSingleChar
-        ;~ pop     ax
-
-    IFDEF   AUX_DEBUG
-        ; Dump the value
-        ;~ call     AuxIO_TeletypeHexByte
-        ;~ call     AuxIO_TeletypeNL
-    ENDIF
+
+IFDEF   AUX_DEBUG
+        IF 0
+        pushf
+        pusha
+            push    si
+            mov     si, offset $+5
+            jmp     @F
+            db      10,'geo',10,0
+            @@:
+            call    AuxIO_Print
+            pop     si
+            call    DEBUG_DumpRegisters
+            call    AuxIO_DumpParagraph
+            call    AuxIO_TeletypeNL
+        popa
+        popf
+        ENDIF
+ENDIF
+
 
         ; Setup the requested LBA sector number
@@ -1036,24 +1269,26 @@
 
 IFDEF   AUX_DEBUG
-                pushf
-                pusha
-                pushf
-                xor     ax, ax
-                mov     al, dl
-                call    AuxIO_TeletypeHexWord
-                mov     al, '#'
-                call    AuxIO_Teletype
-                popf
-                mov     ax,0000h
-                rcl     al, 1
-                call    AuxIO_TeletypeHexWord
-                mov     al, '#'
-                call    AuxIO_Teletype
-                mov     ax,word ptr [INT13X_DAP_Absolute+0]
-                call    AuxIO_TeletypeHexWord
-                mov     al, '#'
-                call    AuxIO_Teletype
-                popa
-                popf
+        IF 0
+        pushf
+        pusha
+            pushf
+            xor     ax, ax
+            mov     al, dl
+            call    AuxIO_TeletypeHexWord
+            mov     al, '#'
+            call    AuxIO_Teletype
+            popf
+            mov     ax,0000h
+            rcl     al, 1
+            call    AuxIO_TeletypeHexWord
+            mov     al, '#'
+            call    AuxIO_Teletype
+            mov     ax,word ptr [INT13X_DAP_Absolute+0]
+            call    AuxIO_TeletypeHexWord
+            mov     al, '#'
+            call    AuxIO_Teletype
+        popa
+        popf
+        ENDIF
 ENDIF
 
@@ -1068,14 +1303,22 @@
         call    LVM_ValidateSector
 
-;        pushf
-;        mov     ah,0
-;        rcl     ah,1
-;        mov     al,'|'
-;        call    VideoIO_PrintSingleChar
-;        mov     al,ah
-;        call    VideoIO_PrintHexByte
-;        mov     al,'|'
-;        call    VideoIO_PrintSingleChar
-;        popf
+IFDEF   AUX_DEBUG
+        IF 0
+        pushf
+        pusha
+            push    si
+            mov     si, offset $+5
+            jmp     @F
+            db      10,'lvm record',10,0
+            @@:
+            call    AuxIO_Print
+            pop     si
+            call    DEBUG_DumpRegisters
+            call    AuxIO_DumpParagraph
+            call    AuxIO_TeletypeNL
+        popa
+        popf
+        ENDIF
+ENDIF
 
 
@@ -1195,4 +1438,24 @@
 ; DL contains BIOS disk-number; 80h for first, 81h for second, etc.
 DriveIO_GatherDiskInfo  Proc Near
+
+IFDEF   AUX_DEBUG
+        IF 0
+        pushf
+        pusha
+            push    si
+            mov     si, offset $+5
+            jmp     @F
+            db      10,'DriveIO_GatherDiskInfo:',10,0
+            @@:
+            call    AuxIO_Print
+            pop     si
+            ;~ call    DEBUG_DumpRegisters
+            ;~ call    AuxIO_DumpParagraph
+            ;~ call    AuxIO_TeletypeNL
+        popa
+        popf
+        ENDIF
+ENDIF
+
         pushf
         push    bx
@@ -1360,3 +1623,3 @@
 secs_per_track_table    db    63,127,255,255,255,255
 
-;db_lmlvm:   db 'Load Master LVM -- disk: ',0
+db_lmlvm    db 'Load Master LVM -- disk: ',0
Index: trunk/bootcode/regular/other.asm
===================================================================
--- trunk/bootcode/regular/other.asm	(revision 110)
+++ trunk/bootcode/regular/other.asm	(revision 111)
@@ -89,4 +89,23 @@
 ;
 PRECRAP_Main    Proc Near
+
+IFDEF   AUX_DEBUG
+        IF 0
+        pushf
+        pusha
+            push    si
+            mov     si, offset $+5
+            jmp     @F
+            db      10,'PRECRAP_Main:',10,0
+            @@:
+            call    AuxIO_Print
+            pop     si
+            ;~ call    DEBUG_DumpRegisters
+            ;~ call    AuxIO_DumpParagraph
+            ;~ call    AuxIO_TeletypeNL
+        popa
+        popf
+        ENDIF
+ENDIF
 
         ; First initialize Variable-Area (everything with NUL)
@@ -180,4 +199,5 @@
         int     13h
 
+; =============================================================================
 
         ; Start with disk at index 0
@@ -206,14 +226,4 @@
 
         pushf
-
-        ;~ mov     al,'#'
-        ;~ pushf
-        ;~ call    VideoIO_PrintSingleChar
-        ;~ popf
-        ;~ mov     al,0
-        ;~ rcl     al,1
-        ;~ call    VideoIO_PrintHexByte
-        ;~ mov     al,'#'
-        ;~ call    VideoIO_PrintSingleChar
 
         mov      bx, offset [TrueSecs]
@@ -264,5 +274,5 @@
         jb      PRECRAP_Main_next_disk
 
-
+; =============================================================================
 
     IFDEF   AUX_DEBUG
@@ -292,16 +302,16 @@
 
         ; Huge Disk indicator
-        mov     si, offset [HugeBootDisk]
-        call    MBR_Teletype
-        mov     al,[HugeDisk]
-        mov     si, offset [No]
-        test    al,al
-        jz      MBR_HugeDriveIndicator
-        mov     si, offset [Yes]
+        ;~ mov     si, offset [HugeBootDisk]
+        ;~ call    MBR_Teletype
+        ;~ mov     al,[HugeDisk]
+        ;~ mov     si, offset [No]
+        ;~ test    al,al
+        ;~ jz      MBR_HugeDriveIndicator
+        ;~ mov     si, offset [Yes]
 
     MBR_HugeDriveIndicator:
-        call    MBR_Teletype
-        xor     si,si
-        call    MBR_TeletypeNL
+        ;~ call    MBR_Teletype
+        ;~ xor     si,si
+        ;~ call    MBR_TeletypeNL
 
 
@@ -323,4 +333,5 @@
         call    MBR_TeletypeNL
 
+; =============================================================================
 
         ; Calculate Cooper-Bar Tables
@@ -438,4 +449,24 @@
 
 AFTERCRAP_Main  Proc Near
+
+IFDEF   AUX_DEBUG
+        IF 0
+        pushf
+        pusha
+            push    si
+            mov     si, offset $+5
+            jmp     @F
+            db      10,'AFTERCRAP_Main:',10,0
+            @@:
+            call    AuxIO_Print
+            pop     si
+            ;~ call    DEBUG_DumpRegisters
+            ;~ call    AuxIO_DumpParagraph
+            ;~ call    AuxIO_TeletypeNL
+        popa
+        popf
+        ENDIF
+ENDIF
+
         ; ===================================================
         ;  Now get volume label of FloppyDrive, if wanted...
@@ -455,4 +486,24 @@
 ; Checks Configuration CheckSum...Displays message, if failed.
 PRECRAP_CheckConfiguration      Proc Near  Uses ds si es di
+
+IFDEF   AUX_DEBUG
+        IF 0
+        pushf
+        pusha
+            push    si
+            mov     si, offset $+5
+            jmp     @F
+            db      10,'PRECRAP_CheckConfiguration:',10,0
+            @@:
+            call    AuxIO_Print
+            pop     si
+            ;~ call    DEBUG_DumpRegisters
+            ;~ call    AuxIO_DumpParagraph
+            ;~ call    AuxIO_TeletypeNL
+        popa
+        popf
+        ENDIF
+ENDIF
+
         mov     si, offset Configuration
         xor     bx, bx
Index: trunk/bootcode/regular/partmain.asm
===================================================================
--- trunk/bootcode/regular/partmain.asm	(revision 110)
+++ trunk/bootcode/regular/partmain.asm	(revision 111)
@@ -514,4 +514,24 @@
 ; Destroyed: None
 PART_HidePartition              Proc Near   Uses ax bx cx dx si di
+
+IFDEF   AUX_DEBUG
+        IF 0
+        pushf
+        pusha
+            push    si
+            mov     si, offset $+5
+            jmp     @F
+            db      10,'PART_HidePartition:',10,0
+            @@:
+            call    AuxIO_Print
+            pop     si
+            ;~ call    DEBUG_DumpRegisters
+            ;~ call    AuxIO_DumpParagraph
+            ;~ call    AuxIO_TeletypeNL
+        popa
+        popf
+        ENDIF
+ENDIF
+
         call    PART_GetPartitionPointer      ; Pointer to partition (DL) -> SI
 
@@ -565,4 +585,24 @@
 ;  do anything else.
 PART_MarkFirstGoodPrimary       Proc Near   Uses ax si di
+
+IFDEF   AUX_DEBUG
+        IF 0
+        pushf
+        pusha
+            push    si
+            mov     si, offset $+5
+            jmp     @F
+            db      10,'PART_MarkFirstGoodPrimary:',10,0
+            @@:
+            call    AuxIO_Print
+            pop     si
+            ;~ call    DEBUG_DumpRegisters
+            ;~ call    AuxIO_DumpParagraph
+            ;~ call    AuxIO_TeletypeNL
+        popa
+        popf
+        ENDIF
+ENDIF
+
     mov     di, offset PartitionSector+446 ; DS:SI - 1st partitionentry
     ; First action to do: Remove the active flag from every partition
@@ -944,4 +984,24 @@
 ;               run boot sector...
 PART_StartPartition             Proc Near   Uses ax dx es di
+
+IFDEF   AUX_DEBUG
+        IF 0
+        pushf
+        pusha
+            push    si
+            mov     si, offset $+5
+            jmp     @F
+            db      10,'PART_StartPartition:',10,0
+            @@:
+            call    AuxIO_Print
+            pop     si
+            ;~ call    DEBUG_DumpRegisters
+            ;~ call    AuxIO_DumpParagraph
+            ;~ call    AuxIO_TeletypeNL
+        popa
+        popf
+        ENDIF
+ENDIF
+
     ;
     ; Local Storage for this much too large function.
@@ -2165,4 +2225,24 @@
 ;
 PART_IsPrimaryPartition Proc Near  Uses bx cx dx si di ds es
+
+IFDEF   AUX_DEBUG
+        IF 0
+        pushf
+        pusha
+            push    si
+            mov     si, offset $+5
+            jmp     @F
+            db      10,'PART_IsPrimaryPartition:',10,0
+            @@:
+            call    AuxIO_Print
+            pop     si
+            ;~ call    DEBUG_DumpRegisters
+            ;~ call    AuxIO_DumpParagraph
+            ;~ call    AuxIO_TeletypeNL
+        popa
+        popf
+        ENDIF
+ENDIF
+
         ; Push LBA address of partition
         push     bx
Index: trunk/bootcode/regular/partscan.asm
===================================================================
--- trunk/bootcode/regular/partscan.asm	(revision 110)
+++ trunk/bootcode/regular/partscan.asm	(revision 111)
@@ -29,4 +29,24 @@
 
 PARTSCAN_ScanForPartitions      Proc Near
+
+IFDEF   AUX_DEBUG
+        IF 0
+        pushf
+        pusha
+            push    si
+            mov     si, offset $+5
+            jmp     @F
+            db      10,'PARTSCAN_ScanForPartitions:',10,0
+            @@:
+            call    AuxIO_Print
+            pop     si
+            ;~ call    DEBUG_DumpRegisters
+            ;~ call    AuxIO_DumpParagraph
+            ;~ call    AuxIO_TeletypeNL
+        popa
+        popf
+        ENDIF
+ENDIF
+
         ; Reset X-Reference
         call    PARTSCAN_ResetXref
@@ -119,4 +139,24 @@
 ;
 PARTSCAN_UpdateDriveLetters     Proc
+
+IFDEF   AUX_DEBUG
+        IF 0
+        pushf
+        pusha
+            push    si
+            mov     si, offset $+5
+            jmp     @F
+            db      10,'PARTSCAN_UpdateDriveLetters:',10,0
+            @@:
+            call    AuxIO_Print
+            pop     si
+            ;~ call    DEBUG_DumpRegisters
+            ;~ call    AuxIO_DumpParagraph
+            ;~ call    AuxIO_TeletypeNL
+        popa
+        popf
+        ENDIF
+ENDIF
+
         pusha
         xor     bx,bx           ; index-pointer
@@ -188,4 +228,24 @@
 ; falls eine Extended Partition (DOS) gefunden wird, wird erneut gescannt.
 PARTSCAN_ScanDriveForPartitions Proc Near
+
+IFDEF   AUX_DEBUG
+        IF 0
+        pushf
+        pusha
+            push    si
+            mov     si, offset $+5
+            jmp     @F
+            db      10,'PARTSCAN_ScanDriveForPartitions:',10,0
+            @@:
+            call    AuxIO_Print
+            pop     si
+            ;~ call    DEBUG_DumpRegisters
+            ;~ call    AuxIO_DumpParagraph
+            ;~ call    AuxIO_TeletypeNL
+        popa
+        popf
+        ENDIF
+ENDIF
+
         xor     ax, ax
         xor     bx, bx     ; Location Absoluter Sektor 0
@@ -218,4 +278,24 @@
 ; be set to this location and Carry will be set
 PARTSCAN_ScanPartitionForExtended Proc Near  Uses si
+
+IFDEF   AUX_DEBUG
+        IF 0
+        pushf
+        pusha
+            push    si
+            mov     si, offset $+5
+            jmp     @F
+            db      10,'PARTSCAN_ScanPartitionForExtended:',10,0
+            @@:
+            call    AuxIO_Print
+            pop     si
+            ;~ call    DEBUG_DumpRegisters
+            ;~ call    AuxIO_DumpParagraph
+            ;~ call    AuxIO_TeletypeNL
+        popa
+        popf
+        ENDIF
+ENDIF
+
         mov     si, offset PartitionSector+446 ; DS:SI - 1st partition entry
         xor     ax, ax
@@ -254,4 +334,25 @@
 ; The following routines have NOT *DS* set to CS, so we must address via ES
 PARTSCAN_ScanPartition          Proc Near  Uses ax si
+
+IFDEF   AUX_DEBUG
+        IF 0
+        pushf
+        pusha
+            push    si
+            mov     si, offset $+5
+            jmp     @F
+            db      10,'PARTSCAN_ScanPartition:',10,0
+            @@:
+            call    AuxIO_Print
+            pop     si
+            ;~ call    DEBUG_DumpRegisters
+            ;~ call    AuxIO_DumpParagraph
+            ;~ call    AuxIO_TeletypeNL
+        popa
+        popf
+        ENDIF
+ENDIF
+
+
         mov     si, offset PartitionSector+446 ; DS:SI - 1st Partition-Entry
     PSSP_ScanLoop:
@@ -316,4 +417,24 @@
 ;        In: SI - Points to Partition-Entry (16-Bytes)
 PARTSCAN_CheckThisPartition     Proc Near  Uses di si
+
+IFDEF   AUX_DEBUG
+        IF 0
+        pushf
+        pusha
+            push    si
+            mov     si, offset $+5
+            jmp     @F
+            db      10,'PARTSCAN_CheckThisPartition:',10,0
+            @@:
+            call    AuxIO_Print
+            pop     si
+            ;~ call    DEBUG_DumpRegisters
+            ;~ call    AuxIO_DumpParagraph
+            ;~ call    AuxIO_TeletypeNL
+        popa
+        popf
+        ENDIF
+ENDIF
+
         local   PartSystemID:byte, PartTypeFlags:byte
         local   PartCRC:word, PartPtr:word
Index: trunk/bootcode/special/lvm.asm
===================================================================
--- trunk/bootcode/special/lvm.asm	(revision 110)
+++ trunk/bootcode/special/lvm.asm	(revision 111)
@@ -56,4 +56,24 @@
 ; Destroyed: None
 LVM_GetSectorCRC                Proc Near   Uses bx cx
+
+IFDEF   AUX_DEBUG
+        IF 0
+        pushf
+        pusha
+            push    si
+            mov     si, offset $+5
+            jmp     @F
+            db      10,'LVM_GetSectorCRC:',10,0
+            @@:
+            call    AuxIO_Print
+            pop     si
+            ;~ call    DEBUG_DumpRegisters
+            ;~ call    AuxIO_DumpParagraph
+            ;~ call    AuxIO_TeletypeNL
+        popa
+        popf
+        ENDIF
+ENDIF
+
         push    word ptr [si+LocLVM_CRC+00]
         push    word ptr [si+LocLVM_CRC+02]
@@ -165,5 +185,28 @@
 ;            DS:SI - points to LVM information entry
 ; Destroyed: None
+
+; INVALID LVM RECORD WHEN STICK INSERTED !
+
 LVM_SearchForPartition          Proc Near   Uses cx
+
+IFDEF   AUX_DEBUG
+        IF 0
+        pushf
+        pusha
+            push    si
+            mov     si, offset $+5
+            jmp     @F
+            db      10,'LVM_SearchForPartition:',10,0
+            @@:
+            call    AuxIO_Print
+            pop     si
+            ;~ call    DEBUG_DumpRegisters
+            ;~ call    AuxIO_DumpParagraph
+            ;~ call    AuxIO_TeletypeNL
+        popa
+        popf
+        ENDIF
+ENDIF
+
         cmp     byte ptr [si+LocLVM_SignatureStart], LocLVM_SignatureByte0
         jne     LVMSFP_NotFound               ; Quick Check, if LVM sector there
@@ -195,4 +238,26 @@
 ;            assigned or no LVM-info.
 LVM_GetDriveLetter      Proc Near   Uses bx cx dx si di ds es
+
+IFDEF   AUX_DEBUG
+        IF 0
+        pushf
+        pusha
+            push    si
+            mov     si, offset $+5
+            jmp     @F
+            db      10,'LVM_GetDriveLetter:',10,0
+            @@:
+            call    AuxIO_Print
+            pop     si
+            ;~ call    DEBUG_DumpRegisters
+            ;~ call    AuxIO_DumpParagraph
+            ;~ call    AuxIO_TeletypeNL
+        popa
+        popf
+        ENDIF
+ENDIF
+
+
+
         ; For primary partitions this information is stored in the last
         ; sector of track0; for all four partition entries in case they
@@ -216,4 +281,11 @@
         ; will be set to 0ffh indicating an invalid index.
         call    PART_IsPrimaryPartition
+IF 0
+                pushf
+                pusha
+                call    VideoIO_PrintHexWord
+                popa
+                popf
+ENDIF
         mov     al,0
         rcl     al,1        ; CY if primary
@@ -262,5 +334,39 @@
         ; This locator takes care of extended OS/2 geometry should that be used
         ;
+IF 0
+                ; DH=0 or 1, DL=disk (8?h)
+                pushf
+                pusha
+                mov     ax, dx
+                call    VideoIO_PrintHexWord
+                mov     al,'-'
+                call    VideoIO_PrintSingleChar
+                popa
+                popf
+ENDIF
+        ; THIS ONE FAULTERS WHEN DISKS > 1
         call    DriveIO_LoadMasterLVMSector
+
+IF 0
+                ; INVALID LVM SECTOR !!
+                pushf
+                pusha
+                mov     ax,0000h
+                rcl     al,1
+                call    VideoIO_PrintHexWord        ; LVMSector
+                mov     al,'-'
+                call    VideoIO_PrintSingleChar
+                mov     si, offset [LVMSector]
+                mov     ax, si
+                call    VideoIO_PrintHexWord        ; LVMSector
+                lodsw
+                call    VideoIO_PrintHexWord        ; sig
+                lodsw
+                call    VideoIO_PrintHexWord        ; sig
+                mov     al,'-'
+                call    VideoIO_PrintSingleChar
+                popa
+                popf
+ENDIF
 
     LVM_GetDriveLetter_is_not_pri:
@@ -279,7 +385,37 @@
         push    si
         mov     ax,cx
-        mov     dx,bx
+        mov     dx,bx                   ; DL DESTROYED
         mov     si,offset [LVMSector]
         call    LVM_SearchForPartition
+
+IF 0
+                pushf
+                pusha
+                mov     ax, 0000h
+                rcl     al, 1
+                call    VideoIO_PrintHexWord
+                mov     ax, si
+                call    VideoIO_PrintHexWord
+                popa
+                popf
+ENDIF
+
+IFDEF   AUX_DEBUG
+        IF 0
+        pusha
+            push    si
+            mov     si, offset $+5
+            jmp     @F
+            db      10,'LVM_GetDriveLetter:',10,0
+            @@:
+            call    AuxIO_Print
+            pop     si
+            call    DEBUG_DumpRegisters
+            call    AuxIO_DumpParagraph
+            call    AuxIO_TeletypeNL
+        popa
+        ENDIF
+ENDIF
+
         mov     bx,si   ; BX now points to LVM entry
         mov     dx,0
@@ -316,4 +452,5 @@
 ;       Out: CY=1 if LVM-info found, 0 if no LVM-info.
 LVM_SetDriveLetter      Proc Near   Uses bx cx dx si di ds es
+
         local   disk:byte
         local   drive_letter:byte
@@ -335,4 +472,23 @@
         ; correct drive-letter.
         ;
+
+IFDEF   AUX_DEBUG
+        IF 0
+        pushf
+        pusha
+            push    si
+            mov     si, offset $+5
+            jmp     @F
+            db      10,'LVM_SetDriveLetter:',10,0
+            @@:
+            call    AuxIO_Print
+            pop     si
+            ;~ call    DEBUG_DumpRegisters
+            ;~ call    AuxIO_DumpParagraph
+            ;~ call    AuxIO_TeletypeNL
+        popa
+        popf
+        ENDIF
+ENDIF
 
         mov     [disk], dl
@@ -457,4 +613,24 @@
 ; Destroyed: None
 LVM_RemoveVolLetterFromSector   Proc Near   Uses cx
+
+IFDEF   AUX_DEBUG
+        IF 0
+        pushf
+        pusha
+            push    si
+            mov     si, offset $+5
+            jmp     @F
+            db      10,'LVM_RemoveVolLetterFromSector:',10,0
+            @@:
+            call    AuxIO_Print
+            pop     si
+            ;~ call    DEBUG_DumpRegisters
+            ;~ call    AuxIO_DumpParagraph
+            ;~ call    AuxIO_TeletypeNL
+        popa
+        popf
+        ENDIF
+ENDIF
+
         cmp     bptr [si+LocLVM_SignatureStart], LocLVM_SignatureByte0
         jne     LVMRVLFS_Done                 ; Quick Check, if LVM sector there
@@ -487,12 +663,22 @@
 LVM_DoLetterReassignment        Proc Near   Uses bx cx dx si di
 
-    IFDEF   AUX_DEBUG
+IFDEF   AUX_DEBUG
+        IF 0
+        pushf
         pusha
-        mov     si, offset [dlra]
-        call    AuxIO_Print
-        call    AuxIO_Teletype
-        call    AuxIO_TeletypeNL
+            push    si
+            mov     si, offset $+5
+            jmp     @F
+            db      10,'LVM_DoLetterReassignment:',10,0
+            @@:
+            call    AuxIO_Print
+            pop     si
+            ;~ call    DEBUG_DumpRegisters
+            ;~ call    AuxIO_DumpParagraph
+            ;~ call    AuxIO_TeletypeNL
         popa
-    ENDIF
+        popf
+        ENDIF
+ENDIF
 
         mov     di, si              ; Save SI in DI (Partition-pointer)
