Changeset 45 for trunk/BOOTCODE/AIR-BOOT.ASM
- Timestamp:
- Apr 12, 2014, 12:36:45 AM (11 years ago)
- File:
-
- 1 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
Note:
See TracChangeset
for help on using the changeset viewer.