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