Ignore:
Timestamp:
Apr 12, 2014, 12:36:45 AM (11 years ago)
Author:
Ben Rietbroek
Message:

Now using compressed HidePartTable (auxdebug on) [2012-02-24]

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

Fixes

o HidePartTabled now uses a 6-bit compressed format

Bitfield functions are used to manipulate the table.
Modifications mostly in PARTSCAN.ASM, PART_SET.ASM and PARTMAIN.ASM.
TODO: Determine impact on upgrading from previous versions.

Changes

o Changed LVM Label behavior

If they are the same, the LVM VolumeName is synced to LVM PartitionName
so they are the same again after the edit.
If they differ, only the LVM VolumeName is updated.

o Implemented stop scanning when partition limit of 45 is exceeded

User is presented with a warning pop-up.
Pressing a key will continue and the partitions that were found
so far are displayed in the menu.
The color of the selection bar is changed to red to indicate this
overflow situation.

o New overlap macro that works correctly with JWasm and Tasm

Now uses DB n DUP (<filler>) to fill space before a new ORG.
When overlap occurs n goes negative causing assembler error.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BOOTCODE/REGULAR/DEBUG.ASM

    r44 r45  
    3737
    3838DEBUG_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 
     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;~
    10972        ;~ ; Start new line
    110         call    AuxIO_TeletypeNL
    111 
    112         popa
    113         popf
     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
    114111
    115112        ret
     
    118115
    119116DEBUG_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
     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
    165162
    166163        ret
     
    186183        call    AuxIO_TeletypeNL
    187184
     185        ;~ call    DEBUG_DumpHidePartTables
     186
    188187        ;~ call    DEBUG_CheckMath
    189188
    190189        ;~ call    DEBUG_DumpGeo
    191190
    192         call    DEBUG_CheckBitFields
     191        ;~ call    DEBUG_CheckBitFields
    193192
    194193        popa
     
    199198
    200199DEBUG_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
     227DEBUG_DumpBSSSectors    EndP
     228
     229
     230DEBUG_DumpHidePartTables    Proc    Near
    201231        pushf
    202232        pusha
    203233
    204         mov     si, offset [PartitionSector]
     234        mov     cx,3
     235        mov     si, offset [HidePartitionTable]
     236    again1:
    205237        call    AuxIO_DumpSector
    206         call    AuxIO_TeletypeNL
    207 
    208         mov     si, offset [JfsPBR]
     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:
    209254        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
     255        add     si,512
     256        loop    again3
    223257        call    AuxIO_TeletypeNL
    224258
     
    226260        popf
    227261        ret
    228 DEBUG_DumpBSSSectors    EndP
     262DEBUG_DumpHidePartTables    EndP
    229263
    230264
    231265DEBUG_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
     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
    263295        ret
    264296DEBUG_CheckBitFields    EndP
Note: See TracChangeset for help on using the changeset viewer.