Changeset 45


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.

Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/BOOTCODE/AIR-BOOT.ASM

    r44 r45  
    6060MaxDisks                equ     64
    6161
    62 ; Only when assembled with JWasm because Tasm generates too large code.
    63 IFDEF   JWASM
    64     ; If defined then include DEBUG.ASM and output debug-info to serial-port.
    65     AUX_DEBUG       EQU
    66 ELSE
    67     ;~ AUX_DEBUG       EQU
    68 ENDIF
     62
     63
     64
     65;
     66; Include Debug Modules and enable COM-port debugging.
     67;
     68AUX_DEBUG       EQU
     69
     70
     71
    6972
    7073
     
    195198; Also, MiniLVM uses a 0-byte terminator, so the maximum length is 19d.
    196199; Same goes for LocLVM_DiskName.
     200; These offsets are relative to an LVM entry.
    197201LocLVM_VolumeName           equ     14h ; 20 bytes
    198202LocLVM_PartitionName        equ     28h ; 20 bytes (Used in menu)
     203
     204; LVM constants.
     205LocLVM_LabelLen             equ     14h ; Length of an LVM Label (Disk/Part/Vol)
     206LocLVM_DiskNameLen          equ     14h ; Length of an LVM DiskName
     207LocLVM_VolumeNameLen        equ     14h ; Length of an LVM VolumeName
     208LocLVM_PartitionNameLen     equ     14h ; Length of an LVM PartitionName
    199209
    200210
     
    216226
    217227; Hidden Partition Table
    218 LocHPT_LenOfHPT             equ     30  ; Length of an HPT-entry
     228;~ LocHPT_LenOfHPT             equ     30  ; Length of an HPT-entry
     229; Length of an HPT-entry ((45 * 6 bits-per-part) / 8) * 45
     230; Packed table !
     231LocHPT_LenOfHPT             equ     34
    219232
    220233; AiR-BOOT IPT-Flags
     
    330343; It fixes issues with huge drives and lvm and more.
    331344
    332 sos1:
    333345
    334346; ---------------------------------------------
     
    358370
    359371                ; ID String, Date (DD,MM,CC,YY), Version Number, Language ID
    360                 db      'AiRBOOT', 21h, 02h, 20h, 12h, 01h, 08h, TXT_LanguageID
     372                db      'AiRBOOT', 24h, 02h, 20h, 12h, 01h, 08h, TXT_LanguageID
    361373
    362374                ; Total Sectors Count.
     
    366378                ; Total Sectors Count,
    367379                ; Dynamic calculation.
    368                 ;~ db      (CODE_END-$)/512
     380                ;~ db      (code_end-$)/512
    369381
    370382
     
    427439MBR_HaltSys:    cli
    428440                jmp     MBR_HaltSys
    429 
     441;db 100 dup (0)
     442
     443
     444
     445                ;
     446                ; Some small space for variables.
     447                ;
     448                ORIGIN  0003Ch
    430449
    431450; Comport settings
     
    434453; It cannot be in the config-area (sector 55)
    435454; because that area is crc-protected and would not allow 'poking'.
    436 here = $
    437                 org     0003Ch
    438                 check_overlap   here
    439455BIOS_AuxParms   dw      BIOS_AUXPARMS_DEFAULT
    440456
    441457reserved        db      6   dup('X')
     458
    442459
    443460                ;
     
    449466                ; want to change the AiR-BOOT signature
    450467                ; because of Microsoft inventions...
    451 here = $
    452                 org     044h
    453                 check_overlap   here
    454 
    455 
     468                ;
     469                ORIGIN  00044h
    456470
    457471                ; Jump again...
     
    590604
    591605
    592 
    593606                ; [v1.05+]
    594607                ; Signature for IBM's LVM to detect our "powerful" features ;)
     608                ;
    595609                ; [v1.0.8+]
    596610                ; Reworked MBR code to be able to create a
     
    599613                ; MBR's created with LVM eCS v2.x have the signature at 0d0h
    600614                ; See eCS bugtracker issue #3002
     615                ;
    601616                ; Update: These are actually MOV EAX,'X31I' instructions
    602617                ; in the eCS LVM MBR-code. They are at different places in
    603618                ; the v1.x and v2.x LVM code.
    604                 ; Let's protect them with an org directive.
    605 
    606 here = $
    607                 org     00d0h
    608                 check_overlap   here
    609                 ;org     00d0h
     619                ; Let's protect their location.
     620                ORIGIN  000d0h
    610621                db      'I13X',0,'I13X',0
    611622
     
    664675
    665676
    666 here = $
    667                 org     001b8h
    668                 check_overlap   here
    669 
    670677                ; Disk Signature
    671678                ; Note that in an LVM 2.x MBR this collides
    672679                ; with the dummy PTE that it uses to look for IBM-BM
    673680                ; on the second harddisk.
     681                ORIGIN  001B8h
     682
     683                ; AiR-BOOT will merge the field from the MBR it replaces.
    674684                db      'DSIG'
    675685
    676                 ; Unused word at 01BCh
    677                 ; An LVM 2.x MBR puts 'CC33' here.
     686                ; Unused word at 01BCh.
     687                ; An LVM 2.x MBR puts 0CC33h here.
     688                ; AiR-BOOT will merge the field from the MBR it replaces.
    678689                dw      '$$'
    679690
    680691
    681 here = $
    682                 org     001beh
    683                 check_overlap   here
    684 
    685                 ; Partition Table
     692                ;
     693                ; Partition Table.
     694                ;
     695                ORIGIN  001BEh
     696
     697                ; The 4 entries just for show.
     698                ; AiR-BOOT will merge them from the MBR it replaces.
    686699                db      16  dup('0')
    687700                db      16  dup('1')
     
    693706
    694707; End of sector 1
    695 eos1a:
     708
    696709
    697710
     
    704717                ; Here starts the second sector, sector 2
    705718                ;
    706                 org     00200h
    707 ; Start of sector 2.
    708 sos2:
     719                ORIGIN  00200h
    709720
    710721;
     
    752763                         ; -> 44 Partition-Types
    753764
    754 ; End of sector 2.
    755 eos2:
    756 
    757 
    758 
    759 
    760 
    761765
    762766
     
    764768;==============================================================================
    765769                                                                    ; Sector 3
    766 here = $
    767                 org     00400h
    768                 check_overlap   here
    769 
    770 
    771 ; Start of sector 3.
    772 sos3:
     770                ;
     771                ; Sector 3
     772                ;
     773                ORIGIN  00400h
    773774
    774775
     
    811812
    812813
    813                 mov     ax, offset sobss
    814                 mov     ax,offset BeginOfVariables
    815                 mov     ax,offset [TrueSecs]
    816                 lea     ax, [TrueSecs]
    817                 mov     ax,word ptr [TrueSecs]
    818                 mov     ax,offset EndOfVariables
    819                 mov     ax, offset eobss
    820                 nop
    821                 ;~ mov     ax, offset qqqq
     814                ;~ nop
     815                ;~ mov     ax, offset sobss
     816                ;~ mov     ax,offset BeginOfVariables
     817                ;~ mov     ax,offset [TrueSecs]
     818                ;~ lea     ax, [TrueSecs]  ; Tasm generates mov here
     819                ;~ mov     ax,word ptr [TrueSecs]
     820                ;~ mov     ax,offset EndOfVariables
     821                ;~ mov     ax, offset eobss
     822                ;~ nop
     823
    822824
    823825
     
    12181220
    12191221
    1220 ; End of sector 3.
    1221 eos3:
    1222 
    1223 
    1224 
    12251222
    12261223
     
    12401237                ;org     04600h                                  ; Sector 36-37
    12411238
    1242 ; Start of sector 36.
    1243 sos36:
    1244 
    1245 
    1246 
    1247 ; End of sector 37, yes this section is 2 sectors long.
    1248 eos37:
    1249 
    1250 
    1251 
    1252 
    12531239
    12541240
     
    12621248                ;org     04A00h
    12631249
    1264 ; Start of sector 28.
    1265 sos38:
    12661250
    12671251b_txtother:
     
    12911275size_billsuxx = $-b_billsuxx
    12921276
     1277
     1278                ;
     1279                ; Critical end of code marker.
     1280                ;
     1281                db  'DEAD'
     1282                db  'FACE'
     1283
     1284;
     1285; Keep these modules here at the end of the code section.
     1286; When debugging, extra code space is used and code will move up towards
     1287; the protection image that is 'orged' and will thus overlay.
     1288; The effects are turned off in debug mode, so it does not matter much that
     1289; this code get's lost.
     1290;
    12931291b_sound:
    12941292Include SPECIAL/SOUND.ASM       ; Sound
     
    13091307Include BLDDATE.ASM                      ; Build Date generated by _build.cmd
    13101308
    1311 ; End of sector x depending on size of translatable texts.
    1312 eosx:
    1313 
    1314 
    13151309                ;
    13161310                ; End of code marker.
     
    13221316
    13231317
    1324 
    1325 here = $
    1326                 org     06800h
    1327                 ; For some reason, this overlap check does not work !!
    1328                 ; I gues it's because 'here' has no definitive value yet
    1329                 ; and since JWasm is a single pass assembler, it won't
    1330                 ; change anymore. it is off by 1dh bytes.
    1331                 ; (Changing the ORG to 6700h produces an overlap of 11dh.
    1332                 ; This 1dh is by sheer coincidence the same length as the
    1333                 ; MBR_Prot signature on my system, but it's not related.
    1334                 check_overlap   here
     1318                ;
     1319                ; AiR-BOOT Protection Image.
     1320                ;
     1321                ORIGIN  06800h
    13351322
    13361323                ;
     
    13661353                ; variables remain vaild.
    13671354                ;
    1368 here = $
    1369                 org     06C00h
    1370                 check_overlap   here
    1371 sos55:
    1372 
    1373 
     1355                ORIGIN  06C00h
    13741356
    13751357Configuration:
     
    14601442;
    14611443
    1462 ; 6cae
    1463 eoc:
    1464 
    1465 
    1466 
     1444                ;
     1445                ; Drive Letters.
     1446                ;
     1447                ORIGIN  06CB0h
     1448
     1449
     1450;
     1451; Moved here to make room for packed hiddenparttable.
     1452;
     1453DriveLetters            db  LocIPT_MaxPartitions dup (0)
     1454                        ; Format is:
     1455                        ;============
     1456                        ; Drive-Letter : BYTE (80h-C:, 81h-D:)
     1457                        ; --------------------> 1 Byte * 45
     1458
     1459                ;
    14671460                ; Allways have the name of the installation volume
    14681461                ; at this offset.
    14691462                ; So future config changes will not break auto-install.
    1470 here = $
    1471                 org     06D00h
    1472                 check_overlap   here
    1473 
    1474 soiv:
     1463                ;
     1464                ORIGIN  06D00h
    14751465
    14761466; SET(A)BOOT stores the volume name of the eCS system being installed here.
     
    14851475
    14861476
    1487 ; 6d0c
    1488 ; End of sector 55.
    1489 eos55:
    1490 
    1491 
    1492 
    1493 
    1494 
    1495 
    14961477;
    14971478; THERE IS ROOM RESERVED HERE FOR MORE VARIABLES
    14981479;
    1499 
    1500 
    15011480
    15021481                ;
     
    15041483                ; Entries allocated down from 06E00 boundary.
    15051484                ;
    1506 here = $
    1507                 org     06DABh                                  ; 427 Boundry
    1508                 check_overlap   here
    1509 sosvs:
     1485                ORIGIN  % 06DABh                                  ; 427 Boundry
    15101486
    15111487; (432 - 5 = 427)
     
    15511527;------------------------------------------------------------------------------
    15521528
    1553 eosvs:
    1554 
    1555 
    1556 
    1557 
    15581529                ;org 06E00h                                     ; Sector 56-57
    15591530
    1560 here = $
    1561                 org     image_size - 0a00h - (image_size - image_size_60secs)
    1562                 check_overlap   here
    1563 
    1564 sos56:
    1565 
    1566 
    1567 
     1531                ;
     1532                ; AiR-BOOT Internal Partition Table (IPT)
     1533                ;
     1534                ORIGIN  % (image_size - 0a00h - (image_size - image_size_60secs))
     1535
     1536
     1537;
    15681538; Rousseau: This is the start of the AiR-BOOT IPT
    1569 
    1570 PartitionTable:  ; no-partitions detected... :]
     1539;
     1540
     1541
     1542PartitionTable  db  (LocIPT_MaxPartitions * LocIPT_LenOfIPT) dup (0)
     1543; no-partitions detected... :]
    15711544;                             db    1, 0, 0, 0, 'Harddisc  1'
    15721545;                             db    0, 0FFh, Flags_BootAble
     
    15901563    ; --------------------> 34 Bytes (total maximum partition-entries = 30)
    15911564
    1592     db  (LocIPT_MaxPartitions * LocIPT_LenOfIPT) dup (0)
    1593 
    1594 
    1595 ; 73fa !!!!!!!!!!!!!!
    1596 eos56:
    1597 
    1598 
    1599 
    1600 
    1601                 ;org 071F6h
    1602 ; 73F6
     1565
    16031566
    16041567                ; No need to check overlap here because this string will
    16051568                ; be overwritten if the maximum partition count is reached.
    16061569                ; So this is not a critical boundary.
    1607                 org     image_size - 600h - (image_size - image_size_60secs) / 2 - 0ah
    1608 
    1609 soiptsig:
     1570                ORG     (image_size - 600h - (image_size - image_size_60secs) / 2 - 10)
     1571
    16101572                db 'AiRBOOTPAR' ; 1K internal partition table
    16111573
    16121574
    1613 
    1614 eoiptsig:
    1615 
    1616 
    1617 
    16181575;------------------------------------------------------------------------------
    1619                             ;org 07200h                            ; Sector 58
    1620 
    1621 here = $
    1622                 org image_size - 600h - (image_size - image_size_60secs) / 2
    1623                 check_overlap   here
    1624 soipt:
    1625 sos58:
    1626 ; 7400h
     1576                            ;org 07400h                            ; Sector 58
     1577
     1578
     1579                ;
     1580                ; Hidden Partition Table (6-bit packed as of v1.0.8)
     1581                ;
     1582                ORIGIN  % (image_size - 600h - (image_size - image_size_60secs) / 2)
     1583
    16271584HidePartitionTable      db  (LocIPT_MaxPartitions * LocHPT_LenOfHPT) dup (0FFh)
    16281585                        ; Format is:
     
    16311588                        ; --------------------> 30 Bytes * 45
    16321589
    1633 DriveLetters            db  LocIPT_MaxPartitions dup (0)
    1634                         ; Format is:
    1635                         ;============
    1636                         ; Drive-Letter : BYTE (80h-C:, 81h-D:)
    1637                         ; --------------------> 1 Byte * 45
    1638 
    1639         ;
    1640         ; There is some room here, but this is the configuration section.
    1641         ; So not available for code.
    1642         ;
    1643 
    1644 eos58:
    1645 eoipt:
    1646 
    1647 
    1648 
    1649 
    1650                 ;org 075F6h
    1651                 ; No need to check overlap here because this string will
    1652                 ; be overwritten if the maximum partition count is reached.
    1653                 ; So this is not a critical boundary.
    1654                 org     image_size - 200h -0ah
    1655                 check_overlap   here
    1656 
    1657 sohidsig:
    1658 ;
    1659                         db  'AiRBOOTHID'    ; 1K internal Hide-partition table
    1660 
    1661 
    1662 eohidsig:
    1663 
    1664 
     1590;
     1591; Driveletters were here.
     1592; Moved down to make room for packed hideparttable.
     1593;
     1594
     1595
     1596                ;
     1597                ; End of hidden partition table.
     1598                ; Check overlap here for security reasons.
     1599                ;
     1600                ORIGIN  % (image_size - 200h - 5)
     1601
     1602; 79fa - end of packed hide table
     1603                        db  'ABHID'    ; 1K internal Hide-partition table
    16651604
    16661605
     
    16681607
    16691608;------------------------------------------------------------------------------
    1670                 ;org 07600h
    1671 
    1672 here = $
    1673                 org     image_size - 200h                       ; Sector 60
    1674                 check_overlap   here
    1675 
    1676 sohid:
    1677 sos60:
     1609                ;org 07A00h
     1610                                                                ; Sector 60
     1611
     1612                ;
     1613                ; AiR-BOOT MBR Backup.
     1614                ;
     1615                ORIGIN  % (image_size - 200h)
     1616
    16781617
    16791618MBR_BackUpMBR           db  'AiR-BOOT MBR-BackUp - Just to fill this sector with something',0
    16801619AirBootRocks            db  'AiR-BOOT Rocks!',0
    16811620
    1682                         db  512-($-sohid)-2  dup(0)
    1683 
    1684 eos60:
    1685 eohid:
    1686 
    1687 
    1688 
    1689 
    1690                 ;org 077FEh
    1691 
    1692 here = $
    1693                 org     image_size - 2
    1694                 check_overlap   here
     1621                        db  (512 - ($-MBR_BackUpMBR) - 2)  dup('M')
     1622
     1623                ; End of Image signature.
     1624                ;
     1625                ORIGIN  % (image_size - 2)
    16951626                        dw      0BABEh
    16961627
    1697 eoab:
     1628
     1629                ;
     1630                ; End of Image.
     1631                ;
     1632                ORIGIN  % (image_size)
    16981633
    16991634
     
    17221657                            ; What happens before this space ??
    17231658                            ; If org 0 corruption occurs.
     1659                            ; Filling hiddenparttable goes out-of-bounds !
    17241660                            ;
    17251661                            org 02400h                         ; Uninitialized
     
    17531689NewPartitions               db  ?           ; Freshly found partitions
    17541690                                            ; Independent of SaveConfiguration
     1691TooManyPartitions           db  ?           ; Non-zero if too many partitions found
    17551692
    17561693VideoIO_Segment             dw  ?           ; Segment for Video I/O
     
    17971734SETUP_VerifyPwd             db  17 dup (?)
    17981735StartSoundPlayed            db  ?
    1799 ChangePartNameSave          db  ?
     1736ChangePartNameSave          db  ?   ; Save label after user-edit ?
     1737SyncLvmLabels               db  ?   ; Sync LVM labels after user-edit ?
    18001738
    18011739FX_UseCount                 dw  ?
     
    18981836ENDIF
    18991837
    1900             END     AIR_BOOT
    1901 
     1838            END     AiR_BOOT
     1839
  • trunk/BOOTCODE/AIR-BOOT.HIS

    r43 r45  
    2424; ---------------------------------
    2525;
    26 ; v1.0.8-rc2-bld20120213
     26; v1.0.8-rc2-bld20120224
    2727;-----------------------
     28; # Implemented stop scanning when max. partitions limit exceeded #
     29;   Previous versions halted the system when the maximum number of partitions
     30;   that can be handled (45) was exceeded.
     31;   This required the user to boot from alternate media to correct the problem.
     32;   Now, when the partition limit is exceeded, AiR-BOOT displays a pop-up
     33;   and waits for a key-press. When the user presses a key, AiR-BOOT continues
     34;   and the boot-menu is shown, enabling the user to boot a system to correct
     35;   the problem. To indicate this situation, the color of the selection-bar
     36;   is displayed in red.
     37;
     38; # Fixed hiding partitions above old max 30-partitions limit #
     39;   Hiding partitions is a per partition setting and it is kept in a table
     40;   in the AiR-BOOT image on disk. In previous versions, including v1.0.8-rc1,
     41;   this table still held the old number of maximum partitions (30).
     42;   So configuring a hide-setting for partitions >30 or hiding more than
     43;   30 partitions per partition would not work properly.
     44;   Unfortunately, there was no room to expand this table, since it resides
     45;   just below the MBR backup, at the end of the AiR-BOOT image.
     46;   To work around this, the table now uses a 6-bits packed format and the
     47;   drive-letter array, which followed this table has been moved elsewhere.
     48;   This is a change in the configuration layout since the previous version,
     49;   so the config-version has been bumped to v1.0.8.
     50;   TODO: Add upgrade-code to the installer to cope with this.
     51;
    2852; # Removed requirement for LVM P and V name to be the same to edit #
    2953;   However, when both are the same before the edit, the V name will be
     
    3862;
    3963; # De-tasemized the Assembler sources for JWasm compatibility #
    40 ;   AiR-BOOT can now be built using JWasm, which is now the preferred
    41 ;   assembler.
     64;   AiR-BOOT can now be built using JWasm, which is the preferred
     65;   assembler as of this release. Tasm support will be dropped in the future.
    4266;
    4367; # Completely reworked the build-system #
     
    204228; # Math, Debug, Conv and Aux modules #
    205229;   These are used for 32-bit arithmatic on 16-bit code,
    206 ;   debug the booting process, converting between data-types
     230;   debug the boot process, converting between data-types
    207231;   and outputting log-data to the com-port.
    208232;
  • trunk/BOOTCODE/BLDDATE.ASM

    r44 r45  
    11IFDEF   JWASM
    2     BUILD_DATE db 'Build Date: 21 Feb 2012 at 11:30:00                                 [JWasm]',0
     2    BUILD_DATE db 'Build Date: 24 Feb 2012 at 13:30:00                                 [JWasm]',0
    33ENDIF
    44IFDEF   TASM
    5     BUILD_DATE db 'Build Date: 21 Feb 2012 at 11:30:00                                  [Tasm]',0
     5    BUILD_DATE db 'Build Date: 24 Feb 2012 at 13:30:00                                  [Tasm]',0
    66ENDIF
  • trunk/BOOTCODE/Makefile

    r43 r45  
    155155# -Cp   = case sensitive symbols
    156156# -zcw  = no _ prefix on symbols (C model)
    157 ASM_FLAGS_D0=-DDEBUG_LEVEL=$(DEBUG_LEVEL) -DJWASM -q -zcw -Fo$^. -Sa -Fl=$^&.LST -Fw$^&.ERR
     157# -Zm   = Masm51 compat -- don't use ! (Will generate incorrect offsets)
     158ASM_FLAGS_D0=-DDEBUG_LEVEL=$(DEBUG_LEVEL) -DJWASM -q -Cp -zcw -Fo$^. -Sa -Fl=$^&.LST -Fw$^&.ERR
    158159ASM_FLAGS_D1=-DDEBUG_LEVEL=$(DEBUG_LEVEL) -DJWASM -q -zcw -Zd -Zi -Fo$^. -Sa -Fl=$^&.LST -Fw$^&.ERR
    159160ASM_FLAGS_D2=-DDEBUG_LEVEL=$(DEBUG_LEVEL) -DJWASM -q -zcw -Zd -Zi -Fo$^. -Sa -Fl=$^&.LST -Fw$^&.ERR
     
    168169!elseif "$(ASM)"=="tasm"
    169170# -ml   = case sensitive symbols
    170 ASM_FLAGS_D0=-dDEBUG_LEVEL=$(DEBUG_LEVEL) -dTASM -t -m2 -l
     171ASM_FLAGS_D0=-dDEBUG_LEVEL=$(DEBUG_LEVEL) -dTASM -t -ml -m9 -l
    171172ASM_FLAGS_D1=-dDEBUG_LEVEL=$(DEBUG_LEVEL) -dTASM -t -m9 -z -zi -c -la
    172173ASM_FLAGS_D2=-dDEBUG_LEVEL=$(DEBUG_LEVEL) -dTASM -t -m9 -z -zi -c -la
     
    373374# 16-bits RAW :: Final image that can be executed when activated by the BIOS.
    374375###############################################################################
    375 $(TARGET):      .MULTIPLE $(BASENAME).COM
     376$(TARGET):      .MULTIPLE Makefile.bu $(BASENAME).COM
    376377#       $(LNK) $(LNK_FLAGS) file $^&.OBJ name $^. sys dos com
    377378!ifdef  __OS2__
    378379        ..$(DS)TOOLS$(DS)INTERNAL$(DS)FIXCODE.COM
     380!endif
     381!ifdef  __LINUX__
     382        ..$(DS)TOOLS$(DS)INTERNAL$(DS)FIXCODE
    379383!endif
    380384#       @echo   FIXCODE
     
    392396# 16-bits COM :: Intermediate image without embedded MBR-prot. and code count.
    393397###############################################################################
     398# While both DOS COM and RAW linkage generate a flat 16-bits image with
     399# fixed-up locations, DOS COM checks that the addressibility of the image does
     400# not exceed the upper 64kB limit while RAW just wraps it's fixups.
     401# So we use DOS COM linkage to proteced us from overflows in the BSS segment.
    394402$(BASENAME).COM:        .MULTIPLE $(BASENAME).OBJ
    395403        $(LNK) $(LNK_FLAGS) file $^&.OBJ name $^. sys dos com
     
    398406#       @echo.
    399407
     408#
     409# Assembled Object File
     410#
    400411$(BASENAME).OBJ:        .MULTIPLE $(BASENAME).ASM
    401412#       @echo.
  • trunk/BOOTCODE/REGULAR/AUXIO.ASM

    r44 r45  
    8484    AuxIO_Teletype_NoLogging:
    8585        ret
    86 AuxIO_TeleType  EndP
     86AuxIO_Teletype  EndP
    8787
    8888
     
    9292        call    AuxIO_Teletype
    9393        ret
    94 AuxIO_TeleTypeNL    EndP
     94AuxIO_TeletypeNL    EndP
    9595
    9696
     
    107107        call    AuxIO_Teletype             ; Output to com-port
    108108        ret
    109 AuxIO_TeleTypeHexByte   EndP
     109AuxIO_TeletypeHexByte   EndP
    110110
    111111; Print hex-word to com-port (teletype style)
     
    120120        call    AuxIO_TeletypeHexByte      ; Output to com-port
    121121        ret
    122 AuxIO_TeleTypeHexWord   EndP
     122AuxIO_TeletypeHexWord   EndP
    123123
    124124
     
    134134        call    AuxIO_TeletypeHexWord      ; Low word next
    135135        ret
    136 AuxIO_TeleTypeHexDWord  EndP
     136AuxIO_TeletypeHexDWord  EndP
    137137
    138138
     
    150150        call    AuxIO_TeletypeHexDWord     ; Low dword next
    151151        ret
    152 AuxIO_TeleTypeHexQWord  EndP
     152AuxIO_TeletypeHexQWord  EndP
    153153
    154154
  • trunk/BOOTCODE/REGULAR/BOOTMENU.ASM

    r43 r45  
    7272   mov     Menu_AbsoluteX, dl
    7373
    74    ; Display Top-Infos in Boot-Window
     74   ; Display Top-Infos (labels) in Boot-Window
    7575
    7676CLR_TOP_INFOS_CLASSIC    = 0b01h
     
    190190   mov     cx, CLR_INFO_WINDOW_BM
    191191   ;mov     cx, 0C06h ; brown, main background
    192    call    VideoIO_Color                                                         ; Ccolor info window
     192   call    VideoIO_Color                    ; Color info window
    193193
    194194   mov     bx, 1401h
    195195   mov     dx, 1950h
    196    call    VideoIO_MakeWindow            ; Information-Window
     196   call    VideoIO_MakeWindow               ; Information-Window
    197197   ; den kleinen Strich...
    198198   mov     cx, 1602h
     
    210210CLR_INFO_TEXT_BM   = 0701h
    211211
    212    mov     cx, CLR_INFO_TEXT_BM                   ; Info text
    213    call    VideoIO_Color                                                         ; Color info text
     212   mov     cx, CLR_INFO_TEXT_BM             ; Info text
     213   call    VideoIO_Color                    ; Color info text
    214214
    215215   mov     si, offset TXT_BootMenuHelpText1
     
    587587CLR_SELECTION_BAR_CLASSIC  = 50h
    588588CLR_SELECTION_BAR_BM = 090h
     589CLR_SELECTION_BAR_WARNING = 040h
    589590
    590591
    591592
    592593  BMBCB_AfterScrolling:
    593    mov     cl, CLR_SELECTION_BAR_BM    ; Color PINK, Partition DL
     594   mov     cl, CLR_SELECTION_BAR_BM
     595   test     byte ptr [TooManyPartitions],0ffh ; Check for too many partitions.
     596   jz       BOOTMENU_BuildChoiceBar_normal
     597   mov     cl, CLR_SELECTION_BAR_WARNING    ; Set red bar if so.
     598   BOOTMENU_BuildChoiceBar_normal:
    594599   call    BOOTMENU_ReColorPart
    595600   ret
  • 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
  • trunk/BOOTCODE/REGULAR/PARTMAIN.ASM

    r44 r45  
    972972      ; First, find Hide-Config
    973973      mov     dl, BootPartNo             ; EntryNumber is straight view
    974       mov     ax, LocIPT_MaxPartitions
     974      ;~ mov     ax, LocIPT_MaxPartitions
     975      mov     ax, LocHPT_LenOfHPT
    975976      mul     dl
    976977      mov     di, offset HidePartitionTable
    977978      add     di, ax                        ; We got the pointer
    978       ; So process Hide-Config. Read out Byte-Entries, each points to a partition
    979       ;  0FFh is end-marker / maximum entries = CFG_Partitions
    980       mov     cl, CFG_Partitions
    981      PSP_PartitionsHideLoop:
    982          mov     dl, es:[di]
    983          inc     di
    984          cmp     dl, 0FFh
    985          je      PSP_EndOfHideProcess    ; -> End of Hiding
    986          call    PART_HidePartition      ; Now hide that partition
    987       dec     cl
    988       jnz     PSP_PartitionsHideLoop
    989      PSP_EndOfHideProcess:
     979
     980
     981        ; So process Hide-Config. Read out Bitfield-Entries,
     982        ; each points to a partition.
     983        ; 3Fh is end-marker / maximum entries = CFG_Partitions
     984        mov     cl, CFG_Partitions
     985        mov     ch,0    ; Index in bitfield array.
     986        mov     dh,6    ; Bitfield width.
     987        mov     bx,di   ; Pointer to entry.
     988    PSP_PartitionsHideLoop:
     989        mov     dl,ch
     990        call    CONV_GetBitfieldValue
     991        mov     dl,al
     992
     993        ;~ mov     dl, es:[di]
     994        ;~ inc     di
     995        ;~ cmp     dl, 0FFh
     996        cmp     dl,3fh  ; Max value for 6-bits field.
     997        je      PSP_EndOfHideProcess    ; -> End of Hiding
     998        call    PART_HidePartition      ; Now hide that partition
     999        inc     ch      ; Next bitfield.
     1000        dec     cl
     1001        jnz     PSP_PartitionsHideLoop
     1002    PSP_EndOfHideProcess:
     1003
    9901004      ; --- HIDE COMPLETED ---
    9911005      ; So something got hidden and we have to remark a primary partition,
     
    16461660        jne      start_pbr
    16471661
    1648         ;xor     ax,ax
    1649         ;mov     [CurPartition_Location+00],ax
    1650         ;mov     [CurPartition_Location+02],ax
    1651         ;mov     [CurPartition_Location+04],ax
    1652         ;mov     [CurPartition_Location+06],ax
    1653 
    1654         ;pusha
    1655         ;xor     al,al
    1656         ;mov     di,si
    1657         ;add     di,LocIPT_Name
    1658         ;mov     cx,12
    1659         ;cld
    1660         ;rep     stosb
    1661         ;popa
    1662 
    1663 
    16641662        ;push    ds
    16651663        ;pop     es
     
    17421740
    17431741PART_StartPartition             EndP
     1742
     1743
     1744
     1745;
     1746; THE FUNCTIONS HERE BELOW WERE INTRODUCED TO ENHANCE THE PBR PROCESSING,
     1747; BUT THEY ARE ACTUALLY OBSOLETE BECAUSE THE INFORMATION THEY PROVIDE CAN
     1748; ALSO BE OBTAINED FROM THE IPT. HOWEVER, THE IPT USES DIFFERENT IDENTIFIERS
     1749; FOR PARTICULAR FILE-SYSTEMS / PBR TYPES, LIKE JFS BEING REPRESENTED AS 0FCh.
     1750; POSSIBLY THE INFO IN THE IPT NEEDS TO BE EXPANDED TO DISTINGUISH BETWEEN
     1751; OTHER BOOT-RECORDS AND FILE-SYSTEMS TOO, LIKE VISTA/WIN7 BMGR AND GRUB, ETC.
     1752; THIS WOULD NEED TO BE DONE IN THE PARTSCAN ROUTINES.
     1753; SO, FOR NOW WE KEEP USING THE STUFF BELOW.
     1754;
    17441755
    17451756
  • trunk/BOOTCODE/REGULAR/PARTSCAN.ASM

    r44 r45  
    4848        mov     CurIO_Scanning, 0             ; Reset flag due scanning complete
    4949
     50IFDEF   AUX_DEBUG
     51        pusha
     52        call    DEBUG_DumpHidePartTables
     53        popa
     54ENDIF
    5055        ; Use X-Reference to sync NewPartitionTable with Hide-Config
    5156        call    PARTSCAN_SyncHideConfigWithXref
     57
     58IFDEF   AUX_DEBUG
     59        pusha
     60        call    DEBUG_DumpHidePartTables
     61        popa
     62ENDIF
    5263
    5364        ; Now we copy the new IPT over the old one...
     
    197208        je      PSSP_IgnorePartition
    198209        ; Ignore these partitions, because there are no real Partitions
    199                 ;~ call    DEBUG_DumpBSSSectors
     210
     211        ;
     212        ; Stop scanning if too many partitions.
     213        ;
     214        cmp     word ptr [cs:NewPartitions],LocIPT_MaxPartitions
     215        jae     skip_check
    200216        call    PARTSCAN_CheckThisPartition
    201                 ;~ call    DEBUG_DumpBSSSectors
     217        jmp     PSSP_IgnorePartition
     218    skip_check:
     219        ; Cannot boot LVM-Data partitions
     220        pusha
     221        mov     byte ptr [cs:TooManyPartitions],1
     222        mov     cx, 0C04h
     223        ;~ mov     si, offset TXT_ERROR_TooManyPartitions
     224        mov     si, offset TXT_TooManyPartitions
     225        add     si,5    ; We stole this string, so skip new-line and dash.
     226        ;~ call    SETUP_Warning_AreYouSure
     227        call    SETUP_ShowErrorBox
     228        popa
     229
    202230    PSSP_IgnorePartition:
    203231        ; L”scht das Boot-Able Flag...
     
    687715        jbe     PCCTP_NotTooManyPartitions
    688716
     717        ; Should not be reached since scanning is stopped outside this
     718        ; function when partition limit exceeds.
    689719        mov     si, offset TXT_TooManyPartitions
    690720        call    MBR_Teletype
     
    730760; Reset X-Reference
    731761PARTSCAN_ResetXref  Proc Near   Uses ax cx di
    732         mov     di, offset PartitionXref      ; X-Reference for later syncing
     762        mov     di, offset PartitionXref        ; X-Reference for later syncing
    733763        mov     cx, LocIPT_MaxPartitions
    734         mov     ax, 0FFFFh                                                  ; Fill up with FFh -- Influences OVERWRITE BUG !
     764        mov     ax, 0FFFFh                      ; Fill up with FFh
    735765        rep     stosb
    736         mov     di, offset NewHidePartTable   ; Temporary Hide-Config Table
     766        mov     di, offset NewHidePartTable     ; Temporary Hide-Config Table
    737767        ;~ mov     cx, LocIPT_MaxPartitions * LocIPT_LenOfIPT
    738         mov     cx, LocIPT_MaxPartitions * LocHPT_LenOfHPT                  ; Checken !!!
    739         rep     stosb                         ; Fill up with FFFFh
     768        mov     cx, LocIPT_MaxPartitions * LocHPT_LenOfHPT
     769        rep     stosb                           ; Fill up with FFFFh
    740770        mov     di, offset NewDriveLetters
    741         mov     cx, LocIPT_MaxPartitions                        ; Temporary Logical-Drive Letter Table
     771        mov     cx, LocIPT_MaxPartitions        ; Temporary Logical-Drive Letter Table
    742772        xor     ax, ax
    743         rep     stosb                         ; Fill up with 0000h
     773        rep     stosb                           ; Fill up with 0000h
    744774        ret
    745775PARTSCAN_ResetXref  EndP
     
    759789        mov     si, offset HidePartitionTable
    760790        mov     di, offset NewHidePartTable
    761         mov     bl, LocIPT_MaxPartitions
     791        ;~ mov     bl, LocIPT_MaxPartitions
     792        mov     bl, LocHPT_LenOfHPT
    762793        mov     al, dl
    763794        mul     bl
     
    766797        mul     bl
    767798        add     di, ax
    768         mov     cx, LocIPT_MaxPartitions
     799        ;~ mov     cx, LocIPT_MaxPartitions
     800        mov     cx, LocHPT_LenOfHPT
    769801        rep     movsb                            ; Copy Hide-Config to NewHideTable
    770802        ; Process Logical-Drive-Letter table as well...
     
    797829
    798830
    799 
     831;
     832; Rousseau: Adjusted for packed hidden-part-table !
     833;           Needs to be re-written.
     834;
    800835; This here updates the contents of the Hide-Configuration to the current IPT
    801836;  table.
     
    803838        mov     si, offset NewHidePartTable
    804839        mov     di, offset HidePartitionTable
    805         mov     ch, LocIPT_MaxPartitions
     840        mov     dh, LocIPT_MaxPartitions    ; Max entries in hide-tables.
     841
    806842    PSSHCWX_SyncPartLoop:
    807         mov     cl, LocIPT_MaxPartitions
     843        mov     cl, LocIPT_MaxPartitions    ; Max entries per hide-entry.
    808844        xor     dl, dl                        ; Partition Lost Counter
     845
     846        mov     ch,0    ; Index.
     847
    809848    PSSHCWX_SyncLoop:
    810         lodsb                              ; Get Part-Pointer from Hide-Cfg
    811         cmp     al, 0FFh
     849        mov     bx,si
     850
     851        ;~ lodsb                              ; Get Part-Pointer from Hide-Cfg
     852
     853        push    dx
     854        mov     dl,ch
     855        mov     dh,6
     856        call    CONV_GetBitfieldValue
     857        pop     dx
     858
     859        ;~ cmp     al, 0FFh
     860        cmp     al, 3Fh
    812861        je      PSSHCWX_SyncEmpty
    813862        ;movzx   bx, al
     
    816865
    817866        mov     al, [PartitionXref+bx]     ; Translate it
    818         cmp     al, 0FFh
     867        ;~ cmp     al, 0FFh
     868        cmp     al, 3Fh
    819869        je      PSSHCWX_PartLost
     870
    820871    PSSHCWX_SyncEmpty:
    821         stosb                              ; Put translated pointer to new table
     872        mov     bx,di
     873        ;~ stosb                              ; Put translated pointer to new table
     874
     875        push    dx
     876        mov     dl,ch
     877        mov     dh,6
     878        call    CONV_SetBitfieldValue
     879        pop     dx
     880
     881        inc     ch
    822882        dec     cl
    823883        jnz     PSSHCWX_SyncLoop
     884
    824885        jmp     PSSHCWX_SyncLoopEnd
     886
    825887    PSSHCWX_PartLost:
    826888        inc     dl                         ; One partition got lost...
     
    829891
    830892    PSSHCWX_SyncLoopEnd:
     893
     894
     895    IFDEF   AUX_DEBUG
     896        pusha
     897        mov     al,dl
     898        call    AuxIO_TeletypeHexByte
     899        call    AuxIO_TeletypeNL
     900        popa
     901    ENDIF
     902
     903
    831904        or      dl, dl
    832905        jz      PSSHCWX_NothingLost
    833         mov     al, 0FFh                                                    ; Influences OVERWRITE BUG ! (OUT OF BOUNDS !!)
    834     PSSHCWX_LostFillLoop:
    835         stosb
     906        ;~ mov     al, 0FFh                     ; Influences OVERWRITE BUG ! (OUT OF BOUNDS !!)
     907        mov     al, 3Fh
     908
     909    PSSHCWX_LostFillLoop:                       ; CHECK !!
     910        ;~ stosb
    836911        dec     cl
    837912        jnz     PSSHCWX_LostFillLoop
    838913
    839                                         ; debug code
    840                                         mov     ax,di
    841                                         call    AuxIO_TeletypeHexWord
    842                                         call    AuxIO_TeletypeNL
     914    IFDEF   AUX_DEBUG
     915        ; debug code
     916        mov     ax,di
     917        call    AuxIO_TeletypeHexWord
     918        call    AuxIO_TeletypeNL
     919    ENDIF
    843920
    844921    PSSHCWX_NothingLost:
    845         dec     ch
     922        add     si, LocHPT_LenOfHPT
     923        add     di, LocHPT_LenOfHPT
     924        dec     dh
    846925        jnz     PSSHCWX_SyncPartLoop
     926
    847927        ret
    848928PARTSCAN_SyncHideConfigWithXref EndP
  • trunk/BOOTCODE/REGULAR/STD_TEXT.ASM

    r44 r45  
    4141;Copyright             db ' AiR-BOOT v1.0.8 - (c) 2012 M. Kiewitz    <<Release Candidate>>    (build: #18)', 0
    4242;Copyright             db ' AiR-BOOT v1.0.8 - (c) 2012 M. Kiewitz  <<Release Candidate 1>> (bld: 20120124)', 0
    43 ;Copyright             db ' AiR-BOOT v1.0.8 - (c) 2012 M. Kiewitz  <<Release Candidate 2>> (bld: 20120214)', 0
    44 Copyright             db ' AiR-BOOT v1.0.8 - (c) 2012 M. Kiewitz  <<Internal Release 2g>> (bld: 20120221)', 0
     43;Copyright             db ' AiR-BOOT v1.0.8 - (c) 2012 M. Kiewitz  <<Release Candidate 2>> (bld: 20120224)', 0
     44Copyright             db ' AiR-BOOT v1.0.8 - (c) 2012 M. Kiewitz  <<Internal Release 2l>> (bld: 20120224)', 0
    4545;Copyright             db ' AiR-BOOT v1.0.8 - (c) 1998-2012 M. Kiewitz, Dedicated to Gerd Kiewitz', 0
    4646
    4747; Message in case the user wants to edit the label of a type 0x35 partition
    48 TXT_SETUP_NoEditType35         db 'The label of an LVM-Data partition cannot be edited', 0
     48TXT_SETUP_NoEditType35          db 'Labels of LVM-Data partitions cannot be changed.', 0
    4949; Message in case the user wants to make a type 0x35 partition bootable
    50 TXT_SETUP_NoBootType35         db 'An LVM-Data partition cannot be set bootable', 0
     50TXT_SETUP_NoBootType35          db 'LVM-Data partitions cannot be set bootable.', 0
     51
     52;TXT_ERROR_TooManyPartitions     db 'Too many partitions! -- Proper operation not guaranteed!', 0
    5153
    5254; Rousseau: switch around
  • trunk/BOOTCODE/SETUP/PART_SET.ASM

    r43 r45  
    637637   jnc     PSCPN_LVMGotError             ; Not Found? -> display error and halt
    638638
    639     ;
    640     ; While AiR-BOOT v1.0.8+ displays the LVM VolumeName, the LVM PartitionName
    641     ; is used here to compare to the IPT.
    642     ; The IPT has the LVM VolumeName, so if they differ the compare will fail
    643     ; and the user-entry will noy be written to the LVM-info sector.
    644     ;
    645    add     si, LocLVM_PartitionName
     639
     640    ; Point to LVM VolumeName
     641   add     si, LocLVM_VolumeName
    646642
    647643
    648644   xchg    si, di                        ; SI-IPTEntry, DI-LVM PartName
    649645   jmp     PSCPN_CheckPartName           ; Check, if match...
     646
     647
    650648
    651649  PSCPN_LVMGotError:
     
    691689   ; Rousseau: Because AiR-BOOT v1.0.8 uses the LVM_VolumeName, which is copied
    692690   ; to the IPT, this compare fails when the LVM_PartitionName is not
    693    ; the same as the LVM_VolumeName.
    694    ; This is a protection against editing the Label when these names differ.
    695    ; MiniLVM assigns the same value to both, so partitions created with MiniLVM
    696    ; can be edited.
     691   ; the same as the LVM_VolumeName. In that case, only the LVM_VolumeName
     692   ; is updated. If they are the same, both are upated so they are the same
     693   ; again after the edit.
     694
    697695  PSCPN_CheckPartName:
    698696
    699   ; SI = IPT_Enty
     697    ; Do no synchronization initially.
     698    mov     [SyncLvmLabels],0
     699
     700  ; SI = IPT_Enty, DI points to LVM VolumeName.
    700701
    701702        ; If the partition is an LVM partition then disable editing completely.
     
    712713
    713714        jmp     PSCPN_AllDone
     715
     716    ; SI = IPT_Enty, DI points to LVM VolumeName.
    714717    no_type_35h:
     718
     719        ;
     720        ; Compare LVM VolumeName and PartitionName and
     721        ; set flag if they are the same and need to be synced after user edit.
     722        ;
     723        push    si
     724        push    di
     725        mov     si,di               ; Pointer to LVM V-name in SI
     726        add     di,LocLVM_LabelLen  ; Pointer to LVM P-name in DI
     727        mov     cx,LocLVM_LabelLen  ; Length of LVM label
     728        cld
     729        repe    cmpsb               ; Compare V and P labels
     730        jnz     LVM_Labels_not_equal
     731        mov     [SyncLvmLabels],1   ; Same so set flag for later
     732    LVM_Labels_not_equal:
     733        pop     di
     734        pop     si
     735
    715736
    716737   mov     cx, 11                        ; Partition-Name-Length = 11 Bytes
     
    725746   mov     ChangePartNameSave, 1         ; Remember, so we will save to BR
    726747
     748  ; SI = IPT_Enty, DI points to LVM PartitionName.
    727749  PSCPN_LetUserEditPartName:
    728750   ; User will now edit the volume label...
     
    746768
    747769   ; Make DI point to LVM VolumeName in LVM-entry
    748    sub     di,20
    749 
    750    ; -------------------------------------------------[LVM SAVE VOLUME NAME]---
    751    ; Copy 11 bytes from IPT into LVM VolumeName, back-padd with zero's
    752    mov     cx, 11
    753    push    si
    754       rep     movsb
    755    pop     si
    756    xor     al, al
    757    mov     cx, 9
    758    rep     stosb
     770   ;~ sub     di,20
     771
     772        ; Points to LVM VolumeName.
     773        push    di
     774
     775        ; -------------------------------------------------[LVM SAVE VOLUME NAME]---
     776        ; Copy 11 bytes from IPT into LVM VolumeName, back-padd with zero's
     777        mov     cx, 11
     778        push    si
     779        rep     movsb
     780        pop     si
     781
     782        ; Padd with zero's, but the editor still might have left spaces
     783        ; at the end of the 11-byte part. We correct that below.
     784        xor     al, al
     785        mov     cx, 9
     786        rep     stosb
    759787
    760788
     
    768796        ; Correct LVM VolumeName
    769797        ;
    770         push    di
    771798        mov     cx,20
    772799    vn_padd_next:
     
    782809        jmp     vn_padd_next
    783810    vn_padded:
     811
     812        ; Points to LVM VolumeName
    784813        pop     di
    785814
    786 
    787 
    788 
    789    ; ----------------------------------------------[LVM SAVE PARTITION NAME]---
    790    ; Copy 11 bytes from IPT into LVM PartitionName, back-padd with zero's
    791    mov     cx, 11
    792    push    si
    793       rep     movsb
    794    pop     si
    795    xor     al, al
    796    mov     cx, 9
    797    rep     stosb
    798 
    799 
    800         ;
    801         ; The AiR-BOOT Label Editor inserts spaces when a label is edited
    802         ; and characters are backspaced.
    803         ; This is fine for filesystem labels, which are space padded,
    804         ; but the LVM VolumeName and PartitionName need to be zero padded.
    805         ; So, below we replace all trailing spaces with zero's.
    806         ;
    807         ; Correct LVM PartitionName
    808         ;
    809         push    di
    810         mov     cx,20
    811     pn_padd_next:
    812         jcxz    pn_padded
    813         dec     di
    814         dec     cx
    815         mov     al,[di]
    816         test    al,al
    817         jz      pn_padd_next
    818         cmp     al,' '
    819         jnz     pn_padded
    820         mov     byte ptr [di],0
    821         jmp     pn_padd_next
    822     pn_padded:
    823         pop     di
    824 
     815        ; See if LVM-labels need to be synced.
     816        test    [SyncLvmLabels],1
     817        jz      LVM_no_sync_labels
     818
     819        ; Sync LVM-labels.
     820        mov     si,di
     821        add     di,LocLVM_LabelLen
     822        mov     cx,LocLVM_LabelLen
     823        cld
     824        rep     movsb
     825
     826
     827    LVM_no_sync_labels:
    825828
    826829   ; Update LVM-CRC now...
     
    917920   ; Collect Hide-Partition-Config and put it into Hide-Table
    918921   mov     dl, PartSetup_ActivePart
     922
     923IFDEF   AUX_DEBUG
     924        pusha
     925        mov     al,dl   ; Partition the hiding is set for.
     926        call    AuxIO_TeletypeHexByte
     927        call    AuxIO_TeletypeNL
     928        popa
     929ENDIF
     930
    919931   call    PARTHIDESETUP_CollectHideConfigAndPutToTable
    920932   ; Simply return to Partition Setup
     
    932944
    933945  PHSM_KeyToogle:
     946
     947IFDEF   AUX_DEBUG
     948        pusha
     949        mov     al,dl   ; Index of partition to set Special Marker on.
     950        call    AuxIO_TeletypeHexByte
     951        call    AuxIO_TeletypeNL
     952        popa
     953ENDIF
     954
    934955   call    PART_GetPartitionPointer      ; Holt den Pointer der Partition (DL) nach SI
    935956   mov     al, [si+LocIPT_Flags]
     
    12691290; =============================================================================
    12701291
     1292
     1293;
     1294; Rousseau: Adjusted for packed hidden-part-table !
     1295;           Needs to be re-written.
     1296;
    12711297; This is called by MBRS_PS_HiddenSetup
    12721298;        In: DL - Partition, where to save Hide-Config
    12731299; Destroyed: None, but Locate-Pointer
    1274 PARTHIDESETUP_GetHideConfigAndSpread Proc Near Uses ax dx si di
    1275    ; First check HideFeature-Flag on selected partition.
    1276    ;  if it's not set, don't do anything...
    1277    call    PART_GetPartitionPointer      ; Holt den Pointer der Partition (DL) nach SI
    1278    mov     al, [si+LocIPT_Flags]
    1279    test    al, Flags_HideFeature
    1280    jz      PHSGHCAS_EndOfEntries
    1281   PHSGHCAS_SomethingHidden:
    1282    ; Calculate, where to get Hide-Config
    1283    mov     ax, LocIPT_MaxPartitions
    1284    mul     dl
    1285    mov     di, offset HidePartitionTable
    1286    add     di, ax                        ; We got the pointer
    1287    ; So process Hide-Config. Read out Byte-Entries, each points to a partition
    1288    ;  0FFh is end-marker / maximum entries = CFG_Partitions
    1289    mov     cl, CFG_Partitions
    1290   PHSGHCAS_SpreadLoop:
    1291       mov     dl, [di]
    1292       inc     di
    1293       cmp     dl, 0FFh
    1294       je      PHSGHCAS_EndOfEntries
    1295       call    PART_GetPartitionPointer   ; Pointer for partition DL to SI
    1296       mov     al, [si+LocIPT_Flags]
    1297       or      al, Flags_SpecialMarker    ; Set marker
    1298       mov     [si+LocIPT_Flags], al
    1299    dec     cl
    1300    jnz     PHSGHCAS_SpreadLoop
    1301   PHSGHCAS_EndOfEntries:
    1302    ret
     1300PARTHIDESETUP_GetHideConfigAndSpread Proc Near Uses ax bx dx si di
     1301        ; First check HideFeature-Flag on selected partition.
     1302        ;  if it's not set, don't do anything...
     1303        call    PART_GetPartitionPointer      ; Holt den Pointer der Partition (DL) nach SI
     1304        mov     al, [si+LocIPT_Flags]
     1305        test    al, Flags_HideFeature
     1306        jz      PHSGHCAS_EndOfEntries
     1307    PHSGHCAS_SomethingHidden:
     1308        ; Calculate, where to get Hide-Config
     1309        mov     ax, LocHPT_LenOfHPT     ; Size of a hidden-part-table entry.
     1310        mul     dl      ; Multiply by partition-index.
     1311        mov     di, offset HidePartitionTable
     1312        add     di, ax                        ; We got the pointer
     1313
     1314        ; So process Hide-Config. Read out Bitfield-Entries,
     1315        ; each points to a partition.
     1316        ; 3Fh is end-marker / maximum entries = CFG_Partitions
     1317        mov     cl, CFG_Partitions
     1318        mov     bx,di   ; Pointer to hidden-parts entry for this partition.
     1319        mov     ch,0    ; Start index in hidden-parts entry for this partition.
     1320        mov     dh,6    ; Bitfields are 6 bits wide.
     1321    PHSGHCAS_SpreadLoop:
     1322        mov     dl,ch   ; Load bitfield index from CH.
     1323        call    CONV_GetBitfieldValue   ; Get value of bitfield.
     1324        mov     dl,al   ; Partition index in DL.
     1325        ;~ mov     dl, [di]
     1326        ;~ inc     di
     1327        ;~ cmp     dl, 0FFh
     1328        cmp     dl,3fh  ; Max value for 6-bits field.
     1329        je      PHSGHCAS_EndOfEntries
     1330        call    PART_GetPartitionPointer   ; Pointer for partition DL to SI
     1331        mov     al, [si+LocIPT_Flags]
     1332        or      al, Flags_SpecialMarker    ; Set marker
     1333        mov     [si+LocIPT_Flags], al
     1334        inc     ch      ; Next bitfield.
     1335        dec     cl
     1336        jnz     PHSGHCAS_SpreadLoop
     1337    PHSGHCAS_EndOfEntries:
     1338        ret
    13031339PARTHIDESETUP_GetHideConfigAndSpread EndP
    13041340
     1341
     1342;
     1343; Rousseau: Adjusted for packed hidden-part-table !
     1344;           Needs to be re-written.
     1345;
    13051346; This is called by MBRS_PS_HiddenSetup
    13061347;        In: DL - Partition, where to save Hide-Config
    13071348; Destroyed: None, but Locate-Pointer
    1308 PARTHIDESETUP_CollectHideConfigAndPutToTable Proc Near Uses ax si es di         ; checken !
    1309    ; First calculate, where to put Hide-Config
    1310    mov     ax, LocIPT_MaxPartitions
    1311    mul     dl
    1312    push    cs
    1313    pop     es
    1314    mov     di, offset HidePartitionTable
    1315    add     di, ax                        ; We got the pointer
    1316    push    di
    1317    push    di
    1318       mov     cx, LocIPT_MaxPartitions
    1319       mov     al, 0FFh
    1320       rep     stosb                      ; Fill up with FFh
    1321    pop     di
    1322       ; Now walk through the IPT collecting all SpecialMarkers
    1323       ;  For each do a byte-entry containing the number of the partition
    1324       mov     si, offset PartitionTable
    1325       xor     ch, ch
    1326       mov     cl, CFG_Partitions
    1327      PHSCHCAPTT_CollectLoop:
    1328          mov     bl, [si+LocIPT_Flags]
    1329          test    bl, Flags_SpecialMarker
    1330          jz      PHSCHCAPTT_NoMarker
    1331          mov     ds:[di], ch             ; Write byte-Entry
    1332          inc     di
    1333          xor     bl, Flags_SpecialMarker ; Reset Flag
    1334          mov     [si+LocIPT_Flags], bl
    1335         PHSCHCAPTT_NoMarker:
    1336          add     si, LocIPT_LenOfIPT
    1337       inc     ch
    1338       dec     cl
    1339       jnz     PHSCHCAPTT_CollectLoop
    1340    pop     si                            ; Original Hide-Config Pointer -> SI
    1341    ; Now check, if we have written anything
    1342    cmp     si, di
    1343    jne     PHSCHCAPTT_SomethingToHide
    1344    ; Nothing to hide...so UNSET the Hidden-Feature Flag
    1345    call    PART_GetPartitionPointer      ; Holt den Pointer der Partition (DL) nach SI
    1346    mov     al, [si+LocIPT_Flags]
    1347    mov     ah, Flags_HideFeature
    1348    not     ah
    1349    and     al, ah
    1350    mov     [si+LocIPT_Flags], al
    1351    ret
    1352 
    1353   PHSCHCAPTT_SomethingToHide:
    1354    mov     ax, si
    1355    add     ax, LocIPT_MaxPartitions
    1356    cmp     di, ax
    1357    jae     PHSCHCAPTT_AllUsed
    1358    ; Set END-marker
    1359    mov     al, 0FFh
    1360    stosb                                 ; Write byte-Entry
    1361   PHSCHCAPTT_AllUsed:
    1362 
    1363    ; Something to hide...so SET the Hidden-Feature Flag
    1364    call    PART_GetPartitionPointer      ; Holt den Pointer der Partition (DL) nach SI
    1365    mov     al, [si+LocIPT_Flags]
    1366    or      al, Flags_HideFeature
    1367    mov     [si+LocIPT_Flags], al
    1368    ret
     1349PARTHIDESETUP_CollectHideConfigAndPutToTable Proc Near Uses ax si es di
     1350        ; First calculate, where to put Hide-Config
     1351        ;~ mov     ax, LocIPT_MaxPartitions
     1352        mov     ax, LocHPT_LenOfHPT             ; Length of an HPT-entry.
     1353        mul     dl                              ; Partition to store info for.
     1354        push    cs
     1355        pop     es
     1356        mov     di, offset HidePartitionTable   ; Packed hideparttable.
     1357        add     di, ax                          ; We got the pointer in DI.
     1358
     1359        ;~ push    di
     1360
     1361        ; Fill hide-part-table entry with 'unused' marker.
     1362        ; Note that the entry is actually an array of 45 6-bit bitfields.
     1363        ; Below fills 34 bytes = 45 6-bit bitfields.
     1364        push    di
     1365        mov     cx, LocHPT_LenOfHPT
     1366        mov     al, 0FFh
     1367        rep     stosb                           ; Fill up with FFh
     1368        pop     di
     1369
     1370        ;~ mov     bp,di
     1371
     1372        ; Now walk through the IPT collecting all SpecialMarkers.
     1373        ; For each do a bitfield-entry containing the number of the partition.
     1374        mov     si, offset PartitionTable
     1375        xor     ch, ch                          ; Partition index
     1376        mov     cl, CFG_Partitions              ; Nr. of partitions in IPT
     1377        mov     ah,0                            ; Next hide-index to write.
     1378
     1379    ;
     1380    ; Collect all partitions that have the special marker set.
     1381    ; This marker was set by toggling the hide/unhide option in the setup menu.
     1382    ;
     1383    PHSCHCAPTT_CollectLoop:
     1384
     1385        ; Get marker and test it.
     1386        mov     bl, [si+LocIPT_Flags]
     1387        test    bl, Flags_SpecialMarker
     1388
     1389        ; No marker.
     1390        jz      PHSCHCAPTT_NoMarker
     1391
     1392        ; Setup stuff for bitfield operation.
     1393        push    dx          ; Save partition pointer.
     1394        push    bx          ; Save marker.
     1395        mov     bx,di       ; Get pointer to HPT-entry.
     1396        mov     dl,ah       ; Index in entry.
     1397        mov     dh,6        ; Bitfield width.
     1398        push    ax          ; Save index.
     1399        mov     al,ch       ; Partition index to store.
     1400
     1401
     1402    IFDEF   AUX_DEBUG
     1403        pushf
     1404        pusha
     1405        push    ax
     1406        mov     al,dl
     1407        call    AuxIO_TeletypeHexByte
     1408        mov     al,':'
     1409        call    AuxIO_Teletype
     1410        mov     ax,bx
     1411        call    AuxIO_TeletypeHexWord
     1412        mov     al,':'
     1413        call    AuxIO_Teletype
     1414        mov     ax,bp
     1415        call    AuxIO_TeletypeHexWord
     1416        mov     al,':'
     1417        call    AuxIO_Teletype
     1418        mov     ax,sp
     1419        call    AuxIO_TeletypeHexWord
     1420        mov     al,':'
     1421        call    AuxIO_Teletype
     1422        pop     ax
     1423        call    AuxIO_TeletypeHexByte
     1424        call    AuxIO_TeletypeNL
     1425        popa
     1426        popf
     1427    ENDIF
     1428
     1429        call    CONV_SetBitfieldValue   ; Store bitfield.
     1430        pop     ax          ; Restore index.
     1431        pop     bx          ; Restore marker.
     1432        pop     dx          ; Restore partition pointer.
     1433
     1434        inc     ah          ; Advance to next index.
     1435
     1436        ;~ mov     ds:[di], ch             ; Write byte-Entry
     1437        ;~ inc     di
     1438        xor     bl, Flags_SpecialMarker     ; Reset Flag
     1439        mov     [si+LocIPT_Flags], bl       ; Store it in IPT
     1440
     1441
     1442    PHSCHCAPTT_NoMarker:
     1443        add     si, LocIPT_LenOfIPT         ; Advance to next partition in IPT.
     1444        inc     ch                          ; Next partition-index.
     1445        dec     cl                          ; Decrement partitions to process.
     1446        jnz     PHSCHCAPTT_CollectLoop      ; Are we done yet ?
     1447
     1448        ;~ pop     si                        ; Original Hide-Config Pointer -> SI
     1449        ; Now check, if we have written anything
     1450        ;~ cmp     si, di
     1451        test    ah,ah                       ; See if we had to store anything.
     1452        jne     PHSCHCAPTT_SomethingToHide  ; Yep, go to write end-marker.
     1453
     1454        ; Nothing to hide...so UNSET the Hidden-Feature Flag
     1455        call    PART_GetPartitionPointer    ; Use DL to get part-pointer in SI.
     1456        mov     al, [si+LocIPT_Flags]       ; Get flags.
     1457        mov     ah, Flags_HideFeature       ; Hide mask.
     1458        not     ah                          ; Complement.
     1459        and     al, ah                      ; Clear hide-flag.
     1460        mov     [si+LocIPT_Flags], al       ; Store it.
     1461        ;~ pop     bp
     1462        ret                                 ; Return to caller.
     1463
     1464    PHSCHCAPTT_SomethingToHide:
     1465        cmp     ah, LocIPT_MaxPartitions    ; See if index is at end.
     1466        jae     PHSCHCAPTT_AllUsed          ; Yep, no need to store end-marker.
     1467
     1468        ; Write end-marker.
     1469        push    dx                          ; Save partition pointer.
     1470        mov     al,3fh                      ; End marker (6-bit)
     1471        mov     dl,ah                       ; Index in HPT-entry.
     1472        mov     dh,6                        ; Bitfield width.
     1473        mov     bx,di                       ; Get pointer to HPT-entry.
     1474        call    CONV_SetBitfieldValue       ; Store end-marker.
     1475        pop     dx                          ; Restore partition pointer.
     1476
     1477        ;~ mov     ax, si
     1478        ;~ add     ax, LocIPT_MaxPartitions
     1479        ;~ cmp     di, ax
     1480        ;~ jae     PHSCHCAPTT_AllUsed
     1481        ; Set END-marker
     1482        ;~ mov     al, 0FFh
     1483        ;~ stosb                                 ; Write byte-Entry
     1484    PHSCHCAPTT_AllUsed:
     1485
     1486        ; Something to hide...so SET the Hidden-Feature Flag
     1487        call    PART_GetPartitionPointer    ; Use DL to get part-pointer in SI.
     1488        mov     al, [si+LocIPT_Flags]       ; Get flags.
     1489        or      al, Flags_HideFeature       ; Set hide-flag.
     1490        mov     [si+LocIPT_Flags], al       ; Store it.
     1491        ;~ pop     bp
     1492        ret                                 ; Return to caller.
    13691493PARTHIDESETUP_CollectHideConfigAndPutToTable EndP
    13701494
  • trunk/BOOTCODE/SPECIAL/CHARSET.ASM

    r29 r45  
    3939   mov    ds, bx                         ; DS==CS
    4040   mov    si, offset CHARSET_Cyrillic
    41    mov    di, offset CharSetTempBuffer+2048
     41   mov    di, offset CharsetTempBuffer+2048
    4242
    4343   mov    dl, 64                         ; Decode 64 character bitmaps
     
    5757      jmp    DecodeLoop
    5858     EndOfStream:
    59       cmp    di, offset CharSetTempBuffer+3840
     59      cmp    di, offset CharsetTempBuffer+3840
    6060      jae    DecodeDone
    6161      add    di, 768                     ; Skip 3x16 char blocks
     
    6868   mov    cx, 0FFh
    6969   xor    dx, dx
    70    mov    bp, offset CharSetTempBuffer ; ES:BP - New charset
     70   mov    bp, offset CharsetTempBuffer ; ES:BP - New charset
    7171   int    10h                            ; VIDEO BIOS: Set new charset table
    7272   mov    ah, 12h
  • trunk/INCLUDE/ASM.INC

    r43 r45  
    3030EndM
    3131
    32 callfar Macro destination
    33    push    cs
    34    call    &destination
    35 EndM
     32
     33; Rousseau:
     34; My editor (Geany) keeps auto-completing 'call' to 'callfar' because
     35; of this definition. Since it's not used anywhere I disabled it.
     36;~ callfar Macro destination
     37   ;~ push    cs
     38   ;~ call    &destination
     39;~ EndM
    3640
    3741
    3842;
    39 ; An ORG directive resets the location counter where code and data is
    40 ; generated. If the location counter is reset back to a point where
    41 ; code or data already has been generated, this will be overwritten
    42 ; without warning.
    43 ; This macro can be used with every ORG directive to check for this condition,
    44 ; and when it occurs further assembly is terminated.
    45 
     43; OLD OVERLAP CHECKER, DOES NOT WORK WELL WITH JWASM.
     44;
    4645; NOTE:  Overlapchecking in JWasm is not as reliable as in Tasm.
    4746;        Because it's a single pass assembler, the current location can be
     
    9190    ; Terminate assembly by forcing an error.
    9291    .ERR
     92ENDM
    9393
     94
     95;
     96; A normal ORG directive resets the location counter where code and data is
     97; going to be emitted. If the location counter is reset back to a point
     98; where code or data already has been emitted, this will be overwritten
     99; without warning.
     100; This macro does a check for this condition and aborts if it exists.
     101; If there is space between the new location and the last emitted code or data
     102; will be filled.
     103;
     104; There are differences between assemblers on when and how labels and values
     105; are evaluated. Since JWasm is a single-pass assembler, some expressions
     106; do not work that do work in multi-pass Tasm.
     107; That's why the actual check for overlap is done by db getting a negative
     108; value if an overlap occured.
     109; So don't change the (after - before) calculations by assigning it to a
     110; variable; that will break this macro.
     111;
     112ORIGIN  MACRO   loc
     113    ;~ IFDEF   JWASM
     114        ;~ db  (@F - $)   dup('X')
     115        ;~ ORG     loc
     116        ;~ @@:
     117    ;~ ENDIF
     118
     119    ; Use this value to fill the gap between the new origin and the last
     120    ; emitted code or data.
     121    fillchar = 'X'
     122
     123    ; Mark the location of the last emitted code or data.
     124    z_&loc&_1before:
     125
     126    ; JWasm can do db 0 dup (0).
     127    IFDEF   JWASM
     128        db  (z_&loc&_2after - z_&loc&_1before)   dup(fillchar)
     129    ENDIF
     130
     131    ; Tasm cannot.
     132    IFDEF   TASM
     133        IF (z_&loc&_2after - z_&loc&_1before) NE 0
     134            db  (z_&loc&_2after - z_&loc&_1before)   dup(fillchar)
     135        ENDIF
     136    ENDIF
     137
     138    ; Set the new origin.
     139    ORG     loc
     140
     141    ; Mark the new location.
     142    z_&loc&_2after:
     143
     144    ; Calculate the gap.
     145    z_&loc&_3gap = z_&loc&_2after - z_&loc&_1before
     146
     147    ;
     148    ; Note that the variables are prefixed with z_ so they appear
     149    ; at the end of the list-file.
     150    ;
    94151ENDM
     152
    95153
    96154
Note: See TracChangeset for help on using the changeset viewer.