Index: trunk/bootcode/airboot.asm
===================================================================
--- trunk/bootcode/airboot.asm	(revision 116)
+++ trunk/bootcode/airboot.asm	(revision 117)
@@ -959,19 +959,22 @@
 
 
-        ; Verify we still got the BIOS disk in DL
-        IFDEF   AUX_DEBUG
-                IF 1
-                pusha
-                    push    si
-                    mov     si, offset $+5
-                    jmp     @F
-                    db      10,'## AiR_BOOT_Start ##',10,0
-                    @@:
-                    call    AuxIO_Print
-                    pop     si
-                    call    DEBUG_DumpRegisters
-                popa
-                ENDIF
+; Verify we still got the BIOS disk in DL
+IFDEF   AUX_DEBUG
+        IF 1
+        pushf
+        pusha
+            push    si
+            mov     si, offset $+5
+            jmp     @F
+            db      10,'## AiR_BOOT_Start ##',10,0
+            @@:
+            call    AuxIO_Print
+            pop     si
+            call    DEBUG_DumpRegisters
+        popa
+        popf
         ENDIF
+ENDIF
+
 
 ; -----------------------------------------------------------------------------
@@ -1019,57 +1022,59 @@
                 ; Number of harddisks and other system-info is now known.
 
-            ;!
-            ;! DEBUG_BLOCK
-            ;! Let's see what the BIOS supplied us with...
-            ;! Uncomment below to activate.
-            ;!
-            ;~ __DUMP_BIOS_REGS__  EQU
-            IFDEF   AUX_DEBUG
-                IFDEF   __DUMP_BIOS_REGS__
-                    pushf
-                    pusha
-                    ; Print title.
-                    mov     si,offset [bios_reg]
-                    call    AuxIO_Print
-                    ; Save the current stack (SS:SP).
-                    mov     ax,ss
-                    mov     [CurrentSS],ax
-                    mov     [CurrentSP],sp
-
-                    ; Restore the old stack.
-                    mov     ss,[OldSS]
-                    mov     sp,[OldSP]
-
-                    ; Pop the registers with the BIOS values.
-                    popa
-                    ; Push them back for AiR-BOOT restart (debug mode).
-                    pusha
-                    ; Dump them to the serial-port.
-                    call    DEBUG_DumpRegisters
-                    ; Restore the current stack.
-                    mov     ax,[CurrentSS]
-                    mov     ss,ax
-                    mov     sp,[CurrentSP]
-
-                    ; Restore registers.
-                    popa
-                    popf
-                ENDIF
-            ENDIF
-
-
-            ;!
-            ;! DEBUG_BLOCK
-            ;! Dump the registers at this point.
-            ;! Uncomment below to activate.
-            ;!
-            IFDEF   AUX_DEBUG
-                ;~ call    DEBUG_DumpRegisters
-                ; Dump drive-letters of dl-feature before partitions are
-                ; scanned and processed.
-                ;~ call    DEBUG_DumpDriveLetters
-                ;~ call    DEBUG_DumpVolumeLetters
-                ;~ call    DEBUG_DumpPartitionXref
-            ENDIF
+;!
+;! DEBUG_BLOCK
+;! Let's see what the BIOS supplied us with...
+;! Uncomment below to activate.
+;!
+IFDEF   AUX_DEBUG
+        IF 0
+        pushf
+        pusha
+
+            ; Print title.
+            mov     si,offset [bios_reg]
+            call    AuxIO_Print
+            ; Save the current stack (SS:SP).
+            mov     ax,ss
+            mov     [CurrentSS],ax
+            mov     [CurrentSP],sp
+
+            ; Restore the old stack.
+            mov     ss,[OldSS]
+            mov     sp,[OldSP]
+
+            ; Pop the registers with the BIOS values.
+            popa
+            ; Push them back for AiR-BOOT restart (debug mode).
+            pusha
+            ; Dump them to the serial-port.
+            call    DEBUG_DumpRegisters
+            ; Restore the current stack.
+            mov     ax,[CurrentSS]
+            mov     ss,ax
+            mov     sp,[CurrentSP]
+
+        popa
+        popf
+        ENDIF
+ENDIF
+
+
+;!
+;! DEBUG_BLOCK
+;! Dump the registers at this point.
+;!
+IFDEF   AUX_DEBUG
+        IF 0
+        pushf
+        pusha
+            ;~ call    DEBUG_DumpRegisters
+            ;~ call    DEBUG_DumpDriveLetters
+            ;~ call    DEBUG_DumpVolumeLetters
+            ;~ call    DEBUG_DumpPartitionXref
+        popa
+        popf
+        ENDIF
+ENDIF
 
 ; -----------------------------------------------------------------------------
