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