Changeset 114 for trunk/bootcode/special/lvm.asm
- Timestamp:
- Apr 8, 2017, 12:27:12 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bootcode/special/lvm.asm
r111 r114 149 149 150 150 ; Checks if a sector is a valid LVM-sector 151 ; Sector is considered valid LVM-sector if both signature and CRC are correct. 152 ; In: DS:SI - Sector that needs to get checked... 153 ; Out: AL = 1 -> LVM Signature found 154 ; AH = 1 -> CRC OK 155 ; ZF = 0 -> Signature found and CRC OK, ZF = 1 -> Invalid LVM sector 156 ; Note: AL thus indicates a valid signature and AH a valid CRC 151 ; Sector is considered valid LVM-sector if both signature and CRC are correct. 152 ; IN : DS:SI - Buffer with LVM-sector that needs to be checked... 153 ; OUT : AL.0 - 1 -> LVM Signature found 154 ; AL.1 - 1 -> CRC OK 155 ; CY - Signature and CRC OK, otherwise none or invalid LVM sector 157 156 ; Destroyed: None 158 157 LVM_ValidateSector Proc Near 159 xor ax, ax ; Start with all zero bits158 xor ax, ax ; Assume no Signature or valid CRC 160 159 call LVM_CheckSectorSignature ; CF=1 -> Signature OK 161 rcl al, 1 ; Store CF in AL 162 call LVM_CheckSectorCRC ; CF=1 -> Checksum OK 163 rcl ah, 1 ; Store CF in AH 164 test al, ah ; ZF=0 if both AL and AH are 1 160 rcl al, 1 ; Store CF in AL.0 161 call LVM_CheckSectorCRC ; CF=1 -> CRC OK 162 rcl ah, 1 ; Store CF in AH.0 163 shl ah, 1 ; Move it to AH.1 164 or al, ah ; Merge CY results to AL 165 cmp al, 3 ; AH=3 -> Signature and CRC OK 166 clc ; Assume invalid LVM-sector 167 jne @F 168 stc ; AH=3 -> Indicate valid LVM-sector 169 @@: 170 mov ah, 0 ; Don't leave garbage in AH 165 171 ret 166 172 LVM_ValidateSector EndP
Note:
See TracChangeset
for help on using the changeset viewer.