@@ -1088,18 +1093,24 @@
                 ; Internal Partition Table is now populated.
 
-            ;!
-            ;! DEBUG_BLOCK
-            ;! Dump various tables.
-            ;! Uncomment below to activate.
-            ;!
-            IFDEF   AUX_DEBUG
-                ;~ call    DEBUG_DumpIPT
-                ;~ call    DEBUG_DumpPartitionPointers
-                ;~ call    DEBUG_DumpNewPartTable
-                ;~ call    DEBUG_DumpDriveLetters
-                ;~ call    DEBUG_DumpDriveLetters
-                ;~ call    DEBUG_DumpVolumeLetters
-                ;~ call    DEBUG_DumpPartitionXref
-            ENDIF
+;!
+;! DEBUG_BLOCK
+;! Dump various tables.
+;! Uncomment below to activate.
+;!
+IFDEF   AUX_DEBUG
+        IF 0
+        pushf
+        pusha
+            ;~ call    DEBUG_DumpIPT
+            ;~ call    DEBUG_DumpPartitionPointers
+            ;~ call    DEBUG_DumpNewPartTable
+            ;~ call    DEBUG_DumpDriveLetters
+            ;~ call    DEBUG_DumpDriveLetters
+            ;~ call    DEBUG_DumpVolumeLetters
+            ;~ call    DEBUG_DumpPartitionXref
+        popa
+        popf
+        ENDIF
+ENDIF
 
 
@@ -1118,18 +1129,23 @@
 
 
-            ;!
-            ;! DEBUG_BLOCK
-            ;! Dump various tables.
-            ;! Uncomment below to activate.
-            ;!
-            IFDEF   AUX_DEBUG
-                ;~ call    DEBUG_DumpIPT
-                ;~ call    DEBUG_DumpPartitionPointers
-                ;~ call    DEBUG_DumpNewPartTable
-                ;~ call    DEBUG_DumpDriveLetters
-                ;~ call    DEBUG_DumpDriveLetters
-                ;~ call    DEBUG_DumpVolumeLetters
-                ;~ call    DEBUG_DumpPartitionXref
-            ENDIF
+;!
+;! DEBUG_BLOCK
+;! Dump various tables.
+;!
+IFDEF   AUX_DEBUG
+        IF 0
+        pushf
+        pusha
+            ;~ call    DEBUG_DumpIPT
+            ;~ call    DEBUG_DumpPartitionPointers
+            ;~ call    DEBUG_DumpNewPartTable
+            ;~ call    DEBUG_DumpDriveLetters
+            ;~ call    DEBUG_DumpDriveLetters
+            ;~ call    DEBUG_DumpVolumeLetters
+            ;~ call    DEBUG_DumpPartitionXref
+        popa
+        popf
+        ENDIF
+ENDIF
 
 
@@ -1200,16 +1216,21 @@
 
 
-            ;!
-            ;! DEBUG_BLOCK
-            ;! Dump various tables.
-            ;! Uncomment below to activate.
-            ;!
-            IFDEF   AUX_DEBUG
-                ;~ call    DEBUG_DumpIPT
-                ;~ call    DEBUG_DumpPartitionPointers
-                ;~ call    DEBUG_DumpPartitionXref
-                ;~ call    DEBUG_DumpNewPartTable
-                ;~ call    DEBUG_DumpDriveLetters
-            ENDIF
+;!
+;! DEBUG_BLOCK
+;! Dump various tables.
+;!
+IFDEF   AUX_DEBUG
+        IF 0
+        pushf
+        pusha
+            ;~ call    DEBUG_DumpIPT
+            ;~ call    DEBUG_DumpPartitionPointers
+            ;~ call    DEBUG_DumpPartitionXref
+            ;~ call    DEBUG_DumpNewPartTable
+            ;~ call    DEBUG_DumpDriveLetters
+        popa
+        popf
+        ENDIF
+ENDIF
 
 
@@ -1224,16 +1245,21 @@
 
 
-            ;!
-            ;! DEBUG_BLOCK
-            ;! Dump various tables.
-            ;! Uncomment below to activate.
-            ;!
-            IFDEF   AUX_DEBUG
-                ;~ call    DEBUG_DumpIPT
-                ;~ call    DEBUG_DumpPartitionPointers
-                ;~ call    DEBUG_DumpPartitionXref
-                ;~ call    DEBUG_DumpNewPartTable
-                ;~ call    DEBUG_DumpDriveLetters
-            ENDIF
+;!
+;! DEBUG_BLOCK
+;! Dump various tables.
+;!
+IFDEF   AUX_DEBUG
+        IF 0
+        pushf
+        pusha
+            ;~ call    DEBUG_DumpIPT
+            ;~ call    DEBUG_DumpPartitionPointers
+            ;~ call    DEBUG_DumpPartitionXref
+            ;~ call    DEBUG_DumpNewPartTable
+            ;~ call    DEBUG_DumpDriveLetters
+        popa
+        popf
+        ENDIF
+ENDIF
 
                 ; Setup automatic boot to forgo the Menu.
