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

Added a function to calculate pointer to DISKINFO entry [v1.1.1-testing]

The DISKINFO structure will replace all the loose disk related variables
like BIOS_*, LVM_*, LOG_* etc. This function returns a pointer into
the DISKINFO array using the BIOS disk number as the index.

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

    r126 r130  
    17941794DriveIO_GatherDiskInfo  EndP
    17951795
     1796;------------------------------------------------------------------------------
     1797; Calculate pointer to entry in DISKINFO structure
     1798;------------------------------------------------------------------------------
     1799; IN    : DL BIOS disk number (80h etc)
     1800; OUT   : BX Pointer to entry
     1801; NOTE  : BIOS disk number must be valid
     1802;------------------------------------------------------------------------------
     1803DriveIO_CalcDiskInfoPointer Proc    Near
     1804        xchg    bx, ax                          ; AX is used for calculation
     1805        mov     al, DISKINFO_Size               ; Size of DISKINFO structure
     1806        mov     ah, dl                          ; BIOS disk number
     1807        sub     ah, 80h                         ; Now 0-based index
     1808        mul     ah                              ; Now offset into DISKINFO array
     1809        add     ax, offset [DiskInformation]    ; Base of DISKINFO array
     1810        xchg    bx, ax                          ; BX now points to entry for disk
     1811        ret
     1812DriveIO_CalcDiskInfoPointer EndP
    17961813
    17971814;------------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.