Changeset 65 in xtideuniversalbios
- Timestamp:
- Dec 5, 2010, 6:52:11 PM (14 years ago)
- google:author:
- aitotat
- Location:
- trunk/XTIDE_Universal_BIOS_Configurator_v2
- Files:
-
- 1 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/Variables.inc
r63 r65 2 2 ; Project name : XTIDE Univeral BIOS Configurator v2 3 3 ; Created date : 5.10.2010 4 ; Last update : 19.11.20104 ; Last update : 2.12.2010 5 5 ; Author : Tomi Tilli 6 6 ; Description : Global variables for configuration program. … … 12 12 EEPROM_POLLING_TIMEOUT_TICKS EQU 3 ; 1 tick = 54.9 ms 13 13 XTIDE_SIGNATURE_LENGTH EQU 8 ; XTIDE Universal BIOS signature string length 14 NUMBER_OF_ SUPPORTED_EEPROM_SIZES EQU 514 NUMBER_OF_EEPROM_TYPES EQU 4 15 15 MAX_EEPROM_SIZE EQU 65536 16 16 … … 20 20 .pMenupage resb 2 ; Offset to MENUPAGE to display 21 21 .wFlags resb 2 ; Program flags 22 .wImageSize resb 2 ; Size in bytes for BIOS image to be flashed (0=65536)22 .wImageSizeInWords resb 2 ; Size in words for loaded ROM or FILE 23 23 .wEepromSegment resb 2 ; Segment where EEPROM is located 24 24 .bEepromType resb 1 ; EEPROM type 25 .bEepromPage Size resb 1 ; EEPROM page size in bytes25 .bEepromPage resb 1 ; EEPROM page size (EEPROM_PAGE) 26 26 .bSdpCommand resb 1 ; Command for Software Data Protection 27 27 resb 1 28 28 .szOpenedFile resb FILENAME_BUFFER_SIZE 29 .flashVars resb FLASHVARS_size30 29 endstruc 31 30 … … 52 51 53 52 ; Page sizes 54 struc EEPROM_PAGE _SIZE53 struc EEPROM_PAGE 55 54 .1_byte resb 2 56 55 .2_bytes resb 2 … … 66 65 DEFAULT_EEPROM_SEGMENT EQU 0D000h 67 66 DEFAULT_EEPROM_TYPE EQU EEPROM_TYPE.2864_8kiB 68 DEFAULT_PAGE_SIZE EQU EEPROM_PAGE _SIZE.1_byte67 DEFAULT_PAGE_SIZE EQU EEPROM_PAGE.1_byte 69 68 DEFAULT_SDP_COMMAND EQU SDP_COMMAND.enable 70 69 … … 72 71 ; Variables required for flashing 73 72 struc FLASHVARS 74 .wTotalPages resb 2 ; Total number of pages to write 75 .wPagesLeft resb 2 ; Pages left to write 76 .wByteOffset resb 2 ; Offset to byte to write next 73 .fpNextSourcePage resb 4 74 .fpNextComparisonPage resb 4 75 .fpNextDestinationPage resb 4 76 .wPagesToFlash resb 2 ; 0 = 65536 77 .wEepromPageSize resb 2 ; 1, 2, 4, 8, 16, 32 or 64 78 .bEepromSdpCommand resb 1 79 .bEepromType resb 1 80 81 .wProgressUpdateParam resb 2 82 .wTimeoutCounter resb 2 83 .wLastOffsetWritten resb 2 84 .bLastByteWritten resb 1 85 .flashResult resb 1 86 endstruc 87 88 ; Flashing results 89 struc FLASH_RESULT 90 .success resb 2 91 .PollingTimeoutError resb 2 92 .DataVerifyError resb 2 77 93 endstruc 78 94 -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/BiosFile.asm
r57 r65 2 2 ; Project name : XTIDE Univeral BIOS Configurator v2 3 3 ; Created date : 10.10.2010 4 ; Last update : 24.10.20104 ; Last update : 30.11.2010 5 5 ; Author : Tomi Tilli 6 6 ; Description : Functions for loading and saving BIOS image file. … … 163 163 call Buffers_GetFileBufferToESDI 164 164 call Registers_CopyESDItoDSSI 165 mov cx, [cs:g_cfgVars+CFGVARS.wImageSize] 165 mov cx, [cs:g_cfgVars+CFGVARS.wImageSizeInWords] 166 shl cx, 1 166 167 call FileIO_WriteCXbytesFromDSSIusingHandleFromBX 167 168 jc SHORT .DisplayErrorMessage -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Buffers.asm
r59 r65 2 2 ; Project name : XTIDE Universal BIOS Configurator v2 3 3 ; Created date : 6.10.2010 4 ; Last update : 19.11.20104 ; Last update : 5.12.2010 5 5 ; Author : Tomi Tilli 6 6 ; Description : Functions for accessing file and flash buffers. … … 41 41 42 42 call Buffers_GetFileBufferToESDI 43 jmp SHORT Buffers_IsXtideUniversalBiosSignatureInESDI 43 call Buffers_IsXtideUniversalBiosSignatureInESDI 44 jnz SHORT .NoFileOrBiosLoaded 45 jmp SHORT .IsSupportedVersionOfXtideUniversalBiosLoaded 44 46 .NoFileOrBiosLoaded: 45 47 or cl, 1 ; Clear ZF 46 48 ret 47 49 50 51 ALIGN JUMP_ALIGN 52 .IsSupportedVersionOfXtideUniversalBiosLoaded: 53 48 54 49 55 ;-------------------------------------------------------------------- … … 79 85 ; Nothing 80 86 ; Corrupts registers: 81 ; AX, BX, CX, DX87 ; AX, CX 82 88 ;-------------------------------------------------------------------- 83 89 ALIGN JUMP_ALIGN … … 85 91 and WORD [cs:g_cfgVars+CFGVARS.wFlags], ~(FLG_CFGVARS_FILELOADED | FLG_CFGVARS_ROMLOADED | FLG_CFGVARS_UNSAVED) 86 92 or WORD [cs:g_cfgVars+CFGVARS.wFlags], ax 87 ; Fall to .AdjustBiosImageSizeToSupportedEepromSize 88 89 ;-------------------------------------------------------------------- 90 ; .AdjustBiosImageSizeInCXtoSupportedEepromSize 91 ; Parameters: 92 ; CX: Size of loaded BIOS image 93 ; Returns: 94 ; CX: Size of BIOS image (and EEPROM required) 95 ; Corrupts registers: 96 ; AX, BX, DX 97 ;-------------------------------------------------------------------- 98 .AdjustBiosImageSizeInCXtoSupportedEepromSize: 99 mov bx, .rgwSupportedEepromSizes 100 mov dx, NUMBER_OF_SUPPORTED_EEPROM_SIZES-1 101 ALIGN JUMP_ALIGN 102 .CheckNextEepromSize: 103 cmp cx, [cs:bx] 104 je SHORT .StoreImageSizeFromCX 105 jb SHORT .AppendZeroesToTheEndOfBuffer 106 inc bx 107 inc bx 108 dec dx 109 jnz SHORT .CheckNextEepromSize 110 xor cx, cx 111 jmp SHORT .StoreImageSizeFromCX ; 0 = 65536 112 ALIGN WORD_ALIGN 113 .rgwSupportedEepromSizes: 114 dw 4<<10 115 dw 8<<10 116 dw 16<<10 117 dw 32<<10 118 119 ;-------------------------------------------------------------------- 120 ; .AppendZeroesToTheEndOfBuffer 121 ; Parameters: 122 ; CX: Size of loaded BIOS image 123 ; CS:BX: Ptr to EEPROM size 124 ; Returns: 125 ; CX: EEPROM size 126 ; Corrupts registers: 127 ; AX 128 ;-------------------------------------------------------------------- 129 ALIGN JUMP_ALIGN 130 .AppendZeroesToTheEndOfBuffer: 131 push es 132 push di 133 134 call Buffers_GetFileBufferToESDI 135 mov ax, [cs:bx] 136 sub ax, cx ; AX = zeroes to append 137 xchg ax, cx ; AX = BIOS image size, CX = zeroes to append 138 add di, ax 139 call Memory_ZeroESDIwithSizeInCX 140 mov cx, [cs:bx] 141 142 pop di 143 pop es 144 ; Fall to .StoreImageSizeFromCX 145 146 ;-------------------------------------------------------------------- 147 ; .StoreImageSizeFromCX 148 ; Parameters: 149 ; CX: Size of BIOS image (and EEPROM required) 150 ; Returns: 151 ; Nothing 152 ; Corrupts registers: 153 ; Nothing 154 ;-------------------------------------------------------------------- 155 ALIGN JUMP_ALIGN 156 .StoreImageSizeFromCX: 157 mov [cs:g_cfgVars+CFGVARS.wImageSize], cx 93 mov ax, (64<<10) / 2 ; 32768 WORDs 94 shr cx, 1 ; Bytes to WORDs 95 eCMOVZ cx, ax 96 mov [cs:g_cfgVars+CFGVARS.wImageSizeInWords], cx 158 97 ret 159 98 … … 204 143 205 144 ;-------------------------------------------------------------------- 145 ; Buffers_AppendZeroesIfNeeded 146 ; Parameters: 147 ; Nothing 148 ; Returns: 149 ; Nothing 150 ; Corrupts registers: 151 ; AX, CX, DI 152 ;-------------------------------------------------------------------- 153 ALIGN JUMP_ALIGN 154 Buffers_AppendZeroesIfNeeded: 155 push es 156 157 eMOVZX di, BYTE [cs:g_cfgVars+CFGVARS.bEepromType] 158 mov cx, [cs:di+g_rgwEepromTypeToSizeInWords] 159 sub cx, [cs:g_cfgVars+CFGVARS.wImageSizeInWords] ; CX = WORDs to append 160 jle SHORT .NoNeedToAppendZeroes 161 162 call Buffers_GetFileBufferToESDI 163 mov ax, [cs:g_cfgVars+CFGVARS.wImageSizeInWords] 164 shl ax, 1 165 add di, ax ; ES:DI now point first unused image byte 166 xor ax, ax 167 cld 168 rep stosw 169 ALIGN JUMP_ALIGN 170 .NoNeedToAppendZeroes: 171 pop es 172 ret 173 174 175 ;-------------------------------------------------------------------- 206 176 ; Buffers_GenerateChecksum 207 177 ; Parameters: … … 217 187 218 188 call Buffers_GetFileBufferToESDI 219 mov cx, [cs:g_cfgVars+CFGVARS.wImageSize] 189 mov cx, [cs:g_cfgVars+CFGVARS.wImageSizeInWords] 190 shl cx, 1 ; Words to bytes 220 191 dec cx ; Leave space for checksum byte 221 192 xor ax, ax … … 268 239 ;-------------------------------------------------------------------- 269 240 ; Buffers_GetFileBufferToESDI 241 ; Buffers_GetFlashComparisonBufferToESDI 270 242 ; Buffers_GetFileDialogItemBufferToESDI 271 243 ; Parameters: … … 277 249 ;-------------------------------------------------------------------- 278 250 ALIGN JUMP_ALIGN 251 Buffers_GetFlashComparisonBufferToESDI: 279 252 Buffers_GetFileDialogItemBufferToESDI: 280 253 call Buffers_GetFileBufferToESDI … … 285 258 pop di 286 259 ret 260 ALIGN JUMP_ALIGN 287 261 Buffers_GetFileBufferToESDI: 288 262 mov di, cs -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Dialogs.asm
r59 r65 2 2 ; Project name : XTIDE Univeral BIOS Configurator v2 3 3 ; Created date : 10.10.2010 4 ; Last update : 19.11.20104 ; Last update : 2.12.2010 5 5 ; Author : Tomi Tilli 6 6 ; Description : Functions for displaying dialogs. … … 85 85 ; Parameters: 86 86 ; DS:SI: Ptr to FILE_DIALOG_IO 87 ; SS:BP: Menu handle 87 88 ; Returns: 88 89 ; Nothing … … 113 114 ; Dialogs_DisplaySaveChangesDialog 114 115 ; Parameters: 115 ; Nothing116 ; SS:BP: Menu handle 116 117 ; Returns: 117 118 ; ZF: Set if user wants to do the action … … 155 156 156 157 ;-------------------------------------------------------------------- 158 ; Dialogs_DisplayProgressDialogForFlashingWithDialogIoInDSSIandFlashvarsInDSBX 159 ; Parameters: 160 ; DS:BX: Ptr to FLASHVARS 161 ; DS:SI: Ptr to PROGRESS_DIALOG_IO 162 ; SS:BP: Menu handle 163 ; Returns: 164 ; Nothing 165 ; Corrupts registers: 166 ; AX, DX, DI 167 ;-------------------------------------------------------------------- 168 ALIGN JUMP_ALIGN 169 Dialogs_DisplayProgressDialogForFlashingWithDialogIoInDSSIandFlashvarsInDSBX: 170 call .InitializeProgressDialogIoInDSSIwithFlashvarsInDSBX 171 mov dx, ds 172 mov ax, bx 173 CALL_MENU_LIBRARY StartProgressTaskWithIoInDSSIandParamInDXAX 174 ret 175 176 ALIGN JUMP_ALIGN 177 .InitializeProgressDialogIoInDSSIwithFlashvarsInDSBX: 178 call InitializeDialogInputFromDSSI 179 mov WORD [si+DIALOG_INPUT.fszTitle], g_szEEPROM 180 181 xor ax, ax 182 mov [si+PROGRESS_DIALOG_IO.wCurrentProgressValue], ax 183 mov dx, [bx+FLASHVARS.wPagesToFlash] 184 mov [si+PROGRESS_DIALOG_IO.wMaxProgressValue], dx 185 mov [si+PROGRESS_DIALOG_IO.wMinProgressValue], ax 186 mov WORD [si+PROGRESS_DIALOG_IO.fnTaskWithParamInDSSI], Flash_EepromWithFlashvarsInDSSI 187 mov [si+PROGRESS_DIALOG_IO.fnTaskWithParamInDSSI+2], cs 188 ret 189 190 191 ;-------------------------------------------------------------------- 157 192 ; InitializeDialogInputFromDSSI 158 193 ; Parameters: -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/EEPROM.asm
r57 r65 2 2 ; Project name : XTIDE Univeral BIOS Configurator v2 3 3 ; Created date : 19.4.2010 4 ; Last update : 10.10.20104 ; Last update : 3.12.2010 5 5 ; Author : Tomi Tilli 6 6 ; Description : Functions for managing EEPROM contents. 7 8 ; Section containing initialized data 9 SECTION .data 10 11 ALIGN WORD_ALIGN 12 g_rgwEepromTypeToSizeInWords: 13 dw (2<<10) / 2 ; EEPROM_TYPE.2816_2kiB 14 dw (8<<10) / 2 15 dw (32<<10) / 2 16 dw (64<<10) / 2 17 18 g_rgwEepromPageToSizeInBytes: 19 dw 1 ; EEPROM_PAGE.1_byte 20 dw 2 21 dw 4 22 dw 8 23 dw 16 24 dw 32 25 dw 64 26 27 7 28 8 29 ; Section containing code … … 134 155 135 156 ;-------------------------------------------------------------------- 136 ; EEPROM_ GetPointerForFlashingToESDI157 ; EEPROM_LoadFromRomToRamComparisonBuffer 137 158 ; Parameters: 138 159 ; Nothing 139 160 ; Returns: 140 ; ES:DI: Ptr to EEPROM to be flashed161 ; Nothing 141 162 ; Corrupts registers: 142 ; Nothing163 ; BX, CX, SI, DI 143 164 ;-------------------------------------------------------------------- 144 165 ALIGN JUMP_ALIGN 145 EEPROM_GetPointerForFlashingToESDI: 146 mov es, [cs:g_cfgVars+CFGVARS.wEepromSegment] 147 xor di, di 166 EEPROM_LoadFromRomToRamComparisonBuffer: 167 push es 168 push ds 169 170 mov ds, [cs:g_cfgVars+CFGVARS.wEepromSegment] 171 xor si, si 172 call Buffers_GetFlashComparisonBufferToESDI 173 eMOVZX bx, BYTE [cs:g_cfgVars+CFGVARS.bEepromType] 174 mov cx, [cs:bx+g_rgwEepromTypeToSizeInWords] 175 cld 176 rep movsw 177 178 pop ds 179 pop es 148 180 ret -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Main.asm
r63 r65 2 2 ; Project name : XTIDE Univeral BIOS Configurator v2 3 3 ; Created date : 5.10.2010 4 ; Last update : 19.11.20104 ; Last update : 3.12.2010 5 5 ; Author : Tomi Tilli 6 6 ; Description : Program start and exit. … … 33 33 %include "Dialogs.asm" 34 34 %include "EEPROM.asm" 35 %include "Flash.asm" 35 36 %include "MenuEvents.asm" 36 37 %include "Menuitem.asm" … … 97 98 at CFGVARS.wEepromSegment, dw DEFAULT_EEPROM_SEGMENT 98 99 at CFGVARS.bEepromType, db DEFAULT_EEPROM_TYPE 99 at CFGVARS.bEepromPage Size,db DEFAULT_PAGE_SIZE100 at CFGVARS.bEepromPage, db DEFAULT_PAGE_SIZE 100 101 at CFGVARS.bSdpCommand, db DEFAULT_SDP_COMMAND 101 102 iend -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/MenuitemPrint.asm
r59 r65 2 2 ; Project name : XTIDE Universal BIOS Configurator v2 3 3 ; Created date : 5.10.2010 4 ; Last update : 2.11.20104 ; Last update : 5.12.2010 5 5 ; Author : Tomi Tilli 6 6 ; Description : Functions for printing MENUITEM name and value. … … 202 202 CALL_DISPLAY_LIBRARY PrepareOffScreenBufferInESBXwithLengthInCX 203 203 204 call Menuitem_GetValueToAXfromMenuitemInDSSI 204 205 mov bx, 10 205 jmp SHORT PrintByteOrWordValue 206 CALL_DISPLAY_LIBRARY PrintWordFromAXwithBaseInBX 207 jmp SHORT FinishPrintingUnsignedOrHexValue 206 208 207 209 ;-------------------------------------------------------------------- … … 222 224 CALL_DISPLAY_LIBRARY PrepareOffScreenBufferInESBXwithLengthInCX 223 225 226 call Menuitem_GetValueToAXfromMenuitemInDSSI 224 227 mov bx, 16 225 PrintByteOrWordValue:226 push bx227 call Menuitem_GetValueToAXfromMenuitemInDSSI228 pop bx229 230 228 CALL_DISPLAY_LIBRARY PrintWordFromAXwithBaseInBX 229 mov al, 'h' 230 CALL_DISPLAY_LIBRARY PrintCharacterFromAL 231 ALIGN JUMP_ALIGN 232 FinishPrintingUnsignedOrHexValue: 231 233 CALL_DISPLAY_LIBRARY GetCharacterPointerToBXAX 232 234 xchg bx, ax -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/FlashMenu.asm
r63 r65 2 2 ; Project name : XTIDE Universal BIOS Configurator v2 3 3 ; Created date : 19.11.2010 4 ; Last update : 19.11.20104 ; Last update : 5.12.2010 5 5 ; Author : Tomi Tilli 6 6 ; Description : "Flash EEPROM" menu structs and functions. … … 78 78 at MENUITEM.bFlags, db FLG_MENUITEM_PROGRAMVAR | FLG_MENUITEM_BYTEVALUE | FLG_MENUITEM_VISIBLE 79 79 at MENUITEM.bType, db TYPE_MENUITEM_MULTICHOISE 80 at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw CFGVARS.bEepromPage Size80 at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw CFGVARS.bEepromPage 81 81 at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgFlashPageSize 82 82 at MENUITEM.itemValue + ITEM_VALUE.szMultichoise, dw g_szMultichoisePageSize … … 137 137 138 138 g_rgwChoiseToValueLookupForPageSize: 139 dw EEPROM_PAGE _SIZE.1_byte140 dw EEPROM_PAGE _SIZE.2_bytes141 dw EEPROM_PAGE _SIZE.4_bytes142 dw EEPROM_PAGE _SIZE.8_bytes143 dw EEPROM_PAGE _SIZE.16_bytes144 dw EEPROM_PAGE _SIZE.32_bytes145 dw EEPROM_PAGE _SIZE.64_bytes139 dw EEPROM_PAGE.1_byte 140 dw EEPROM_PAGE.2_bytes 141 dw EEPROM_PAGE.4_bytes 142 dw EEPROM_PAGE.8_bytes 143 dw EEPROM_PAGE.16_bytes 144 dw EEPROM_PAGE.32_bytes 145 dw EEPROM_PAGE.64_bytes 146 146 g_rgszValueToStringLookupForPageSize: 147 147 dw g_szValueFlash1byte … … 185 185 ALIGN JUMP_ALIGN 186 186 StartFlashing: 187 push es 188 push ds 189 190 call .PrepareBuffersForFlashing 191 mov cx, FLASHVARS_size + PROGRESS_DIALOG_IO_size 192 call Memory_ReserveCXbytesFromStackToDSSI 193 call .InitializeFlashvarsFromDSSI 194 mov bx, si ; DS:BX now points to FLASHVARS 195 add si, BYTE FLASHVARS_size ; DS:SI now points to PROGRESS_DIALOG_IO 196 call Dialogs_DisplayProgressDialogForFlashingWithDialogIoInDSSIandFlashvarsInDSBX 197 call .DisplayFlashingResultsFromFlashvarsInDSBX 198 199 add sp, BYTE FLASHVARS_size + PROGRESS_DIALOG_IO_size 200 pop ds 201 pop es 187 202 ret 203 204 ;-------------------------------------------------------------------- 205 ; .PrepareBuffersForFlashing 206 ; Parameters: 207 ; SS:BP: Ptr to MENU 208 ; Returns: 209 ; Nothing 210 ; Corrupts registers: 211 ; AX, BX, CX, SI, DI 212 ;-------------------------------------------------------------------- 213 ALIGN JUMP_ALIGN 214 .PrepareBuffersForFlashing: 215 call EEPROM_LoadFromRomToRamComparisonBuffer 216 call Buffers_AppendZeroesIfNeeded 217 test WORD [cs:g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_CHECKSUM 218 jz SHORT .DoNotGenerateChecksumByte 219 jmp Buffers_GenerateChecksum 220 .DoNotGenerateChecksumByte: 221 ret 222 223 ;-------------------------------------------------------------------- 224 ; .InitializeFlashvarsFromDSSI 225 ; Parameters: 226 ; DS:SI: Ptr to FLASHVARS to initialize 227 ; SS:BP: Ptr to MENU 228 ; Returns: 229 ; Nothing 230 ; Corrupts registers: 231 ; AX, BX, DX, DI, ES 232 ;-------------------------------------------------------------------- 233 ALIGN JUMP_ALIGN 234 .InitializeFlashvarsFromDSSI: 235 call Buffers_GetFileBufferToESDI 236 mov [si+FLASHVARS.fpNextSourcePage], di 237 mov [si+FLASHVARS.fpNextSourcePage+2], es 238 239 call Buffers_GetFlashComparisonBufferToESDI 240 mov [si+FLASHVARS.fpNextComparisonPage], di 241 mov [si+FLASHVARS.fpNextComparisonPage+2], es 242 243 mov ax, [cs:g_cfgVars+CFGVARS.wEepromSegment] 244 mov WORD [si+FLASHVARS.fpNextDestinationPage], 0 245 mov [si+FLASHVARS.fpNextDestinationPage+2], ax 246 247 mov al, [cs:g_cfgVars+CFGVARS.bEepromType] 248 mov [si+FLASHVARS.bEepromType], al 249 250 mov al, [cs:g_cfgVars+CFGVARS.bSdpCommand] 251 mov [si+FLASHVARS.bEepromSdpCommand], al 252 253 eMOVZX bx, BYTE [cs:g_cfgVars+CFGVARS.bEepromPage] 254 mov ax, [cs:bx+g_rgwEepromPageToSizeInBytes] 255 mov [si+FLASHVARS.wEepromPageSize], ax 256 257 call .GetNumberOfPagesToFlashToAX 258 mov [si+FLASHVARS.wPagesToFlash], ax 259 ret 260 261 ;-------------------------------------------------------------------- 262 ; .GetNumberOfPagesToFlashToAX 263 ; Parameters: 264 ; DS:SI: Ptr to FLASHVARS to initialize 265 ; Returns: 266 ; AX: Number of pages to flash (0 = 65536) 267 ; Corrupts registers: 268 ; BX, DX 269 ;-------------------------------------------------------------------- 270 ALIGN JUMP_ALIGN 271 .GetNumberOfPagesToFlashToAX: 272 eMOVZX bx, BYTE [si+FLASHVARS.bEepromType] 273 mov ax, [cs:bx+g_rgwEepromTypeToSizeInWords] 274 xor dx, dx 275 shl ax, 1 ; Size in bytes to... 276 rcl dx, 1 ; ...DX:AX 277 278 cmp WORD [si+FLASHVARS.wEepromPageSize], BYTE 1 279 jbe SHORT .PreventDivideException 280 div WORD [si+FLASHVARS.wEepromPageSize] 281 .PreventDivideException: 282 ret 283 284 285 ;-------------------------------------------------------------------- 286 ; .DisplayFlashingResultsFromFlashvarsInDSBX 287 ; Parameters: 288 ; DS:BX: Ptr to FLASHVARS 289 ; SS:BP: Ptr to MENU 290 ; Returns: 291 ; Nothing 292 ; Corrupts registers: 293 ; AX, BX, DX 294 ;-------------------------------------------------------------------- 295 ALIGN JUMP_ALIGN 296 .DisplayFlashingResultsFromFlashvarsInDSBX: 297 eMOVZX bx, BYTE [bx+FLASHVARS.flashResult] 298 jmp [cs:bx+.rgfnFlashResultMessage] 299 300 ALIGN WORD_ALIGN 301 .rgfnFlashResultMessage: 302 dw .DisplayFlashSuccessful 303 dw .DisplayPollingError 304 dw .DisplayDataVerifyError 305 306 307 ;-------------------------------------------------------------------- 308 ; .DisplayPollingError 309 ; .DisplayDataVerifyError 310 ; .DisplayFlashSuccessful 311 ; Parameters: 312 ; SS:BP: Ptr to MENU 313 ; Returns: 314 ; Nothing 315 ; Corrupts registers: 316 ; AX, DX, DI, ES 317 ;-------------------------------------------------------------------- 318 ALIGN JUMP_ALIGN 319 .DisplayPollingError: 320 mov dx, g_szErrEepromPolling 321 jmp Dialogs_DisplayErrorFromCSDX 322 323 ALIGN JUMP_ALIGN 324 .DisplayDataVerifyError: 325 mov dx, g_szErrEepromVerify 326 jmp Dialogs_DisplayErrorFromCSDX 327 328 ALIGN JUMP_ALIGN 329 .DisplayFlashSuccessful: 330 call Buffers_GetFileBufferToESDI 331 cmp WORD [es:di+ROMVARS.wRomSign], 0AA55h ; PC ROM? 332 je SHORT .DisplayRebootMessageAndReboot 333 mov dx, g_szForeignFlash 334 jmp Dialogs_DisplayNotificationFromCSDX 335 ALIGN JUMP_ALIGN 336 .DisplayRebootMessageAndReboot: 337 mov dx, g_szPCFlashSuccessfull 338 call Dialogs_DisplayNotificationFromCSDX 339 ; Fall to .RebootComputer 340 341 342 ;-------------------------------------------------------------------- 343 ; .RebootComputer 344 ; Parameters: 345 ; Nothing 346 ; Returns: 347 ; Nothing, function never returns 348 ; Corrupts registers: 349 ; Doesn't matter 350 ;-------------------------------------------------------------------- 351 .RebootComputer: 352 mov al, 0FEh ; System reset (AT+ keyboard controller) 353 out 64h, al ; Reset computer (AT+) 354 nop 355 jmp WORD 0F000h:0FFF0h ; XT reset -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Strings.asm
r63 r65 2 2 ; Project name : XTIDE Universal BIOS Configurator v2 3 3 ; Created date : 5.10.2010 4 ; Last update : 19.11.20104 ; Last update : 5.12.2010 5 5 ; Author : Tomi Tilli 6 6 ; Description : All strings. … … 12 12 ; Menu title 13 13 g_szProgramTitle: 14 db "Configuration and Flashing program for XTIDE Universal BIOS v1.1. 4.",LF,CR,NULL14 db "Configuration and Flashing program for XTIDE Universal BIOS v1.1.5.",LF,CR,NULL 15 15 g_szXtideUniversalBiosSignature: db "XTIDE110",NULL 16 16 g_szBiosIsNotLoaded: db "BIOS is not loaded!",NULL … … 41 41 g_szErrorDialog: db "Error!",NULL 42 42 g_szGenericDialogInfo: db "Press ENTER or ESC to close dialog.",NULL 43 44 ; Flashing related strings 45 g_szErrEepromPolling: db "Timeout when polling EEPROM.",LF 46 db "EEPROM was not flashed properly!",NULL 47 g_szErrEepromVerify: db "EEPROM did not return the same byte that was written.",LF 48 db "EEPROM was not flashed properly!",NULL 49 g_szPCFlashSuccessfull: db "EEPROM was written successfully.",LF 50 db "Press any key to reboot.",NULL 51 g_szForeignFlash: db "EEPROM was written successfully.",NULL 43 52 44 53 … … 262 271 db "32 bytes",LF 263 272 db "64 bytes",NULL 264 g_szValueFlash1byte: db " None",NULL273 g_szValueFlash1byte: db "1 byte",NULL 265 274 g_szValueFlash2bytes: db "2 bytes",NULL 266 275 g_szValueFlash4bytes: db "4 bytes",NULL
Note:
See TracChangeset
for help on using the changeset viewer.