Changeset 36 for trunk/BOOTCODE/AIR-BOOT.ASM
- Timestamp:
- Jan 13, 2013, 9:29:14 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BOOTCODE/AIR-BOOT.ASM
r35 r36 17 17 ; 18 18 19 ; ------------------- 20 ; Rousseau: # Fixes # 21 ; ------------------- 19 20 21 ; --------------------------------- 22 ; Rousseau: Fixes and Enhancements 23 ; --------------------------------- 22 24 ; 23 25 ; v1.0.8 24 26 ; ------ 25 ; - Changed version format to be more WarpIN compatible. 26 ; This is a cosmetic change only. 27 ; - Fixed driveletter feature which was broken in v1.07. 28 ; - Reworked MBR-code to provide two I13X signatures. 29 ; - Fixed booting older eCS installations on HPFS 30 ; - Fixed booting Windows when installed in logical partition 31 ; with loader on FAT32. 32 ; - Corrected contact links. 33 ; - Location of AUX parameters has changed. 34 ; - Fixed DOS installer (AIRBOOT.COM) 27 ; # Changed version format to be more WarpIN compatible # 28 ; This is a cosmetic change only, the internal format has not changed. 29 ; 30 ; # Show LVM VolumeName instead of LVM PartitionName # 31 ; Previous versions of AiR-BOOT used the LVM PartitionName as the Label 32 ; if LVM-info was present for the partition. 33 ; This is inconsistent with MiniLVM which shows the LVM VolumeName. 34 ; Starting with v1.0.8 the LVM VolumeName is displayed. 35 ; 36 ; # LVM Partition and Volume name Synchronization # 37 ; Changing the Label of a partition with LVM-info now synchronizes 38 ; the LVM Partition Name with the LVM Volume Name. 39 ; This is the same behavior as MiniLVM. 40 ; Note however that the Label can only be changed when both the 41 ; LVM PartitionName and LVM VolumeName are the same. 42 ; See protected editing below. 43 ; 44 ; # Protected editing of the Label when LVM-info is present # 45 ; When the LVM VolumeName differs from the LVM PartitionName, the user can 46 ; edit the label but it will not be saved to the LVM record on disk. 47 ; This is to protect configurations created with the classic LVM tool. 48 ; Since MiniLVM assigns the same name to both the Partition and the Volume, 49 ; the Label can be edited and will be saved for such partitions. 50 ; To further protect a given configuration, LVM volumes with type 0x35 51 ; cannot be edited at all. This is to ensure that the LVM PartitionNames 52 ; remain unique when Spanning Volumes are used. 53 ; 54 ; # Editing the Label appended spaces # 55 ; When editing and changing the Label of a System using SETUP, 56 ; trailing spaces were stored in the LVM Volume and Partition names. 57 ; These labels need to be padded with zero's. 58 ; This has been fixed. 59 ; This bug is also present in v1.06. 60 ; 61 ; # Reworked Primary Partition <-> LVM-info association # 62 ; The previous way was to use a 1:1 correspondence between the PT-index 63 ; and the LVM-index. However, when the PT is cross-linked, lower entries 64 ; pointing to higher locations on the disk, or vice-versa, incorrect 65 ; LVM-info was associated. Such a cross-linked PT is sometimes generated 66 ; by the LVM engine when creating or deleting multiple partitions at once. 67 ; Best is to intermediately save after creating or deleting a partition 68 ; with (Mini)LVM. 69 ; The new way is to search the LVM-entries for the partition requested. 70 ; 71 ; # Reworked MBR-code to provide two I13X signatures # 72 ; The normal LVM MBR-code uses a special setup to indicate Int13X capability. 73 ; It contains the instruction, MOV EAX,'X31I', and some software checks 74 ; for the presence of the 'I13X' string in the MBR. 75 ; However, the location of this instruction differs between eCS 1.x and 76 ; eCS 2.x LVM MBR-code. 77 ; For compatibility, the v1.0.8 MBR has the 'I13X' string at both locations. 78 ; 79 ; # Fixed booting older eCS installations on HPFS # 80 ; When restoring systems from archive or otherwise generated systems, 81 ; the HPFS BPB sometimes lacked information that AiR-BOOT did not fill in. 82 ; The result was that a wrong partition was booted or that booting 83 ; stalled with the "unable to operate harddisk" message. 84 ; This has been fixed. 85 ; 86 ; # Fixed booting Windows from a logical partition with loader on FAT32 # 87 ; Depending on the configuration, sometimes the NTLDR could not be found. 88 ; This has been fixed. 89 ; 90 ; # Fixed drive-letter feature which was broken in v1.07 # 91 ; a) v1.07 did remember the drive-letter feature was active for a partition, 92 ; but it failed to store the drive-letter because too few configuration 93 ; sectors were saved. This resulted in arbitrary values to be assigned 94 ; to the drive-letter for the partition. 95 ; b) The JFS PBR-code does not use the in-memory BPB but uses the one 96 ; that is on disk. This prevented AiR-BOOT from passing the user assigned 97 ; drive-letter. AiR-BOOT now inserts the drive-letter in the BPB on disk, 98 ; but only if the partition is JFS. 99 ; AB v1.06 is also unable to use the drive-letter feature on JFS. 100 ; As a convenience, a drive-letter in the dl-feature pop-up can now be set 101 ; to "Disabled" by pressing backspace. 102 ; (As opposed to arrowing up/down to get to the "Disabled" entry) 103 ; 104 ; # Fixed stuck phase1 indicator when wrong name entered # 105 ; When using SET(A)BOOT /4:NAME with the MEMDRIVE env-var set, 106 ; and NAME being a non-existing partition, the phase1 indicator 107 ; would stay stuck between reboots. 108 ; This has been fixed. 109 ; 110 ; # Fixed DOS installer (AIRBOOT.COM) # 111 ; Behavior should now be the same as the eCS and WIN installers. 112 ; This re-enables the use of a bootable floppy or usb-stick 113 ; to install AiR-BOOT. 114 ; 115 ; # Fixed booting from FloppyDrive # 116 ; This is actually also broken in v1.06 when Int13X is forced on. 117 ; Now regular BIOS calls are used when booting from floppydrive. 118 ; A fresh AiR-BOOT installation now includes the floppydrive menu entry. 119 ; 120 ; # Fixed chainloading IBM Boot Manager # 121 ; AiR-BOOT v1.06 could chainload IBM-BM but only when it resided on 122 ; the first disk and was located below the 1024 cylinder and forced Int13X 123 ; extensions were disabled. 124 ; AiR-BOOT v1.0.8 can now chainload IBM-BM with forced Int13X extensions 125 ; enabled (the default) and if IBM-BM resides above the 1024 cylinder limit. 126 ; Also, chainloading IBM-BM from the second disk is supported. 127 ; Do not use chainloading IBM-BM unless you really have a need to. 128 ; See the AiR-BOOT Manual for "gotcha's" when using both AiR-BOOT and IBM-BM. 129 ; 130 ; # Corrected contact links # 131 ; Version 1.07 still presented the old contact links to the sourceforge 132 ; repository and the original author. 133 ; This caused confusion with regard to issues with v1.07. 134 ; This has been corrected. 35 135 ; 36 136 ; NOTE: 37 137 ; AB v1.07 had a bug with saving and loading the correct size of the 38 ; configuration. Th erefore the CRC over the config was also calculated39 ; wrongly.138 ; configuration. This broke the drive-letter feature. 139 ; As a result, the CRC over the config was also calculated wrongly. 40 140 ; While AB v1.0.8 fixes this, it has to use the v1.07 way of CRC calculation. 41 ; Otherwise SET(A)BOOT from the eCS v2.1 would break because it sees42 ; a corrupt AiR-BOOT configuration.141 ; Otherwise SET(A)BOOT from the eCS v2.1 would break on AB v1.0.8 because it 142 ; sees a corrupt AiR-BOOT configuration. 43 143 ; This means that the CRC over the AB config is calculated over 5 sectors 44 144 ; instead of 7, just like in v1.07. … … 53 153 ; ----- 54 154 ; # Huge Drives and LVM # 55 ; When using disks >512GB under eComStation, the drive geometry changes to56 ; 127 or 255 sectors per track. Since LVM-info is written at the last sector57 ; of a track, and AiR-BOOT uses the geometry of the MBR, it cannot find the58 ; LVM-info and the eCS partition / volume bootsector.59 ; This has been fixed.60 ; Now, when an eCS-partition is discovered and the drive is >512GB, AiR-BOOT61 ; will use the eCS geometry to locate the LVM-info and the bootsector.155 ; When using disks >512GB under eComStation, the drive geometry changes to 156 ; 127 or 255 sectors per track. Since LVM-info is written at the last sector 157 ; of a track, and AiR-BOOT uses the geometry of the MBR, it cannot find the 158 ; LVM-info and the eCS partition / volume bootsector. 159 ; This has been fixed. 160 ; Now, when an eCS-partition is discovered and the drive is >512GB, AiR-BOOT 161 ; will use the eCS geometry to locate the LVM-info and the bootsector. 62 162 ; 63 163 ; # Special loader handling # 64 ; The special handling of partition boot-loaders has been enhanced to65 ; enable booting of legacy sysems on huge drives with or without OS/266 ; extended geometry.164 ; The special handling of partition boot-loaders has been enhanced to 165 ; enable booting of legacy systems on huge drives with or without OS/2 166 ; extended geometry. 67 167 ; 68 168 ; # eComStation boot-through after phase 1 # 69 ; A special functionality is implemented to directly boot the newly 70 ; installed system ; when installing eCS without showing the Boot Menu, 71 ; independant of user settings. 72 ; This works in conjuntion with the OS/2 specific SETABOOT.EXE program, 73 ; also part of this AiR-BOOT package. 169 ; Special functionality is implemented to directly boot a newly 170 ; installed eCS system after completing phase 1 of the installation. 171 ; This works in conjuntion with the OS/2 specific SET(A)BOOT.EXE program, 172 ; also part of the AiR-BOOT package. 74 173 ; 75 174 ; # Math, Debug, Conv and Aux modules # 76 ; These are used for 32-bit arithmatic on 16-bit code,77 ; debug the booting process, converting between data-types78 ; and outputting log-data to the com-port.175 ; These are used for 32-bit arithmatic on 16-bit code, 176 ; debug the booting process, converting between data-types 177 ; and outputting log-data to the com-port. 79 178 ; 80 179 ; … … 84 183 ; It serves as the base for the versions above. 85 184 ; Please do not post your feedback on sourceforge or bother Martin with 86 ; regard to the above versions.87 ; Use the eCS bug-tracker or the Trac project-page at netlabs .88 ; See the documentation for the correct contact information.185 ; regard to issues with the above versions. 186 ; Use the eCS bug-tracker or the Trac project-page at netlabs and see the 187 ; documentation of this newer versions for the relevant contact information. 89 188 90 189 … … 95 194 96 195 97 ; ------------------------- ---98 ; Rousseau: # JUMPS disabled #99 ; ------------------------- ---196 ; ------------------------- 197 ; Rousseau: JUMPS disabled 198 ; ------------------------- 100 199 ; We actually don't want to use this directive because it generates extra 101 200 ; NOP instructions that we can do without. … … 204 303 205 304 ; Special line-drawing characters 206 TextChar_WinLineRight equ 0C4h ; 'Ä' 207 TextChar_WinLineDown equ 0B3h ; '³' 208 TextChar_WinRep1 equ 0D1h ; 'Ñ' 209 TextChar_WinRep2 equ 0C5h ; 'Å' 210 TextChar_WinRep3 equ 0CFh ; 'Ï' 211 TextChar_WinRep4 equ 0B5h ; 'µ' 212 TextChar_WinRep5 equ 0C6h ; 'Æ' 213 TextChar_WinRep6 equ 0D8h ; 'Ø' 305 TextChar_WinLineRight equ 0C4h ; 'Ã' 306 TextChar_WinLineDown equ 0B3h ; '³' 307 TextChar_WinRep1 equ 0D1h ; 'Ã' 308 TextChar_WinRep2 equ 0C5h ; 'à 309 ' 310 TextChar_WinRep3 equ 0CFh ; 'Ã' 311 TextChar_WinRep4 equ 0B5h ; 'µ' 312 TextChar_WinRep5 equ 0C6h ; 'Ã' 313 TextChar_WinRep6 equ 0D8h ; 'Ã' 214 314 215 315 ; Offsets for Partition-Entries in MBR/EPRs … … 387 487 db 0EBh ; JMP-Short -> MBR_Start 388 488 ; Uses the 'A' as the displacement ! 389 db 'AiRBOOT', 2 0h, 01h, 20h, 12h, 01h, 08h, TXT_LanguageID489 db 'AiRBOOT', 24h, 01h, 20h, 12h, 01h, 08h, TXT_LanguageID 390 490 391 491 ; ID String, Date (DD,MM,CC,YY), Version Number, Language ID … … 604 704 ; [v1.05+] 605 705 ; Signature for IBM's LVM to detect our "powerful" features ;) 606 ; [v1.0 8+]706 ; [v1.0.8+] 607 707 ; Reworked MBR code to be able to create a double 'I13X' signature. 608 708 ; MBR's created with LVM eCS v1.x have the signature at 0d5h … … 678 778 679 779 ; Disk Signature 780 ; Note that in an LVM 2.x MBR this collides 781 ; with the dummy PTE that it used to look for IBM-BM 782 ; on the second harddisk. 680 783 db 'DSIG' 681 784 682 ; Unused word 785 ; Unused word at 01BCh 786 ; An LVM 2.x MBR puts 'CC33' here. 683 787 dw '$$' 684 788 … … 727 831 ; 01h -> Boot-Able 728 832 ; 10h -> FAT32 - Name Getting Scheme 729 ; 20h -> No Name To Get (use Partition Name )833 ; 20h -> No Name To Get (use Partition Name from IPT) 730 834 ; 40h -> 'L' flag possible 731 835 db 'AiRSYS-TABLE' … … 753 857 db ' ', ' ', ' ', ' ' 754 858 db ' ', 'Kernel ', ' ', '0V-Award' 755 db 'OS/2 Man', 'via BIOS', 'Floppy ', 'Unknown ' 859 ; db 'OS/2 Man', 'via BIOS', 'Floppy ', 'Unknown ' 860 db 'OS2-BMGR', 'via BIOS', 'Floppy ', 'Unknown ' 756 861 ; -> 44 Partition-Types 757 862 … … 797 902 798 903 799 AiR_BOOT_Start: nop 904 AiR_BOOT_Start: 905 906 907 908 ; 909 ; Since v1.0.8, AiR-BOOT is able to chainload IBM-BM. 910 ; When IBM-BM resides above the 1024-cylinder limit, the 'I13X' 911 ; signature is required at 3000:0000, FS needs to contain 3000h 912 ; and the 32-bit LBA address needs to follow the 'I13X' signature. 913 ; For booting IBM-BM from the second disk, a copy of the MBR of the 914 ; first disk is also required at 0000:7E00. 915 ; This information is derived from the eCS 2.x LVM MBR. 916 ; 917 ; So, now is a good time to copy the MBR of the first disk to 918 ; 0000:7E00 in case the partition that will be started is IBM-BM. 919 ; This copy is located at 8000:0000 and DS already points to this 920 ; segment. 921 ; 922 pusha 923 push es 924 xor ax,ax 925 mov es,ax 926 mov si,offset BootBasePtr 927 mov di,7e00h 928 mov cx,100h 929 cld 930 rep movsw 931 pop es 932 popa 933 934 800 935 801 936 ;jmp skip … … 840 975 841 976 ; 842 ; Enumberate Bootable Systemen by name 843 ; And prepare Phase 1 if active 977 ; Enumberate Bootable Systems by name 978 ; and prepare Phase 1 if active. 979 ; 980 ; This can also be implemented using the 981 ; Installable LVM-flag I think. 982 ; But at the time I had lesser knowledge about LVM... 844 983 ; 845 984 mov si, offset PartitionTable … … 855 994 jnc MBR_Parts_NI 856 995 857 ; install volume996 ; Install Volume 858 997 mov al,' ' 859 998 mov bl,7 … … 879 1018 shr ah, 6 ; move ZF to LSB 880 1019 mov [CFG_AutomaticBoot], ah ; automatic boot if phase 1 is active 881 mov [eCS_InstallVolume], 0 ; disable phase 1 for next boot 1020 882 1021 883 1022 add al,'1' … … 907 1046 ;call MBR_Teletype 908 1047 909 mov al, [CFG_PartAutomatic]910 add al, 31h911 mov ah, 09h912 mov bx, 15913 mov cx, 11048 ;mov al, [CFG_PartAutomatic] 1049 ;add al, 31h 1050 ;mov ah, 09h 1051 ;mov bx, 15 1052 ;mov cx, 1 914 1053 ;int 10h 915 1054 916 mov al, [CFG_PartAutomatic]917 add al, 31h918 mov ah, 0eh919 mov bx, 15920 mov cx, 11055 ;mov al, [CFG_PartAutomatic] 1056 ;add al, 31h 1057 ;mov ah, 0eh 1058 ;mov bx, 15 1059 ;mov cx, 1 921 1060 ;int 10h 922 1061 … … 926 1065 call MBR_TeletypeNL 927 1066 928 mov ax,[BIOS_AuxParms]1067 ;mov ax,[BIOS_AuxParms] 929 1068 ;call VideoIO_SyncPos 930 push ax931 add al,'0'932 mov bl,7933 mov ah, 0eh1069 ;push ax 1070 ;add al,'0' 1071 ;mov bl,7 1072 ;mov ah, 0eh 934 1073 ;int 10h 935 pop ax936 xchg al,ah937 sub al,0a2h938 mov bl,7939 mov ah, 0eh1074 ;pop ax 1075 ;xchg al,ah 1076 ;sub al,0a2h 1077 ;mov bl,7 1078 ;mov ah, 0eh 940 1079 ;int 10h 941 1080 … … 990 1129 ; Moved here to fix that Esc out of SETUP would also save. 991 1130 ; So moved above the MBR_Main_ReEnterSetup label. 1131 mov [eCS_InstallVolume], 0 ; disable phase 1 for next boot 992 1132 call DriveIO_SaveConfiguration 993 1133 … … 1170 1310 size_math = $-b_math 1171 1311 1172 b_conv: 1173 Include REGULAR\CONV.ASM ; Various conversion routines 1174 size_conv = $-b_conv 1312 1175 1313 1176 1314 IFDEF AuxDebug … … 1260 1398 size_charset = $-b_charset 1261 1399 1262 1263 ; 1264 ; Here is room for more code. 1265 ; Let's move the special modules here... 1266 ; The come from the previous section. 1267 ; 1400 b_conv: 1401 Include REGULAR\CONV.ASM ; Various conversion routines 1402 size_conv = $-b_conv 1403 1268 1404 b_virus: 1269 1405 Include SPECiAL\ViRUS.asm ; Virus Detection / Anti-Virus … … 1288 1424 size_fx = $-b_fx 1289 1425 1290 ;b_lvm:1291 ;Include SPECiAL\LVM.asm ; LVM-specific code1292 ;size_lvm = $-b_lvm1293 1294 1295 1296 1297 1426 1298 1427 ; … … 1332 1461 1333 1462 1463 1334 1464 Configuration: ; THERE IS AN INVISIBLE CHAR HERE !! 1465 ; Your editor may not display the invisible 1466 ; character at the end if the 'AiRCFG-TABLE' 1467 ; string. When this character get's deleted, 1468 ; AiR-BOOT will not function because it cannot 1469 ; find the config-signature which includes this 1470 ; invisible character. The code is: 0x0ad. 1335 1471 db 'AiRCFG-TABLE' 1336 1472 db 01h, 07h, 'U' ; "Compressed" ID String … … 1354 1490 1355 1491 CFG_PartLast db 0 ; Which Partition was booted last time ? (Base=0) 1356 CFG_TimedBoot db 0; Timed Boot Enable (for REAL Enable look TimedBootEnable)1492 CFG_TimedBoot db 1 ; Timed Boot Enable (for REAL Enable look TimedBootEnable) 1357 1493 CFG_TimedSecs db 15 ; Timed Boot - How Many Seconds Till Boot 1358 1494 CFG_TimedDelay dw 123 ; Timed Boot - Delay … … 1360 1496 CFG_RememberBoot db 1 ; Remember Manual Boot Choice 1361 1497 CFG_RememberTimed db 0 ; Remember if Timed Boot (if both disabled: Boot Default) 1362 CFG_IncludeFloppy db 0; Include Floppy Drives in Boot-Menu1498 CFG_IncludeFloppy db 1 ; Include Floppy Drives in Boot-Menu 1363 1499 CFG_BootMenuActive db 1 ; Display Boot-Menu (if Disabled: Boot Default) 1364 1500 ; v0.29+ -> 2 - Detailed Bootmenu … … 1541 1677 ; --------------------> 34 Bytes (total maximum partition-entries = 30) 1542 1678 1543 db (partition_count * 34) dup (' P')1679 db (partition_count * 34) dup ('0') 1544 1680 1545 1681 eos56: … … 1584 1720 ; Drive-Letter : BYTE (80h-C:, 81h-D:) 1585 1721 ; --------------------> 1 Byte * 30 1722 1723 ; 1724 ; There is some room here, but this is the configuration section. 1725 ; So not available for code. 1726 ; 1727 1586 1728 eos58: 1587 1729 eoipt: … … 1621 1763 AirBootRocks db 'AiR-BOOT Rocks!',0 1622 1764 1765 db 512-($-sohid)-2 dup(0) 1766 1623 1767 eos60: 1624 1768 eohid: 1625 1769 1626 1770 ; Check for overlap 1627 slack12 = eoab - eohid 1771 slack12 = eoab - eohid -2 1628 1772 IF slack12 LT 0 1629 1773 .ERR2 "Location Overlap slack12 !" … … 1651 1795 BeginOfVariables: 1652 1796 PartitionSector db 512 dup (?) ; Temporary Sector for Partition 1797 JfsPBR db 512 dup (?) ; Temporary Sector for JFS PBR writeback 1653 1798 LVMSector: db 512 dup (?) ; Temporary Sector for LVM 1654 1799 TmpSector: db 512 dup (?) ; Temporary Sector … … 1678 1823 ExtendedAbsPosSet db ? ; If Absolute Position set 1679 1824 1680 CurPartition_Location dw 4 dup (?) ; Where did current partition c ame from?1825 CurPartition_Location dw 4 dup (?) ; Where did current partition come from? 1681 1826 CurIO_UseExtension db ? ; 1-Use INT 13h EXTENSIONS 1682 1827 ; (filled out by PreCrap)
Note:
See TracChangeset
for help on using the changeset viewer.