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

Fake write succes on removable disks [v1.1.1-testing]

Accessing, and thus writing, removable disks is highly dependent on
the BIOS USB mass-storage emulation. Also, some removable disks have
a small switch to set it to read-only. We don't want such stuff to halt
AiR-BOOT with a 'SAVE ERROR', so we fake success in such cases.

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

    r164 r168  
    10501050
    10511051    DriveIO_WriteSectorLBA_exit:
     1052
     1053        ; Skip the removable drive check on success
     1054        jnc     @F
     1055
     1056        ; Here, CF=1 because of a failure.
     1057        ; This could be from a removable drive that is set to read-only,
     1058        ; in which case we want to fake success. What this boils down to
     1059        ; is that CY must be set to !IsRemovable.
     1060        call    DriveIO_CalcDiskInfoPointer         ; Get DISKINFO pointer
     1061        mov     dx, [bx+LocDISKINFO_I13X_Flags]     ; Get INT13X flags
     1062        xor     dl, 04h                             ; Invert 'removable' bit
     1063        and     dl, 04h                             ; Mask it out
     1064        rcr     dl, 3                               ; Move it to CY
     1065
     1066    @@:
    10521067
    10531068        ; Pop all registers
Note: See TracChangeset for help on using the changeset viewer.