Changeset 102270 in vbox for trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-linker.h
- Timestamp:
- Nov 23, 2023 12:40:38 AM (12 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-linker.h
r102181 r102270 53 53 uint8_t cFATs; /**< 010h */ 54 54 uint16_t cRootDirEntries; /**< 011h */ 55 uint16_t cTotalSectors; /**< 013h */55 uint16_t cTotalSectors; /**< 013h - We (ab)use this for the checksum length in sectors. */ 56 56 uint8_t bMediaDescriptor; /**< 015h */ 57 57 uint16_t cSectorsPerFAT; /**< 016h */ … … 63 63 uint8_t bFlagsEtc; /**< 025h */ 64 64 uint8_t bExtendedSignature; /**< 026h */ 65 uint32_t dwSerialNumber; /**< 027h */65 uint32_t dwSerialNumber; /**< 027h - We (ab)use this for the base image checksum. */ 66 66 char abLabel[11]; /**< 02bh */ 67 67 char abFSType[8]; /**< 036h */ … … 104 104 int32_t offStrings; /**< Relative address (to entry start) of the string table. */ 105 105 uint32_t offFilename; /**< String table offset of the DLL name (sans path, with extension). */ 106 uint32_t uChecksum; /**< Simple checksum of all the on-disk image bits. */ 106 107 } BS3HIGHDLLENTRY; 107 108 /** Magic value for BS3HIGHDLLENTRY. */ … … 125 126 126 127 128 /** Initial value for Bs3CalcChecksum. */ 129 #define BS3_CALC_CHECKSUM_INITIAL_VALUE 1 130 131 /** 132 * Calculates an Adler-32 checksum. 133 */ 134 DECLINLINE(uint32_t) Bs3CalcChecksum(uint32_t uChecksum, uint8_t const RT_FAR *pbSrc, size_t cbSrc) 135 { 136 uint32_t uA = RT_LO_U16(uChecksum); 137 uint32_t uB = RT_HI_U16(uChecksum); 138 139 while (cbSrc-- > 0) 140 { 141 uA = (uA + *pbSrc++) % 0xfff1; 142 uB = (uA + uB) % 0xfff1; 143 } 144 145 return RT_MAKE_U32(uA, uB); 146 } 147 127 148 #endif /* !BS3KIT_INCLUDED_bs3kit_linker_h */ 128 149
Note:
See TracChangeset
for help on using the changeset viewer.