@@ -1432,10 +1458,16 @@
     MBR_Main_StartPartition:
 
-            IFDEF   AUX_DEBUG
-                ;~ call    DEBUG_DumpIPT
-                ;~ call    DEBUG_DumpPartitionPointers
-                ;~ call    DEBUG_DumpPartitionXref
-                ;~ call    DEBUG_DumpNewPartTable
-            ENDIF
+IFDEF   AUX_DEBUG
+        IF 0
+        pushf
+        pusha
+            ;~ call    DEBUG_DumpIPT
+            ;~ call    DEBUG_DumpPartitionPointers
+            ;~ call    DEBUG_DumpPartitionXref
+            ;~ call    DEBUG_DumpNewPartTable
+        popa
+        popf
+        ENDIF
+ENDIF
 
 
Index: trunk/bootcode/regular/bootmenu.asm
===================================================================
--- trunk/bootcode/regular/bootmenu.asm	(revision 116)
+++ trunk/bootcode/regular/bootmenu.asm	(revision 117)
@@ -691,12 +691,18 @@
         mov     ah, [si+LocIPT_SystemID]
 
-    IFDEF   AUX_DEBUG
-        mov     al, ' '
-        call    VideoIO_PrintSingleChar
-        mov     al, ah
-        call    VideoIO_PrintHexByte
-        mov     al, ' '
-        call    VideoIO_PrintSingleChar
-    ENDIF
+IFDEF   AUX_DEBUG
+        IF 1
+        pushf
+        pusha
+            mov     al, ' '
+            call    VideoIO_PrintSingleChar
+            mov     al, ah
+            call    VideoIO_PrintHexByte
+            mov     al, ' '
+            call    VideoIO_PrintSingleChar
+        popa
+        popf
+        ENDIF
+ENDIF
 
         mov     al, ah
@@ -723,7 +729,13 @@
         mov     al, [si+25h]
 
-    IFDEF   AUX_DEBUG
-        call    VideoIO_PrintHexByte
-    ENDIF
+IFDEF   AUX_DEBUG
+        IF 1
+        pushf
+        pusha
+            call    VideoIO_PrintHexByte
+        popa
+        popf
+        ENDIF
+ENDIF
 
         mov     dh,al
Index: trunk/bootcode/regular/driveio.asm
===================================================================
--- trunk/bootcode/regular/driveio.asm	(revision 116)
+++ trunk/bootcode/regular/driveio.asm	(revision 117)
@@ -35,4 +35,33 @@
         mov     dl, [BIOS_BootDisk]     ; We check using the boot-disk
         int     13h
+
+IFDEF   AUX_DEBUG
+        IF 0
+        pushf
+        pusha
+            push    si
+            mov     si, offset $+5
+            jmp     @F
+            db      10,'DriveIO_CheckFor13extensions:',10,0
+            @@:
+            call    AuxIO_Print
+            pop     si
+            call    DEBUG_DumpRegisters
+            ;~ call    AuxIO_DumpParagraph
+            ;~ call    AuxIO_TeletypeNL
+
+            mov     si, offset [INT13X_DiskParams]
+            mov     word ptr [si], 50h
+            mov     ah, 48h
+            int     13h
+            call    DEBUG_DumpRegisters
+            ;~ call    AuxIO_DumpSector
+
+
+        popa
+        popf
+        ENDIF
+ENDIF
+
         jc      PCCF13E_NotFound        ; Error occured
         cmp     bx, 0AA55h
@@ -351,4 +380,24 @@
 ; #########################################################################
 DriveIO_LoadPartition   Proc Near  Uses si
+
+IFDEF   AUX_DEBUG
+        IF 0
+        pushf
+        pusha
+            push    si
+            mov     si, offset $+5
+            jmp     @F
+            db      10,'DriveIO_LoadPartition:',10,0
+            @@:
+            call    AuxIO_Print
+            pop     si
+            call    DEBUG_DumpRegisters
+            ;~ call    AuxIO_DumpParagraph
+            ;~ call    AuxIO_TeletypeNL
+        popa
+        popf
+        ENDIF
+ENDIF
+
         mov     wptr cs:[CurPartition_Location+0], ax
         mov     wptr cs:[CurPartition_Location+2], bx
