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

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

Created Bitfield functions (auxdebug on) [2012-02-21]

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!!

New

o Functions to insert/retrieve bitfields

Let's see if we can compress the hideparttable...

File size: 10.2 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 ; Start new line
107 call AuxIO_TeletypeNL
108
109 ;~ ; Start new line
110 call AuxIO_TeletypeNL
111
112 popa
113 popf
114
115 ret
116DEBUG_CheckMath EndP
117
118
119DEBUG_DumpGeo Proc
120 pushf
121 pusha
122
123 ; BIOS cyls
124 mov dx,word ptr [BIOS_Cyls+02]
125 mov ax,word ptr [BIOS_Cyls+00]
126 call AuxIO_TeletypeHexDWord
127 call AuxIO_TeletypeNL
128
129 ; BIOS heads
130 mov dx,word ptr [BIOS_Heads+02]
131 mov ax,word ptr [BIOS_Heads+00]
132 call AuxIO_TeletypeHexDWord
133 call AuxIO_TeletypeNL
134
135 ; BIOS secs
136 mov dx,word ptr [BIOS_Secs+02]
137 mov ax,word ptr [BIOS_Secs+00]
138 call AuxIO_TeletypeHexDWord
139 call AuxIO_TeletypeNL
140
141 ; Bytes per sector
142 mov ax,[BIOS_Bytes]
143 call AuxIO_TeletypeHexWord
144 call AuxIO_TeletypeNL
145
146 ; Total secs
147 mov bx, word ptr [BIOS_TotalSecs+06]
148 mov cx, word ptr [BIOS_TotalSecs+04]
149 mov dx, word ptr [BIOS_TotalSecs+02]
150 mov ax, word ptr [BIOS_TotalSecs+00]
151 call AuxIO_TeletypeHexDWord
152 call AuxIO_TeletypeNL
153
154 ; CHS to LBA
155 mov dx,1
156 mov ax,29e5h
157 mov bx,23h
158 mov cx,9h
159 call CONV_CHS2LBA
160 call AuxIO_TeletypeHexDWord
161 call AuxIO_TeletypeNL
162
163 popa
164 popf
165
166 ret
167DEBUG_DumpGeo Endp
168
169;
170; Dump information before the menu is displayed.
171;
172DEBUG_Dump1 Proc Near
173 pushf
174 pusha
175
176 ; Hello message
177 mov si, offset AuxIOHello
178 call AuxIO_Print
179
180 ; Build Date
181 mov si, offset BUILD_DATE
182 call AuxIO_Print
183
184 ; Start new line
185 call AuxIO_TeletypeNL
186 call AuxIO_TeletypeNL
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_CheckBitFields Proc
232 pushf
233 pusha
234
235 mov bx,offset [ott]
236
237 mov al,0
238 mov dl,0
239 mov dh,6
240 DEBUG_CheckBitFields_next_write:
241 call CONV_SetBitfieldValue
242 inc al
243 inc dl
244 ;~ cmp dl,70
245 jnz DEBUG_CheckBitFields_next_write
246
247 mov dl,0
248 mov dh,6
249 DEBUG_CheckBitFields_next_read:
250 mov al,dl
251 call AuxIO_TeletypeHexByte
252 mov al,':'
253 call AuxIO_Teletype
254 call CONV_GetBitfieldValue
255 call AuxIO_TeletypeHexWord
256 call AuxIO_TeletypeNL
257 inc dl
258 ;~ cmp dl,70
259 jnz DEBUG_CheckBitFields_next_read
260
261 popa
262 popf
263 ret
264DEBUG_CheckBitFields EndP
265
266;
267; Dump information before the partition is booted.
268;
269DEBUG_Dump2 Proc Near
270 ;~ pushf
271 ;~ pusha
272;~
273;~
274 ;~ call AuxIO_TeletypeNL
275 ;~ call AuxIO_TeletypeNL
276;~
277;~
278 ;~ mov si,offset db_config
279 ;~ call AuxIO_Print
280;~
281 ;~ mov si,offset db_cfgparts
282 ;~ call AuxIO_Print
283 ;~ mov al,[CFG_Partitions]
284 ;~ call AuxIO_TeletypeHexByte
285 ;~ call AuxIO_TeletypeNL
286;~
287 ;~ mov si,offset db_cfgpartdef
288 ;~ call AuxIO_Print
289 ;~ mov al,[CFG_PartDefault]
290 ;~ call AuxIO_TeletypeHexByte
291 ;~ call AuxIO_TeletypeNL
292;~
293 ;~ mov si,offset db_cfgpartlast
294 ;~ call AuxIO_Print
295 ;~ mov al,[CFG_PartLast]
296 ;~ call AuxIO_TeletypeHexByte
297 ;~ call AuxIO_TeletypeNL
298 ;~ call AuxIO_TeletypeNL
299;~
300;~
301;~
302 ;~ mov si,offset db_vars
303 ;~ call AuxIO_Print
304;~
305 ;~ mov si,offset db_newpart
306 ;~ call AuxIO_Print
307 ;~ mov si,offset NewPartTable
308 ;~ call AuxIO_DumpSector
309 ;~ call AuxIO_TeletypeNL
310 ;~ add si,512
311 ;~ call AuxIO_DumpSector
312 ;~ call AuxIO_TeletypeNL
313 ;~ call AuxIO_TeletypeNL
314;~
315 ;~ mov si,offset db_newhide
316 ;~ call AuxIO_Print
317 ;~ mov si,offset NewHidePartTable
318 ;~ call AuxIO_DumpSector
319 ;~ call AuxIO_TeletypeNL
320 ;~ add si,512
321 ;~ call AuxIO_DumpSector
322 ;~ call AuxIO_TeletypeNL
323 ;~ call AuxIO_TeletypeNL
324;~
325 ;~ mov si,offset db_dletters
326 ;~ call AuxIO_Print
327 ;~ mov si,offset NewDriveLetters
328 ;~ call AuxIO_DumpParagraph
329 ;~ call AuxIO_TeletypeNL
330 ;~ add si,16
331 ;~ call AuxIO_DumpParagraph
332 ;~ call AuxIO_TeletypeNL
333 ;~ call AuxIO_TeletypeNL
334;~
335 ;~ mov si,offset db_tmpec
336 ;~ call AuxIO_Print
337 ;~ mov si,offset TmpSector
338 ;~ call AuxIO_DumpSector
339 ;~ call AuxIO_TeletypeNL
340 ;~ call AuxIO_TeletypeNL
341;~
342 ;~ mov si,offset db_partsec
343 ;~ call AuxIO_Print
344 ;~ mov si,offset PartitionSector
345 ;~ call AuxIO_DumpSector
346 ;~ call AuxIO_TeletypeNL
347 ;~ call AuxIO_TeletypeNL
348;~
349 ;~ popa
350 ;~ popf
351 ret
352DEBUG_Dump2 EndP
353
354
355
356db_mbr db "## MBR ##",10,0
357db_masterlvm db "## MLVMR ##",10,0
358
359db_checkmath db "## CHK MATH ##",10,0
360
361
362db_config db '## CFG (DMP2) ##',10,0
363db_cfgparts db 'CFG_Partitions:',0
364db_cfgpartdef db 'CFG_PartDefault:',0
365db_cfgpartlast db 'CFG_PartLast:',0
366
367
368db_vars db '## VARS ##',10,0
369db_partsec db 'PartitionSector:',10,0
370;db_lvmsec db 'LVMSector :',10,0
371db_tmpec db 'TmpSector :',10,0
372
373db_newpart db 'NewPartTable :',10,0
374db_newhide db 'NewHideTable:',10,0
375db_dletters db 'NewDriveLetters:',10,0
376
377;db_partsize db 'PartitionSizeTable:',10,0
378;db_partpoint db 'PartitionPointers:',10,0
379;db_partpointcnt db 'PartitionPointerCount:',0
380;db_partxref db 'PartitionXref:',10,0
381;db_partvoldl db 'PartitionVolumeLetters:',10,0
382
383;db_totaldisks db 'TotalHarddiscs:',0
384;db_lbaswitchtab db 'LBASwitchTable:',10,0
385;db_newparts db 'NewPartitions:',0
386
387;db_exabspos db 'ExtendedAbsPos:',0
388;db_exabsposset db 'ExtendedAbsPosSet:',0
389
390db_curpartloc db 'CurPartition_Location:',0
391;db_curiox db 'CurIO_UseExtension:',0
392
393db_curlvmsec db 'Current LVM Sector:',0
394
Note: See TracBrowser for help on using the repository browser.