Changeset 124


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

Use SI instead of BX for actions on sector buffers [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

Location:
trunk
Files:
5 edited

Legend:

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

    r123 r124  
    878878;# ACTION   : Locates the Master LVM sector on the specified disk
    879879;# ----------------------------------------------------------------------------
    880 ;# EFFECTS  : None
     880;# EFFECTS  : Leaves [Scratch] with last sector read or cleared
    881881;# ----------------------------------------------------------------------------
    882882;# IN       : DL    - BIOS disk number of drive to search
     
    909909        ; This is of course no problem since it is the MBR.
    910910    DriveIO_LocateMasterLVMSector_next:
     911        mov     si, offset [Scratch]    ; Use scratch area to load sectors
     912        call    ClearSectorBuffer       ; Clear the scratch area
    911913        clc                             ; Indicate Master LVM sector not found
    912914        jcxz    DriveIO_LocateMasterLVMSector_done
    913915
    914         ; Clear the sector buffer
    915         mov     bx, cx                  ; Save our precious sector LBA
    916         mov     cx, 100h                ; Clear 256 words is 512 bytes
    917         mov     di, offset [TmpSector]  ; Offset of buffer
    918         xor     ax, ax                  ; Value to sture
    919         cld                             ; Increment DI each time
    920         rep     stosw                   ; Store the value
    921         mov     cx, bx                  ; Restore our precious sector LBA
    922 
    923         ; Now read the LBA sector specified in CX
     916        ; Read the LBA sector specified in CX
    924917        mov     ax, cx                  ; LBA low
    925918        xor     bx, bx                  ; LBA high
    926         mov     di, ds                  ; Segment of temp buffer
    927         mov     si, offset [TmpSector]  ; Offset of temp buffer
     919        mov     di, ds                  ; Segment of scratch buffer
     920        mov     si, offset [Scratch]    ; Offset of scratch buffer
    928921        call    DriveIO_ReadSectorLBA   ; Read the sector
    929922        lahf                            ; Save CF
     
    944937        ; of the SPT value its OS/2 geometery specifies, which, in LBA terms
    945938        ; is LVM SPT-1 -- let's check that...
    946         mov     bx, offset [TmpSector]          ; Offset of the loaded LVM sector
     939        mov     bx, offset [Scratch]            ; Offset of the loaded LVM sector
    947940        mov     al, [bx+LocLVM_Secs]            ; Get the LVM SPT value (<=255)
    948941        dec     al                              ; Adjust to LVM LBA
     
    950943        inc     ah                              ; This one was found here
    951944        cmp     al, ah                          ; If same, LVM LBA location OK
    952         call    DEBUG_DumpRegisters
    953945        jne     DriveIO_LocateMasterLVMSector_next
    954946
  • trunk/bootcode/regular/other.asm

    r123 r124  
    639639; Check if a loaded sector is all zeros
    640640;------------------------------------------------------------------------------
    641 ; IN    : BX pointer to memblock
     641; IN    : SI pointer to sector buffer
    642642; OUT   : ZF=1 block if all zeros
    643643; NOTE  : Segment used is DS
    644644;------------------------------------------------------------------------------
    645 IsSectorZero    Proc    Near    Uses cx
     645IsSectorBufferZero  Proc    Near    Uses bx cx
     646        mov     bx, si          ; Address of sector buffer
    646647        mov     cx, sector_size ; Normal size of a sector (512 bytes)
    647648        call    IsMemBlockZero  ; Check the memory block
    648649        ret
    649 IsSectorZero    EndP
     650IsSectorBufferZero  EndP
    650651
    651652;------------------------------------------------------------------------------
     
    685686; Clears a sector buffer
    686687;------------------------------------------------------------------------------
    687 ; IN    : BX pointer to sector buffer
     688; IN    : SI pointer to sector buffer
    688689; OUT   : Nothing
    689690; NOTE  : Segment used is DS
    690691;------------------------------------------------------------------------------
    691 ClearSectorBuffer   Proc    Near    Uses cx
     692ClearSectorBuffer   Proc    Near    Uses bx cx
     693        mov     bx, si              ; Address of sector buffer
    692694        mov     cx, sector_size     ; Normal size of a sector (512 bytes)
    693695        call    ClearMemBlock       ; Clear the sector buffer
  • trunk/bootcode/special/lvm.asm

    r123 r124  
    125125; Destroyed: None
    126126LVM_CheckSectorCRC              Proc Near   Uses ax bx dx
    127         mov     bx, si
    128         call    IsSectorZero                ; Zero sector implies bad CRC
     127        call    IsSectorBufferZero          ; Zero sector implies bad CRC
    129128        jz      LVMCSCRC_BadCRC
    130129        call    LVM_GetSectorCRC            ; Only use after CRC table is valid
  • trunk/include/version.h

    r121 r124  
    3232#define     BLDLVL_YEAR             "2017"
    3333#define     BLDLVL_MONTH            "03"
    34 #define     BLDLVL_DAY              "27"
     34#define     BLDLVL_DAY              "28"
    3535// Build time
    3636//~ #define     BLDLVL_HOURS            "01"
  • trunk/include/version.inc

    r121 r124  
    7070AB_YEAR             EQU     2017h
    7171AB_MONTH            EQU     03h
    72 AB_DAY              EQU     27h
     72AB_DAY              EQU     28h
    7373
    7474; The Hours, Minutes and Seconds, again in BCD for easy manipulation.
Note: See TracChangeset for help on using the changeset viewer.