source: trunk/BOOTCODE/REGULAR/DEBUG.ASM@ 46

Last change on this file since 46 was 46, checked in by Ben Rietbroek, 12 years ago

Various Changes [2012-04-14]

WARNING!!

All commits upto and including the commit of [2012-05-13] contain
a severe bug!! Building from these sources and then disabling
the 'force LBA' feature while also using the drive-letter feature or
editing the label can DESTROY THE MBR on ALL ATTACHED DISKS!!
DO NOT DISABLE 'FORCE LBA USAGE' WHEN BUILT FROM THE THESE COMMITS!!

Changes

o Added BLDLEVEL support
o Enhanced Master Make
o Sanitized sources
o Support for Wasm and Masm6 (experimental)
o Renamed MBR_PROT.ASM to MBR-PROT.ASM
o Merged bitfield code Into Installer
o First steps for cross platform Installer
o More...

File size: 11.5 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.
29;
30; Had problems with RU language version because it includes cyrillic charset.
31; Parts disabled for now.
32
33
34IFDEF ModuleNames
35DB 'DEBUG',0
36ENDIF
37
38DEBUG_CheckMath Proc Near
39 ;~ pushf
40 ;~ pusha
41;~
42 ;~ ; Msg check math-module
43 ;~ mov si,offset db_checkmath
44 ;~ call AuxIO_Print
45;~
46 ;~ ; Output hex-word
47 ;~ mov ax,0BABEh
48 ;~ call AuxIO_TeletypeHexWord
49;~
50 ;~ mov al,' '
51 ;~ call AuxIO_Teletype
52 ;~ mov al,'*'
53 ;~ call AuxIO_Teletype
54 ;~ mov al,' '
55 ;~ call AuxIO_Teletype
56;~
57 ;~ ; Output hex-word
58 ;~ mov ax,0BABEh
59 ;~ call AuxIO_TeletypeHexWord
60;~
61 ;~ mov al,' '
62 ;~ call AuxIO_Teletype
63 ;~ mov al,'='
64 ;~ call AuxIO_Teletype
65 ;~ mov al,' '
66 ;~ call AuxIO_Teletype
67;~
68 ;~ mov ax,0BABEh
69 ;~ mul ax
70 ;~ call AuxIO_TeletypeHexDWord
71;~
72 ;~ ; Start new line
73 ;~ call AuxIO_TeletypeNL
74;~
75 ;~ ; Output hex-dword
76 ;~ mov dx,0DEADh
77 ;~ mov ax,0FACEh
78 ;~ call AuxIO_TeletypeHexDWord
79;~
80 ;~ mov al,' '
81 ;~ call AuxIO_Teletype
82 ;~ mov al,'*'
83 ;~ call AuxIO_Teletype
84 ;~ mov al,' '
85 ;~ call AuxIO_Teletype
86;~
87 ;~ ; Output hex-dword
88 ;~ mov dx,0DEADh
89 ;~ mov ax,0FACEh
90 ;~ call AuxIO_TeletypeHexDWord
91;~
92 ;~ mov al,' '
93 ;~ call AuxIO_Teletype
94 ;~ mov al,'='
95 ;~ call AuxIO_Teletype
96 ;~ mov al,' '
97 ;~ call AuxIO_Teletype
98;~
99 ;~ mov bx,0DEADh
100 ;~ mov cx,0FACEh
101 ;~ mov dx,0DEADh
102 ;~ mov ax,0FACEh
103 ;~ call MATH_Mul32
104 ;~ call AuxIO_TeletypeHexQWord
105;~
106 ;~ call AuxIO_TeletypeNL
107 ;~ call AuxIO_TeletypeNL
108;~
109 ;~ popa
110 ;~ popf
111
112 ret
113DEBUG_CheckMath EndP
114
115
116DEBUG_DumpGeo Proc
117 ;~ pushf
118 ;~ pusha
119;~
120 ;~ ; BIOS cyls
121 ;~ mov dx,word ptr [BIOS_Cyls+02]
122 ;~ mov ax,word ptr [BIOS_Cyls+00]
123 ;~ call AuxIO_TeletypeHexDWord
124 ;~ call AuxIO_TeletypeNL
125;~
126 ;~ ; BIOS heads
127 ;~ mov dx,word ptr [BIOS_Heads+02]
128 ;~ mov ax,word ptr [BIOS_Heads+00]
129 ;~ call AuxIO_TeletypeHexDWord
130 ;~ call AuxIO_TeletypeNL
131;~
132 ;~ ; BIOS secs
133 ;~ mov dx,word ptr [BIOS_Secs+02]
134 ;~ mov ax,word ptr [BIOS_Secs+00]
135 ;~ call AuxIO_TeletypeHexDWord
136 ;~ call AuxIO_TeletypeNL
137;~
138 ;~ ; Bytes per sector
139 ;~ mov ax,[BIOS_Bytes]
140 ;~ call AuxIO_TeletypeHexWord
141 ;~ call AuxIO_TeletypeNL
142;~
143 ;~ ; Total secs
144 ;~ mov bx, word ptr [BIOS_TotalSecs+06]
145 ;~ mov cx, word ptr [BIOS_TotalSecs+04]
146 ;~ mov dx, word ptr [BIOS_TotalSecs+02]
147 ;~ mov ax, word ptr [BIOS_TotalSecs+00]
148 ;~ call AuxIO_TeletypeHexDWord
149 ;~ call AuxIO_TeletypeNL
150;~
151 ;~ ; CHS to LBA
152 ;~ mov dx,1
153 ;~ mov ax,29e5h
154 ;~ mov bx,23h
155 ;~ mov cx,9h
156 ;~ call CONV_CHS2LBA
157 ;~ call AuxIO_TeletypeHexDWord
158 ;~ call AuxIO_TeletypeNL
159;~
160 ;~ popa
161 ;~ popf
162
163 ret
164DEBUG_DumpGeo Endp
165
166;
167; Dump information before the menu is displayed.
168;
169DEBUG_Dump1 Proc Near
170 pushf
171 pusha
172
173 ; Hello message
174 mov si, offset AuxIOHello
175 call AuxIO_Print
176
177 ; Build Info
178 ;~ mov si, offset BUILD_DATE
179 ;~ call AuxIO_Print
180 call AuxIO_PrintBuildInfo
181
182 ; Start new line
183 call AuxIO_TeletypeNL
184 call AuxIO_TeletypeNL
185
186 ;~ call DEBUG_DumpHidePartTables
187
188 ;~ call DEBUG_CheckMath
189
190 ;~ call DEBUG_DumpGeo
191
192 ;~ call DEBUG_CheckBitFields
193
194 popa
195 popf
196 ret
197DEBUG_Dump1 EndP
198
199
200DEBUG_DumpBSSSectors Proc Near
201 ;~ pushf
202 ;~ pusha
203;~
204 ;~ mov si, offset [PartitionSector]
205 ;~ call AuxIO_DumpSector
206 ;~ call AuxIO_TeletypeNL
207;~
208 ;~ mov si, offset [JfsPBR]
209 ;~ call AuxIO_DumpSector
210 ;~ call AuxIO_TeletypeNL
211;~
212 ;~ mov si, offset [LVMSector]
213 ;~ call AuxIO_DumpSector
214 ;~ call AuxIO_TeletypeNL
215;~
216 ;~ mov si, offset [TmpSector]
217 ;~ call AuxIO_DumpSector
218 ;~ call AuxIO_TeletypeNL
219;~
220 ;~ mov si, offset [NewPartTable]
221 ;~ call AuxIO_DumpSector
222 ;~ call AuxIO_TeletypeNL
223 ;~ call AuxIO_TeletypeNL
224;~
225 ;~ popa
226 ;~ popf
227 ret
228DEBUG_DumpBSSSectors EndP
229
230
231DEBUG_DumpHidePartTables Proc Near
232 pushf
233 pusha
234
235 mov cx,3
236 mov si, offset [HidePartitionTable]
237 again1:
238 call AuxIO_DumpSector
239 add si,512
240 loop again1
241 call AuxIO_TeletypeNL
242
243 mov cx,3
244 mov si, offset [PartitionXref]
245 again2:
246 call AuxIO_DumpParagraph
247 call AuxIO_TeletypeNL
248 add si,16
249 loop again2
250 call AuxIO_TeletypeNL
251
252 mov cx,3
253 mov si, offset [NewHidePartTable]
254 again3:
255 call AuxIO_DumpSector
256 add si,512
257 loop again3
258 call AuxIO_TeletypeNL
259
260 popa
261 popf
262 ret
263DEBUG_DumpHidePartTables EndP
264
265
266DEBUG_CheckBitFields Proc
267 ;~ pushf
268 ;~ pusha
269;~
270 ;~ mov bx,offset [ott]
271;~
272 ;~ mov al,0
273 ;~ mov dl,0
274 ;~ mov dh,6
275 ;~ DEBUG_CheckBitFields_next_write:
276 ;~ call CONV_SetBitfieldValue
277 ;~ inc al
278 ;~ inc dl
279 ;~ jnz DEBUG_CheckBitFields_next_write
280;~
281 ;~ mov dl,0
282 ;~ mov dh,6
283 ;~ DEBUG_CheckBitFields_next_read:
284 ;~ mov al,dl
285 ;~ call AuxIO_TeletypeHexByte
286 ;~ mov al,':'
287 ;~ call AuxIO_Teletype
288 ;~ call CONV_GetBitfieldValue
289 ;~ call AuxIO_TeletypeHexWord
290 ;~ call AuxIO_TeletypeNL
291 ;~ inc dl
292 ;~ jnz DEBUG_CheckBitFields_next_read
293;~
294 ;~ popa
295 ;~ popf
296 ret
297DEBUG_CheckBitFields EndP
298
299;
300; Dump information before the partition is booted.
301;
302DEBUG_Dump2 Proc Near
303 ;~ pushf
304 ;~ pusha
305;~
306;~
307 ;~ call AuxIO_TeletypeNL
308 ;~ call AuxIO_TeletypeNL
309;~
310;~
311 ;~ mov si,offset db_config
312 ;~ call AuxIO_Print
313;~
314 ;~ mov si,offset db_cfgparts
315 ;~ call AuxIO_Print
316 ;~ mov al,[CFG_Partitions]
317 ;~ call AuxIO_TeletypeHexByte
318 ;~ call AuxIO_TeletypeNL
319;~
320 ;~ mov si,offset db_cfgpartdef
321 ;~ call AuxIO_Print
322 ;~ mov al,[CFG_PartDefault]
323 ;~ call AuxIO_TeletypeHexByte
324 ;~ call AuxIO_TeletypeNL
325;~
326 ;~ mov si,offset db_cfgpartlast
327 ;~ call AuxIO_Print
328 ;~ mov al,[CFG_PartLast]
329 ;~ call AuxIO_TeletypeHexByte
330 ;~ call AuxIO_TeletypeNL
331 ;~ call AuxIO_TeletypeNL
332;~
333;~
334;~
335 ;~ mov si,offset db_vars
336 ;~ call AuxIO_Print
337;~
338 ;~ mov si,offset db_newpart
339 ;~ call AuxIO_Print
340 ;~ mov si,offset NewPartTable
341 ;~ call AuxIO_DumpSector
342 ;~ call AuxIO_TeletypeNL
343 ;~ add si,512
344 ;~ call AuxIO_DumpSector
345 ;~ call AuxIO_TeletypeNL
346 ;~ call AuxIO_TeletypeNL
347;~
348 ;~ mov si,offset db_newhide
349 ;~ call AuxIO_Print
350 ;~ mov si,offset NewHidePartTable
351 ;~ call AuxIO_DumpSector
352 ;~ call AuxIO_TeletypeNL
353 ;~ add si,512
354 ;~ call AuxIO_DumpSector
355 ;~ call AuxIO_TeletypeNL
356 ;~ call AuxIO_TeletypeNL
357;~
358 ;~ mov si,offset db_dletters
359 ;~ call AuxIO_Print
360 ;~ mov si,offset NewDriveLetters
361 ;~ call AuxIO_DumpParagraph
362 ;~ call AuxIO_TeletypeNL
363 ;~ add si,16
364 ;~ call AuxIO_DumpParagraph
365 ;~ call AuxIO_TeletypeNL
366 ;~ call AuxIO_TeletypeNL
367;~
368 ;~ mov si,offset db_tmpec
369 ;~ call AuxIO_Print
370 ;~ mov si,offset TmpSector
371 ;~ call AuxIO_DumpSector
372 ;~ call AuxIO_TeletypeNL
373 ;~ call AuxIO_TeletypeNL
374;~
375 ;~ mov si,offset db_partsec
376 ;~ call AuxIO_Print
377 ;~ mov si,offset PartitionSector
378 ;~ call AuxIO_DumpSector
379 ;~ call AuxIO_TeletypeNL
380 ;~ call AuxIO_TeletypeNL
381;~
382 ;~ popa
383 ;~ popf
384 ret
385DEBUG_Dump2 EndP
386
387
388
389db_mbr db "## MBR ##",10,0
390db_masterlvm db "## MLVMR ##",10,0
391
392db_checkmath db "## CHK MATH ##",10,0
393
394
395db_config db '## CFG (DMP2) ##',10,0
396db_cfgparts db 'CFG_Partitions:',0
397db_cfgpartdef db 'CFG_PartDefault:',0
398db_cfgpartlast db 'CFG_PartLast:',0
399
400
401db_vars db '## VARS ##',10,0
402db_partsec db 'PartitionSector:',10,0
403;db_lvmsec db 'LVMSector :',10,0
404db_tmpec db 'TmpSector :',10,0
405
406db_newpart db 'NewPartTable :',10,0
407db_newhide db 'NewHideTable:',10,0
408db_dletters db 'NewDriveLetters:',10,0
409
410;db_partsize db 'PartitionSizeTable:',10,0
411;db_partpoint db 'PartitionPointers:',10,0
412;db_partpointcnt db 'PartitionPointerCount:',0
413;db_partxref db 'PartitionXref:',10,0
414;db_partvoldl db 'PartitionVolumeLetters:',10,0
415
416;db_totaldisks db 'TotalHarddiscs:',0
417;db_lbaswitchtab db 'LBASwitchTable:',10,0
418;db_newparts db 'NewPartitions:',0
419
420;db_exabspos db 'ExtendedAbsPos:',0
421;db_exabsposset db 'ExtendedAbsPosSet:',0
422
423db_curpartloc db 'CurPartition_Location:',0
424;db_curiox db 'CurIO_UseExtension:',0
425
426db_curlvmsec db 'Current LVM Sector:',0
427
Note: See TracBrowser for help on using the repository browser.