Changeset 620 in xtideuniversalbios
- Timestamp:
- Oct 5, 2021, 1:01:04 PM (3 years ago)
- Location:
- trunk/XTIDE_Universal_BIOS_Configurator_v2
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Variables.inc
r614 r620 22 22 23 23 ; Equates and defines 24 BOOT_MENU_DEFAULT_TIMEOUT EQU (TICKS_PER_MINUTE / 2) 25 MAX_ALLOWED_IDE_CONTROLLERS EQU 4 ; Maximum number of IDE controllers 26 MAX_LITE_MODE_CONTROLLERS EQU 2 27 EEPROM_POLLING_TIMEOUT_TICKS EQU 3 ; 1 tick = 54.9 ms 28 XTIDE_SIGNATURE_LENGTH EQU 6 ; XTIDE Universal BIOS signature string length (must be even) 29 NUMBER_OF_EEPROM_TYPES EQU 5 30 MAX_EEPROM_SIZE_IN_BYTES EQU 65536 31 24 BOOT_MENU_DEFAULT_TIMEOUT EQU (TICKS_PER_MINUTE / 2) 25 MAX_ALLOWED_IDE_CONTROLLERS EQU 4 ; Maximum number of IDE controllers 26 MAX_LITE_MODE_CONTROLLERS EQU 2 27 EEPROM_POLLING_TIMEOUT_TICKS EQU 3 ; 1 tick = 54.9 ms 28 XTIDE_SIGNATURE_LENGTH EQU 6 ; XTIDE Universal BIOS signature string length (must be even) 29 NUMBER_OF_EEPROM_TYPES EQU 5 30 MAX_EEPROM_SIZE_IN_BYTES EQU 65536 31 SST_PAGE_SIZE_SHIFT EQU 12 ; Minimum we can erase is a 4K sector. 32 SST_PAGE_SIZE EQU (1 << SST_PAGE_SIZE_SHIFT) 32 33 33 34 ; Program global variables … … 57 58 .28256_32kiB resb 2 58 59 .28512_64kiB resb 2 60 .SST_39SF resb 2 59 61 endstruc 60 62 … … 96 98 97 99 .wProgressUpdateParam resb 2 98 .wTimeoutCounter resb 2 100 .wTimeoutCounter resb 2 ; On SSI, this is timeout cal 99 101 .wLastOffsetWritten resb 2 100 102 .bLastByteWritten resb 1 … … 105 107 struc FLASH_RESULT 106 108 .success resb 2 109 .DeviceNotDetected resb 2 107 110 .PollingTimeoutError resb 2 108 111 .DataVerifyError resb 2 -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Buffers.asm
r614 r620 173 173 ret 174 174 175 ;-------------------------------------------------------------------- 176 ; Buffers_GetSelectedEepromSizeInWordsToAX 177 ; Parameters: 178 ; Nothing 179 ; Returns: 180 ; AX: Selected EEPROM size in WORDs 181 ; Corrupts registers: 182 ; BX 183 ;-------------------------------------------------------------------- 184 ALIGN JUMP_ALIGN 185 Buffers_GetSelectedEepromSizeInWordsToAX: 186 eMOVZX bx, [cs:g_cfgVars+CFGVARS.bEepromType] 187 mov ax, [cs:bx+g_rgwEepromTypeToSizeInWords] 188 189 cmp bl, EEPROM_TYPE.SST_39SF 190 jnz SHORT .HaveEepromSize 191 cmp ax, [cs:g_cfgVars+CFGVARS.wImageSizeInWords] 192 jae SHORT .HaveEepromSize 193 shl ax, 1 ; Auto-double SST size when too small. 194 .HaveEepromSize: 195 ret 175 196 176 197 ;-------------------------------------------------------------------- … … 181 202 ; Nothing 182 203 ; Corrupts registers: 183 ; AX, CX, DI204 ; AX, BX, CX, DI 184 205 ;-------------------------------------------------------------------- 185 206 ALIGN JUMP_ALIGN … … 187 208 push es 188 209 189 eMOVZX di, [cs:g_cfgVars+CFGVARS.bEepromType]190 mov cx, [cs:di+g_rgwEepromTypeToSizeInWords]210 call Buffers_GetSelectedEepromSizeInWordsToAX 211 mov cx, ax 191 212 sub cx, [cs:g_cfgVars+CFGVARS.wImageSizeInWords] ; CX = WORDs to append 192 213 jbe SHORT .NoNeedToAppendZeroes -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/EEPROM.asm
r593 r620 28 28 dw (32<<10) / 2 29 29 dw (64<<10) / 2 30 dw (32<<10) / 2 ; EEPROM_TYPE.SST_39SF 31 ; Actual size of flash will be larger than 32K, 32 ; however most (all?) XUB devices map a 32K window. 30 33 31 34 g_rgwEepromPageToSizeInBytes: -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Flash.asm
r596 r620 123 123 dw DoNotWriteAnySdpCommand ; EEPROM_TYPE.28256_32kiB 124 124 dw DoNotWriteAnySdpCommand ; EEPROM_TYPE.28512_64kiB 125 dw DoNotWriteAnySdpCommand ; EEPROM_TYPE.SST_39SF 125 126 .rgfnEnableSdpAndFlash: ; SDP_COMMAND.enable 126 127 dw WriteSdpEnableCommandFor2816 ; EEPROM_TYPE.2816_2kiB … … 129 130 dw WriteSdpEnableCommandFor28256or28512 ; EEPROM_TYPE.28256_32kiB 130 131 dw WriteSdpEnableCommandFor28256or28512 ; EEPROM_TYPE.28512_64kiB 132 dw DoNotWriteAnySdpCommand ; EEPROM_TYPE.SST_39SF 131 133 .rgfnDisableSdpAndFlash: ; SDP_COMMAND.disable 132 134 dw WriteSdpDisableCommandFor2816 ; EEPROM_TYPE.2816_2kiB … … 135 137 dw WriteSdpDisableCommandFor28256or28512 ; EEPROM_TYPE.28256_32kiB 136 138 dw WriteSdpDisableCommandFor28256or28512 ; EEPROM_TYPE.28512_64kiB 139 dw DoNotWriteAnySdpCommand ; EEPROM_TYPE.SST_39SF 137 140 138 141 -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Main.asm
r614 r620 56 56 %include "EEPROM.asm" 57 57 %include "Flash.asm" 58 %include "FlashSST.asm" 58 59 %include "IdeAutodetect.asm" 59 60 %include "MenuEvents.asm" -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/FlashMenu.asm
r602 r620 56 56 at MENUITEM.szQuickInfo, dw g_szNfoFlashEepromType 57 57 at MENUITEM.szHelp, dw g_szNfoFlashEepromType 58 at MENUITEM.bFlags, db FLG_MENUITEM_ PROGRAMVAR | FLG_MENUITEM_BYTEVALUE | FLG_MENUITEM_VISIBLE58 at MENUITEM.bFlags, db FLG_MENUITEM_MODIFY_MENU | FLG_MENUITEM_PROGRAMVAR | FLG_MENUITEM_BYTEVALUE | FLG_MENUITEM_VISIBLE 59 59 at MENUITEM.bType, db TYPE_MENUITEM_MULTICHOICE 60 60 at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw CFGVARS.bEepromType … … 72 72 at MENUITEM.szQuickInfo, dw g_szNfoFlashSDP 73 73 at MENUITEM.szHelp, dw g_szHelpFlashSDP 74 at MENUITEM.bFlags, db FLG_MENUITEM_PROGRAMVAR | FLG_MENUITEM_BYTEVALUE | FLG_MENUITEM_VISIBLE74 at MENUITEM.bFlags, db FLG_MENUITEM_PROGRAMVAR | FLG_MENUITEM_BYTEVALUE 75 75 at MENUITEM.bType, db TYPE_MENUITEM_MULTICHOICE 76 76 at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw CFGVARS.bSdpCommand … … 88 88 at MENUITEM.szQuickInfo, dw g_szNfoFlashPageSize 89 89 at MENUITEM.szHelp, dw g_szHelpFlashPageSize 90 at MENUITEM.bFlags, db FLG_MENUITEM_PROGRAMVAR | FLG_MENUITEM_BYTEVALUE | FLG_MENUITEM_VISIBLE90 at MENUITEM.bFlags, db FLG_MENUITEM_PROGRAMVAR | FLG_MENUITEM_BYTEVALUE 91 91 at MENUITEM.bType, db TYPE_MENUITEM_MULTICHOICE 92 92 at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw CFGVARS.bEepromPage … … 134 134 dw EEPROM_TYPE.28256_32kiB 135 135 dw EEPROM_TYPE.28512_64kiB 136 dw EEPROM_TYPE.SST_39SF 137 136 138 g_rgszValueToStringLookupForEepromType: 137 139 dw g_szValueFlash2816 … … 140 142 dw g_szValueFlash28256 141 143 dw g_szValueFlash28512 144 dw g_szValueFlashSST39SF 142 145 143 146 g_rgwChoiceToValueLookupForSdpCommand: … … 201 204 .AlreadySet: 202 205 mov si, g_MenupageForFlashMenu 203 jmp Menupage_ChangeToNewMenupageInDSSI 204 206 ePUSH_T bx, Menupage_ChangeToNewMenupageInDSSI 207 cmp WORD [g_cfgVars+CFGVARS.bEepromType], EEPROM_TYPE.SST_39SF 208 jz SHORT .DisableMenuitemsUnusedBySstFlash 209 ; Fall to .EnableMenuitemsUnusedBySstFlash 210 211 ;-------------------------------------------------------------------- 212 ; .EnableMenuitemsUnusedBySstFlash 213 ; Parameters: 214 ; SS:BP: Menu handle 215 ; Returns: 216 ; Nothing 217 ; Corrupts registers: 218 ; AX, BX 219 ;-------------------------------------------------------------------- 220 ALIGN JUMP_ALIGN 221 .EnableMenuitemsUnusedBySstFlash: 222 mov bx, g_MenuitemFlashSdpCommand 223 call EnableMenuitemFromCSBX 224 mov bx, g_MenuitemFlashPageSize 225 jmp EnableMenuitemFromCSBX 226 227 ;-------------------------------------------------------------------- 228 ; .DisableMenuitemsUnusedBySstFlash 229 ; Parameters: 230 ; SS:BP: Menu handle 231 ; Returns: 232 ; Nothing 233 ; Corrupts registers: 234 ; AX, BX 235 ;-------------------------------------------------------------------- 236 ALIGN JUMP_ALIGN 237 .DisableMenuitemsUnusedBySstFlash: 238 mov bx, g_MenuitemFlashSdpCommand 239 call DisableMenuitemFromCSBX 240 mov bx, g_MenuitemFlashPageSize 241 jmp DisableMenuitemFromCSBX 205 242 206 243 ;-------------------------------------------------------------------- … … 217 254 call .MakeSureThatImageFitsInEeprom 218 255 jc SHORT .InvalidFlashingParameters 256 cmp WORD [cs:g_cfgVars+CFGVARS.bEepromType], EEPROM_TYPE.SST_39SF 257 jnz SHORT .SkipAlignmentCheck 258 call .MakeSureAddress32KAligned 259 jc SHORT .InvalidFlashingParameters 260 .SkipAlignmentCheck: 219 261 push es 220 262 push ds … … 225 267 call .InitializeFlashvarsFromDSSI 226 268 mov bx, si ; DS:BX now points to FLASHVARS 269 cmp WORD [cs:g_cfgVars+CFGVARS.bEepromType], EEPROM_TYPE.SST_39SF 270 jz SHORT .FlashWithoutProgressBar 227 271 add si, BYTE FLASHVARS_size ; DS:SI now points to PROGRESS_DIALOG_IO 228 272 call Dialogs_DisplayProgressDialogForFlashingWithDialogIoInDSSIandFlashvarsInDSBX 273 .FlashComplete: 229 274 call .DisplayFlashingResultsFromFlashvarsInDSBX 230 275 … … 235 280 ret 236 281 282 .FlashWithoutProgressBar: ; Worst case. SST devices will 283 call FlashSst_WithFlashvarsInDSBX ; either complete flashing 284 jmp SHORT .FlashComplete ; or timeout within 2 seconds. 285 237 286 ;-------------------------------------------------------------------- 238 287 ; .MakeSureThatImageFitsInEeprom … … 246 295 ALIGN JUMP_ALIGN 247 296 .MakeSureThatImageFitsInEeprom: 248 call .GetSelectedEepromSizeInWordsToAX297 call Buffers_GetSelectedEepromSizeInWordsToAX 249 298 cmp ax, [cs:g_cfgVars+CFGVARS.wImageSizeInWords] 250 299 jae SHORT .ImageFitsInSelectedEeprom … … 254 303 ALIGN JUMP_ALIGN, ret 255 304 .ImageFitsInSelectedEeprom: 305 .AlignmentIs32K: 256 306 .DoNotGenerateChecksumByte: 307 ret 308 309 ;-------------------------------------------------------------------- 310 ; .MakeSureAddress32KAligned 311 ; Parameters: 312 ; SS:BP: Ptr to MENU 313 ; Returns: 314 ; CF: Set if EEPROM segment is not 32K aligned 315 ; Corrupts registers: 316 ; AX, BX, DX 317 ;-------------------------------------------------------------------- 318 ALIGN JUMP_ALIGN 319 .MakeSureAddress32KAligned: 320 mov ax, [cs:g_cfgVars+CFGVARS.wEepromSegment] 321 and ax, 007FFh 322 jz SHORT .AlignmentIs32K 323 mov dx, g_szErrAddrNot32KAligned 324 call Dialogs_DisplayErrorFromCSDX 325 stc 257 326 ret 258 327 … … 304 373 mov [si+FLASHVARS.bEepromSdpCommand], al 305 374 375 mov ax, SST_PAGE_SIZE 376 cmp WORD [g_cfgVars+CFGVARS.bEepromType], EEPROM_TYPE.SST_39SF 377 jz SHORT .UseSstPageSize 378 306 379 eMOVZX bx, [cs:g_cfgVars+CFGVARS.bEepromPage] 307 380 mov ax, [cs:bx+g_rgwEepromPageToSizeInBytes] 381 .UseSstPageSize: 308 382 mov [si+FLASHVARS.wEepromPageSize], ax 309 383 … … 323 397 ALIGN JUMP_ALIGN 324 398 .GetNumberOfPagesToFlashToAX: 325 call .GetSelectedEepromSizeInWordsToAX399 call Buffers_GetSelectedEepromSizeInWordsToAX 326 400 xor dx, dx 327 401 eSHL_IM ax, 1 ; Size in bytes to... … … 335 409 336 410 ;-------------------------------------------------------------------- 337 ; .GetSelectedEepromSizeInWordsToAX338 ; Parameters:339 ; Nothing340 ; Returns:341 ; AX: Selected EEPROM size in WORDs342 ; Corrupts registers:343 ; BX344 ;--------------------------------------------------------------------345 ALIGN JUMP_ALIGN346 .GetSelectedEepromSizeInWordsToAX:347 eMOVZX bx, [cs:g_cfgVars+CFGVARS.bEepromType]348 mov ax, [cs:bx+g_rgwEepromTypeToSizeInWords]349 ret350 351 352 ;--------------------------------------------------------------------353 411 ; .DisplayFlashingResultsFromFlashvarsInDSBX 354 412 ; Parameters: … … 368 426 .rgfnFlashResultMessage: 369 427 dw .DisplayFlashSuccessful 428 dw .DisplayDeviceDetectionError 370 429 dw .DisplayPollingError 371 430 dw .DisplayDataVerifyError … … 373 432 374 433 ;-------------------------------------------------------------------- 434 ; .DisplayDeviceDetectionError 375 435 ; .DisplayPollingError 376 436 ; .DisplayDataVerifyError … … 383 443 ; AX, DX, DI, ES 384 444 ;-------------------------------------------------------------------- 445 ALIGN JUMP_ALIGN 446 .DisplayDeviceDetectionError: 447 mov dx, g_szErrEepromDetection 448 jmp Dialogs_DisplayErrorFromCSDX 449 385 450 ALIGN JUMP_ALIGN 386 451 .DisplayPollingError: -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Strings.asm
r614 r620 53 53 54 54 ; Flashing related strings 55 g_szFlashTitle: db "Flashing EEPROM, please wait.",NULL 56 g_szErrEepromTooSmall: db "Image is too large for selected EEPROM type!",NULL 57 g_szErrEepromPolling: db "Timeout when polling EEPROM.",LF 58 db "EEPROM was not flashed properly!",NULL 59 g_szErrEepromVerify: db "EEPROM did not return the same byte that was written.",LF 60 db "EEPROM was not flashed properly!",NULL 61 g_szPCFlashSuccessful: db "EEPROM was written successfully.",LF 62 db "Press any key to reboot.",NULL 63 g_szForeignFlash: db "EEPROM was written successfully.",NULL 55 g_szFlashTitle: db "Flashing EEPROM, please wait.",NULL 56 g_szErrEepromTooSmall: db "Image is too large for selected EEPROM type!",NULL 57 g_szErrAddrNot32KAligned: db "The selected EEPROM type requires the address to be 32 " 58 db "kiB aligned (C800, D000, D800, E000, etc.)",NULL 59 g_szErrEepromDetection: db "EEPROM of type not found.",LF 60 db "EEPROM was not flashed properly!",NULL 61 g_szErrEepromPolling: db "Timeout when polling EEPROM.",LF 62 db "EEPROM was not flashed properly!",NULL 63 g_szErrEepromVerify: db "EEPROM did not return the same byte that was written.",LF 64 db "EEPROM was not flashed properly!",NULL 65 g_szPCFlashSuccessful: db "EEPROM was written successfully.",LF 66 db "Press any key to reboot.",NULL 67 g_szForeignFlash: db "EEPROM was written successfully.",NULL 64 68 65 69 … … 556 560 db "2864 mod (8 kiB)",LF 557 561 db "28256 (32 kiB)",LF 558 db "28512 (64 kiB)",NULL 562 db "28512 (64 kiB)",LF 563 db "SST39SFx flash",NULL 559 564 g_szValueFlash2816: db "2816",NULL 560 565 g_szValueFlash2864: db "2864",NULL … … 562 567 g_szValueFlash28256: db "28256",NULL 563 568 g_szValueFlash28512: db "28512",NULL 569 g_szValueFlashSST39SF: db "SST39SFx",NULL 564 570 565 571 g_szMultichoiceSdpCommand: db "None",LF
Note:
See TracChangeset
for help on using the changeset viewer.