Changeset 86


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

Added preliminary code for debug video page, hotkey 'd' [v1.1.1-testing]

Like the TAB-key switches between BIOS-post info and MENU, this toggles
the display of debug output to the screen. This uses video page 3.
No functionality is implemented yet.

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/regular/debug.asm

    r85 r86  
    9696        db      't'
    9797        dw      offset  DEBUG_Test
     98        db      'd'
     99        dw      offset  DEBUG_DebugScreenToggle
    98100        db      'l'
    99101        dw      offset  DEBUG_DumpDriveLetters
     
    325327
    326328;
     329; Toggle display of debug video page.
     330;
     331IF  0
     332DEBUG_DebugScreenToggle Proc
     333        pushf
     334        pusha
     335
     336        mov     si, offset $+5
     337        jmp     @F
     338        db      10,'DebugScreenToggle:',10,0
     339prvpg   db      00h
     340hdr     db      10,'[Debug Console]',13,10,0
     341@@:     call    AuxIO_Print
     342
     343        ; Get current page in BH
     344        mov     ah, 0fh
     345        int     10h
     346
     347        ; Already debug page ?
     348        cmp     bh, 03h
     349        je      DEBUG_DebugScreenToggle_back
     350
     351        ; Remember page
     352        mov     [prvpg], bh
     353
     354        ; Switch to debug page
     355        mov     al, 03h
     356        mov     ah, 05h
     357        int     10h
     358
     359        ; Get cursor position in DX (DH=row, DL=column)
     360        ;~ mov     ah, 03h
     361        ;~ mov     bh, 03h
     362        ;~ int     10h
     363
     364        ;~ mov     al, 01h
     365        ;~ mov     bh, 03h
     366        ;~ mov     bl, 07h
     367        ;~ mov     bp, offset [hdr]
     368        ;~ mov     cx, sizeof(hdr)
     369        ;~ mov     ah, 13h
     370        ;~ int     10h
     371
     372        ;~ mov     bh, 03h
     373        ;~ mov     dh, 00h
     374        ;~ mov     dl, 00h
     375        ;~ mov     ah, 02h
     376        ;~ int     10h
     377
     378        mov     si, offset [hdr]
     379        call    DBG_Teletype
     380
     381        jmp     DEBUG_DebugScreenToggle_end
     382
     383    DEBUG_DebugScreenToggle_back:
     384        ; Switch back to previous page
     385        mov     al, [prvpg]
     386        mov     ah, 05h
     387        int     10h
     388        jmp     DEBUG_DebugScreenToggle_end
     389
     390    DEBUG_DebugScreenToggle_end:
     391        popa
     392        popf
     393        ret
     394DEBUG_DebugScreenToggle EndP
     395ELSE
     396DEBUG_DebugScreenToggle Proc
     397        ret
     398DEBUG_DebugScreenToggle EndP
     399ENDIF
     400
     401
     402
     403;
    327404; Dump the geometry.
    328405;
     
    10051082
    10061083;
     1084; Like the MBR version, but uses video page 3
     1085;
     1086DBG_Teletype    Proc Near   Uses ax bx cx
     1087        mov     ah, 0Eh
     1088        mov     bh, 03h
     1089        mov     bl, 07h
     1090    DBGT_Loop:
     1091        lodsb
     1092        or      al, al
     1093        jz      DBGT_End
     1094        int     10h
     1095        jmp     DBGT_Loop
     1096    DBGT_End:
     1097        ret
     1098DBG_Teletype    EndP
     1099
     1100
     1101
     1102;
    10071103; These strings can also be referenced outside the debug module when debugging
    10081104; is enabled.
Note: See TracChangeset for help on using the changeset viewer.