@@ -369,21 +418,5 @@
     DIOLP_Success:
 
-    IFDEF   AUX_DEBUG
-        ; show current partition location
-        ;~ pushf
-        ;~ pusha
-        ;~ call     AuxIO_TeletypeNL
-        ;~ mov      si,offset db_curpartloc
-        ;~ call     AuxIO_Print
-        ;~ mov      dx,word ptr [CurPartition_Location+02]
-        ;~ mov      ax,word ptr [CurPartition_Location+00]
-        ;~ call     AuxIO_TeletypeHexDWord
-        ;~ call     AuxIO_TeletypeNL
-        ;~ mov      si,offset PartitionSector
-        ;~ call     AuxIO_DumpSector
-        ;~ call     AuxIO_TeletypeNL
-        ;~ popa
-        ;~ popf
-    ENDIF
+
 
         ret
@@ -462,5 +495,6 @@
             call    AuxIO_Print
             pop     si
-            ;~ call    DEBUG_DumpRegisters
+            call    DEBUG_DumpRegisters
+            call    AuxIO_DumpSector
             ;~ call    AuxIO_DumpParagraph
             ;~ call    AuxIO_TeletypeNL
@@ -479,23 +513,34 @@
         call    DriveIO_LVMAdjustToInfoSector
 
-        mov     si, offset LVMSector
+        mov     si, offset [LVMSector]
         call    DriveIO_LoadSector
 
-    IFDEF   AUX_DEBUG
-        ; show current partition location
-        ;~ pushf
-        ;~ pusha
-        ;~ call    AuxIO_TeletypeNL
-        ;~ mov     si,offset db_curlvmsec
-        ;~ call    AuxIO_Print
-        ;~ mov     dx,bx
-        ;~ call    AuxIO_TeletypeHexDWord
-        ;~ call    AuxIO_TeletypeNL
-        ;~ mov     si,offset LVMSector
-        ;~ call    AuxIO_DumpSector
-        ;~ call    AuxIO_TeletypeNL
-        ;~ popa
-        ;~ popf
-    ENDIF
+IFDEF   AUX_DEBUG
+        IF 0
+        pushf
+        pusha
+            push    si
+            mov     si, offset $+5
+            jmp     @F
+            db      10,'lvm record ex',10,0
+            @@:
+            call    AuxIO_Print
+            pop     si
+            ;~ call    AuxIO_TeletypeHexWord
+            ;~ call    AuxIO_TeletypeNL
+            call    DEBUG_DumpRegisters
+            ;~ call    AuxIO_DumpSector
+            ;~ mov     cx, 7
+            mov     cx, 32
+        @@:
+            call    AuxIO_DumpParagraph
+            call    AuxIO_TeletypeNL
+            add     si, 16
+            loop @B
+        popa
+        popf
+        ENDIF
+ENDIF
+
 
         call    LVM_CheckSectorSignature
@@ -545,22 +590,34 @@
         jnc     DIOSLVMS_SevereError                  ; LVM Signature must be there
 
-    IFDEF   AUX_DEBUG
-;~ dioatlvm    db 'DriveIO_LVMAdjustToInfoSector',10,0
-        ;~ pushf
-        ;~ pusha
-        ;~ mov     si,offset dioatlvm
-        ;~ call    AuxIO_Print
-        ;~ popa
-        ;~ popf
-        call    DEBUG_DumpRegisters
-        call    DEBUG_DumpCHS
-    ENDIF
+IFDEF   AUX_DEBUG
+        IF 0
+        pushf
+        pusha
+            ;~ dioatlvm    db 'DriveIO_LVMAdjustToInfoSector',10,0
+            ;~ pushf
+            ;~ pusha
+            ;~ mov     si,offset dioatlvm
+            ;~ call    AuxIO_Print
+            ;~ popa
+            ;~ popf
+            call    DEBUG_DumpRegisters
+            call    DEBUG_DumpCHS
+        popa
+        popf
+        ENDIF
+ENDIF
 
         call    DriveIO_LVMAdjustToInfoSector
 
-    IFDEF   AUX_DEBUG
-        call    DEBUG_DumpRegisters
-        call    DEBUG_DumpCHS
-    ENDIF
+IFDEF   AUX_DEBUG
+        IF 0
+        pushf
+        pusha
+            call    DEBUG_DumpRegisters
+            call    DEBUG_DumpCHS
+        popa
+        popf
+        ENDIF
+ENDIF
 
         mov     si, offset LVMSector
@@ -621,5 +678,5 @@
             call    AuxIO_Print
             pop     si
-            ;~ call    DEBUG_DumpRegisters
+            call    DEBUG_DumpRegisters
             ;~ call    AuxIO_DumpParagraph
             ;~ call    AuxIO_TeletypeNL
