Ignore:
Timestamp:
Apr 8, 2017, 12:27:09 AM (8 years ago)
Author:
Ben Rietbroek
Message:

Updated debug hooks (debugging) [v1.1.1-testing]

CAUTION:
This is a testbuild !
AirBoot uses the BIOS to access disks and a small coding error can trash
partition tables or other vital disk structures. You are advised to make
backups of TRACK0 and EBRs before using this testbuild. More info at:
https://rousseaux.github.io/netlabs.air-boot/pdf/AirBoot-v1.1.0-manual.pdf

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bootcode/special/lvm.asm

    r102 r111  
    5656; Destroyed: None
    5757LVM_GetSectorCRC                Proc Near   Uses bx cx
     58
     59IFDEF   AUX_DEBUG
     60        IF 0
     61        pushf
     62        pusha
     63            push    si
     64            mov     si, offset $+5
     65            jmp     @F
     66            db      10,'LVM_GetSectorCRC:',10,0
     67            @@:
     68            call    AuxIO_Print
     69            pop     si
     70            ;~ call    DEBUG_DumpRegisters
     71            ;~ call    AuxIO_DumpParagraph
     72            ;~ call    AuxIO_TeletypeNL
     73        popa
     74        popf
     75        ENDIF
     76ENDIF
     77
    5878        push    word ptr [si+LocLVM_CRC+00]
    5979        push    word ptr [si+LocLVM_CRC+02]
     
    165185;            DS:SI - points to LVM information entry
    166186; Destroyed: None
     187
     188; INVALID LVM RECORD WHEN STICK INSERTED !
     189
    167190LVM_SearchForPartition          Proc Near   Uses cx
     191
     192IFDEF   AUX_DEBUG
     193        IF 0
     194        pushf
     195        pusha
     196            push    si
     197            mov     si, offset $+5
     198            jmp     @F
     199            db      10,'LVM_SearchForPartition:',10,0
     200            @@:
     201            call    AuxIO_Print
     202            pop     si
     203            ;~ call    DEBUG_DumpRegisters
     204            ;~ call    AuxIO_DumpParagraph
     205            ;~ call    AuxIO_TeletypeNL
     206        popa
     207        popf
     208        ENDIF
     209ENDIF
     210
    168211        cmp     byte ptr [si+LocLVM_SignatureStart], LocLVM_SignatureByte0
    169212        jne     LVMSFP_NotFound               ; Quick Check, if LVM sector there
     
    195238;            assigned or no LVM-info.
    196239LVM_GetDriveLetter      Proc Near   Uses bx cx dx si di ds es
     240
     241IFDEF   AUX_DEBUG
     242        IF 0
     243        pushf
     244        pusha
     245            push    si
     246            mov     si, offset $+5
     247            jmp     @F
     248            db      10,'LVM_GetDriveLetter:',10,0
     249            @@:
     250            call    AuxIO_Print
     251            pop     si
     252            ;~ call    DEBUG_DumpRegisters
     253            ;~ call    AuxIO_DumpParagraph
     254            ;~ call    AuxIO_TeletypeNL
     255        popa
     256        popf
     257        ENDIF
     258ENDIF
     259
     260
     261
    197262        ; For primary partitions this information is stored in the last
    198263        ; sector of track0; for all four partition entries in case they
     
    216281        ; will be set to 0ffh indicating an invalid index.
    217282        call    PART_IsPrimaryPartition
     283IF 0
     284                pushf
     285                pusha
     286                call    VideoIO_PrintHexWord
     287                popa
     288                popf
     289ENDIF
    218290        mov     al,0
    219291        rcl     al,1        ; CY if primary
     
    262334        ; This locator takes care of extended OS/2 geometry should that be used
    263335        ;
     336IF 0
     337                ; DH=0 or 1, DL=disk (8?h)
     338                pushf
     339                pusha
     340                mov     ax, dx
     341                call    VideoIO_PrintHexWord
     342                mov     al,'-'
     343                call    VideoIO_PrintSingleChar
     344                popa
     345                popf
     346ENDIF
     347        ; THIS ONE FAULTERS WHEN DISKS > 1
    264348        call    DriveIO_LoadMasterLVMSector
     349
     350IF 0
     351                ; INVALID LVM SECTOR !!
     352                pushf
     353                pusha
     354                mov     ax,0000h
     355                rcl     al,1
     356                call    VideoIO_PrintHexWord        ; LVMSector
     357                mov     al,'-'
     358                call    VideoIO_PrintSingleChar
     359                mov     si, offset [LVMSector]
     360                mov     ax, si
     361                call    VideoIO_PrintHexWord        ; LVMSector
     362                lodsw
     363                call    VideoIO_PrintHexWord        ; sig
     364                lodsw
     365                call    VideoIO_PrintHexWord        ; sig
     366                mov     al,'-'
     367                call    VideoIO_PrintSingleChar
     368                popa
     369                popf
     370ENDIF
    265371
    266372    LVM_GetDriveLetter_is_not_pri:
     
    279385        push    si
    280386        mov     ax,cx
    281         mov     dx,bx
     387        mov     dx,bx                   ; DL DESTROYED
    282388        mov     si,offset [LVMSector]
    283389        call    LVM_SearchForPartition
     390
     391IF 0
     392                pushf
     393                pusha
     394                mov     ax, 0000h
     395                rcl     al, 1
     396                call    VideoIO_PrintHexWord
     397                mov     ax, si
     398                call    VideoIO_PrintHexWord
     399                popa
     400                popf
     401ENDIF
     402
     403IFDEF   AUX_DEBUG
     404        IF 0
     405        pusha
     406            push    si
     407            mov     si, offset $+5
     408            jmp     @F
     409            db      10,'LVM_GetDriveLetter:',10,0
     410            @@:
     411            call    AuxIO_Print
     412            pop     si
     413            call    DEBUG_DumpRegisters
     414            call    AuxIO_DumpParagraph
     415            call    AuxIO_TeletypeNL
     416        popa
     417        ENDIF
     418ENDIF
     419
    284420        mov     bx,si   ; BX now points to LVM entry
    285421        mov     dx,0
     
    316452;       Out: CY=1 if LVM-info found, 0 if no LVM-info.
    317453LVM_SetDriveLetter      Proc Near   Uses bx cx dx si di ds es
     454
    318455        local   disk:byte
    319456        local   drive_letter:byte
     
    335472        ; correct drive-letter.
    336473        ;
     474
     475IFDEF   AUX_DEBUG
     476        IF 0
     477        pushf
     478        pusha
     479            push    si
     480            mov     si, offset $+5
     481            jmp     @F
     482            db      10,'LVM_SetDriveLetter:',10,0
     483            @@:
     484            call    AuxIO_Print
     485            pop     si
     486            ;~ call    DEBUG_DumpRegisters
     487            ;~ call    AuxIO_DumpParagraph
     488            ;~ call    AuxIO_TeletypeNL
     489        popa
     490        popf
     491        ENDIF
     492ENDIF
    337493
    338494        mov     [disk], dl
     
    457613; Destroyed: None
    458614LVM_RemoveVolLetterFromSector   Proc Near   Uses cx
     615
     616IFDEF   AUX_DEBUG
     617        IF 0
     618        pushf
     619        pusha
     620            push    si
     621            mov     si, offset $+5
     622            jmp     @F
     623            db      10,'LVM_RemoveVolLetterFromSector:',10,0
     624            @@:
     625            call    AuxIO_Print
     626            pop     si
     627            ;~ call    DEBUG_DumpRegisters
     628            ;~ call    AuxIO_DumpParagraph
     629            ;~ call    AuxIO_TeletypeNL
     630        popa
     631        popf
     632        ENDIF
     633ENDIF
     634
    459635        cmp     bptr [si+LocLVM_SignatureStart], LocLVM_SignatureByte0
    460636        jne     LVMRVLFS_Done                 ; Quick Check, if LVM sector there
     
    487663LVM_DoLetterReassignment        Proc Near   Uses bx cx dx si di
    488664
    489     IFDEF   AUX_DEBUG
     665IFDEF   AUX_DEBUG
     666        IF 0
     667        pushf
    490668        pusha
    491         mov     si, offset [dlra]
    492         call    AuxIO_Print
    493         call    AuxIO_Teletype
    494         call    AuxIO_TeletypeNL
     669            push    si
     670            mov     si, offset $+5
     671            jmp     @F
     672            db      10,'LVM_DoLetterReassignment:',10,0
     673            @@:
     674            call    AuxIO_Print
     675            pop     si
     676            ;~ call    DEBUG_DumpRegisters
     677            ;~ call    AuxIO_DumpParagraph
     678            ;~ call    AuxIO_TeletypeNL
    495679        popa
    496     ENDIF
     680        popf
     681        ENDIF
     682ENDIF
    497683
    498684        mov     di, si              ; Save SI in DI (Partition-pointer)
Note: See TracChangeset for help on using the changeset viewer.