source: trunk/bootcode/regular/debug.asm@ 88

Last change on this file since 88 was 88, checked in by Ben Rietbroek, 8 years ago

Added a test-function for the packed BCD converter [v1.1.1-testing]

CAUTION:
This is a testbuild !
AirBoot uses the BIOS to access disks and a small coding error can trash
partition tables or other vital disk structures. You are advised to make
backups of TRACK0 and EBRs before using this testbuild. More info at:
https://rousseaux.github.io/netlabs.air-boot/pdf/AirBoot-v1.1.0-manual.pdf

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