@@ -707,4 +764,22 @@
 
     DIOLS_Success:
+
+IFDEF   AUX_DEBUG
+        IF 0
+        pusha
+            push    si
+            mov     si, offset $+5
+            jmp     @F
+            db      10,'sector loaded',10,0
+            @@:
+            call    AuxIO_Print
+            pop     si
+            ;~ call    DEBUG_DumpRegisters
+            call    AuxIO_DumpSector
+            ;~ call    AuxIO_DumpParagraph
+            ;~ call    AuxIO_TeletypeNL
+        popa
+        ENDIF
+ENDIF
         ret
 DriveIO_LoadSector      EndP
@@ -714,4 +789,6 @@
 ;##############################################################################
 ;# ACTION   : Reads a sector from disk using INT13 extensions
+;# ----------------------------------------------------------------------------
+;# EFFECTS  : Modifies DAP structure and fills transfer buffer
 ;# ----------------------------------------------------------------------------
 ;# IN       : BX:CX - LBA address of sector
@@ -719,6 +796,4 @@
 ;# ----------------------------------------------------------------------------
 ;# OUT      : CF=1  - failure, AH failure code
-;# ----------------------------------------------------------------------------
-;# EFFECTS  : Modifies DAP structure and fills transfer buffer
 ;##############################################################################
 DriveIO_ReadSectorLBA       Proc Near  Uses bx cx dx si di ds es
@@ -783,4 +858,6 @@
 ;##############################################################################
 ;# ACTION   : Writes a sector to disk using INT13 extensions
+;# ----------------------------------------------------------------------------
+;# EFFECTS  : Modifies DAP structure and mofifies the disk
 ;# ----------------------------------------------------------------------------
 ;# IN       : AL    - write flags, AL.0 verify (1.0,2.0), AL.1 verify (2.1+)
@@ -789,6 +866,4 @@
 ;# ----------------------------------------------------------------------------
 ;# OUT      : CF=1  - failure, AH failure code
-;# ----------------------------------------------------------------------------
-;# EFFECTS  : Modifies DAP structure and mofifies the disk
 ;##############################################################################
 DriveIO_WriteSectorLBA      Proc Near  Uses bx cx dx si di ds es
@@ -1160,12 +1235,14 @@
 ENDIF
 
-    ;!
-    ;! DEBUG_BLOCK
-    ;! Force write to LBA0 to test interception routine.
-    ;! Do *NOT* enable unless you are debugging, will overwrite MBR !
-    ;!
-    ;~ __DIO_FORCE_LBA0_WRITE__    EQU
-    IFDEF   AUX_DEBUG
-        IFDEF   __DIO_FORCE_LBA0_WRITE__
+
+;!
+;! DEBUG_BLOCK
+;! Force write to LBA0 to test interception routine.
+;! Do *NOT* enable unless you are debugging, will overwrite MBR !
+;!
+IFDEF   AUX_DEBUG
+    IF 0
+    pushf
+    pusha
         xor ax,ax
         xor bx,bx
@@ -1173,6 +1250,8 @@
         inc cx
         xor dh,dh
-        ENDIF
+    popa
+    popf
     ENDIF
+ENDIF
 
         ;
@@ -1210,12 +1289,16 @@
 
 
-    IFDEF   AUX_DEBUG
-        pusha
-        mov     si, offset NonMBRwrite
+IFDEF   AUX_DEBUG
+    IF 0
+    pushf
+    pusha
+        mov     si, offset [NonMBRwrite]
         call    AuxIO_TeletypeNL
         call    AuxIO_Print
         call    AuxIO_TeletypeNL
-        popa
+    popa
+    popf
     ENDIF
+ENDIF
 
         ; Show popup and halt the system.
@@ -1442,4 +1525,6 @@
         call    LVM_ValidateSector
 
+
+
 IFDEF   AUX_DEBUG
         IF 0
@@ -1454,6 +1539,11 @@
             pop     si
             call    DEBUG_DumpRegisters
+            ;~ call    AuxIO_DumpSector
+            mov     cx, 7
+        @@:
             call    AuxIO_DumpParagraph
             call    AuxIO_TeletypeNL
+            add     si, 16
+            loop @B
         popa
         popf
@@ -1590,5 +1680,5 @@
             call    AuxIO_Print
             pop     si
-            ;~ call    DEBUG_DumpRegisters
+            call    DEBUG_DumpRegisters
             ;~ call    AuxIO_DumpParagraph
             ;~ call    AuxIO_TeletypeNL
