Changeset 114
- Timestamp:
- Apr 8, 2017, 12:27:12 AM (8 years ago)
- Location:
- trunk/bootcode
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bootcode/regular/driveio.asm
r113 r114 1303 1303 1304 1304 ; See if this is a valid LVM-sector 1305 ; ZF=0if valid1305 ; CY if valid 1306 1306 call LVM_ValidateSector 1307 1307 … … 1327 1327 1328 1328 ; Yep, we found the master LVM-sector 1329 jnz DriveIO_LoadMasterLVMSector_Found 1329 jc DriveIO_LoadMasterLVMSector_Found 1330 1330 1331 ; Try next location 1331 1332 loop DriveIO_LoadMasterLVMSector_NextTry -
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.