Changeset 143


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

Added function to scan all disks for base information [v1.1.1-testing]

This function does the initial scanning of disks with the purpose of
populating the DISKINFO structures for each disk.

It precedes the second scanning stage, which involves scanning disks to
gather info about partitions etc.

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/driveio.asm

    r140 r143  
    17201720
    17211721;------------------------------------------------------------------------------
     1722; Scan all disks to gather information
     1723;------------------------------------------------------------------------------
     1724; IN    : None
     1725; OUT   : CF=1  - some failure occured
     1726;       : ZF=1  - no harddisks
     1727; NOTE  : This does the preliminary gathering of disk information
     1728;------------------------------------------------------------------------------
     1729DriveIO_ScanDisks   Proc    Near
     1730
     1731IFDEF   AUX_DEBUG
     1732        IF 1
     1733        DBG_TEXT_OUT_AUX    'DriveIO_ScanDisks:'
     1734        PUSHRF
     1735            call    DEBUG_DumpRegisters
     1736            ;~ call    AuxIO_DumpParagraph
     1737            ;~ call    AuxIO_TeletypeNL
     1738        POPRF
     1739        ENDIF
     1740ENDIF
     1741
     1742        ; Save all registers
     1743        pusha
     1744
     1745        ; Get number of disks in DH
     1746        call    DriveIO_GetHardDriveCount
     1747
     1748        ; Check if there are any disks to scan
     1749        xor     cx, cx                      ; Prepare 16-bit counter
     1750        mov     cl, dh                      ; Number of disks now in CX
     1751        jcxz    DriveIO_ScanDisks_end       ; Quit if no disks
     1752
     1753        ; Scan disks from 80h upward
     1754        mov     dl, 80h                     ; BIOS number of first disk
     1755    DriveIO_ScanDisks_next:
     1756        call    DriveIO_GatherDiskInfo      ; Gather info for this disk
     1757        jc       DriveIO_ScanDisks_end      ; Quit if some error occured
     1758        inc     dl                          ; Advance to next disk
     1759        loop    DriveIO_ScanDisks_next      ; Scan next disk if there is one
     1760        test    dl, dl                      ; Set ZF=0
     1761        clc                                 ; Indicate success
     1762
     1763    DriveIO_ScanDisks_end:
     1764        ; Restore all registers
     1765        popa
     1766
     1767        ret
     1768DriveIO_ScanDisks   EndP
     1769
     1770;------------------------------------------------------------------------------
    17221771; Calculate pointer to entry in DISKINFO structure
    17231772;------------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.