@@ -1615,5 +1705,5 @@
         ; so we clear the whole buffer to be sure.
         mov     cx, i13xbuf_size        ; Dynamically calculated by assembler.
-        mov     di, offset i13xbuf      ; Points to size field.
+        mov     di, offset [i13xbuf]    ; Points to size field.
         mov     [di],cx                 ; Setup buffer-size.
         inc     di
@@ -1626,5 +1716,5 @@
         mov     ah, 48h                 ; Get Drive Parameters (extended version)
         ;mov     dl, 80h                ; Drive number
-        mov     si, offset i13xbuf      ; Buffer for result-info
+        mov     si, offset [i13xbuf]    ; Buffer for result-info
         push    dx
         int     13h                     ; Call the BIOS-function
@@ -1689,5 +1779,5 @@
 
         ; Store total secs
-        mov      bx, offset BIOS_TotalSecs
+        mov      bx, offset [BIOS_TotalSecs]
         add      bx,dx
         add      bx,dx
@@ -1703,5 +1793,5 @@
 
         ; Store number of bytes per sector
-        mov      bx, offset BIOS_Bytes
+        mov      bx, offset [BIOS_Bytes]
         add      bx,dx
         mov      ax,[si+18h]
Index: trunk/bootcode/regular/other.asm
===================================================================
--- trunk/bootcode/regular/other.asm	(revision 116)
+++ trunk/bootcode/regular/other.asm	(revision 117)
@@ -167,5 +167,5 @@
 
         ; Copyright
-        mov     si, offset Copyright
+        mov     si, [offset Copyright]
         call    MBR_Teletype
         xor     si,si
@@ -198,4 +198,9 @@
         mov     ah, 03h
         int     13h
+        ;!
+        ;! TODO: Check success
+        ;! Yes, we should check for errors here, coz it would mean AirBoot
+        ;! was loaded from a disk where the MBR cannot be written !
+        ;!
 
 ; =============================================================================
@@ -227,9 +232,26 @@
         pushf
 
-        mov      bx, offset [TrueSecs]
-        add      bx,cx
-        add      bx,cx
-        add      bx,cx
-        add      bx,cx
+        mov     bx, offset [TrueSecs]
+        add     bx,cx
+        add     bx,cx
+        add     bx,cx
+        add     bx,cx
+
+IFDEF   AUX_DEBUG
+        IF 0
+        pushf
+        pusha
+            mov     al, '#'
+            call    AuxIO_Teletype
+            mov     ax, [bx]
+            call    AuxIO_TeletypeHexWord
+            mov     al, '#'
+            call    AuxIO_Teletype
+            call    AuxIO_TeletypeNL
+        popa
+        popf
+        ENDIF
+ENDIF
+
         popf
 
@@ -276,8 +298,9 @@
 ; =============================================================================
 
-    IFDEF   AUX_DEBUG
-        ; Write some debug-info to the com-port
-        call     DEBUG_Dump1
+IFDEF   AUX_DEBUG
+    IF 1
+    call     DEBUG_Dump1
     ENDIF
+ENDIF
 
         ;~ jz      NoValidMasterLVM
@@ -299,5 +322,5 @@
 ;               call     AuxIO_TeletypeNL
 
-
+;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
         ; Huge Disk indicator
@@ -392,4 +415,15 @@
         call    PRECRAP_CheckConfiguration
 
+
+IFDEF   AUX_DEBUG
+        IF 1
+        mov     dl, [BIOS_BootDisk]
+        ;~ mov     dl, 81h
+        call    DriveIO_LocateMasterLVMSector
+        call    DEBUG_DumpRegisters
+        mov     si, offset [TmpSector]
+        call    AuxIO_DumpSector
+        ENDIF
+ENDIF
 
         ; =======================================
Index: trunk/bootcode/regular/partmain.asm
===================================================================
--- trunk/bootcode/regular/partmain.asm	(revision 116)
+++ trunk/bootcode/regular/partmain.asm	(revision 117)
@@ -1122,13 +1122,17 @@
 
 IFDEF   AUX_DEBUG
-    pusha
-    mov     si,offset [ptetb]
-    call    AuxIO_Print
-    call    DEBUG_DumpRegisters
-    call    AuxIO_TeletypeNL
-    mov     ax, word ptr [FreeDriveletterMap+00h]
-    mov     dx, word ptr [FreeDriveletterMap+02h]
-    call    AuxIO_TeletypeBinDWord
-    popa
+        IF 1
+        pushf
+        pusha
+            mov     si,offset [ptetb]
+            call    AuxIO_Print
+            call    DEBUG_DumpRegisters
+            call    AuxIO_TeletypeNL
+            mov     ax, word ptr [FreeDriveletterMap+00h]
+            mov     dx, word ptr [FreeDriveletterMap+02h]
+            call    AuxIO_TeletypeBinDWord
+        popa
+        popf
+        ENDIF
 ENDIF
 
