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

Updated all debug hooks to use the new macros [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
  • TabularUnified trunk/bootcode/regular/driveio.asm

    r120 r123  
    3838IFDEF   AUX_DEBUG
    3939        IF 0
    40         pushf
    41         pusha
    42             push    si
    43             mov     si, offset $+5
    44             jmp     @F
    45             db      10,'DriveIO_CheckFor13extensions:',10,0
    46             @@:
    47             call    AuxIO_Print
    48             pop     si
     40        DBG_TEXT_OUT_AUX    'DriveIO_CheckFor13extensions:'
     41        PUSHRF
    4942            call    DEBUG_DumpRegisters
    5043            ;~ call    AuxIO_DumpParagraph
    5144            ;~ call    AuxIO_TeletypeNL
    52 
    5345            mov     si, offset [INT13X_DiskParams]
    5446            mov     word ptr [si], 50h
     
    5749            call    DEBUG_DumpRegisters
    5850            ;~ call    AuxIO_DumpSector
    59 
    60 
    61         popa
    62         popf
     51        POPRF
    6352        ENDIF
    6453ENDIF
     
    9079IFDEF   AUX_DEBUG
    9180        IF 0
    92         pushf
    93         pusha
    94             push    si
    95             mov     si, offset $+5
    96             jmp     @F
    97             db      10,'DriveIO_LoadConfiguration:',10,0
    98             @@:
    99             call    AuxIO_Print
    100             pop     si
     81        DBG_TEXT_OUT_AUX    'DriveIO_LoadConfiguration:'
     82        PUSHRF
    10183            ;~ call    DEBUG_DumpRegisters
    10284            ;~ call    AuxIO_DumpParagraph
    10385            ;~ call    AuxIO_TeletypeNL
    104         popa
    105         popf
    106         ENDIF
    107 ENDIF
    108 
     86        POPRF
     87        ENDIF
     88ENDIF
     89
     90;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    10991        mov     ax, cs
    11092        mov     es, ax
     
    11799        jnc     DIOLC_NoError
    118100        call    MBR_LoadError                 ; Will Abort BootUp
     101
     102
    119103    DIOLC_NoError:
    120104        ret
     
    125109IFDEF   AUX_DEBUG
    126110        IF 0
    127         pushf
    128         pusha
    129             push    si
    130             mov     si, offset $+5
    131             jmp     @F
    132             db      10,'DriveIO_SaveConfiguration:',10,0
    133             @@:
    134             call    AuxIO_Print
    135             pop     si
     111        DBG_TEXT_OUT_AUX    'DriveIO_SaveConfiguration:'
     112        PUSHRF
    136113            ;~ call    DEBUG_DumpRegisters
    137114            ;~ call    AuxIO_DumpParagraph
    138115            ;~ call    AuxIO_TeletypeNL
    139         popa
    140         popf
     116        POPRF
    141117        ENDIF
    142118ENDIF
     
    187163        mov     al, (MBR_BackUpMBR - Configuration) / 200h
    188164        mov     ah,03h
    189 
     165;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    190166        int     13h
    191167        jnc     DIOSC_NoError
     
    275251        jc      DIOILUT_Error
    276252        and     cl, 111111b    ; Isolate lower 6 bits of CL -> sector count
    277 
     253;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    278254        ;movzx   ax, cl
    279255        mov   al,cl
     
    310286IFDEF   AUX_DEBUG
    311287        IF 0
    312         pusha
    313             push    si
    314             mov     si, offset $+5
    315             jmp     @F
    316             db      10,'DriveIO_LVMAdjustToInfoSector:',10,0
    317             @@:
    318             call    AuxIO_Print
    319             pop     si
     288        DBG_TEXT_OUT_AUX    'DriveIO_LVMAdjustToInfoSector:'
     289        PUSHRF
    320290            call    DEBUG_DumpRegisters
    321291            ;~ call    AuxIO_DumpParagraph
    322292            ;~ call    AuxIO_TeletypeNL
    323         popa
     293        POPRF
    324294        ENDIF
    325295ENDIF
     
    347317IFDEF   AUX_DEBUG
    348318        IF 0
    349         pusha
    350             push    si
    351             mov     si, offset $+5
    352             jmp     @F
    353             db      10,'adjusted',10,0
    354             @@:
    355             call    AuxIO_Print
    356             pop     si
     319        DBG_TEXT_OUT_AUX    'adjusted'
     320        PUSHRF
    357321            call    DEBUG_DumpRegisters
    358322            ;~ call    AuxIO_DumpParagraph
    359323            ;~ call    AuxIO_TeletypeNL
    360         popa
     324        POPRF
    361325        ENDIF
    362326ENDIF
     
    383347IFDEF   AUX_DEBUG
    384348        IF 0
    385         pushf
    386         pusha
    387             push    si
    388             mov     si, offset $+5
    389             jmp     @F
    390             db      10,'DriveIO_LoadPartition:',10,0
    391             @@:
    392             call    AuxIO_Print
    393             pop     si
     349        DBG_TEXT_OUT_AUX    'DriveIO_LoadPartition:'
     350        PUSHRF
    394351            call    DEBUG_DumpRegisters
    395352            ;~ call    AuxIO_DumpParagraph
    396353            ;~ call    AuxIO_TeletypeNL
    397         popa
    398         popf
     354        POPRF
    399355        ENDIF
    400356ENDIF
     
    405361        mov     wptr cs:[CurPartition_Location+6], cx ; Saves the location
    406362        mov     si, offset PartitionSector    ; DS:SI - ExecBase
     363
     364
     365;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    407366        call    DriveIO_LoadSector
     367
    408368        clc
    409369        cmp     wptr [si+LocBR_Magic], 0AA55h
     
    436396IFDEF   AUX_DEBUG
    437397        IF 0
    438         pushf
    439         pusha
    440             push    si
    441             mov     si, offset $+5
    442             jmp     @F
    443             db      10,'DriveIO_SavePartition:',10,0
    444             @@:
    445             call    AuxIO_Print
    446             pop     si
     398        DBG_TEXT_OUT_AUX    'DriveIO_SavePartition:'
     399        PUSHRF
    447400            ;~ call    DEBUG_DumpRegisters
    448401            ;~ call    AuxIO_DumpParagraph
    449402            ;~ call    AuxIO_TeletypeNL
    450         popa
    451         popf
     403        POPRF
    452404        ENDIF
    453405ENDIF
     
    486438IFDEF   AUX_DEBUG
    487439        IF 0
    488         pushf
    489         pusha
    490             push    si
    491             mov     si, offset $+5
    492             jmp     @F
    493             db      10,'DriveIO_LoadLVMSector:',10,0
    494             @@:
    495             call    AuxIO_Print
    496             pop     si
     440        DBG_TEXT_OUT_AUX    'DriveIO_LoadLVMSector:'
     441        PUSHRF
    497442            call    DEBUG_DumpRegisters
    498443            call    AuxIO_DumpSector
    499444            ;~ call    AuxIO_DumpParagraph
    500445            ;~ call    AuxIO_TeletypeNL
    501         popa
    502         popf
     446        POPRF
    503447        ENDIF
    504448ENDIF
     
    518462IFDEF   AUX_DEBUG
    519463        IF 0
    520         pushf
    521         pusha
    522             push    si
    523             mov     si, offset $+5
    524             jmp     @F
    525             db      10,'lvm record ex',10,0
    526             @@:
    527             call    AuxIO_Print
    528             pop     si
     464        DBG_TEXT_OUT_AUX    'lvm record ex'
     465        PUSHRF
    529466            ;~ call    AuxIO_TeletypeHexWord
    530467            ;~ call    AuxIO_TeletypeNL
    531468            call    DEBUG_DumpRegisters
    532469            ;~ call    AuxIO_DumpSector
    533             ;~ mov     cx, 7
    534             mov     cx, 32
     470            mov     cx, 7
    535471        @@:
    536472            call    AuxIO_DumpParagraph
     
    538474            add     si, 16
    539475            loop @B
    540         popa
    541         popf
     476        POPRF
    542477        ENDIF
    543478ENDIF
     
    549484        jnc     DIOLLVMS_NoLVMSector
    550485        ret
     486
    551487        ; This here is called, if an invalid (or no) LVM information sector is found
    552488        ;  It will truncate the first byte of the sector, so all other routines
     
    564500IFDEF   AUX_DEBUG
    565501        IF 0
    566         pushf
    567         pusha
    568             push    si
    569             mov     si, offset $+5
    570             jmp     @F
    571             db      10,'DriveIO_SaveLVMSector:',10,0
    572             @@:
    573             call    AuxIO_Print
    574             pop     si
     502        DBG_TEXT_OUT_AUX    'DriveIO_SaveLVMSector:'
     503        PUSHRF
    575504            ;~ call    DEBUG_DumpRegisters
    576505            ;~ call    AuxIO_DumpParagraph
    577506            ;~ call    AuxIO_TeletypeNL
    578         popa
    579         popf
     507        POPRF
    580508        ENDIF
    581509ENDIF
     
    669597IFDEF   AUX_DEBUG
    670598        IF 0
    671         pushf
    672         pusha
    673             push    si
    674             mov     si, offset $+5
    675             jmp     @F
    676             db      10,'DriveIO_LoadSector:',10,0
    677             @@:
    678             call    AuxIO_Print
    679             pop     si
     599        DBG_TEXT_OUT_AUX    'DriveIO_LoadSector:'
     600        PUSHRF
    680601            call    DEBUG_DumpRegisters
    681602            ;~ call    AuxIO_DumpParagraph
    682603            ;~ call    AuxIO_TeletypeNL
    683         popa
    684         popf
     604        POPRF
    685605        ENDIF
    686606ENDIF
     
    709629IFDEF   AUX_DEBUG
    710630        IF 0
    711         pusha
    712             push    si
    713             mov     si, offset $+5
    714             jmp     @F
    715             db      10,'DriveIO_ReadSectorCHS:',10,0
    716             @@:
    717             call    AuxIO_Print
    718             pop     si
     631        DBG_TEXT_OUT_AUX    'DriveIO_ReadSectorCHS:'
     632        PUSHRF
    719633            call    DEBUG_DumpRegisters
    720634            call    AuxIO_DumpParagraph
    721635            call    AuxIO_TeletypeNL
    722         popa
     636        POPRF
    723637        ENDIF
    724638ENDIF
     
    766680IFDEF   AUX_DEBUG
    767681        IF 0
    768         pusha
    769             push    si
    770             mov     si, offset $+5
    771             jmp     @F
    772             db      10,'sector loaded',10,0
    773             @@:
    774             call    AuxIO_Print
    775             pop     si
     682        DBG_TEXT_OUT_AUX    'sector loaded'
     683        PUSHRF
    776684            ;~ call    DEBUG_DumpRegisters
    777             call    AuxIO_DumpSector
    778             ;~ call    AuxIO_DumpParagraph
    779             ;~ call    AuxIO_TeletypeNL
    780         popa
     685            ;~ call    AuxIO_DumpSector
     686            mov     cx, 32
     687        @@:
     688            call    AuxIO_DumpParagraph
     689            call    AuxIO_TeletypeNL
     690            add     si, 16
     691            loop @B
     692        POPRF
    781693        ENDIF
    782694ENDIF
     
    800712IFDEF   AUX_DEBUG
    801713        IF 0
    802         pushf
    803         pusha
    804             push    si
    805             mov     si, offset $+5
    806             jmp     @F
    807             db      10,'DriveIO_ReadSectorLBA:',10,0
    808             @@:
    809             call    AuxIO_Print
    810             pop     si
     714        DBG_TEXT_OUT_AUX    'DriveIO_ReadSectorLBA:'
     715        PUSHRF
    811716            call    DEBUG_DumpRegisters
    812717            call    AuxIO_DumpParagraph
    813718            call    AuxIO_TeletypeNL
    814         popa
    815         popf
     719        POPRF
    816720        ENDIF
    817721ENDIF
     
    879783IFDEF   AUX_DEBUG
    880784        IF 0
    881         pusha
    882             push    si
    883             mov     si, offset $+5
    884             jmp     @F
    885             db      10,'DriveIO_WriteSectorLBA:',10,0
    886             @@:
    887             call    AuxIO_Print
    888             pop     si
     785        DBG_TEXT_OUT_AUX    'DriveIO_WriteSectorLBA:'
     786        PUSHRF
    889787            call    DEBUG_DumpRegisters
    890788            call    AuxIO_DumpParagraph
    891789            call    AuxIO_TeletypeNL
    892         popa
     790        POPRF
    893791        ENDIF
    894792ENDIF
     
    991889IFDEF   AUX_DEBUG
    992890        IF 1
    993         pushf
    994         pusha
    995             push    si
    996             mov     si, offset $+5
    997             jmp     @F
    998             db      10,'DriveIO_LocateMasterLVMSector:',10,0
    999             @@:
    1000             call    AuxIO_Print
    1001             pop     si
     891        DBG_TEXT_OUT_AUX    'DriveIO_LocateMasterLVMSector:'
     892        PUSHRF
    1002893            call    DEBUG_DumpRegisters
    1003894            ;~ call    AuxIO_DumpSector
    1004895            ;~ call    AuxIO_DumpParagraph
    1005896            ;~ call    AuxIO_TeletypeNL
    1006         popa
    1007         popf
     897        POPRF
    1008898        ENDIF
    1009899ENDIF
     
    1037927        mov     si, offset [TmpSector]  ; Offset of temp buffer
    1038928        call    DriveIO_ReadSectorLBA   ; Read the sector
    1039         lahf
     929        lahf                            ; Save CF
    1040930        dec     cx                      ; Prepare LBA of next sector to read
    1041931        sahf                            ; Restore CF
     
    12341124IFDEF   AUX_DEBUG
    12351125        IF 0
    1236         pushf
    1237         pusha
    1238             push    si
    1239             mov     si, offset $+5
    1240             jmp     @F
    1241             db      10,'DriveIO_SaveSector:',10,0
    1242             @@:
    1243             call    AuxIO_Print
    1244             pop     si
     1126        DBG_TEXT_OUT_AUX    'DriveIO_SaveSector:'
     1127        PUSHRF
    12451128            ;~ call    DEBUG_DumpRegisters
    12461129            ;~ call    AuxIO_DumpParagraph
    12471130            ;~ call    AuxIO_TeletypeNL
    1248         popa
    1249         popf
     1131        POPRF
    12501132        ENDIF
    12511133ENDIF
     
    13501232IFDEF   AUX_DEBUG
    13511233        IF 0
    1352         pusha
    1353             push    si
    1354             mov     si, offset $+5
    1355             jmp     @F
    1356             db      10,'DriveIO_WriteSectorCHS:',10,0
    1357             @@:
    1358             call    AuxIO_Print
    1359             pop     si
     1234        DBG_TEXT_OUT_AUX    'DriveIO_WriteSectorCHS:'
     1235        PUSHRF
    13601236            call    DEBUG_DumpRegisters
    13611237            call    AuxIO_DumpParagraph
    13621238            call    AuxIO_TeletypeNL
    1363         popa
     1239        POPRF
    13641240        ENDIF
    13651241ENDIF
     
    14291305IFDEF   AUX_DEBUG
    14301306        IF 0
    1431         pushf
    1432         pusha
    1433             push    si
    1434             mov     si, offset $+5
    1435             jmp     @F
    1436             db      10,'DriveIO_LoadMasterLVMSector:',10,0
    1437             @@:
    1438             call    AuxIO_Print
    1439             pop     si
     1307        DBG_TEXT_OUT_AUX    'DriveIO_LoadMasterLVMSector:'
     1308        PUSHRF
    14401309            ;~ call    DEBUG_DumpRegisters
    14411310            ;~ call    AuxIO_DumpParagraph
    14421311            ;~ call    AuxIO_TeletypeNL
    1443         popa
    1444         popf
     1312        POPRF
    14451313        ENDIF
    14461314ENDIF
     
    14791347IFDEF   AUX_DEBUG
    14801348        IF 0
    1481         pushf
    1482         pusha
    1483             push    si
    1484             mov     si, offset $+5
    1485             jmp     @F
    1486             db      10,'geo',10,0
    1487             @@:
    1488             call    AuxIO_Print
    1489             pop     si
     1349        DBG_TEXT_OUT_AUX    'geo'
     1350        PUSHRF
    14901351            call    DEBUG_DumpRegisters
    14911352            call    AuxIO_DumpParagraph
    14921353            call    AuxIO_TeletypeNL
    1493         popa
    1494         popf
     1354        POPRF
    14951355        ENDIF
    14961356ENDIF
     
    15031363        mov     ah, 42h
    15041364        int     13h                                    ; do the i/o, CF=1->error, CF=0->success
    1505 
     1365;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    15061366IFDEF   AUX_DEBUG
    15071367        IF 0
     
    15431403IFDEF   AUX_DEBUG
    15441404        IF 0
    1545         pushf
    1546         pusha
    1547             push    si
    1548             mov     si, offset $+5
    1549             jmp     @F
    1550             db      10,'lvm record',10,0
    1551             @@:
    1552             call    AuxIO_Print
    1553             pop     si
     1405        DBG_TEXT_OUT_AUX    'lvm record'
     1406        PUSHRF
    15541407            call    DEBUG_DumpRegisters
    15551408            ;~ call    AuxIO_DumpSector
     
    15601413            add     si, 16
    15611414            loop @B
    1562         popa
    1563         popf
     1415        POPRF
    15641416        ENDIF
    15651417ENDIF
     
    16851537IFDEF   AUX_DEBUG
    16861538        IF 0
    1687         pushf
    1688         pusha
    1689             push    si
    1690             mov     si, offset $+5
    1691             jmp     @F
    1692             db      10,'DriveIO_GatherDiskInfo:',10,0
    1693             @@:
    1694             call    AuxIO_Print
    1695             pop     si
     1539        DBG_TEXT_OUT_AUX    'DriveIO_GatherDiskInfo:'
     1540        PUSHRF
    16961541            call    DEBUG_DumpRegisters
    16971542            ;~ call    AuxIO_DumpParagraph
    16981543            ;~ call    AuxIO_TeletypeNL
    1699         popa
    1700         popf
     1544        POPRF
    17011545        ENDIF
    17021546ENDIF
     
    18911735secs_per_track_table    db    63,127,255,255,255,255
    18921736
    1893 db_lmlvm    db 'Load Master LVM -- disk: ',0
     1737;~ db_lmlvm    db 'Load Master LVM -- disk: ',0
Note: See TracChangeset for help on using the changeset viewer.