| 1 | ; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
|
|---|
| 2 | ;
|
|---|
| 3 | ; This file is part of AiR-BOOT
|
|---|
| 4 | ;
|
|---|
| 5 | ; AiR-BOOT is free software: you can redistribute it and/or modify it under
|
|---|
| 6 | ; the terms of the GNU General Public License as published by the Free
|
|---|
| 7 | ; Software Foundation, either version 3 of the License, or (at your option)
|
|---|
| 8 | ; any later version.
|
|---|
| 9 | ;
|
|---|
| 10 | ; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
|
|---|
| 11 | ; WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
|
|---|
| 12 | ; FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|---|
| 13 | ; details.
|
|---|
| 14 | ;
|
|---|
| 15 | ; You should have received a copy of the GNU General Public License along with
|
|---|
| 16 | ; AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
|
|---|
| 17 | ;
|
|---|
| 18 | ;---------------------------------------------------------------------------
|
|---|
| 19 | ; AiR-BOOT / DEBUG
|
|---|
| 20 | ;---------------------------------------------------------------------------
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 | ; -----------------------
|
|---|
| 24 | ; Rousseau: # DEBUG.ASM #
|
|---|
| 25 | ; -----------------------
|
|---|
| 26 | ; This module contains functions for debugging AiR-BOOT.
|
|---|
| 27 | ; It is only included in debug builds and the codesize of AiR-BOOT increases
|
|---|
| 28 | ; in that case. To compensate for that, the FX code is disabled when debugging
|
|---|
| 29 | ; is active. Also, most of the debug-routines can selectively be disabled
|
|---|
| 30 | ; by commenting-out the define above it.
|
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 |
|
|---|
| 34 | IFDEF MODULE_NAMES
|
|---|
| 35 | DB 'DEBUG',0
|
|---|
| 36 | ENDIF
|
|---|
| 37 |
|
|---|
| 38 | ;
|
|---|
| 39 | ; Display a number that was put on the stack.
|
|---|
| 40 | ; Used to track code-flow.
|
|---|
| 41 | ;
|
|---|
| 42 | dbp db '>---------->> DebugProbe: ',0
|
|---|
| 43 | DEBUG_Probe Proc
|
|---|
| 44 | push bp
|
|---|
| 45 | mov bp,sp
|
|---|
| 46 | pushf
|
|---|
| 47 | pusha
|
|---|
| 48 |
|
|---|
| 49 | mov si,offset [dbp] ; Default probe-text.
|
|---|
| 50 | call AuxIO_Print
|
|---|
| 51 | mov ax,[bp+04] ; Get probe-number from stack.
|
|---|
| 52 | call AuxIO_TeletypeHexWord
|
|---|
| 53 | call AuxIO_TeletypeNL
|
|---|
| 54 |
|
|---|
| 55 | ; Also display registers.
|
|---|
| 56 | popa
|
|---|
| 57 | pusha
|
|---|
| 58 | call DEBUG_DumpRegisters
|
|---|
| 59 |
|
|---|
| 60 | popa
|
|---|
| 61 | popf
|
|---|
| 62 | pop bp
|
|---|
| 63 | ret 2
|
|---|
| 64 | DEBUG_Probe Endp
|
|---|
| 65 |
|
|---|
| 66 |
|
|---|
| 67 |
|
|---|
| 68 | ;
|
|---|
| 69 | ; Show help on keys.
|
|---|
| 70 | ;
|
|---|
| 71 | dbh db 10,'h=HELP, d=DRIVE-LETTERS, g=GEO, i=IPT, r=RESTART, v=VOL-LETTERS, x=XREF',10,10,0
|
|---|
| 72 | DEBUG_ShowHelp Proc
|
|---|
| 73 | pushf
|
|---|
| 74 | pusha
|
|---|
| 75 | mov si, offset dbh
|
|---|
| 76 | call AuxIO_Print
|
|---|
| 77 | popa
|
|---|
| 78 | popf
|
|---|
| 79 | ret
|
|---|
| 80 | DEBUG_ShowHelp EndP
|
|---|
| 81 |
|
|---|
| 82 |
|
|---|
| 83 | ;
|
|---|
| 84 | ; Call list for debug hot-keys.
|
|---|
| 85 | ;
|
|---|
| 86 | dbg_call_list:
|
|---|
| 87 | db 'd'
|
|---|
| 88 | dw offset DEBUG_DumpDriveLetters
|
|---|
| 89 | db 'g'
|
|---|
| 90 | dw offset DEBUG_DumpGeo
|
|---|
| 91 | db 'h'
|
|---|
| 92 | dw offset DEBUG_ShowHelp
|
|---|
| 93 | db 'i'
|
|---|
| 94 | dw offset DEBUG_DumpIPT
|
|---|
| 95 | db 'r'
|
|---|
| 96 | dw offset AirbootRestart
|
|---|
| 97 | db 'v'
|
|---|
| 98 | dw offset DEBUG_DumpVolumeLetters
|
|---|
| 99 | db 'x'
|
|---|
| 100 | dw offset DEBUG_DumpPartitionXref
|
|---|
| 101 | db 'R'
|
|---|
| 102 | dw offset AirbootRestart
|
|---|
| 103 | db 0
|
|---|
| 104 |
|
|---|
| 105 | ;
|
|---|
| 106 | ; Handle keypresses when the main menu is active.
|
|---|
| 107 | ;
|
|---|
| 108 | DEBUG_HandleKeypress Proc
|
|---|
| 109 | pushf
|
|---|
| 110 | pusha
|
|---|
| 111 |
|
|---|
| 112 | ; Save hot-key
|
|---|
| 113 | mov dl,al
|
|---|
| 114 |
|
|---|
| 115 | ; Check for digit.
|
|---|
| 116 | cmp al,'0'
|
|---|
| 117 | jb DEBUG_HandleKeypress_exit
|
|---|
| 118 | cmp al,'9'
|
|---|
| 119 | ja DEBUG_HandleKeypress_try_alpha
|
|---|
| 120 | ; It was a digit.
|
|---|
| 121 | jmp DEBUG_HandleKeypress_check_it
|
|---|
| 122 |
|
|---|
| 123 | ; Check for alpha.
|
|---|
| 124 | DEBUG_HandleKeypress_try_alpha:
|
|---|
| 125 | ; Force upper-case.
|
|---|
| 126 | and al,11011111b
|
|---|
| 127 | cmp al,'A'
|
|---|
| 128 | jb DEBUG_HandleKeypress_exit
|
|---|
| 129 | cmp al,'Z'
|
|---|
| 130 | ja DEBUG_HandleKeypress_exit
|
|---|
| 131 | ; It was an alpha.
|
|---|
| 132 | jmp DEBUG_HandleKeypress_check_it
|
|---|
| 133 |
|
|---|
| 134 |
|
|---|
| 135 | ; Check if the key is a hot-key.
|
|---|
| 136 | DEBUG_HandleKeypress_check_it:
|
|---|
| 137 | cld
|
|---|
| 138 | mov si,offset dbg_call_list
|
|---|
| 139 |
|
|---|
| 140 | ; Loop over jump-list.
|
|---|
| 141 | DEBUG_HandleKeypress_next_entry:
|
|---|
| 142 |
|
|---|
| 143 | ; Load the hot-key.
|
|---|
| 144 | lodsb
|
|---|
| 145 | ; No hot-key (not implemented) if end-of-list.
|
|---|
| 146 | test al,al
|
|---|
| 147 | jz DEBUG_HandleKeypress_ni
|
|---|
| 148 |
|
|---|
| 149 | ; Compare hot-key and iterate if not the same.
|
|---|
| 150 | cmp dl,al
|
|---|
| 151 | lodsw
|
|---|
| 152 | jne DEBUG_HandleKeypress_next_entry
|
|---|
| 153 |
|
|---|
| 154 | ; Entry found, call corresponding routine.
|
|---|
| 155 | mov bx,ax
|
|---|
| 156 | call bx
|
|---|
| 157 |
|
|---|
| 158 | ; Done.
|
|---|
| 159 | jmp DEBUG_HandleKeypress_exit
|
|---|
| 160 |
|
|---|
| 161 | ; Call not-assigned routine.
|
|---|
| 162 | DEBUG_HandleKeypress_ni:
|
|---|
| 163 | call DEBUG_NotAssigned
|
|---|
| 164 | jmp DEBUG_HandleKeypress_exit
|
|---|
| 165 |
|
|---|
| 166 | ; Return to caller.
|
|---|
| 167 | DEBUG_HandleKeypress_exit:
|
|---|
| 168 | popa
|
|---|
| 169 | popf
|
|---|
| 170 | ret
|
|---|
| 171 | DEBUG_HandleKeypress Endp
|
|---|
| 172 |
|
|---|
| 173 |
|
|---|
| 174 |
|
|---|
| 175 | ;
|
|---|
| 176 | ; Show not assigned message.
|
|---|
| 177 | ;
|
|---|
| 178 | dbg_na db 'This key is not assigned, press ''h'' for Help.',10,0
|
|---|
| 179 | DEBUG_NotAssigned Proc
|
|---|
| 180 | pushf
|
|---|
| 181 | pusha
|
|---|
| 182 | mov si,offset dbg_na
|
|---|
| 183 | call AuxIO_Print
|
|---|
| 184 | popa
|
|---|
| 185 | popf
|
|---|
| 186 | ret
|
|---|
| 187 | DEBUG_NotAssigned Endp
|
|---|
| 188 |
|
|---|
| 189 |
|
|---|
| 190 |
|
|---|
| 191 | ;
|
|---|
| 192 | ; Dump information before the menu is displayed.
|
|---|
| 193 | ;
|
|---|
| 194 | DEBUG_Dump1 Proc Near
|
|---|
| 195 | pushf
|
|---|
| 196 | pusha
|
|---|
| 197 |
|
|---|
| 198 | ; Hello message
|
|---|
| 199 | mov si, offset AuxIOHello
|
|---|
| 200 | call AuxIO_Print
|
|---|
| 201 |
|
|---|
| 202 | ; Build Info
|
|---|
| 203 | ;~ mov si, offset BUILD_DATE
|
|---|
| 204 | ;~ call AuxIO_Print
|
|---|
| 205 | call AuxIO_PrintBuildInfo
|
|---|
| 206 |
|
|---|
| 207 | ; Start new line
|
|---|
| 208 | call AuxIO_TeletypeNL
|
|---|
| 209 | ;~ call AuxIO_TeletypeNL
|
|---|
| 210 |
|
|---|
| 211 | ;~ call DEBUG_DumpHidePartTables
|
|---|
| 212 | ;~ call DEBUG_CheckMath
|
|---|
| 213 | ;~ call DEBUG_DumpGeo
|
|---|
| 214 | ;~ call DEBUG_CheckBitFields
|
|---|
| 215 |
|
|---|
| 216 | popa
|
|---|
| 217 | popf
|
|---|
| 218 | ret
|
|---|
| 219 | DEBUG_Dump1 EndP
|
|---|
| 220 |
|
|---|
| 221 |
|
|---|
| 222 | ;
|
|---|
| 223 | ; Check the simple 32-bit math functions.
|
|---|
| 224 | ;
|
|---|
| 225 | ;~ __CHECK_MATH__ EQU
|
|---|
| 226 | DEBUG_CheckMath Proc Near
|
|---|
| 227 | IFDEF __CHECK_MATH__
|
|---|
| 228 | pushf
|
|---|
| 229 | pusha
|
|---|
| 230 |
|
|---|
| 231 | ; Msg check math-module
|
|---|
| 232 | mov si,offset db_checkmath
|
|---|
| 233 | call AuxIO_Print
|
|---|
| 234 |
|
|---|
| 235 | ; Output hex-word
|
|---|
| 236 | mov ax,0BABEh
|
|---|
| 237 | call AuxIO_TeletypeHexWord
|
|---|
| 238 |
|
|---|
| 239 | mov al,' '
|
|---|
| 240 | call AuxIO_Teletype
|
|---|
| 241 | mov al,'*'
|
|---|
| 242 | call AuxIO_Teletype
|
|---|
| 243 | mov al,' '
|
|---|
| 244 | call AuxIO_Teletype
|
|---|
| 245 |
|
|---|
| 246 | ; Output hex-word
|
|---|
| 247 | mov ax,0BABEh
|
|---|
| 248 | call AuxIO_TeletypeHexWord
|
|---|
| 249 |
|
|---|
| 250 | mov al,' '
|
|---|
| 251 | call AuxIO_Teletype
|
|---|
| 252 | mov al,'='
|
|---|
| 253 | call AuxIO_Teletype
|
|---|
| 254 | mov al,' '
|
|---|
| 255 | call AuxIO_Teletype
|
|---|
| 256 |
|
|---|
| 257 | mov ax,0BABEh
|
|---|
| 258 | mul ax
|
|---|
| 259 | call AuxIO_TeletypeHexDWord
|
|---|
| 260 |
|
|---|
| 261 | ; Start new line
|
|---|
| 262 | call AuxIO_TeletypeNL
|
|---|
| 263 |
|
|---|
| 264 | ; Output hex-dword
|
|---|
| 265 | mov dx,0DEADh
|
|---|
| 266 | mov ax,0FACEh
|
|---|
| 267 | call AuxIO_TeletypeHexDWord
|
|---|
| 268 |
|
|---|
| 269 | mov al,' '
|
|---|
| 270 | call AuxIO_Teletype
|
|---|
| 271 | mov al,'*'
|
|---|
| 272 | call AuxIO_Teletype
|
|---|
| 273 | mov al,' '
|
|---|
| 274 | call AuxIO_Teletype
|
|---|
| 275 |
|
|---|
| 276 | ; Output hex-dword
|
|---|
| 277 | mov dx,0DEADh
|
|---|
| 278 | mov ax,0FACEh
|
|---|
| 279 | call AuxIO_TeletypeHexDWord
|
|---|
| 280 |
|
|---|
| 281 | mov al,' '
|
|---|
| 282 | call AuxIO_Teletype
|
|---|
| 283 | mov al,'='
|
|---|
| 284 | call AuxIO_Teletype
|
|---|
| 285 | mov al,' '
|
|---|
| 286 | call AuxIO_Teletype
|
|---|
| 287 |
|
|---|
| 288 | mov bx,0DEADh
|
|---|
| 289 | mov cx,0FACEh
|
|---|
| 290 | mov dx,0DEADh
|
|---|
| 291 | mov ax,0FACEh
|
|---|
| 292 | call MATH_Mul32
|
|---|
| 293 | call AuxIO_TeletypeHexQWord
|
|---|
| 294 |
|
|---|
| 295 | call AuxIO_TeletypeNL
|
|---|
| 296 | call AuxIO_TeletypeNL
|
|---|
| 297 |
|
|---|
| 298 | popa
|
|---|
| 299 | popf
|
|---|
| 300 | ENDIF
|
|---|
| 301 | ret
|
|---|
| 302 | DEBUG_CheckMath EndP
|
|---|
| 303 |
|
|---|
| 304 |
|
|---|
| 305 | ;
|
|---|
| 306 | ; Dump the geometry.
|
|---|
| 307 | ;
|
|---|
| 308 | __DUMP_GEO__ EQU
|
|---|
| 309 | DEBUG_DumpGeo Proc
|
|---|
| 310 | IFDEF __DUMP_GEO__
|
|---|
| 311 | pushf
|
|---|
| 312 | pusha
|
|---|
| 313 |
|
|---|
| 314 | ; BIOS cyls
|
|---|
| 315 | mov dx,word ptr [BIOS_Cyls+02]
|
|---|
| 316 | mov ax,word ptr [BIOS_Cyls+00]
|
|---|
| 317 | call AuxIO_TeletypeHexDWord
|
|---|
| 318 | call AuxIO_TeletypeNL
|
|---|
| 319 |
|
|---|
| 320 | ; BIOS heads
|
|---|
| 321 | mov dx,word ptr [BIOS_Heads+02]
|
|---|
| 322 | mov ax,word ptr [BIOS_Heads+00]
|
|---|
| 323 | call AuxIO_TeletypeHexDWord
|
|---|
| 324 | call AuxIO_TeletypeNL
|
|---|
| 325 |
|
|---|
| 326 | ; BIOS secs
|
|---|
| 327 | mov dx,word ptr [BIOS_Secs+02]
|
|---|
| 328 | mov ax,word ptr [BIOS_Secs+00]
|
|---|
| 329 | call AuxIO_TeletypeHexDWord
|
|---|
| 330 | call AuxIO_TeletypeNL
|
|---|
| 331 |
|
|---|
| 332 | ; Bytes per sector
|
|---|
| 333 | mov ax,[BIOS_Bytes]
|
|---|
| 334 | call AuxIO_TeletypeHexWord
|
|---|
| 335 | call AuxIO_TeletypeNL
|
|---|
| 336 |
|
|---|
| 337 | ; Total secs
|
|---|
| 338 | mov bx, word ptr [BIOS_TotalSecs+06]
|
|---|
| 339 | mov cx, word ptr [BIOS_TotalSecs+04]
|
|---|
| 340 | mov dx, word ptr [BIOS_TotalSecs+02]
|
|---|
| 341 | mov ax, word ptr [BIOS_TotalSecs+00]
|
|---|
| 342 | call AuxIO_TeletypeHexDWord
|
|---|
| 343 | call AuxIO_TeletypeNL
|
|---|
| 344 |
|
|---|
| 345 | ; CHS to LBA
|
|---|
| 346 | mov dx,1
|
|---|
| 347 | mov ax,29e5h
|
|---|
| 348 | mov bx,23h
|
|---|
| 349 | mov cx,9h
|
|---|
| 350 | call CONV_CHS2LBA
|
|---|
| 351 | call AuxIO_TeletypeHexDWord
|
|---|
| 352 | call AuxIO_TeletypeNL
|
|---|
| 353 |
|
|---|
| 354 | popa
|
|---|
| 355 | popf
|
|---|
| 356 | ENDIF
|
|---|
| 357 |
|
|---|
| 358 | ret
|
|---|
| 359 | DEBUG_DumpGeo Endp
|
|---|
| 360 |
|
|---|
| 361 |
|
|---|
| 362 | ;
|
|---|
| 363 | ; Dump the internal partition table.
|
|---|
| 364 | ;
|
|---|
| 365 | __DUMP_IPT__ EQU
|
|---|
| 366 | DEBUG_DumpIPT Proc
|
|---|
| 367 | IFDEF __DUMP_IPT__
|
|---|
| 368 | pushf
|
|---|
| 369 | pusha
|
|---|
| 370 |
|
|---|
| 371 | call AuxIO_TeletypeNL
|
|---|
| 372 |
|
|---|
| 373 | mov si,offset [BIOScontIPTentry]
|
|---|
| 374 | ;~ mov si,offset [PartitionTable]
|
|---|
| 375 | call AuxIO_DumpSector
|
|---|
| 376 |
|
|---|
| 377 | popa
|
|---|
| 378 | popf
|
|---|
| 379 | ENDIF
|
|---|
| 380 | ret
|
|---|
| 381 | DEBUG_DumpIPT EndP
|
|---|
| 382 |
|
|---|
| 383 |
|
|---|
| 384 | ;
|
|---|
| 385 | ; Dump the new partitions table.
|
|---|
| 386 | ;
|
|---|
| 387 | ;~ __DUMP_NPT__ EQU
|
|---|
| 388 | DEBUG_DumpNewPartTable Proc
|
|---|
| 389 | IFDEF __DUMP_NPT__
|
|---|
| 390 | pushf
|
|---|
| 391 | pusha
|
|---|
| 392 |
|
|---|
| 393 | call AuxIO_TeletypeNL
|
|---|
| 394 |
|
|---|
| 395 | mov si,offset [NewPartTable]
|
|---|
| 396 | call AuxIO_DumpSector
|
|---|
| 397 |
|
|---|
| 398 | popa
|
|---|
| 399 | popf
|
|---|
| 400 | ENDIF
|
|---|
| 401 | ret
|
|---|
| 402 | DEBUG_DumpNewPartTable EndP
|
|---|
| 403 |
|
|---|
| 404 |
|
|---|
| 405 | ;
|
|---|
| 406 | ; Dump the partition pointers table.
|
|---|
| 407 | ;
|
|---|
| 408 | ;~ __DUMP_PP__ EQU
|
|---|
| 409 | DEBUG_DumpPartitionPointers Proc
|
|---|
| 410 | IFDEF __DUMP_PP__
|
|---|
| 411 | pushf
|
|---|
| 412 | pusha
|
|---|
| 413 |
|
|---|
| 414 | call AuxIO_TeletypeNL
|
|---|
| 415 |
|
|---|
| 416 | mov si,offset [PartitionPointers]
|
|---|
| 417 | mov cx,7
|
|---|
| 418 |
|
|---|
| 419 | DEBUG_DumpPartitionPointers_next:
|
|---|
| 420 | call AuxIO_DumpParagraph
|
|---|
| 421 | add si,16
|
|---|
| 422 | call AuxIO_TeletypeNL
|
|---|
| 423 | loop DEBUG_DumpPartitionPointers_next
|
|---|
| 424 |
|
|---|
| 425 | popa
|
|---|
| 426 | popf
|
|---|
| 427 | ENDIF
|
|---|
| 428 | ret
|
|---|
| 429 | DEBUG_DumpPartitionPointers EndP
|
|---|
| 430 |
|
|---|
| 431 |
|
|---|
| 432 | ;
|
|---|
| 433 | ; Dump the partition x-ref table.
|
|---|
| 434 | ;
|
|---|
| 435 | __DUMP_PX__ EQU
|
|---|
| 436 | DEBUG_DumpPartitionXref Proc
|
|---|
| 437 | IFDEF __DUMP_PX__
|
|---|
| 438 | pushf
|
|---|
| 439 | pusha
|
|---|
| 440 |
|
|---|
| 441 | mov si, offset [xrt]
|
|---|
| 442 | call AuxIO_Print
|
|---|
| 443 | ;~ call AuxIO_TeletypeNL
|
|---|
| 444 |
|
|---|
| 445 | mov si,offset [PartitionXref]
|
|---|
| 446 | mov cx,3
|
|---|
| 447 |
|
|---|
| 448 | DEBUG_DumpPartitionXref_next:
|
|---|
| 449 | call AuxIO_DumpParagraph
|
|---|
| 450 | add si,16
|
|---|
| 451 | call AuxIO_TeletypeNL
|
|---|
| 452 | loop DEBUG_DumpPartitionXref_next
|
|---|
| 453 |
|
|---|
| 454 | popa
|
|---|
| 455 | popf
|
|---|
| 456 | ENDIF
|
|---|
| 457 | ret
|
|---|
| 458 | DEBUG_DumpPartitionXref EndP
|
|---|
| 459 |
|
|---|
| 460 |
|
|---|
| 461 | ;
|
|---|
| 462 | ; Dump the dl-feature drive-letters.
|
|---|
| 463 | ;
|
|---|
| 464 | __DUMP_DL__ EQU
|
|---|
| 465 | DEBUG_DumpDriveLetters Proc
|
|---|
| 466 | IFDEF __DUMP_DL__
|
|---|
| 467 | pushf
|
|---|
| 468 | pusha
|
|---|
| 469 |
|
|---|
| 470 | mov si, offset [ddl]
|
|---|
| 471 | call AuxIO_Print
|
|---|
| 472 |
|
|---|
| 473 | ; Dump the old drive-letters as set with the dl-feature.
|
|---|
| 474 | mov si,offset [DriveLetters]
|
|---|
| 475 | mov cx,3
|
|---|
| 476 | DEBUG_DumpDriveLetters_next_1:
|
|---|
| 477 | call AuxIO_DumpParagraph
|
|---|
| 478 | add si,16
|
|---|
| 479 | call AuxIO_TeletypeNL
|
|---|
| 480 | loop DEBUG_DumpDriveLetters_next_1
|
|---|
| 481 |
|
|---|
| 482 | ; Dump the new drive-letters as composed when scanning partitions
|
|---|
| 483 | ; and partitions were added or removed.
|
|---|
| 484 | mov si,offset [NewDriveLetters]
|
|---|
| 485 | mov cx,3
|
|---|
| 486 | DEBUG_DumpDriveLetters_next_2:
|
|---|
| 487 | call AuxIO_DumpParagraph
|
|---|
| 488 | add si,16
|
|---|
| 489 | call AuxIO_TeletypeNL
|
|---|
| 490 | loop DEBUG_DumpDriveLetters_next_2
|
|---|
| 491 |
|
|---|
| 492 | popa
|
|---|
| 493 | popf
|
|---|
| 494 | ENDIF
|
|---|
| 495 | ret
|
|---|
| 496 | DEBUG_DumpDriveLetters EndP
|
|---|
| 497 |
|
|---|
| 498 |
|
|---|
| 499 | ;
|
|---|
| 500 | ; Dump the lvm volume drive-letters.
|
|---|
| 501 | ;
|
|---|
| 502 | __DUMP_VL__ EQU
|
|---|
| 503 | DEBUG_DumpVolumeLetters Proc
|
|---|
| 504 | IFDEF __DUMP_VL__
|
|---|
| 505 | pushf
|
|---|
| 506 | pusha
|
|---|
| 507 |
|
|---|
| 508 | mov si, offset [dvl]
|
|---|
| 509 | call AuxIO_Print
|
|---|
| 510 |
|
|---|
| 511 | mov si,offset [PartitionVolumeLetters]
|
|---|
| 512 | mov cx,3
|
|---|
| 513 |
|
|---|
| 514 | DEBUG_DumpVolumeLetters_next:
|
|---|
| 515 | call AuxIO_DumpParagraph
|
|---|
| 516 | add si,16
|
|---|
| 517 | call AuxIO_TeletypeNL
|
|---|
| 518 | loop DEBUG_DumpVolumeLetters_next
|
|---|
| 519 |
|
|---|
| 520 | popa
|
|---|
| 521 | popf
|
|---|
| 522 | ENDIF
|
|---|
| 523 | ret
|
|---|
| 524 | DEBUG_DumpVolumeLetters EndP
|
|---|
| 525 |
|
|---|
| 526 |
|
|---|
| 527 |
|
|---|
| 528 |
|
|---|
| 529 | ;
|
|---|
| 530 | ; Dump the registers.
|
|---|
| 531 | ;
|
|---|
| 532 | __DUMP_REG__ EQU
|
|---|
| 533 | IFDEF __DUMP_REG__
|
|---|
| 534 | regAX db 'AX:',0
|
|---|
| 535 | regBX db ' BX:',0
|
|---|
| 536 | regCX db ' CX:',0
|
|---|
| 537 | regDX db ' DX:',0
|
|---|
| 538 | regSI db ' SI:',0
|
|---|
| 539 | regDI db ' DI:',0
|
|---|
| 540 |
|
|---|
| 541 | regBP db 'CS:',0
|
|---|
| 542 | regSP db ' DS:',0
|
|---|
| 543 | regCS db ' ES:',0
|
|---|
| 544 | regSS db ' SS:',0
|
|---|
| 545 | regDS db ' SP:',0
|
|---|
| 546 | regES db ' BP:',0
|
|---|
| 547 |
|
|---|
| 548 | ;~ regFS db 'FS:',0
|
|---|
| 549 | ;~ regGS db ' GS:',0
|
|---|
| 550 | ENDIF
|
|---|
| 551 | DEBUG_DumpRegisters Proc
|
|---|
| 552 | IFDEF __DUMP_REG__
|
|---|
| 553 | pushf
|
|---|
| 554 | pusha
|
|---|
| 555 |
|
|---|
| 556 | push si
|
|---|
| 557 | mov si, offset regAX
|
|---|
| 558 | call AuxIO_Print
|
|---|
| 559 | call AuxIO_TeletypeHexWord
|
|---|
| 560 | ;~ call AuxIO_TeletypeNL
|
|---|
| 561 |
|
|---|
| 562 | call AuxIO_Print
|
|---|
| 563 | mov ax,bx
|
|---|
| 564 | call AuxIO_TeletypeHexWord
|
|---|
| 565 | ;~ call AuxIO_TeletypeNL
|
|---|
| 566 |
|
|---|
| 567 | call AuxIO_Print
|
|---|
| 568 | mov ax,cx
|
|---|
| 569 | call AuxIO_TeletypeHexWord
|
|---|
| 570 | ;~ call AuxIO_TeletypeNL
|
|---|
| 571 |
|
|---|
| 572 | call AuxIO_Print
|
|---|
| 573 | mov ax,dx
|
|---|
| 574 | call AuxIO_TeletypeHexWord
|
|---|
| 575 | ;~ call AuxIO_TeletypeNL
|
|---|
| 576 |
|
|---|
| 577 | call AuxIO_Print
|
|---|
| 578 | pop ax
|
|---|
| 579 | call AuxIO_TeletypeHexWord
|
|---|
| 580 | ;~ call AuxIO_TeletypeNL
|
|---|
| 581 |
|
|---|
| 582 | call AuxIO_Print
|
|---|
| 583 | mov ax,di
|
|---|
| 584 | call AuxIO_TeletypeHexWord
|
|---|
| 585 | call AuxIO_TeletypeNL
|
|---|
| 586 |
|
|---|
| 587 |
|
|---|
| 588 |
|
|---|
| 589 | call AuxIO_Print
|
|---|
| 590 | mov ax,cs
|
|---|
| 591 | call AuxIO_TeletypeHexWord
|
|---|
| 592 | ;~ call AuxIO_TeletypeNL
|
|---|
| 593 |
|
|---|
| 594 | call AuxIO_Print
|
|---|
| 595 | mov ax,ds
|
|---|
| 596 | call AuxIO_TeletypeHexWord
|
|---|
| 597 | ;~ call AuxIO_TeletypeNL
|
|---|
| 598 |
|
|---|
| 599 | call AuxIO_Print
|
|---|
| 600 | mov ax,es
|
|---|
| 601 | call AuxIO_TeletypeHexWord
|
|---|
| 602 | ;~ call AuxIO_TeletypeNL
|
|---|
| 603 |
|
|---|
| 604 | call AuxIO_Print
|
|---|
| 605 | mov ax,ss
|
|---|
| 606 | call AuxIO_TeletypeHexWord
|
|---|
| 607 | ;~ call AuxIO_TeletypeNL
|
|---|
| 608 |
|
|---|
| 609 | call AuxIO_Print
|
|---|
| 610 | mov ax,sp
|
|---|
| 611 | call AuxIO_TeletypeHexWord
|
|---|
| 612 | ;~ call AuxIO_TeletypeNL
|
|---|
| 613 |
|
|---|
| 614 | call AuxIO_Print
|
|---|
| 615 | mov ax,bp
|
|---|
| 616 | call AuxIO_TeletypeHexWord
|
|---|
| 617 | call AuxIO_TeletypeNL
|
|---|
| 618 |
|
|---|
| 619 | ;~ call AuxIO_Print
|
|---|
| 620 | ;~ mov ax,fs
|
|---|
| 621 | ;~ call AuxIO_TeletypeHexWord
|
|---|
| 622 | ;~ call AuxIO_TeletypeNL
|
|---|
| 623 |
|
|---|
| 624 | ;~ call AuxIO_Print
|
|---|
| 625 | ;~ mov ax,gs
|
|---|
| 626 | ;~ call AuxIO_TeletypeHexWord
|
|---|
| 627 | ;~ call AuxIO_TeletypeNL
|
|---|
| 628 |
|
|---|
| 629 | call AuxIO_TeletypeNL
|
|---|
| 630 |
|
|---|
| 631 | popa
|
|---|
| 632 | popf
|
|---|
| 633 | ENDIF
|
|---|
| 634 | ret
|
|---|
| 635 | DEBUG_DumpRegisters EndP
|
|---|
| 636 |
|
|---|
| 637 |
|
|---|
| 638 | ;
|
|---|
| 639 | ; Dump CHS values.
|
|---|
| 640 | ;
|
|---|
| 641 | __DUMP_CHS__ EQU
|
|---|
| 642 | DEBUG_DumpCHS Proc Near
|
|---|
| 643 | IFDEF __DUMP_CHS__
|
|---|
| 644 | pushf
|
|---|
| 645 | pusha
|
|---|
| 646 | mov al,'C'
|
|---|
| 647 | call AuxIO_Teletype
|
|---|
| 648 | mov al,':'
|
|---|
| 649 | call AuxIO_Teletype
|
|---|
| 650 | mov ah,cl
|
|---|
| 651 | shr ah,6
|
|---|
| 652 | mov al,ch
|
|---|
| 653 | call AuxIO_TeletypeHexWord
|
|---|
| 654 | mov al,' '
|
|---|
| 655 | call AuxIO_Teletype
|
|---|
| 656 | mov al,'H'
|
|---|
| 657 | call AuxIO_Teletype
|
|---|
| 658 | mov al,':'
|
|---|
| 659 | call AuxIO_Teletype
|
|---|
| 660 | mov al,dh
|
|---|
| 661 | call AuxIO_TeletypeHexByte
|
|---|
| 662 | mov al,' '
|
|---|
| 663 | call AuxIO_Teletype
|
|---|
| 664 | mov al,'S'
|
|---|
| 665 | call AuxIO_Teletype
|
|---|
| 666 | mov al,':'
|
|---|
| 667 | call AuxIO_Teletype
|
|---|
| 668 | mov al,cl
|
|---|
| 669 | and al,00111111b
|
|---|
| 670 | call AuxIO_TeletypeHexByte
|
|---|
| 671 | call AuxIO_TeletypeNL
|
|---|
| 672 | popa
|
|---|
| 673 | popf
|
|---|
| 674 | ENDIF
|
|---|
| 675 | ret
|
|---|
| 676 | DEBUG_DumpCHS EndP
|
|---|
| 677 |
|
|---|
| 678 |
|
|---|
| 679 | ;
|
|---|
| 680 | ; Dump BSS.
|
|---|
| 681 | ;
|
|---|
| 682 | ;~ __DUMP_BSS__ EQU
|
|---|
| 683 | DEBUG_DumpBSSSectors Proc Near
|
|---|
| 684 | IFDEF __DUMP_BSS__
|
|---|
| 685 | pushf
|
|---|
| 686 | pusha
|
|---|
| 687 |
|
|---|
| 688 | mov si, offset [PartitionSector]
|
|---|
| 689 | call AuxIO_DumpSector
|
|---|
| 690 | call AuxIO_TeletypeNL
|
|---|
| 691 |
|
|---|
| 692 | mov si, offset [PBRSector]
|
|---|
| 693 | call AuxIO_DumpSector
|
|---|
| 694 | call AuxIO_TeletypeNL
|
|---|
| 695 |
|
|---|
| 696 | mov si, offset [LVMSector]
|
|---|
| 697 | call AuxIO_DumpSector
|
|---|
| 698 | call AuxIO_TeletypeNL
|
|---|
| 699 |
|
|---|
| 700 | mov si, offset [TmpSector]
|
|---|
| 701 | call AuxIO_DumpSector
|
|---|
| 702 | call AuxIO_TeletypeNL
|
|---|
| 703 |
|
|---|
| 704 | mov si, offset [NewPartTable]
|
|---|
| 705 | call AuxIO_DumpSector
|
|---|
| 706 | call AuxIO_TeletypeNL
|
|---|
| 707 | call AuxIO_TeletypeNL
|
|---|
| 708 |
|
|---|
| 709 | popa
|
|---|
| 710 | popf
|
|---|
| 711 | ENDIF
|
|---|
| 712 | ret
|
|---|
| 713 | DEBUG_DumpBSSSectors EndP
|
|---|
| 714 |
|
|---|
| 715 |
|
|---|
| 716 | ;
|
|---|
| 717 | ; Dump 6-bit packed hide partition table.
|
|---|
| 718 | ;
|
|---|
| 719 | ;~ __DUMP_HPT__ EQU
|
|---|
| 720 | DEBUG_DumpHidePartTables Proc Near
|
|---|
| 721 | IFDEF __DUMP_HPT__
|
|---|
| 722 | pushf
|
|---|
| 723 | pusha
|
|---|
| 724 |
|
|---|
| 725 | mov cx,3
|
|---|
| 726 | mov si, offset [HidePartitionTable]
|
|---|
| 727 | again1:
|
|---|
| 728 | call AuxIO_DumpSector
|
|---|
| 729 | add si,512
|
|---|
| 730 | loop again1
|
|---|
| 731 | call AuxIO_TeletypeNL
|
|---|
| 732 |
|
|---|
| 733 | mov cx,3
|
|---|
| 734 | mov si, offset [PartitionXref]
|
|---|
| 735 | again2:
|
|---|
| 736 | call AuxIO_DumpParagraph
|
|---|
| 737 | call AuxIO_TeletypeNL
|
|---|
| 738 | add si,16
|
|---|
| 739 | loop again2
|
|---|
| 740 | call AuxIO_TeletypeNL
|
|---|
| 741 |
|
|---|
| 742 | mov cx,3
|
|---|
| 743 | mov si, offset [NewHidePartTable]
|
|---|
| 744 | again3:
|
|---|
| 745 | call AuxIO_DumpSector
|
|---|
| 746 | add si,512
|
|---|
| 747 | loop again3
|
|---|
| 748 | call AuxIO_TeletypeNL
|
|---|
| 749 |
|
|---|
| 750 | popa
|
|---|
| 751 | popf
|
|---|
| 752 | ENDIF
|
|---|
| 753 | ret
|
|---|
| 754 | DEBUG_DumpHidePartTables EndP
|
|---|
| 755 |
|
|---|
| 756 |
|
|---|
| 757 | ;
|
|---|
| 758 | ; Check the bitfield routines.
|
|---|
| 759 | ;
|
|---|
| 760 | ;~ __CBF__ EQU
|
|---|
| 761 | DEBUG_CheckBitFields Proc
|
|---|
| 762 | IFDEF __CBF__
|
|---|
| 763 | pushf
|
|---|
| 764 | pusha
|
|---|
| 765 |
|
|---|
| 766 | mov bx,offset [ott]
|
|---|
| 767 |
|
|---|
| 768 | mov al,0
|
|---|
| 769 | mov dl,0
|
|---|
| 770 | mov dh,6
|
|---|
| 771 | DEBUG_CheckBitFields_next_write:
|
|---|
| 772 | call CONV_SetBitfieldValue
|
|---|
| 773 | inc al
|
|---|
| 774 | inc dl
|
|---|
| 775 | jnz DEBUG_CheckBitFields_next_write
|
|---|
| 776 |
|
|---|
| 777 | mov dl,0
|
|---|
| 778 | mov dh,6
|
|---|
| 779 | DEBUG_CheckBitFields_next_read:
|
|---|
| 780 | mov al,dl
|
|---|
| 781 | call AuxIO_TeletypeHexByte
|
|---|
| 782 | mov al,':'
|
|---|
| 783 | call AuxIO_Teletype
|
|---|
| 784 | call CONV_GetBitfieldValue
|
|---|
| 785 | call AuxIO_TeletypeHexWord
|
|---|
| 786 | call AuxIO_TeletypeNL
|
|---|
| 787 | inc dl
|
|---|
| 788 | jnz DEBUG_CheckBitFields_next_read
|
|---|
| 789 |
|
|---|
| 790 | popa
|
|---|
| 791 | popf
|
|---|
| 792 | ENDIF
|
|---|
| 793 | ret
|
|---|
| 794 | DEBUG_CheckBitFields EndP
|
|---|
| 795 |
|
|---|
| 796 |
|
|---|
| 797 |
|
|---|
| 798 |
|
|---|
| 799 | ;
|
|---|
| 800 | ; Dump information before the partition is booted.
|
|---|
| 801 | ;
|
|---|
| 802 | ;~ __DMP2__ EQU
|
|---|
| 803 | DEBUG_Dump2 Proc Near
|
|---|
| 804 | IFDEF __DMP2__
|
|---|
| 805 | pushf
|
|---|
| 806 | pusha
|
|---|
| 807 |
|
|---|
| 808 | call AuxIO_TeletypeNL
|
|---|
| 809 | call AuxIO_TeletypeNL
|
|---|
| 810 |
|
|---|
| 811 | mov si,offset db_config
|
|---|
| 812 | call AuxIO_Print
|
|---|
| 813 |
|
|---|
| 814 | mov si,offset db_cfgparts
|
|---|
| 815 | call AuxIO_Print
|
|---|
| 816 | mov al,[CFG_Partitions]
|
|---|
| 817 | call AuxIO_TeletypeHexByte
|
|---|
| 818 | call AuxIO_TeletypeNL
|
|---|
| 819 |
|
|---|
| 820 | mov si,offset db_cfgpartdef
|
|---|
| 821 | call AuxIO_Print
|
|---|
| 822 | mov al,[CFG_PartDefault]
|
|---|
| 823 | call AuxIO_TeletypeHexByte
|
|---|
| 824 | call AuxIO_TeletypeNL
|
|---|
| 825 |
|
|---|
| 826 | mov si,offset db_cfgpartlast
|
|---|
| 827 | call AuxIO_Print
|
|---|
| 828 | mov al,[CFG_PartLast]
|
|---|
| 829 | call AuxIO_TeletypeHexByte
|
|---|
| 830 | call AuxIO_TeletypeNL
|
|---|
| 831 | call AuxIO_TeletypeNL
|
|---|
| 832 |
|
|---|
| 833 | mov si,offset db_vars
|
|---|
| 834 | call AuxIO_Print
|
|---|
| 835 |
|
|---|
| 836 | mov si,offset db_newpart
|
|---|
| 837 | call AuxIO_Print
|
|---|
| 838 | mov si,offset NewPartTable
|
|---|
| 839 | call AuxIO_DumpSector
|
|---|
| 840 | call AuxIO_TeletypeNL
|
|---|
| 841 | add si,512
|
|---|
| 842 | call AuxIO_DumpSector
|
|---|
| 843 | call AuxIO_TeletypeNL
|
|---|
| 844 | call AuxIO_TeletypeNL
|
|---|
| 845 |
|
|---|
| 846 | mov si,offset db_newhide
|
|---|
| 847 | call AuxIO_Print
|
|---|
| 848 | mov si,offset NewHidePartTable
|
|---|
| 849 | call AuxIO_DumpSector
|
|---|
| 850 | call AuxIO_TeletypeNL
|
|---|
| 851 | add si,512
|
|---|
| 852 | call AuxIO_DumpSector
|
|---|
| 853 | call AuxIO_TeletypeNL
|
|---|
| 854 | call AuxIO_TeletypeNL
|
|---|
| 855 |
|
|---|
| 856 | mov si,offset db_dletters
|
|---|
| 857 | call AuxIO_Print
|
|---|
| 858 | mov si,offset NewDriveLetters
|
|---|
| 859 | call AuxIO_DumpParagraph
|
|---|
| 860 | call AuxIO_TeletypeNL
|
|---|
| 861 | add si,16
|
|---|
| 862 | call AuxIO_DumpParagraph
|
|---|
| 863 | call AuxIO_TeletypeNL
|
|---|
| 864 | call AuxIO_TeletypeNL
|
|---|
| 865 |
|
|---|
| 866 | mov si,offset db_tmpec
|
|---|
| 867 | call AuxIO_Print
|
|---|
| 868 | mov si,offset TmpSector
|
|---|
| 869 | call AuxIO_DumpSector
|
|---|
| 870 | call AuxIO_TeletypeNL
|
|---|
| 871 | call AuxIO_TeletypeNL
|
|---|
| 872 |
|
|---|
| 873 | mov si,offset db_partsec
|
|---|
| 874 | call AuxIO_Print
|
|---|
| 875 | mov si,offset PartitionSector
|
|---|
| 876 | call AuxIO_DumpSector
|
|---|
| 877 | call AuxIO_TeletypeNL
|
|---|
| 878 | call AuxIO_TeletypeNL
|
|---|
| 879 |
|
|---|
| 880 | popa
|
|---|
| 881 | popf
|
|---|
| 882 | ENDIF
|
|---|
| 883 | ret
|
|---|
| 884 | DEBUG_Dump2 EndP
|
|---|
| 885 |
|
|---|
| 886 |
|
|---|
| 887 |
|
|---|
| 888 | xrt db 10,'XrefTable:',10,0
|
|---|
| 889 | ddl db 10,'Driveletters:',10,0
|
|---|
| 890 | dvl db 10,'VolumeLetters:',10,0
|
|---|
| 891 | dlra db 10,'LVM_DoLetterReassignment: ',0
|
|---|
| 892 | ptetb db 10,'Partition Table Entry to boot',10,0
|
|---|
| 893 | bios_reg db 10,'Registers passed by BIOS:',10,0
|
|---|
| 894 | ;~ diopmbr db 10,'DriveIO_ProtectMBR',10,0
|
|---|
| 895 | dioss db 10,'DriveIO_SaveSector',10,0
|
|---|
| 896 |
|
|---|
| 897 |
|
|---|
| 898 | ;~ db_mbr db "## MBR ##",10,0
|
|---|
| 899 | ;~ db_masterlvm db "## MLVMR ##",10,0
|
|---|
| 900 |
|
|---|
| 901 | ;~ db_checkmath db "## CHK MATH ##",10,0
|
|---|
| 902 |
|
|---|
| 903 |
|
|---|
| 904 | ;~ db_config db '## CFG (DMP2) ##',10,0
|
|---|
| 905 | ;~ db_cfgparts db 'CFG_Partitions:',0
|
|---|
| 906 | ;~ db_cfgpartdef db 'CFG_PartDefault:',0
|
|---|
| 907 | ;~ db_cfgpartlast db 'CFG_PartLast:',0
|
|---|
| 908 |
|
|---|
| 909 |
|
|---|
| 910 | ;~ db_vars db '## VARS ##',10,0
|
|---|
| 911 | ;~ db_partsec db 'PartitionSector:',10,0
|
|---|
| 912 | ;~ db_lvmsec db 'LVMSector :',10,0
|
|---|
| 913 | ;~ db_tmpec db 'TmpSector :',10,0
|
|---|
| 914 |
|
|---|
| 915 | ;~ db_newpart db 'NewPartTable :',10,0
|
|---|
| 916 | ;~ db_newhide db 'NewHideTable:',10,0
|
|---|
| 917 | ;~ db_dletters db 'NewDriveLetters:',10,0
|
|---|
| 918 |
|
|---|
| 919 | ;~ db_partsize db 'PartitionSizeTable:',10,0
|
|---|
| 920 | ;~ db_partpoint db 'PartitionPointers:',10,0
|
|---|
| 921 | ;~ db_partpointcnt db 'PartitionPointerCount:',0
|
|---|
| 922 | ;~ db_partxref db 'PartitionXref:',10,0
|
|---|
| 923 | ;~ db_partvoldl db 'PartitionVolumeLetters:',10,0
|
|---|
| 924 |
|
|---|
| 925 | ;~ db_totaldisks db 'TotalHarddiscs:',0
|
|---|
| 926 | ;~ db_lbaswitchtab db 'LBASwitchTable:',10,0
|
|---|
| 927 | ;~ db_newparts db 'NewPartitions:',0
|
|---|
| 928 |
|
|---|
| 929 | ;~ db_exabspos db 'ExtendedAbsPos:',0
|
|---|
| 930 | ;~ db_exabsposset db 'ExtendedAbsPosSet:',0
|
|---|
| 931 |
|
|---|
| 932 | ;~ db_curpartloc db 'CurPartition_Location:',0
|
|---|
| 933 | ;~ db_curiox db 'CurIO_UseExtension:',0
|
|---|
| 934 |
|
|---|
| 935 | ;~ db_curlvmsec db 'Current LVM Sector:',0
|
|---|
| 936 |
|
|---|
| 937 |
|
|---|
| 938 | ;~ drive db 'drive : ',0
|
|---|
| 939 | ;~ before_lvm_adjust db 'before lvm adjust : ',0
|
|---|
| 940 | ;~ after_lvm_adjust db 'after lvm adjust : ',0
|
|---|
| 941 | ;~ before_lvm_adjust_log db 'before lvm logical adjust: ',0
|
|---|
| 942 | ;~ after_lvm_adjust_log db 'after lvm logical adjust : ',0
|
|---|
| 943 | ;~ spt_used db 'spt used : ',0
|
|---|