@@ -1969,24 +1973,28 @@
 
 IFDEF   AUX_DEBUG
-    pusha
-    call    AuxIO_TeletypeNL
-    mov     bx, [PhysDiskBpbIndex]
-    inc     bx
-    mov     al, [di+bx]
-    call    AuxIO_TeletypeHexByte
-    mov     bl,[BootPartNo]
-    mov     al, [DriveLetters+bx]
-    call    AuxIO_TeletypeHexByte
-    mov     al, [PartitionVolumeLetters+bx]
-    add     al, 3dh
-    call    AuxIO_TeletypeHexByte
-    mov     al, [LVMdl]
-    add     al, 3dh
-    call    AuxIO_TeletypeHexByte
-    mov     al, [si+LocIPT_SystemID]
-    call    AuxIO_TeletypeHexByte
-    mov     al,[FSType]
-    call    AuxIO_TeletypeHexByte
-    popa
+        IF 1
+        pushf
+        pusha
+            call    AuxIO_TeletypeNL
+            mov     bx, [PhysDiskBpbIndex]
+            inc     bx
+            mov     al, [di+bx]
+            call    AuxIO_TeletypeHexByte
+            mov     bl,[BootPartNo]
+            mov     al, [DriveLetters+bx]
+            call    AuxIO_TeletypeHexByte
+            mov     al, [PartitionVolumeLetters+bx]
+            add     al, 3dh
+            call    AuxIO_TeletypeHexByte
+            mov     al, [LVMdl]
+            add     al, 3dh
+            call    AuxIO_TeletypeHexByte
+            mov     al, [si+LocIPT_SystemID]
+            call    AuxIO_TeletypeHexByte
+            mov     al,[FSType]
+            call    AuxIO_TeletypeHexByte
+        popa
+        popf
+        ENDIF
 ENDIF
 
@@ -2105,13 +2113,17 @@
 
 
-    IFDEF   AUX_DEBUG
+IFDEF   AUX_DEBUG
+        IF 1
+        pushf
         pusha
-        call    DEBUG_Dump2
-        ;~ call    DEBUG_DumpBSSSectors
-        call    DEBUG_DumpDriveLetters
-        call    DEBUG_DumpVolumeLetters
-        call    AuxIO_TeletypeNL
+            call    DEBUG_Dump2
+            ;~ call    DEBUG_DumpBSSSectors
+            call    DEBUG_DumpDriveLetters
+            call    DEBUG_DumpVolumeLetters
+            call    AuxIO_TeletypeNL
         popa
-    ENDIF
+        popf
+        ENDIF
+ENDIF
 
 
Index: trunk/bootcode/regular/partscan.asm
===================================================================
--- trunk/bootcode/regular/partscan.asm	(revision 116)
+++ trunk/bootcode/regular/partscan.asm	(revision 117)
@@ -68,17 +68,26 @@
         mov     byte ptr [CurIO_Scanning], 0             ; Reset flag due scanning complete
 
-    IFDEF   AUX_DEBUG
-        ;~ pusha
-        ;~ call    DEBUG_DumpHidePartTables
-        ;~ popa
-    ENDIF
+IFDEF   AUX_DEBUG
+        IF 0
+        pushf
+        pusha
+            call    DEBUG_DumpHidePartTables
+        popa
+        popf
+        ENDIF
+ENDIF
+
         ; Use X-Reference to sync NewPartitionTable with Hide-Config
         call    PARTSCAN_SyncHideConfigWithXref
 
-    IFDEF   AUX_DEBUG
-        ;~ pusha
-        ;~ call    DEBUG_DumpHidePartTables
-        ;~ popa
-    ENDIF
+IFDEF   AUX_DEBUG
+        IF 0
+        pushf
+        pusha
+        call    DEBUG_DumpHidePartTables
+        popa
+        popf
+        ENDIF
+ENDIF
 
         ; Now we copy the new IPT over the old one...
@@ -418,4 +427,7 @@
 PARTSCAN_CheckThisPartition     Proc Near  Uses di si
 
+        local   PartSystemID:byte, PartTypeFlags:byte
+        local   PartCRC:word, PartPtr:word
+
 IFDEF   AUX_DEBUG
         IF 0
@@ -437,6 +449,4 @@
 ENDIF
 
-        local   PartSystemID:byte, PartTypeFlags:byte
-        local   PartCRC:word, PartPtr:word
 
         mov     wptr [PartPtr], si          ; Save Pointer to PartitionEntry
