Changeset 84


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

Changed the way to enable/disable debug-functions [v1.1.1-testing]

Instead of using named defines, now a simple 'IF' directive is used.
Any function local resources like strings are also conditionally enabled
or disabled.

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

Location:
trunk/bootcode
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/bootcode/regular/debug.asm

    r75 r84  
    2828; in that case. To compensate for that, the FX code is disabled when debugging
    2929; is active. Also, most of the debug-routines can selectively be disabled
    30 ; by commenting-out the define above it.
     30; by setting the 'IF' directive to 0 or 1. Setting to 0 does an immediate
     31; return, setting to 1 enables the routine.
    3132
    3233
     
    3536DB 'DEBUG',0
    3637ENDIF
     38
     39
    3740
    3841;
     
    7073;
    7174dbh     db  10
    72         db  'h=HELP, d=DRIVE-LETTERS, g=GEO, i=IPT, r=RESTART, v=VOL-LETTERS, x=XREF',10
     75        db  'h=HELP, d=DBGSCR-TOGGLE',10
     76        db  'l=DRIVE-LETTERS, g=GEO, i=IPT, r=RESTART, v=VOL-LETTERS, x=XREF',10
    7377        db  '0-9=disk 80h-89h info',10
    7478        db  10,0
     
    8589
    8690
     91
    8792;
    8893; Call list for debug hot-keys.
    8994;
    9095dbg_call_list:
    91         db      'd'
     96        db      'l'
    9297        dw      offset  DEBUG_DumpDriveLetters
    9398        db      'g'
     
    107112        db      0
    108113
     114
     115
    109116;
    110117; Handle keypresses when the main menu is active.
     
    180187
    181188;
    182 ; Show not assigned message.
     189; Show 'not assigned' message.
    183190;
    184191dbg_na  db  'This key is not assigned, press ''h'' for Help.',10,0
     
    226233
    227234
     235
    228236;
    229237; Check the simple 32-bit math functions.
    230238;
    231 ;~ __CHECK_MATH__  EQU
    232 DEBUG_CheckMath Proc    Near
    233     IFDEF   __CHECK_MATH__
     239IF  0
     240db_testmul32   db "## CHK MUL32 ##",10,0
     241DEBUG_Test_MATH_Mul32   Proc    Near
    234242        pushf
    235243        pusha
    236244
    237245        ; Msg check math-module
    238         mov     si,offset db_checkmath
     246        mov     si,offset [db_testmul32]
    239247        call    AuxIO_Print
    240248
     
    304312        popa
    305313        popf
    306     ENDIF
    307         ret
    308 DEBUG_CheckMath EndP
     314        ret
     315DEBUG_Test_MATH_Mul32   EndP
     316ELSE
     317DEBUG_Test_MATH_Mul32   Proc    Near
     318        ret
     319DEBUG_Test_MATH_Mul32   EndP
     320ENDIF
     321
    309322
    310323
     
    312325; Dump the geometry.
    313326;
    314 __DUMP_GEO__    EQU
     327IF  0
    315328DEBUG_DumpGeo   Proc
    316     IFDEF   __DUMP_GEO__
    317329        pushf
    318330        pusha
     
    360372        popa
    361373        popf
    362     ENDIF
    363 
    364374        ret
    365375DEBUG_DumpGeo   Endp
     376ELSE
     377DEBUG_DumpGeo   Proc
     378        ret
     379DEBUG_DumpGeo   Endp
     380ENDIF
     381
    366382
    367383
     
    369385; Dump the internal partition table.
    370386;
    371 __DUMP_IPT__    EQU
     387IF  0
    372388DEBUG_DumpIPT   Proc
    373     IFDEF   __DUMP_IPT__
    374389        pushf
    375390        pusha
     
    383398        popa
    384399        popf
    385     ENDIF
    386400        ret
    387401DEBUG_DumpIPT   EndP
     402ELSE
     403DEBUG_DumpIPT   Proc
     404        ret
     405DEBUG_DumpIPT   EndP
     406ENDIF
     407
    388408
    389409
     
    391411; Dump the new  partitions table.
    392412;
    393 ;~ __DUMP_NPT__    EQU
     413IF  0
    394414DEBUG_DumpNewPartTable  Proc
    395     IFDEF   __DUMP_NPT__
    396415        pushf
    397416        pusha
     
    404423        popa
    405424        popf
    406     ENDIF
    407425        ret
    408426DEBUG_DumpNewPartTable  EndP
     427DEBUG_DumpNewPartTable  Proc
     428        ret
     429DEBUG_DumpNewPartTable  EndP
     430ENDIF
     431
    409432
    410433
     
    412435; Dump the partition pointers table.
    413436;
    414 ;~ __DUMP_PP__     EQU
     437IF  0
    415438DEBUG_DumpPartitionPointers     Proc
    416     IFDEF   __DUMP_PP__
    417439        pushf
    418440        pusha
     
    431453        popa
    432454        popf
    433     ENDIF
    434455        ret
    435456DEBUG_DumpPartitionPointers     EndP
     457ELSE
     458DEBUG_DumpPartitionPointers     Proc
     459        ret
     460DEBUG_DumpPartitionPointers     EndP
     461ENDIF
     462
    436463
    437464
     
    439466; Dump the partition x-ref table.
    440467;
    441 __DUMP_PX__     EQU
     468IF  0
     469xrt     db  10,'XrefTable:',10,0
    442470DEBUG_DumpPartitionXref     Proc
    443     IFDEF   __DUMP_PX__
    444471        pushf
    445472        pusha
     
    460487        popa
    461488        popf
    462     ENDIF
    463489        ret
    464490DEBUG_DumpPartitionXref     EndP
     491ELSE
     492DEBUG_DumpPartitionXref     Proc
     493        ret
     494DEBUG_DumpPartitionXref     EndP
     495ENDIF
     496
    465497
    466498
     
    468500; Dump the dl-feature drive-letters.
    469501;
    470 __DUMP_DL__     EQU
     502IF  0
     503ddl     db  10,'Driveletters:',10,0
    471504DEBUG_DumpDriveLetters      Proc
    472     IFDEF   __DUMP_DL__
    473505        pushf
    474506        pusha
     
    498530        popa
    499531        popf
    500     ENDIF
    501532        ret
    502533DEBUG_DumpDriveLetters      EndP
     534ELSE
     535DEBUG_DumpDriveLetters      Proc
     536        ret
     537DEBUG_DumpDriveLetters      EndP
     538ENDIF
     539
     540
    503541
    504542;
    505543; Dump some disk information.
    506544;
    507 __DUMP_DI__     EQU
     545IF  0
     546ddi     db  10,'DumpDiskInfo:',10,0
    508547DEBUG_DumpDiskInfo          Proc
    509     IFDEF   __DUMP_DI__
    510548        pushf
    511549        pusha
     
    521559        popa
    522560        popf
    523     ENDIF
    524561        ret
    525562DEBUG_DumpDiskInfo          EndP
     563ELSE
     564DEBUG_DumpDiskInfo          Proc
     565        ret
     566DEBUG_DumpDiskInfo          EndP
     567ENDIF
     568
     569
    526570
    527571;
    528572; Dump the lvm volume drive-letters.
    529573;
    530 __DUMP_VL__     EQU
     574IF  0
     575dvl     db  10,'VolumeLetters:',10,0
    531576DEBUG_DumpVolumeLetters     Proc
    532     IFDEF   __DUMP_VL__
    533577        pushf
    534578        pusha
     
    548592        popa
    549593        popf
    550     ENDIF
    551594        ret
    552595DEBUG_DumpVolumeLetters     EndP
    553 
     596ELSE
     597DEBUG_DumpVolumeLetters     Proc
     598        ret
     599DEBUG_DumpVolumeLetters     EndP
     600ENDIF
    554601
    555602
     
    558605; Dump the registers.
    559606;
    560 __DUMP_REG__    EQU
    561 IFDEF   __DUMP_REG__
     607IF  1
    562608regAX   db  'AX:',0
    563609regBX   db  ' BX:',0
     
    576622;~ regFS   db  'FS:',0
    577623;~ regGS   db  ' GS:',0
    578 ENDIF
    579624DEBUG_DumpRegisters     Proc
    580     IFDEF   __DUMP_REG__
    581625        pushf
    582626        pusha
    583627
    584628        push    si
    585         mov     si, offset regAX
     629        mov     si, offset [regAX]
    586630        call    AuxIO_Print
    587631        call    AuxIO_TeletypeHexWord
     
    659703        popa
    660704        popf
    661     ENDIF
    662705        ret
    663706DEBUG_DumpRegisters     EndP
     707ELSE
     708DEBUG_DumpRegisters     Proc
     709        ret
     710DEBUG_DumpRegisters     EndP
     711ENDIF
     712
    664713
    665714
     
    667716; Dump CHS values.
    668717;
    669 __DUMP_CHS__    EQU
     718IF  0
    670719DEBUG_DumpCHS   Proc    Near
    671     IFDEF   __DUMP_CHS__
    672720        pushf
    673721        pusha
     
    700748        popa
    701749        popf
    702     ENDIF
    703750        ret
    704751DEBUG_DumpCHS   EndP
     752ELSE
     753DEBUG_DumpCHS   Proc    Near
     754        ret
     755DEBUG_DumpCHS   EndP
     756ENDIF
     757
    705758
    706759
     
    708761; Dump BSS.
    709762;
    710 ;~ __DUMP_BSS__    EQU
     763IF  0
    711764DEBUG_DumpBSSSectors    Proc    Near
    712     IFDEF   __DUMP_BSS__
    713765        pushf
    714766        pusha
     
    737789        popa
    738790        popf
    739     ENDIF
    740791        ret
    741792DEBUG_DumpBSSSectors    EndP
     793ELSE
     794DEBUG_DumpBSSSectors    Proc    Near
     795        ret
     796DEBUG_DumpBSSSectors    EndP
     797ENDIF
     798
    742799
    743800
     
    745802; Dump 6-bit packed hide partition table.
    746803;
    747 ;~ __DUMP_HPT__    EQU
     804IF  0
    748805DEBUG_DumpHidePartTables    Proc    Near
    749     IFDEF   __DUMP_HPT__
    750806        pushf
    751807        pusha
     
    778834        popa
    779835        popf
    780     ENDIF
    781836        ret
    782837DEBUG_DumpHidePartTables    EndP
     838ELSE
     839DEBUG_DumpHidePartTables    Proc    Near
     840        ret
     841DEBUG_DumpHidePartTables    EndP
     842ENDIF
     843
    783844
    784845
     
    786847; Check the bitfield routines.
    787848;
    788 ;~ __CBF__     EQU
     849IF  0
    789850DEBUG_CheckBitFields    Proc
    790     IFDEF   __CBF__
    791851        pushf
    792852        pusha
     
    818878        popa
    819879        popf
    820     ENDIF
    821880        ret
    822881DEBUG_CheckBitFields    EndP
    823 
     882ELSE
     883DEBUG_CheckBitFields    Proc
     884        ret
     885DEBUG_CheckBitFields    EndP
     886ENDIF
    824887
    825888
     
    828891; Dump information before the partition is booted.
    829892;
    830 ;~ __DMP2__    EQU
     893IF  0
    831894DEBUG_Dump2     Proc  Near
    832     IFDEF   __DMP2__
    833895        pushf
    834896        pusha
     
    908970        popa
    909971        popf
    910     ENDIF
    911972        ret
    912973DEBUG_Dump2     EndP
    913 
    914 
    915 
    916 xrt     db  10,'XrefTable:',10,0
    917 ddl     db  10,'Driveletters:',10,0
    918 ddi     db  10,'DumpDiskInfo:',10,0
    919 dvl     db  10,'VolumeLetters:',10,0
     974ELSE
     975DEBUG_Dump2     Proc  Near
     976        ret
     977DEBUG_Dump2     EndP
     978ENDIF
     979
     980
     981
     982;
     983; These strings can also be referenced outside the debug module when debugging
     984; is enabled.
     985;
    920986dlra    db  10,'LVM_DoLetterReassignment: ',0
    921987ptetb   db  10,'Partition Table Entry to boot',10,0
     
    927993;~ db_mbr              db "## MBR ##",10,0
    928994;~ db_masterlvm        db "## MLVMR ##",10,0
    929 
    930 ;~ db_checkmath        db "## CHK MATH ##",10,0
    931995
    932996
  • trunk/bootcode/regular/driveio.asm

    r78 r84  
    943943        pusha
    944944        push    si
    945         mov     si,offset dioss
     945        mov     si,offset [dioss]
    946946        call    AuxIO_Print
    947947        pop     si
  • trunk/bootcode/regular/partmain.asm

    r78 r84  
    11251125IFDEF   AUX_DEBUG
    11261126    pusha
    1127     mov     si,offset ptetb
     1127    mov     si,offset [ptetb]
    11281128    call    AuxIO_Print
    11291129    call    DEBUG_DumpRegisters
  • trunk/bootcode/special/lvm.asm

    r76 r84  
    468468    IFDEF   AUX_DEBUG
    469469        pusha
    470         mov     si, offset dlra
     470        mov     si, offset [dlra]
    471471        call    AuxIO_Print
    472472        call    AuxIO_Teletype
Note: See TracChangeset for help on using the changeset viewer.