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