@@ -512,6 +522,9 @@
         add     ax, wptr [CurPartition_Location+0] ; +Partition-Absolute
         adc     dx, wptr [CurPartition_Location+2] ;  sectors
-        mov     si, offset LVMSector
+
+        mov     si, offset [LVMSector]
+
         call    LVM_SearchForPartition     ; Search for DX:AX partition
+
         jnc     PCCTP_CheckBootRecord
         ; Check, if volume has driveletter assigned and remember it for later
@@ -1078,11 +1091,15 @@
 
 
-    IFDEF   AUX_DEBUG
-        ;~ pusha
-        ;~ mov     al,dl
-        ;~ call    AuxIO_TeletypeHexByte
-        ;~ call    AuxIO_TeletypeNL
-        ;~ popa
-    ENDIF
+IFDEF   AUX_DEBUG
+        IF 0
+        pushf
+        pusha
+            mov     al,dl
+            call    AuxIO_TeletypeHexByte
+            call    AuxIO_TeletypeNL
+        popa
+        popf
+        ENDIF
+ENDIF
 
 
@@ -1098,8 +1115,13 @@
 
     IFDEF   AUX_DEBUG
-        ; debug code
-        ;~ mov     ax,di
-        ;~ call    AuxIO_TeletypeHexWord
-        ;~ call    AuxIO_TeletypeNL
+        IF 0
+        pushf
+        pusha
+            mov     ax,di
+            call    AuxIO_TeletypeHexWord
+            call    AuxIO_TeletypeNL
+        popa
+        popf
+        ENDIF
     ENDIF
 
Index: trunk/bootcode/regular/videoio.asm
===================================================================
--- trunk/bootcode/regular/videoio.asm	(revision 116)
+++ trunk/bootcode/regular/videoio.asm	(revision 117)
@@ -887,5 +887,5 @@
         push    dx
         ; Offset of array containing LVM SPT values for each disk found
-        mov     bx,offset TrueSecs
+        mov     bx,offset [TrueSecs]
         ; DX to index
         xor     dh,dh
Index: trunk/bootcode/setup/part_set.asm
===================================================================
--- trunk/bootcode/setup/part_set.asm	(revision 116)
+++ trunk/bootcode/setup/part_set.asm	(revision 117)
@@ -973,9 +973,13 @@
 
 IFDEF   AUX_DEBUG
-        ;~ pusha
-        ;~ mov     al,dl   ; Partition the hiding is set for.
-        ;~ call    AuxIO_TeletypeHexByte
-        ;~ call    AuxIO_TeletypeNL
-        ;~ popa
+        IF 0
+        pushf
+        pusha
+            mov     al,dl   ; Partition the hiding is set for.
+            call    AuxIO_TeletypeHexByte
+            call    AuxIO_TeletypeNL
+        popa
+        popf
+        ENDIF
 ENDIF
 
@@ -997,9 +1001,13 @@
 
 IFDEF   AUX_DEBUG
-        ;~ pusha
-        ;~ mov     al,dl   ; Index of partition to set Special Marker on.
-        ;~ call    AuxIO_TeletypeHexByte
-        ;~ call    AuxIO_TeletypeNL
-        ;~ popa
+        IF 0
+        pushf
+        pusha
+            mov     al,dl   ; Index of partition to set Special Marker on.
+            call    AuxIO_TeletypeHexByte
+            call    AuxIO_TeletypeNL
+        popa
+        popf
+        ENDIF
 ENDIF
 
Index: trunk/bootcode/special/apm.asm
===================================================================
--- trunk/bootcode/special/apm.asm	(revision 116)
+++ trunk/bootcode/special/apm.asm	(revision 117)
@@ -31,10 +31,14 @@
 
 IFDEF       AUX_DEBUG
+            IF 1
+            pushf
             pusha
-            mov     si, offset $+5
-            jmp     @F
-            db      10,'>> System Shutdown <<',10,0
-@@:         call    AuxIO_Print
+                mov     si, offset $+5
+                jmp     @F
+                db      10,'>> System Shutdown <<',10,0
+        @@:     call    AuxIO_Print
             popa
+            popf
+            ENDIF
 ENDIF
 
Index: trunk/bootcode/special/lvm.asm
===================================================================
--- trunk/bootcode/special/lvm.asm	(revision 116)
+++ trunk/bootcode/special/lvm.asm	(revision 117)
@@ -207,5 +207,5 @@
             call    AuxIO_Print
             pop     si
-            ;~ call    DEBUG_DumpRegisters
+            call    DEBUG_DumpRegisters
             ;~ call    AuxIO_DumpParagraph
             ;~ call    AuxIO_TeletypeNL
