| 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 |
|
|---|
| 34 | IFDEF ModuleNames
|
|---|
| 35 | DB 'DEBUG',0
|
|---|
| 36 | ENDIF
|
|---|
| 37 |
|
|---|
| 38 | DEBUG_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
|
|---|
| 113 | DEBUG_CheckMath EndP
|
|---|
| 114 |
|
|---|
| 115 |
|
|---|
| 116 | DEBUG_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
|
|---|
| 164 | DEBUG_DumpGeo Endp
|
|---|
| 165 |
|
|---|
| 166 | ;
|
|---|
| 167 | ; Dump information before the menu is displayed.
|
|---|
| 168 | ;
|
|---|
| 169 | DEBUG_Dump1 Proc Near
|
|---|
| 170 | pushf
|
|---|
| 171 | pusha
|
|---|
| 172 |
|
|---|
| 173 | ; Hello message
|
|---|
| 174 | mov si, offset AuxIOHello
|
|---|
| 175 | call AuxIO_Print
|
|---|
| 176 |
|
|---|
| 177 | ; Build Date
|
|---|
| 178 | mov si, offset BUILD_DATE
|
|---|
| 179 | call AuxIO_Print
|
|---|
| 180 |
|
|---|
| 181 | ; Start new line
|
|---|
| 182 | call AuxIO_TeletypeNL
|
|---|
| 183 | call AuxIO_TeletypeNL
|
|---|
| 184 |
|
|---|
| 185 | ;~ call DEBUG_DumpHidePartTables
|
|---|
| 186 |
|
|---|
| 187 | ;~ call DEBUG_CheckMath
|
|---|
| 188 |
|
|---|
| 189 | ;~ call DEBUG_DumpGeo
|
|---|
| 190 |
|
|---|
| 191 | ;~ call DEBUG_CheckBitFields
|
|---|
| 192 |
|
|---|
| 193 | popa
|
|---|
| 194 | popf
|
|---|
| 195 | ret
|
|---|
| 196 | DEBUG_Dump1 EndP
|
|---|
| 197 |
|
|---|
| 198 |
|
|---|
| 199 | DEBUG_DumpBSSSectors Proc Near
|
|---|
| 200 | ;~ pushf
|
|---|
| 201 | ;~ pusha
|
|---|
| 202 | ;~
|
|---|
| 203 | ;~ mov si, offset [PartitionSector]
|
|---|
| 204 | ;~ call AuxIO_DumpSector
|
|---|
| 205 | ;~ call AuxIO_TeletypeNL
|
|---|
| 206 | ;~
|
|---|
| 207 | ;~ mov si, offset [JfsPBR]
|
|---|
| 208 | ;~ call AuxIO_DumpSector
|
|---|
| 209 | ;~ call AuxIO_TeletypeNL
|
|---|
| 210 | ;~
|
|---|
| 211 | ;~ mov si, offset [LVMSector]
|
|---|
| 212 | ;~ call AuxIO_DumpSector
|
|---|
| 213 | ;~ call AuxIO_TeletypeNL
|
|---|
| 214 | ;~
|
|---|
| 215 | ;~ mov si, offset [TmpSector]
|
|---|
| 216 | ;~ call AuxIO_DumpSector
|
|---|
| 217 | ;~ call AuxIO_TeletypeNL
|
|---|
| 218 | ;~
|
|---|
| 219 | ;~ mov si, offset [NewPartTable]
|
|---|
| 220 | ;~ call AuxIO_DumpSector
|
|---|
| 221 | ;~ call AuxIO_TeletypeNL
|
|---|
| 222 | ;~ call AuxIO_TeletypeNL
|
|---|
| 223 | ;~
|
|---|
| 224 | ;~ popa
|
|---|
| 225 | ;~ popf
|
|---|
| 226 | ret
|
|---|
| 227 | DEBUG_DumpBSSSectors EndP
|
|---|
| 228 |
|
|---|
| 229 |
|
|---|
| 230 | DEBUG_DumpHidePartTables Proc Near
|
|---|
| 231 | pushf
|
|---|
| 232 | pusha
|
|---|
| 233 |
|
|---|
| 234 | mov cx,3
|
|---|
| 235 | mov si, offset [HidePartitionTable]
|
|---|
| 236 | again1:
|
|---|
| 237 | call AuxIO_DumpSector
|
|---|
| 238 | add si,512
|
|---|
| 239 | loop again1
|
|---|
| 240 | call AuxIO_TeletypeNL
|
|---|
| 241 |
|
|---|
| 242 | mov cx,3
|
|---|
| 243 | mov si, offset [PartitionXref]
|
|---|
| 244 | again2:
|
|---|
| 245 | call AuxIO_DumpParagraph
|
|---|
| 246 | call AuxIO_TeletypeNL
|
|---|
| 247 | add si,16
|
|---|
| 248 | loop again2
|
|---|
| 249 | call AuxIO_TeletypeNL
|
|---|
| 250 |
|
|---|
| 251 | mov cx,3
|
|---|
| 252 | mov si, offset [NewHidePartTable]
|
|---|
| 253 | again3:
|
|---|
| 254 | call AuxIO_DumpSector
|
|---|
| 255 | add si,512
|
|---|
| 256 | loop again3
|
|---|
| 257 | call AuxIO_TeletypeNL
|
|---|
| 258 |
|
|---|
| 259 | popa
|
|---|
| 260 | popf
|
|---|
| 261 | ret
|
|---|
| 262 | DEBUG_DumpHidePartTables EndP
|
|---|
| 263 |
|
|---|
| 264 |
|
|---|
| 265 | DEBUG_CheckBitFields Proc
|
|---|
| 266 | ;~ pushf
|
|---|
| 267 | ;~ pusha
|
|---|
| 268 | ;~
|
|---|
| 269 | ;~ mov bx,offset [ott]
|
|---|
| 270 | ;~
|
|---|
| 271 | ;~ mov al,0
|
|---|
| 272 | ;~ mov dl,0
|
|---|
| 273 | ;~ mov dh,6
|
|---|
| 274 | ;~ DEBUG_CheckBitFields_next_write:
|
|---|
| 275 | ;~ call CONV_SetBitfieldValue
|
|---|
| 276 | ;~ inc al
|
|---|
| 277 | ;~ inc dl
|
|---|
| 278 | ;~ jnz DEBUG_CheckBitFields_next_write
|
|---|
| 279 | ;~
|
|---|
| 280 | ;~ mov dl,0
|
|---|
| 281 | ;~ mov dh,6
|
|---|
| 282 | ;~ DEBUG_CheckBitFields_next_read:
|
|---|
| 283 | ;~ mov al,dl
|
|---|
| 284 | ;~ call AuxIO_TeletypeHexByte
|
|---|
| 285 | ;~ mov al,':'
|
|---|
| 286 | ;~ call AuxIO_Teletype
|
|---|
| 287 | ;~ call CONV_GetBitfieldValue
|
|---|
| 288 | ;~ call AuxIO_TeletypeHexWord
|
|---|
| 289 | ;~ call AuxIO_TeletypeNL
|
|---|
| 290 | ;~ inc dl
|
|---|
| 291 | ;~ jnz DEBUG_CheckBitFields_next_read
|
|---|
| 292 | ;~
|
|---|
| 293 | ;~ popa
|
|---|
| 294 | ;~ popf
|
|---|
| 295 | ret
|
|---|
| 296 | DEBUG_CheckBitFields EndP
|
|---|
| 297 |
|
|---|
| 298 | ;
|
|---|
| 299 | ; Dump information before the partition is booted.
|
|---|
| 300 | ;
|
|---|
| 301 | DEBUG_Dump2 Proc Near
|
|---|
| 302 | ;~ pushf
|
|---|
| 303 | ;~ pusha
|
|---|
| 304 | ;~
|
|---|
| 305 | ;~
|
|---|
| 306 | ;~ call AuxIO_TeletypeNL
|
|---|
| 307 | ;~ call AuxIO_TeletypeNL
|
|---|
| 308 | ;~
|
|---|
| 309 | ;~
|
|---|
| 310 | ;~ mov si,offset db_config
|
|---|
| 311 | ;~ call AuxIO_Print
|
|---|
| 312 | ;~
|
|---|
| 313 | ;~ mov si,offset db_cfgparts
|
|---|
| 314 | ;~ call AuxIO_Print
|
|---|
| 315 | ;~ mov al,[CFG_Partitions]
|
|---|
| 316 | ;~ call AuxIO_TeletypeHexByte
|
|---|
| 317 | ;~ call AuxIO_TeletypeNL
|
|---|
| 318 | ;~
|
|---|
| 319 | ;~ mov si,offset db_cfgpartdef
|
|---|
| 320 | ;~ call AuxIO_Print
|
|---|
| 321 | ;~ mov al,[CFG_PartDefault]
|
|---|
| 322 | ;~ call AuxIO_TeletypeHexByte
|
|---|
| 323 | ;~ call AuxIO_TeletypeNL
|
|---|
| 324 | ;~
|
|---|
| 325 | ;~ mov si,offset db_cfgpartlast
|
|---|
| 326 | ;~ call AuxIO_Print
|
|---|
| 327 | ;~ mov al,[CFG_PartLast]
|
|---|
| 328 | ;~ call AuxIO_TeletypeHexByte
|
|---|
| 329 | ;~ call AuxIO_TeletypeNL
|
|---|
| 330 | ;~ call AuxIO_TeletypeNL
|
|---|
| 331 | ;~
|
|---|
| 332 | ;~
|
|---|
| 333 | ;~
|
|---|
| 334 | ;~ mov si,offset db_vars
|
|---|
| 335 | ;~ call AuxIO_Print
|
|---|
| 336 | ;~
|
|---|
| 337 | ;~ mov si,offset db_newpart
|
|---|
| 338 | ;~ call AuxIO_Print
|
|---|
| 339 | ;~ mov si,offset NewPartTable
|
|---|
| 340 | ;~ call AuxIO_DumpSector
|
|---|
| 341 | ;~ call AuxIO_TeletypeNL
|
|---|
| 342 | ;~ add si,512
|
|---|
| 343 | ;~ call AuxIO_DumpSector
|
|---|
| 344 | ;~ call AuxIO_TeletypeNL
|
|---|
| 345 | ;~ call AuxIO_TeletypeNL
|
|---|
| 346 | ;~
|
|---|
| 347 | ;~ mov si,offset db_newhide
|
|---|
| 348 | ;~ call AuxIO_Print
|
|---|
| 349 | ;~ mov si,offset NewHidePartTable
|
|---|
| 350 | ;~ call AuxIO_DumpSector
|
|---|
| 351 | ;~ call AuxIO_TeletypeNL
|
|---|
| 352 | ;~ add si,512
|
|---|
| 353 | ;~ call AuxIO_DumpSector
|
|---|
| 354 | ;~ call AuxIO_TeletypeNL
|
|---|
| 355 | ;~ call AuxIO_TeletypeNL
|
|---|
| 356 | ;~
|
|---|
| 357 | ;~ mov si,offset db_dletters
|
|---|
| 358 | ;~ call AuxIO_Print
|
|---|
| 359 | ;~ mov si,offset NewDriveLetters
|
|---|
| 360 | ;~ call AuxIO_DumpParagraph
|
|---|
| 361 | ;~ call AuxIO_TeletypeNL
|
|---|
| 362 | ;~ add si,16
|
|---|
| 363 | ;~ call AuxIO_DumpParagraph
|
|---|
| 364 | ;~ call AuxIO_TeletypeNL
|
|---|
| 365 | ;~ call AuxIO_TeletypeNL
|
|---|
| 366 | ;~
|
|---|
| 367 | ;~ mov si,offset db_tmpec
|
|---|
| 368 | ;~ call AuxIO_Print
|
|---|
| 369 | ;~ mov si,offset TmpSector
|
|---|
| 370 | ;~ call AuxIO_DumpSector
|
|---|
| 371 | ;~ call AuxIO_TeletypeNL
|
|---|
| 372 | ;~ call AuxIO_TeletypeNL
|
|---|
| 373 | ;~
|
|---|
| 374 | ;~ mov si,offset db_partsec
|
|---|
| 375 | ;~ call AuxIO_Print
|
|---|
| 376 | ;~ mov si,offset PartitionSector
|
|---|
| 377 | ;~ call AuxIO_DumpSector
|
|---|
| 378 | ;~ call AuxIO_TeletypeNL
|
|---|
| 379 | ;~ call AuxIO_TeletypeNL
|
|---|
| 380 | ;~
|
|---|
| 381 | ;~ popa
|
|---|
| 382 | ;~ popf
|
|---|
| 383 | ret
|
|---|
| 384 | DEBUG_Dump2 EndP
|
|---|
| 385 |
|
|---|
| 386 |
|
|---|
| 387 |
|
|---|
| 388 | db_mbr db "## MBR ##",10,0
|
|---|
| 389 | db_masterlvm db "## MLVMR ##",10,0
|
|---|
| 390 |
|
|---|
| 391 | db_checkmath db "## CHK MATH ##",10,0
|
|---|
| 392 |
|
|---|
| 393 |
|
|---|
| 394 | db_config db '## CFG (DMP2) ##',10,0
|
|---|
| 395 | db_cfgparts db 'CFG_Partitions:',0
|
|---|
| 396 | db_cfgpartdef db 'CFG_PartDefault:',0
|
|---|
| 397 | db_cfgpartlast db 'CFG_PartLast:',0
|
|---|
| 398 |
|
|---|
| 399 |
|
|---|
| 400 | db_vars db '## VARS ##',10,0
|
|---|
| 401 | db_partsec db 'PartitionSector:',10,0
|
|---|
| 402 | ;db_lvmsec db 'LVMSector :',10,0
|
|---|
| 403 | db_tmpec db 'TmpSector :',10,0
|
|---|
| 404 |
|
|---|
| 405 | db_newpart db 'NewPartTable :',10,0
|
|---|
| 406 | db_newhide db 'NewHideTable:',10,0
|
|---|
| 407 | db_dletters db 'NewDriveLetters:',10,0
|
|---|
| 408 |
|
|---|
| 409 | ;db_partsize db 'PartitionSizeTable:',10,0
|
|---|
| 410 | ;db_partpoint db 'PartitionPointers:',10,0
|
|---|
| 411 | ;db_partpointcnt db 'PartitionPointerCount:',0
|
|---|
| 412 | ;db_partxref db 'PartitionXref:',10,0
|
|---|
| 413 | ;db_partvoldl db 'PartitionVolumeLetters:',10,0
|
|---|
| 414 |
|
|---|
| 415 | ;db_totaldisks db 'TotalHarddiscs:',0
|
|---|
| 416 | ;db_lbaswitchtab db 'LBASwitchTable:',10,0
|
|---|
| 417 | ;db_newparts db 'NewPartitions:',0
|
|---|
| 418 |
|
|---|
| 419 | ;db_exabspos db 'ExtendedAbsPos:',0
|
|---|
| 420 | ;db_exabsposset db 'ExtendedAbsPosSet:',0
|
|---|
| 421 |
|
|---|
| 422 | db_curpartloc db 'CurPartition_Location:',0
|
|---|
| 423 | ;db_curiox db 'CurIO_UseExtension:',0
|
|---|
| 424 |
|
|---|
| 425 | db_curlvmsec db 'Current LVM Sector:',0
|
|---|
| 426 |
|
|---|