Changeset 45
- Timestamp:
- Apr 12, 2014, 12:36:45 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BOOTCODE/AIR-BOOT.ASM
r44 r45 60 60 MaxDisks equ 64 61 61 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 ; 68 AUX_DEBUG EQU 69 70 71 69 72 70 73 … … 195 198 ; Also, MiniLVM uses a 0-byte terminator, so the maximum length is 19d. 196 199 ; Same goes for LocLVM_DiskName. 200 ; These offsets are relative to an LVM entry. 197 201 LocLVM_VolumeName equ 14h ; 20 bytes 198 202 LocLVM_PartitionName equ 28h ; 20 bytes (Used in menu) 203 204 ; LVM constants. 205 LocLVM_LabelLen equ 14h ; Length of an LVM Label (Disk/Part/Vol) 206 LocLVM_DiskNameLen equ 14h ; Length of an LVM DiskName 207 LocLVM_VolumeNameLen equ 14h ; Length of an LVM VolumeName 208 LocLVM_PartitionNameLen equ 14h ; Length of an LVM PartitionName 199 209 200 210 … … 216 226 217 227 ; 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 ! 231 LocHPT_LenOfHPT equ 34 219 232 220 233 ; AiR-BOOT IPT-Flags … … 330 343 ; It fixes issues with huge drives and lvm and more. 331 344 332 sos1:333 345 334 346 ; --------------------------------------------- … … 358 370 359 371 ; ID String, Date (DD,MM,CC,YY), Version Number, Language ID 360 db 'AiRBOOT', 2 1h, 02h, 20h, 12h, 01h, 08h, TXT_LanguageID372 db 'AiRBOOT', 24h, 02h, 20h, 12h, 01h, 08h, TXT_LanguageID 361 373 362 374 ; Total Sectors Count. … … 366 378 ; Total Sectors Count, 367 379 ; Dynamic calculation. 368 ;~ db ( CODE_END-$)/512380 ;~ db (code_end-$)/512 369 381 370 382 … … 427 439 MBR_HaltSys: cli 428 440 jmp MBR_HaltSys 429 441 ;db 100 dup (0) 442 443 444 445 ; 446 ; Some small space for variables. 447 ; 448 ORIGIN 0003Ch 430 449 431 450 ; Comport settings … … 434 453 ; It cannot be in the config-area (sector 55) 435 454 ; because that area is crc-protected and would not allow 'poking'. 436 here = $437 org 0003Ch438 check_overlap here439 455 BIOS_AuxParms dw BIOS_AUXPARMS_DEFAULT 440 456 441 457 reserved db 6 dup('X') 458 442 459 443 460 ; … … 449 466 ; want to change the AiR-BOOT signature 450 467 ; because of Microsoft inventions... 451 here = $ 452 org 044h 453 check_overlap here 454 455 468 ; 469 ORIGIN 00044h 456 470 457 471 ; Jump again... … … 590 604 591 605 592 593 606 ; [v1.05+] 594 607 ; Signature for IBM's LVM to detect our "powerful" features ;) 608 ; 595 609 ; [v1.0.8+] 596 610 ; Reworked MBR code to be able to create a … … 599 613 ; MBR's created with LVM eCS v2.x have the signature at 0d0h 600 614 ; See eCS bugtracker issue #3002 615 ; 601 616 ; Update: These are actually MOV EAX,'X31I' instructions 602 617 ; in the eCS LVM MBR-code. They are at different places in 603 618 ; 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 610 621 db 'I13X',0,'I13X',0 611 622 … … 664 675 665 676 666 here = $667 org 001b8h668 check_overlap here669 670 677 ; Disk Signature 671 678 ; Note that in an LVM 2.x MBR this collides 672 679 ; with the dummy PTE that it uses to look for IBM-BM 673 680 ; on the second harddisk. 681 ORIGIN 001B8h 682 683 ; AiR-BOOT will merge the field from the MBR it replaces. 674 684 db 'DSIG' 675 685 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. 678 689 dw '$$' 679 690 680 691 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. 686 699 db 16 dup('0') 687 700 db 16 dup('1') … … 693 706 694 707 ; End of sector 1 695 eos1a: 708 696 709 697 710 … … 704 717 ; Here starts the second sector, sector 2 705 718 ; 706 org 00200h 707 ; Start of sector 2. 708 sos2: 719 ORIGIN 00200h 709 720 710 721 ; … … 752 763 ; -> 44 Partition-Types 753 764 754 ; End of sector 2.755 eos2:756 757 758 759 760 761 765 762 766 … … 764 768 ;============================================================================== 765 769 ; 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 773 774 774 775 … … 811 812 812 813 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 822 824 823 825 … … 1218 1220 1219 1221 1220 ; End of sector 3.1221 eos3:1222 1223 1224 1225 1222 1226 1223 … … 1240 1237 ;org 04600h ; Sector 36-37 1241 1238 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 1253 1239 1254 1240 … … 1262 1248 ;org 04A00h 1263 1249 1264 ; Start of sector 28.1265 sos38:1266 1250 1267 1251 b_txtother: … … 1291 1275 size_billsuxx = $-b_billsuxx 1292 1276 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 ; 1293 1291 b_sound: 1294 1292 Include SPECIAL/SOUND.ASM ; Sound … … 1309 1307 Include BLDDATE.ASM ; Build Date generated by _build.cmd 1310 1308 1311 ; End of sector x depending on size of translatable texts.1312 eosx:1313 1314 1315 1309 ; 1316 1310 ; End of code marker. … … 1322 1316 1323 1317 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 1335 1322 1336 1323 ; … … 1366 1353 ; variables remain vaild. 1367 1354 ; 1368 here = $ 1369 org 06C00h 1370 check_overlap here 1371 sos55: 1372 1373 1355 ORIGIN 06C00h 1374 1356 1375 1357 Configuration: … … 1460 1442 ; 1461 1443 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 ; 1453 DriveLetters db LocIPT_MaxPartitions dup (0) 1454 ; Format is: 1455 ;============ 1456 ; Drive-Letter : BYTE (80h-C:, 81h-D:) 1457 ; --------------------> 1 Byte * 45 1458 1459 ; 1467 1460 ; Allways have the name of the installation volume 1468 1461 ; at this offset. 1469 1462 ; 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 1475 1465 1476 1466 ; SET(A)BOOT stores the volume name of the eCS system being installed here. … … 1485 1475 1486 1476 1487 ; 6d0c1488 ; End of sector 55.1489 eos55:1490 1491 1492 1493 1494 1495 1496 1477 ; 1497 1478 ; THERE IS ROOM RESERVED HERE FOR MORE VARIABLES 1498 1479 ; 1499 1500 1501 1480 1502 1481 ; … … 1504 1483 ; Entries allocated down from 06E00 boundary. 1505 1484 ; 1506 here = $ 1507 org 06DABh ; 427 Boundry 1508 check_overlap here 1509 sosvs: 1485 ORIGIN % 06DABh ; 427 Boundry 1510 1486 1511 1487 ; (432 - 5 = 427) … … 1551 1527 ;------------------------------------------------------------------------------ 1552 1528 1553 eosvs:1554 1555 1556 1557 1558 1529 ;org 06E00h ; Sector 56-57 1559 1530 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 ; 1568 1538 ; Rousseau: This is the start of the AiR-BOOT IPT 1569 1570 PartitionTable: ; no-partitions detected... :] 1539 ; 1540 1541 1542 PartitionTable db (LocIPT_MaxPartitions * LocIPT_LenOfIPT) dup (0) 1543 ; no-partitions detected... :] 1571 1544 ; db 1, 0, 0, 0, 'Harddisc 1' 1572 1545 ; db 0, 0FFh, Flags_BootAble … … 1590 1563 ; --------------------> 34 Bytes (total maximum partition-entries = 30) 1591 1564 1592 db (LocIPT_MaxPartitions * LocIPT_LenOfIPT) dup (0) 1593 1594 1595 ; 73fa !!!!!!!!!!!!!! 1596 eos56: 1597 1598 1599 1600 1601 ;org 071F6h 1602 ; 73F6 1565 1603 1566 1604 1567 ; No need to check overlap here because this string will 1605 1568 ; be overwritten if the maximum partition count is reached. 1606 1569 ; 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 1610 1572 db 'AiRBOOTPAR' ; 1K internal partition table 1611 1573 1612 1574 1613 1614 eoiptsig:1615 1616 1617 1618 1575 ;------------------------------------------------------------------------------ 1619 ;org 07 200h ; Sector 581620 1621 here = $ 1622 org image_size - 600h - (image_size - image_size_60secs) / 21623 check_overlap here1624 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 1627 1584 HidePartitionTable db (LocIPT_MaxPartitions * LocHPT_LenOfHPT) dup (0FFh) 1628 1585 ; Format is: … … 1631 1588 ; --------------------> 30 Bytes * 45 1632 1589 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 1665 1604 1666 1605 … … 1668 1607 1669 1608 ;------------------------------------------------------------------------------ 1670 ;org 07 600h1671 1672 here = $ 1673 org image_size - 200h ; Sector 601674 check_overlap here1675 1676 sohid: 1677 sos60: 1609 ;org 07A00h 1610 ; Sector 60 1611 1612 ; 1613 ; AiR-BOOT MBR Backup. 1614 ; 1615 ORIGIN % (image_size - 200h) 1616 1678 1617 1679 1618 MBR_BackUpMBR db 'AiR-BOOT MBR-BackUp - Just to fill this sector with something',0 1680 1619 AirBootRocks db 'AiR-BOOT Rocks!',0 1681 1620 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) 1695 1626 dw 0BABEh 1696 1627 1697 eoab: 1628 1629 ; 1630 ; End of Image. 1631 ; 1632 ORIGIN % (image_size) 1698 1633 1699 1634 … … 1722 1657 ; What happens before this space ?? 1723 1658 ; If org 0 corruption occurs. 1659 ; Filling hiddenparttable goes out-of-bounds ! 1724 1660 ; 1725 1661 org 02400h ; Uninitialized … … 1753 1689 NewPartitions db ? ; Freshly found partitions 1754 1690 ; Independent of SaveConfiguration 1691 TooManyPartitions db ? ; Non-zero if too many partitions found 1755 1692 1756 1693 VideoIO_Segment dw ? ; Segment for Video I/O … … 1797 1734 SETUP_VerifyPwd db 17 dup (?) 1798 1735 StartSoundPlayed db ? 1799 ChangePartNameSave db ? 1736 ChangePartNameSave db ? ; Save label after user-edit ? 1737 SyncLvmLabels db ? ; Sync LVM labels after user-edit ? 1800 1738 1801 1739 FX_UseCount dw ? … … 1898 1836 ENDIF 1899 1837 1900 END A IR_BOOT1901 1838 END AiR_BOOT 1839 -
trunk/BOOTCODE/AIR-BOOT.HIS
r43 r45 24 24 ; --------------------------------- 25 25 ; 26 ; v1.0.8-rc2-bld201202 1326 ; v1.0.8-rc2-bld20120224 27 27 ;----------------------- 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 ; 28 52 ; # Removed requirement for LVM P and V name to be the same to edit # 29 53 ; However, when both are the same before the edit, the V name will be … … 38 62 ; 39 63 ; # De-tasemized the Assembler sources for JWasm compatibility # 40 ; AiR-BOOT can now be built using JWasm, which is nowthe preferred41 ; 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. 42 66 ; 43 67 ; # Completely reworked the build-system # … … 204 228 ; # Math, Debug, Conv and Aux modules # 205 229 ; These are used for 32-bit arithmatic on 16-bit code, 206 ; debug the boot ingprocess, converting between data-types230 ; debug the boot process, converting between data-types 207 231 ; and outputting log-data to the com-port. 208 232 ; -
trunk/BOOTCODE/BLDDATE.ASM
r44 r45 1 1 IFDEF JWASM 2 BUILD_DATE db 'Build Date: 2 1 Feb 2012 at 11:30:00 [JWasm]',02 BUILD_DATE db 'Build Date: 24 Feb 2012 at 13:30:00 [JWasm]',0 3 3 ENDIF 4 4 IFDEF TASM 5 BUILD_DATE db 'Build Date: 2 1 Feb 2012 at 11:30:00 [Tasm]',05 BUILD_DATE db 'Build Date: 24 Feb 2012 at 13:30:00 [Tasm]',0 6 6 ENDIF -
trunk/BOOTCODE/Makefile
r43 r45 155 155 # -Cp = case sensitive symbols 156 156 # -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) 158 ASM_FLAGS_D0=-DDEBUG_LEVEL=$(DEBUG_LEVEL) -DJWASM -q -Cp -zcw -Fo$^. -Sa -Fl=$^&.LST -Fw$^&.ERR 158 159 ASM_FLAGS_D1=-DDEBUG_LEVEL=$(DEBUG_LEVEL) -DJWASM -q -zcw -Zd -Zi -Fo$^. -Sa -Fl=$^&.LST -Fw$^&.ERR 159 160 ASM_FLAGS_D2=-DDEBUG_LEVEL=$(DEBUG_LEVEL) -DJWASM -q -zcw -Zd -Zi -Fo$^. -Sa -Fl=$^&.LST -Fw$^&.ERR … … 168 169 !elseif "$(ASM)"=="tasm" 169 170 # -ml = case sensitive symbols 170 ASM_FLAGS_D0=-dDEBUG_LEVEL=$(DEBUG_LEVEL) -dTASM -t -m 2-l171 ASM_FLAGS_D0=-dDEBUG_LEVEL=$(DEBUG_LEVEL) -dTASM -t -ml -m9 -l 171 172 ASM_FLAGS_D1=-dDEBUG_LEVEL=$(DEBUG_LEVEL) -dTASM -t -m9 -z -zi -c -la 172 173 ASM_FLAGS_D2=-dDEBUG_LEVEL=$(DEBUG_LEVEL) -dTASM -t -m9 -z -zi -c -la … … 373 374 # 16-bits RAW :: Final image that can be executed when activated by the BIOS. 374 375 ############################################################################### 375 $(TARGET): .MULTIPLE $(BASENAME).COM376 $(TARGET): .MULTIPLE Makefile.bu $(BASENAME).COM 376 377 # $(LNK) $(LNK_FLAGS) file $^&.OBJ name $^. sys dos com 377 378 !ifdef __OS2__ 378 379 ..$(DS)TOOLS$(DS)INTERNAL$(DS)FIXCODE.COM 380 !endif 381 !ifdef __LINUX__ 382 ..$(DS)TOOLS$(DS)INTERNAL$(DS)FIXCODE 379 383 !endif 380 384 # @echo FIXCODE … … 392 396 # 16-bits COM :: Intermediate image without embedded MBR-prot. and code count. 393 397 ############################################################################### 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. 394 402 $(BASENAME).COM: .MULTIPLE $(BASENAME).OBJ 395 403 $(LNK) $(LNK_FLAGS) file $^&.OBJ name $^. sys dos com … … 398 406 # @echo. 399 407 408 # 409 # Assembled Object File 410 # 400 411 $(BASENAME).OBJ: .MULTIPLE $(BASENAME).ASM 401 412 # @echo. -
trunk/BOOTCODE/REGULAR/AUXIO.ASM
r44 r45 84 84 AuxIO_Teletype_NoLogging: 85 85 ret 86 AuxIO_Tele Type EndP86 AuxIO_Teletype EndP 87 87 88 88 … … 92 92 call AuxIO_Teletype 93 93 ret 94 AuxIO_Tele TypeNL EndP94 AuxIO_TeletypeNL EndP 95 95 96 96 … … 107 107 call AuxIO_Teletype ; Output to com-port 108 108 ret 109 AuxIO_Tele TypeHexByte EndP109 AuxIO_TeletypeHexByte EndP 110 110 111 111 ; Print hex-word to com-port (teletype style) … … 120 120 call AuxIO_TeletypeHexByte ; Output to com-port 121 121 ret 122 AuxIO_Tele TypeHexWord EndP122 AuxIO_TeletypeHexWord EndP 123 123 124 124 … … 134 134 call AuxIO_TeletypeHexWord ; Low word next 135 135 ret 136 AuxIO_Tele TypeHexDWord EndP136 AuxIO_TeletypeHexDWord EndP 137 137 138 138 … … 150 150 call AuxIO_TeletypeHexDWord ; Low dword next 151 151 ret 152 AuxIO_Tele TypeHexQWord EndP152 AuxIO_TeletypeHexQWord EndP 153 153 154 154 -
trunk/BOOTCODE/REGULAR/BOOTMENU.ASM
r43 r45 72 72 mov Menu_AbsoluteX, dl 73 73 74 ; Display Top-Infos in Boot-Window74 ; Display Top-Infos (labels) in Boot-Window 75 75 76 76 CLR_TOP_INFOS_CLASSIC = 0b01h … … 190 190 mov cx, CLR_INFO_WINDOW_BM 191 191 ;mov cx, 0C06h ; brown, main background 192 call VideoIO_Color ; Ccolor info window192 call VideoIO_Color ; Color info window 193 193 194 194 mov bx, 1401h 195 195 mov dx, 1950h 196 call VideoIO_MakeWindow ; Information-Window196 call VideoIO_MakeWindow ; Information-Window 197 197 ; den kleinen Strich... 198 198 mov cx, 1602h … … 210 210 CLR_INFO_TEXT_BM = 0701h 211 211 212 mov cx, CLR_INFO_TEXT_BM 213 call VideoIO_Color 212 mov cx, CLR_INFO_TEXT_BM ; Info text 213 call VideoIO_Color ; Color info text 214 214 215 215 mov si, offset TXT_BootMenuHelpText1 … … 587 587 CLR_SELECTION_BAR_CLASSIC = 50h 588 588 CLR_SELECTION_BAR_BM = 090h 589 CLR_SELECTION_BAR_WARNING = 040h 589 590 590 591 591 592 592 593 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: 594 599 call BOOTMENU_ReColorPart 595 600 ret -
trunk/BOOTCODE/REGULAR/DEBUG.ASM
r44 r45 37 37 38 38 DEBUG_CheckMath Proc Near 39 pushf 40 pusha 41 42 ; Msg check math-module 43 mov si,offset db_checkmath 44 call AuxIO_Print 45 46 ; Output hex-word 47 mov ax,0BABEh 48 call AuxIO_TeletypeHexWord 49 50 mov al,' ' 51 call AuxIO_Teletype 52 mov al,'*' 53 call AuxIO_Teletype 54 mov al,' ' 55 call AuxIO_Teletype 56 57 ; Output hex-word 58 mov ax,0BABEh 59 call AuxIO_TeletypeHexWord 60 61 mov al,' ' 62 call AuxIO_Teletype 63 mov al,'=' 64 call AuxIO_Teletype 65 mov al,' ' 66 call AuxIO_Teletype 67 68 mov ax,0BABEh 69 mul ax 70 call AuxIO_TeletypeHexDWord 71 72 ; Start new line 73 call AuxIO_TeletypeNL 74 75 ; Output hex-dword 76 mov dx,0DEADh 77 mov ax,0FACEh 78 call AuxIO_TeletypeHexDWord 79 80 mov al,' ' 81 call AuxIO_Teletype 82 mov al,'*' 83 call AuxIO_Teletype 84 mov al,' ' 85 call AuxIO_Teletype 86 87 ; Output hex-dword 88 mov dx,0DEADh 89 mov ax,0FACEh 90 call AuxIO_TeletypeHexDWord 91 92 mov al,' ' 93 call AuxIO_Teletype 94 mov al,'=' 95 call AuxIO_Teletype 96 mov al,' ' 97 call AuxIO_Teletype 98 99 mov bx,0DEADh 100 mov cx,0FACEh 101 mov dx,0DEADh 102 mov ax,0FACEh 103 call MATH_Mul32 104 call AuxIO_TeletypeHexQWord 105 106 ; 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 ;~ 109 72 ;~ ; 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 114 111 115 112 ret … … 118 115 119 116 DEBUG_DumpGeo Proc 120 pushf121 pusha122 123 ; BIOS cyls124 mov dx,word ptr [BIOS_Cyls+02]125 mov ax,word ptr [BIOS_Cyls+00]126 call AuxIO_TeletypeHexDWord127 call AuxIO_TeletypeNL128 129 ; BIOS heads130 mov dx,word ptr [BIOS_Heads+02]131 mov ax,word ptr [BIOS_Heads+00]132 call AuxIO_TeletypeHexDWord133 call AuxIO_TeletypeNL134 135 ; BIOS secs136 mov dx,word ptr [BIOS_Secs+02]137 mov ax,word ptr [BIOS_Secs+00]138 call AuxIO_TeletypeHexDWord139 call AuxIO_TeletypeNL140 141 ; Bytes per sector142 mov ax,[BIOS_Bytes]143 call AuxIO_TeletypeHexWord144 call AuxIO_TeletypeNL145 146 ; Total secs147 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_TeletypeHexDWord152 call AuxIO_TeletypeNL153 154 ; CHS to LBA155 mov dx,1156 mov ax,29e5h157 mov bx,23h158 mov cx,9h159 call CONV_CHS2LBA160 call AuxIO_TeletypeHexDWord161 call AuxIO_TeletypeNL162 163 popa164 popf117 ;~ 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 165 162 166 163 ret … … 186 183 call AuxIO_TeletypeNL 187 184 185 ;~ call DEBUG_DumpHidePartTables 186 188 187 ;~ call DEBUG_CheckMath 189 188 190 189 ;~ call DEBUG_DumpGeo 191 190 192 call DEBUG_CheckBitFields191 ;~ call DEBUG_CheckBitFields 193 192 194 193 popa … … 199 198 200 199 DEBUG_DumpBSSSectors Proc Near 200 ;~ pushf 201 ;~ pusha 202 ;~ 203 ;~ mov si, offset [PartitionSector] 204 ;~ call AuxIO_DumpSector 205 ;~ call AuxIO_TeletypeNL 206 ;~ 207 ;~ mov si, offset [JfsPBR] 208 ;~ call AuxIO_DumpSector 209 ;~ call AuxIO_TeletypeNL 210 ;~ 211 ;~ mov si, offset [LVMSector] 212 ;~ call AuxIO_DumpSector 213 ;~ call AuxIO_TeletypeNL 214 ;~ 215 ;~ mov si, offset [TmpSector] 216 ;~ call AuxIO_DumpSector 217 ;~ call AuxIO_TeletypeNL 218 ;~ 219 ;~ mov si, offset [NewPartTable] 220 ;~ call AuxIO_DumpSector 221 ;~ call AuxIO_TeletypeNL 222 ;~ call AuxIO_TeletypeNL 223 ;~ 224 ;~ popa 225 ;~ popf 226 ret 227 DEBUG_DumpBSSSectors EndP 228 229 230 DEBUG_DumpHidePartTables Proc Near 201 231 pushf 202 232 pusha 203 233 204 mov si, offset [PartitionSector] 234 mov cx,3 235 mov si, offset [HidePartitionTable] 236 again1: 205 237 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: 209 254 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 223 257 call AuxIO_TeletypeNL 224 258 … … 226 260 popf 227 261 ret 228 DEBUG_Dump BSSSectors EndP262 DEBUG_DumpHidePartTables EndP 229 263 230 264 231 265 DEBUG_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 263 295 ret 264 296 DEBUG_CheckBitFields EndP -
trunk/BOOTCODE/REGULAR/PARTMAIN.ASM
r44 r45 972 972 ; First, find Hide-Config 973 973 mov dl, BootPartNo ; EntryNumber is straight view 974 mov ax, LocIPT_MaxPartitions 974 ;~ mov ax, LocIPT_MaxPartitions 975 mov ax, LocHPT_LenOfHPT 975 976 mul dl 976 977 mov di, offset HidePartitionTable 977 978 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 990 1004 ; --- HIDE COMPLETED --- 991 1005 ; So something got hidden and we have to remark a primary partition, … … 1646 1660 jne start_pbr 1647 1661 1648 ;xor ax,ax1649 ;mov [CurPartition_Location+00],ax1650 ;mov [CurPartition_Location+02],ax1651 ;mov [CurPartition_Location+04],ax1652 ;mov [CurPartition_Location+06],ax1653 1654 ;pusha1655 ;xor al,al1656 ;mov di,si1657 ;add di,LocIPT_Name1658 ;mov cx,121659 ;cld1660 ;rep stosb1661 ;popa1662 1663 1664 1662 ;push ds 1665 1663 ;pop es … … 1742 1740 1743 1741 PART_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 ; 1744 1755 1745 1756 -
trunk/BOOTCODE/REGULAR/PARTSCAN.ASM
r44 r45 48 48 mov CurIO_Scanning, 0 ; Reset flag due scanning complete 49 49 50 IFDEF AUX_DEBUG 51 pusha 52 call DEBUG_DumpHidePartTables 53 popa 54 ENDIF 50 55 ; Use X-Reference to sync NewPartitionTable with Hide-Config 51 56 call PARTSCAN_SyncHideConfigWithXref 57 58 IFDEF AUX_DEBUG 59 pusha 60 call DEBUG_DumpHidePartTables 61 popa 62 ENDIF 52 63 53 64 ; Now we copy the new IPT over the old one... … … 197 208 je PSSP_IgnorePartition 198 209 ; 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 200 216 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 202 230 PSSP_IgnorePartition: 203 231 ; Lscht das Boot-Able Flag... … … 687 715 jbe PCCTP_NotTooManyPartitions 688 716 717 ; Should not be reached since scanning is stopped outside this 718 ; function when partition limit exceeds. 689 719 mov si, offset TXT_TooManyPartitions 690 720 call MBR_Teletype … … 730 760 ; Reset X-Reference 731 761 PARTSCAN_ResetXref Proc Near Uses ax cx di 732 mov di, offset PartitionXref ; X-Reference for later syncing762 mov di, offset PartitionXref ; X-Reference for later syncing 733 763 mov cx, LocIPT_MaxPartitions 734 mov ax, 0FFFFh ; Fill up with FFh -- Influences OVERWRITE BUG !764 mov ax, 0FFFFh ; Fill up with FFh 735 765 rep stosb 736 mov di, offset NewHidePartTable ; Temporary Hide-Config Table766 mov di, offset NewHidePartTable ; Temporary Hide-Config Table 737 767 ;~ mov cx, LocIPT_MaxPartitions * LocIPT_LenOfIPT 738 mov cx, LocIPT_MaxPartitions * LocHPT_LenOfHPT ; Checken !!!739 rep stosb ; Fill up with FFFFh768 mov cx, LocIPT_MaxPartitions * LocHPT_LenOfHPT 769 rep stosb ; Fill up with FFFFh 740 770 mov di, offset NewDriveLetters 741 mov cx, LocIPT_MaxPartitions 771 mov cx, LocIPT_MaxPartitions ; Temporary Logical-Drive Letter Table 742 772 xor ax, ax 743 rep stosb ; Fill up with 0000h773 rep stosb ; Fill up with 0000h 744 774 ret 745 775 PARTSCAN_ResetXref EndP … … 759 789 mov si, offset HidePartitionTable 760 790 mov di, offset NewHidePartTable 761 mov bl, LocIPT_MaxPartitions 791 ;~ mov bl, LocIPT_MaxPartitions 792 mov bl, LocHPT_LenOfHPT 762 793 mov al, dl 763 794 mul bl … … 766 797 mul bl 767 798 add di, ax 768 mov cx, LocIPT_MaxPartitions 799 ;~ mov cx, LocIPT_MaxPartitions 800 mov cx, LocHPT_LenOfHPT 769 801 rep movsb ; Copy Hide-Config to NewHideTable 770 802 ; Process Logical-Drive-Letter table as well... … … 797 829 798 830 799 831 ; 832 ; Rousseau: Adjusted for packed hidden-part-table ! 833 ; Needs to be re-written. 834 ; 800 835 ; This here updates the contents of the Hide-Configuration to the current IPT 801 836 ; table. … … 803 838 mov si, offset NewHidePartTable 804 839 mov di, offset HidePartitionTable 805 mov ch, LocIPT_MaxPartitions 840 mov dh, LocIPT_MaxPartitions ; Max entries in hide-tables. 841 806 842 PSSHCWX_SyncPartLoop: 807 mov cl, LocIPT_MaxPartitions 843 mov cl, LocIPT_MaxPartitions ; Max entries per hide-entry. 808 844 xor dl, dl ; Partition Lost Counter 845 846 mov ch,0 ; Index. 847 809 848 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 812 861 je PSSHCWX_SyncEmpty 813 862 ;movzx bx, al … … 816 865 817 866 mov al, [PartitionXref+bx] ; Translate it 818 cmp al, 0FFh 867 ;~ cmp al, 0FFh 868 cmp al, 3Fh 819 869 je PSSHCWX_PartLost 870 820 871 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 822 882 dec cl 823 883 jnz PSSHCWX_SyncLoop 884 824 885 jmp PSSHCWX_SyncLoopEnd 886 825 887 PSSHCWX_PartLost: 826 888 inc dl ; One partition got lost... … … 829 891 830 892 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 831 904 or dl, dl 832 905 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 836 911 dec cl 837 912 jnz PSSHCWX_LostFillLoop 838 913 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 843 920 844 921 PSSHCWX_NothingLost: 845 dec ch 922 add si, LocHPT_LenOfHPT 923 add di, LocHPT_LenOfHPT 924 dec dh 846 925 jnz PSSHCWX_SyncPartLoop 926 847 927 ret 848 928 PARTSCAN_SyncHideConfigWithXref EndP -
trunk/BOOTCODE/REGULAR/STD_TEXT.ASM
r44 r45 41 41 ;Copyright db ' AiR-BOOT v1.0.8 - (c) 2012 M. Kiewitz <<Release Candidate>> (build: #18)', 0 42 42 ;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: 201202 14)', 044 Copyright db ' AiR-BOOT v1.0.8 - (c) 2012 M. Kiewitz <<Internal Release 2 g>> (bld: 20120221)', 043 ;Copyright db ' AiR-BOOT v1.0.8 - (c) 2012 M. Kiewitz <<Release Candidate 2>> (bld: 20120224)', 0 44 Copyright db ' AiR-BOOT v1.0.8 - (c) 2012 M. Kiewitz <<Internal Release 2l>> (bld: 20120224)', 0 45 45 ;Copyright db ' AiR-BOOT v1.0.8 - (c) 1998-2012 M. Kiewitz, Dedicated to Gerd Kiewitz', 0 46 46 47 47 ; 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', 048 TXT_SETUP_NoEditType35 db 'Labels of LVM-Data partitions cannot be changed.', 0 49 49 ; 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 50 TXT_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 51 53 52 54 ; Rousseau: switch around -
trunk/BOOTCODE/SETUP/PART_SET.ASM
r43 r45 637 637 jnc PSCPN_LVMGotError ; Not Found? -> display error and halt 638 638 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 646 642 647 643 648 644 xchg si, di ; SI-IPTEntry, DI-LVM PartName 649 645 jmp PSCPN_CheckPartName ; Check, if match... 646 647 650 648 651 649 PSCPN_LVMGotError: … … 691 689 ; Rousseau: Because AiR-BOOT v1.0.8 uses the LVM_VolumeName, which is copied 692 690 ; 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 MiniLVM696 ; 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 697 695 PSCPN_CheckPartName: 698 696 699 ; SI = IPT_Enty 697 ; Do no synchronization initially. 698 mov [SyncLvmLabels],0 699 700 ; SI = IPT_Enty, DI points to LVM VolumeName. 700 701 701 702 ; If the partition is an LVM partition then disable editing completely. … … 712 713 713 714 jmp PSCPN_AllDone 715 716 ; SI = IPT_Enty, DI points to LVM VolumeName. 714 717 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 715 736 716 737 mov cx, 11 ; Partition-Name-Length = 11 Bytes … … 725 746 mov ChangePartNameSave, 1 ; Remember, so we will save to BR 726 747 748 ; SI = IPT_Enty, DI points to LVM PartitionName. 727 749 PSCPN_LetUserEditPartName: 728 750 ; User will now edit the volume label... … … 746 768 747 769 ; 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 759 787 760 788 … … 768 796 ; Correct LVM VolumeName 769 797 ; 770 push di771 798 mov cx,20 772 799 vn_padd_next: … … 782 809 jmp vn_padd_next 783 810 vn_padded: 811 812 ; Points to LVM VolumeName 784 813 pop di 785 814 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: 825 828 826 829 ; Update LVM-CRC now... … … 917 920 ; Collect Hide-Partition-Config and put it into Hide-Table 918 921 mov dl, PartSetup_ActivePart 922 923 IFDEF AUX_DEBUG 924 pusha 925 mov al,dl ; Partition the hiding is set for. 926 call AuxIO_TeletypeHexByte 927 call AuxIO_TeletypeNL 928 popa 929 ENDIF 930 919 931 call PARTHIDESETUP_CollectHideConfigAndPutToTable 920 932 ; Simply return to Partition Setup … … 932 944 933 945 PHSM_KeyToogle: 946 947 IFDEF 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 953 ENDIF 954 934 955 call PART_GetPartitionPointer ; Holt den Pointer der Partition (DL) nach SI 935 956 mov al, [si+LocIPT_Flags] … … 1269 1290 ; ============================================================================= 1270 1291 1292 1293 ; 1294 ; Rousseau: Adjusted for packed hidden-part-table ! 1295 ; Needs to be re-written. 1296 ; 1271 1297 ; This is called by MBRS_PS_HiddenSetup 1272 1298 ; In: DL - Partition, where to save Hide-Config 1273 1299 ; 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 1300 PARTHIDESETUP_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 1303 1339 PARTHIDESETUP_GetHideConfigAndSpread EndP 1304 1340 1341 1342 ; 1343 ; Rousseau: Adjusted for packed hidden-part-table ! 1344 ; Needs to be re-written. 1345 ; 1305 1346 ; This is called by MBRS_PS_HiddenSetup 1306 1347 ; In: DL - Partition, where to save Hide-Config 1307 1348 ; 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 1349 PARTHIDESETUP_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. 1369 1493 PARTHIDESETUP_CollectHideConfigAndPutToTable EndP 1370 1494 -
trunk/BOOTCODE/SPECIAL/CHARSET.ASM
r29 r45 39 39 mov ds, bx ; DS==CS 40 40 mov si, offset CHARSET_Cyrillic 41 mov di, offset Char SetTempBuffer+204841 mov di, offset CharsetTempBuffer+2048 42 42 43 43 mov dl, 64 ; Decode 64 character bitmaps … … 57 57 jmp DecodeLoop 58 58 EndOfStream: 59 cmp di, offset Char SetTempBuffer+384059 cmp di, offset CharsetTempBuffer+3840 60 60 jae DecodeDone 61 61 add di, 768 ; Skip 3x16 char blocks … … 68 68 mov cx, 0FFh 69 69 xor dx, dx 70 mov bp, offset Char SetTempBuffer ; ES:BP - New charset70 mov bp, offset CharsetTempBuffer ; ES:BP - New charset 71 71 int 10h ; VIDEO BIOS: Set new charset table 72 72 mov ah, 12h -
trunk/INCLUDE/ASM.INC
r43 r45 30 30 EndM 31 31 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 36 40 37 41 38 42 ; 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 ; 46 45 ; NOTE: Overlapchecking in JWasm is not as reliable as in Tasm. 47 46 ; Because it's a single pass assembler, the current location can be … … 91 90 ; Terminate assembly by forcing an error. 92 91 .ERR 92 ENDM 93 93 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 ; 112 ORIGIN 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 ; 94 151 ENDM 152 95 153 96 154
Note:
See TracChangeset
for help on using the changeset viewer.