[40] | 1 | ;
|
---|
[29] | 2 | ; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
|
---|
| 3 | ;
|
---|
| 4 | ; This file is part of AiR-BOOT
|
---|
| 5 | ;
|
---|
| 6 | ; AiR-BOOT is free software: you can redistribute it and/or modify it under
|
---|
| 7 | ; the terms of the GNU General Public License as published by the Free
|
---|
| 8 | ; Software Foundation, either version 3 of the License, or (at your option)
|
---|
| 9 | ; any later version.
|
---|
| 10 | ;
|
---|
| 11 | ; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
|
---|
| 12 | ; WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
|
---|
| 13 | ; FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
---|
| 14 | ; details.
|
---|
| 15 | ;
|
---|
| 16 | ; You should have received a copy of the GNU General Public License along with
|
---|
| 17 | ; AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
|
---|
| 18 | ;
|
---|
[7] | 19 |
|
---|
[36] | 20 |
|
---|
[51] | 21 |
|
---|
| 22 |
|
---|
| 23 |
|
---|
| 24 |
|
---|
| 25 |
|
---|
| 26 | ;##############################################################################
|
---|
[46] | 27 | ; AiR-BOOT / DEFINITIONS
|
---|
[51] | 28 | ;##############################################################################
|
---|
[7] | 29 |
|
---|
[46] | 30 | ;
|
---|
[186] | 31 | ; This one should never be undefined, but if so, then default to English.
|
---|
| 32 | ;
|
---|
| 33 | IFNDEF BLD_LANG
|
---|
| 34 | BLD_LANG EQU en
|
---|
| 35 | ENDIF
|
---|
| 36 |
|
---|
| 37 | ;
|
---|
[46] | 38 | ; Include AiR-BOOT Version Information.
|
---|
[51] | 39 | ; This version-info is defined using simpel EQU's so it can serve as a
|
---|
| 40 | ; single source for other formats. The AiR-BOOT signature and the
|
---|
| 41 | ; OS/2 BLDLEVEL use this basic version information.
|
---|
[46] | 42 | ;
|
---|
[70] | 43 | include ../include/version.inc
|
---|
[30] | 44 |
|
---|
[46] | 45 | ;
|
---|
| 46 | ; Include OS/2 BLDLEVEL Information.
|
---|
[51] | 47 | ; It uses the version-information in VERSION.INC to build it's signature.
|
---|
[46] | 48 | ;
|
---|
[60] | 49 | include bldlevel.inc
|
---|
[46] | 50 |
|
---|
[51] | 51 | ;
|
---|
| 52 | ; Include some macro's.
|
---|
| 53 | ; This file contains the ORIGIN macro that is used to detect overlaps.
|
---|
| 54 | ;
|
---|
[60] | 55 | include ../include/asm.inc
|
---|
[46] | 56 |
|
---|
[186] | 57 | ;
|
---|
| 58 | ; The BLD_LANG is passed as an unquoted string so it can be used with
|
---|
| 59 | ; the 'include' directive. But for other language conditional actions a quoted
|
---|
| 60 | ; version is needed. This macro creates BLD_LANG_TXT holding the language
|
---|
| 61 | ; in single quotes.
|
---|
| 62 | ;
|
---|
| 63 | enquote BLD_LANG,%BLD_LANG
|
---|
[51] | 64 |
|
---|
[30] | 65 | ; We actually don't want to use this directive because it generates extra
|
---|
| 66 | ; NOP instructions that we can do without.
|
---|
[31] | 67 | ; TASM also has a bug in that when the .ERR2 directive is used when
|
---|
| 68 | ; the .386 directive is in effect, the JUMPS directive is also active
|
---|
| 69 | ; and cannot be turned off.
|
---|
[30] | 70 | ; NOJUMPS seems to have no effect in this situation.
|
---|
| 71 | ; In this case 4 NOP instructions are generated after forward referencing jump
|
---|
| 72 | ; instructions, to allow for automatic recoding by TASM.
|
---|
| 73 | ; This seems to be a TASM bug. (v2,v3,v4, dunno v5)
|
---|
[43] | 74 | IFDEF TASM
|
---|
| 75 | ;~ JUMPS
|
---|
| 76 | ENDIF
|
---|
[30] | 77 |
|
---|
[51] | 78 |
|
---|
[30] | 79 | ;
|
---|
| 80 | ; If defined then each module is prefixed with it's name.
|
---|
[51] | 81 | ; This is used for debugging purposes but it also increases code space.
|
---|
[30] | 82 | ; It should be off in release code.
|
---|
| 83 | ;
|
---|
[51] | 84 | ;~ MODULE_NAMES EQU
|
---|
[30] | 85 |
|
---|
| 86 |
|
---|
| 87 |
|
---|
[51] | 88 | ; -----------------------------------------------------------------------------
|
---|
| 89 | ; DEBUG
|
---|
| 90 | ; -----------------------------------------------------------------------------
|
---|
[30] | 91 |
|
---|
[31] | 92 | ;
|
---|
[51] | 93 | ; Enable this to include Debug Modules and enable COM-port debugging.
|
---|
| 94 | ; To have room for the debug-code, the FX-code can only be enabled
|
---|
| 95 | ; when AUX_DEBUG is not defined.
|
---|
[45] | 96 | ;
|
---|
[173] | 97 | ;~ AUX_DEBUG EQU
|
---|
[45] | 98 |
|
---|
[185] | 99 |
|
---|
[51] | 100 | ;
|
---|
[185] | 101 | ; The FX (video animation) module is about to be completely removed from the
|
---|
| 102 | ; build to regain code space. This is especially true for non-EN builds,
|
---|
| 103 | ; which often have longer strings or even load special character sets.
|
---|
[51] | 104 | ;
|
---|
[185] | 105 | ; However, because the EN-build for REALEASE-v1.1.2 was already distributed
|
---|
| 106 | ; with ArcaOS v5, FX will only be excluded for non-EN builds. When FX is not
|
---|
| 107 | ; compiled-in and Cooper Bars is enabled in the SETUP, the TAB-key used for
|
---|
| 108 | ; switching between MENU and PRE-BOOT screens will not work.
|
---|
| 109 | ;
|
---|
| 110 | ; Upcoming releases will completely remove FX related code and SETUP options.
|
---|
| 111 | ;
|
---|
| 112 | ; As can be read in 'special/fx.asm' around line 26, this removal may have
|
---|
| 113 | ; severe consequences for me, so if no new AiR-BOOT releases appear, then you
|
---|
| 114 | ; know I have been './'-ted, which most probably will be something completely
|
---|
| 115 | ; different from being 'slash-dotted' ... ;)
|
---|
| 116 | ;
|
---|
[45] | 117 |
|
---|
[221] | 118 | ;~ IF BLD_LANG_TXT EQ 'en'
|
---|
| 119 | ;~ IFNDEF AUX_DEBUG
|
---|
| 120 | ;~ FX_ENABLED EQU
|
---|
| 121 | ;~ ENDIF
|
---|
| 122 | ;~ ELSE
|
---|
| 123 | ;~ echo
|
---|
| 124 | ;~ echo ***** NOTE: Excluding FX-module for this language ! *****
|
---|
| 125 | ;~ echo
|
---|
| 126 | ;~ ENDIF
|
---|
[45] | 127 |
|
---|
[221] | 128 | echo
|
---|
| 129 | echo *** NOTE: As of v1.1.4-RELEASE the FX-module is excluded to save space ***
|
---|
| 130 | echo
|
---|
| 131 |
|
---|
[51] | 132 | ; -----------------------------------------------------------------------------
|
---|
| 133 | ; AUX
|
---|
| 134 | ; -----------------------------------------------------------------------------
|
---|
[45] | 135 | ;
|
---|
[31] | 136 | ; bits 7-5 = datarate
|
---|
| 137 | ; (000=110,001=150,010=300,011=600,100=1200,101=2400,110=4800,111=9600 bps)
|
---|
| 138 | ; bits 4-3 = parity
|
---|
| 139 | ; (00 or 10 = none, 01 = odd, 11 = even)
|
---|
| 140 | ; bit 2 = stop-bits
|
---|
| 141 | ; (set = 2 stop-bits, clear = 1 stop-bit)
|
---|
| 142 | ; bits 1-0 = data-bits
|
---|
| 143 | ; (00 = 5, 01 = 6, 10 = 7, 11 = 8)
|
---|
| 144 | ;
|
---|
[30] | 145 |
|
---|
[31] | 146 | ; 9600 bps, no parity, 1 stop-bit, 8 bits per char
|
---|
[43] | 147 | AUX_INIT_PARMS EQU 11100011b
|
---|
[31] | 148 |
|
---|
[43] | 149 | ; Com-port for debugging, 0 is disabled
|
---|
| 150 | BIOS_COM_PORT EQU 1
|
---|
| 151 |
|
---|
[31] | 152 | ; Default word value for BIOS_AuxParms variable
|
---|
| 153 | ; Note that is has moved since v1.07
|
---|
[43] | 154 | BIOS_AUXPARMS_DEFAULT EQU (AUX_INIT_PARMS SHL 8) OR BIOS_COM_PORT
|
---|
[31] | 155 |
|
---|
[78] | 156 | ; Default byte value for BIOS_BootDisk variable
|
---|
[77] | 157 | BIOS_BOOTDISK_DEFAULT EQU 80h
|
---|
[43] | 158 |
|
---|
| 159 |
|
---|
| 160 |
|
---|
[51] | 161 | ; -----------------------------------------------------------------------------
|
---|
| 162 | ; LABELS
|
---|
| 163 | ; -----------------------------------------------------------------------------
|
---|
| 164 | ; Address labels after code-move
|
---|
[76] | 165 | BootBaseSeg equ 08000h ; Pre-boot, in the low 640K
|
---|
| 166 | BootBasePtr equ 0h ; We put our MBR to this location
|
---|
[51] | 167 | BootBaseExec equ BootBasePtr+offset MBR_RealStart
|
---|
[76] | 168 | StackSeg equ 07000h ; Put the stack below the code
|
---|
| 169 | StartBaseSeg equ 00000h ; Pre-boot, we are in low memory
|
---|
| 170 | StartBasePtr equ 07C00h ; BIOS starts our MBR at 0:7C00
|
---|
[7] | 171 |
|
---|
| 172 |
|
---|
[30] | 173 |
|
---|
[51] | 174 | ; -----------------------------------------------------------------------------
|
---|
| 175 | ; VIDEO
|
---|
| 176 | ; -----------------------------------------------------------------------------
|
---|
[30] | 177 | ; Video pages, no INT 10h is used for menu-drawing etc.
|
---|
[7] | 178 | VideoIO_Page0 equ 0B800h
|
---|
| 179 | VideoIO_Page1 equ 0B900h
|
---|
| 180 | VideoIO_Page2 equ 0BA00h
|
---|
| 181 | VideoIO_Page4 equ 0BC00h
|
---|
| 182 | VideoIO_FXSegment equ 0A000h
|
---|
| 183 |
|
---|
[30] | 184 | ; Special line-drawing characters
|
---|
[69] | 185 | TextChar_WinLineRight equ 0C4h
|
---|
| 186 | TextChar_WinLineDown equ 0B3h
|
---|
| 187 | TextChar_WinRep1 equ 0D1h
|
---|
| 188 | TextChar_WinRep2 equ 0C5h
|
---|
| 189 | TextChar_WinRep3 equ 0CFh
|
---|
[234] | 190 |
|
---|
| 191 | ; Remap the box-char for Spanish
|
---|
| 192 | IF BLD_LANG_TXT EQ 'es'
|
---|
| 193 | TextChar_WinRep4 equ 0D9h ; Remapped box-char for ES
|
---|
| 194 | ELSE
|
---|
| 195 | TextChar_WinRep4 equ 0B5h ; Normal box-char
|
---|
| 196 | ENDIF
|
---|
| 197 |
|
---|
[69] | 198 | TextChar_WinRep5 equ 0C6h
|
---|
| 199 | TextChar_WinRep6 equ 0D8h
|
---|
[7] | 200 |
|
---|
[51] | 201 |
|
---|
[128] | 202 | ; -----------------------------------------------------------------------------
|
---|
| 203 | ; DISK INFORMATION
|
---|
| 204 | ; -----------------------------------------------------------------------------
|
---|
| 205 | ; Offsets into the DISKINFO structures located in the array [DiskInformation]
|
---|
[51] | 206 |
|
---|
[128] | 207 | ; BIOS disk number and MBR flags
|
---|
| 208 | LocDISKINFO_DiskNum equ 00h ; BYTE - BIOS disk number (80h etc)
|
---|
| 209 | LocDISKINFO_MbrFlags equ 01h ; BYTE - Valid MBR, etc
|
---|
| 210 |
|
---|
| 211 | ; BIOS INT13 Info
|
---|
| 212 | LocDISKINFO_I13_Secs equ 02h ; WORD - Max 63
|
---|
| 213 | LocDISKINFO_I13_Heads equ 04h ; WORD - Max 16 or 255
|
---|
| 214 | LocDISKINFO_I13_Cyls equ 06h ; WORD - Max 1024
|
---|
| 215 |
|
---|
| 216 | ; BIOS INT13X Info
|
---|
| 217 | LocDISKINFO_I13X_Flags equ 08h ; WORD - CHS valid, etc
|
---|
| 218 | LocDISKINFO_I13X_SecSize equ 0ah ; WORD - Normally 512 bytes
|
---|
| 219 | LocDISKINFO_I13X_Secs equ 0ch ; DWORD - Max 63 ?
|
---|
| 220 | LocDISKINFO_I13X_Heads equ 10h ; DWORD - Max 255 ?
|
---|
| 221 | LocDISKINFO_I13X_Cyls equ 14h ; DWORD - Max 2_32 (4294967296)
|
---|
| 222 | LocDISKINFO_I13X_SecsLBA equ 18h ; QWORD - Max 2^64 (4294967296^2)
|
---|
| 223 | LocDISKINFO_I13X_HostBus equ 20h ; 4 bytes
|
---|
| 224 | LocDISKINFO_I13X_Interface equ 24h ; 8 bytes
|
---|
| 225 |
|
---|
| 226 | ; OS/2 LVM Info
|
---|
| 227 | LocDISKINFO_LVM_Flags equ 2ch ; WORD - OS/2 ext geo, etc
|
---|
| 228 | LocDISKINFO_LVM_MasterLBA equ 2eh ; DWORD - Max 254
|
---|
| 229 | LocDISKINFO_LVM_Secs equ 32h ; DWORD - Max 255
|
---|
| 230 | LocDISKINFO_LVM_Heads equ 36h ; DWORD - Max 255
|
---|
| 231 | LocDISKINFO_LVM_Cyls equ 3ah ; DWORD - Max 65536
|
---|
| 232 |
|
---|
| 233 | ; Custom Info
|
---|
| 234 | LocDISKINFO_Flags equ 3eh ; WORD - Custom flags, dunno yet
|
---|
| 235 |
|
---|
| 236 | ; Size of this structure
|
---|
| 237 | DISKINFO_Size equ 40h ; Size to be allocated
|
---|
| 238 |
|
---|
| 239 |
|
---|
[51] | 240 | ; -----------------------------------------------------------------------------
|
---|
| 241 | ; PARTITION TABLE
|
---|
| 242 | ; -----------------------------------------------------------------------------
|
---|
| 243 | ; Offsets for Partition-Entries in MBR/EBRs
|
---|
[37] | 244 | LocBRPT_LenOfEntry equ 16 ; Length of a standard MBR or EPR entry
|
---|
| 245 | LocBRPT_Flags equ 0 ; Bootable, Hidden, etc.
|
---|
[51] | 246 | LocBRPT_BeginCHS equ 1 ; Packed CHS value
|
---|
| 247 | LocBRPT_BeginHead equ 1 ; Start head, usually < 16
|
---|
| 248 | LocBRPT_BeginSector equ 2 ; Start sector, max 63 + cyl high bits
|
---|
| 249 | LocBRPT_BeginCylinder equ 3 ; Start cylinder 8+2 bits, max 1023
|
---|
[37] | 250 | LocBRPT_SystemID equ 4 ; Type of system using the partition
|
---|
[51] | 251 | LocBRPT_EndCHS equ 5 ; Packed CHS value
|
---|
| 252 | LocBRPT_EndHead equ 5 ; End head, usually < 16
|
---|
| 253 | LocBRPT_EndSector equ 6 ; End sector, max 63 + cyl high bits
|
---|
| 254 | LocBRPT_EndCylinder equ 7 ; End cylinder 8+2 bits, max 1023
|
---|
| 255 | LocBRPT_RelativeBegin equ 8 ; LBA32 address of partition
|
---|
| 256 | LocBRPT_AbsoluteLength equ 12 ; 32-bit length of partition
|
---|
[7] | 257 |
|
---|
[51] | 258 | ; Signature relative to start of MBR/EBR
|
---|
| 259 | LocBR_Magic equ 510 ; Offset of 0AA55h signature
|
---|
[7] | 260 |
|
---|
[128] | 261 |
|
---|
[51] | 262 | ; -----------------------------------------------------------------------------
|
---|
| 263 | ; LVM RECORD
|
---|
| 264 | ; -----------------------------------------------------------------------------
|
---|
[34] | 265 | ; Used as a quick compare in LVM.ASM
|
---|
[37] | 266 | LocLVM_SignatureByte0 equ 02h
|
---|
[30] | 267 |
|
---|
[34] | 268 | ; Offsets for LVM Information Sector.
|
---|
| 269 | ; These are relative to the start of the LVM sector.
|
---|
[37] | 270 | LocLVM_SignatureStart equ 00h ; 02h,'RMBPMFD' (8 bytes)
|
---|
| 271 | LocLVM_CRC equ 08h ; CRC is a DWORD
|
---|
| 272 | LocLVM_Heads equ 1ch ; Number of heads
|
---|
| 273 | LocLVM_Secs equ 20h ; Sectors per Track
|
---|
| 274 | LocLVM_DiskName equ 24h ; Name of the disk
|
---|
| 275 | LocLVM_StartOfEntries equ 3ch ; (contains maximum of 4 entries)
|
---|
| 276 | LocLVM_LenOfEntry equ 3ch ; Length of an LVM-entry
|
---|
[30] | 277 |
|
---|
[34] | 278 | ; An LVM info-sector can contain information on max. 4 partitions.
|
---|
| 279 | ; All 4 entries will be used when there 4 primary partitions defined.
|
---|
| 280 | ; For logical partitions, the LVM info-sector is located below the start
|
---|
| 281 | ; of the logical partition and only one LVM entry is used in that logical
|
---|
| 282 | ; LVM info-sector.
|
---|
[37] | 283 | LocLVM_MaxEntries equ 4 ; Max entries in an LVM-sector
|
---|
[30] | 284 |
|
---|
[51] | 285 |
|
---|
| 286 | ; -----------------------------------------------------------------------------
|
---|
| 287 | ; LVM ENTRY
|
---|
| 288 | ; -----------------------------------------------------------------------------
|
---|
[34] | 289 | ; Offsets for LVM entry.
|
---|
| 290 | ; These are relative to the start of the entry.
|
---|
[51] | 291 | LocLVM_VolumeID equ 00h ; DWORD
|
---|
| 292 | LocLVM_PartitionID equ 04h ; DWORD
|
---|
| 293 | LocLVM_PartitionSize equ 08h ; DWORD
|
---|
| 294 | LocLVM_PartitionStart equ 0ch ; DWORD
|
---|
[37] | 295 | LocLVM_OnBootMenu equ 10h ; is on IBM BM Bootmenu
|
---|
| 296 | LocLVM_Startable equ 11h ; is Startable (newly installed system)
|
---|
[51] | 297 | LocLVM_VolumeLetter equ 12h ; Drive Letter for partition (C-Z or 0)
|
---|
| 298 | LocLVM_Unknown equ 13h ; unknown BYTE (can be used ?)
|
---|
| 299 | LocLVM_InstallLetter equ 13h ; unknown BYTE (can be used ?)
|
---|
[37] | 300 |
|
---|
[71] | 301 | ; Truncated to 11 chars when displayed in menu.
|
---|
[34] | 302 | ; MiniLVM sets both to the same value.
|
---|
| 303 | ; Also, MiniLVM uses a 0-byte terminator, so the maximum length is 19d.
|
---|
| 304 | ; Same goes for LocLVM_DiskName.
|
---|
[45] | 305 | ; These offsets are relative to an LVM entry.
|
---|
[37] | 306 | LocLVM_VolumeName equ 14h ; 20 bytes
|
---|
| 307 | LocLVM_PartitionName equ 28h ; 20 bytes (Used in menu)
|
---|
[30] | 308 |
|
---|
[45] | 309 | ; LVM constants.
|
---|
[51] | 310 | LocLVM_LabelLen equ 14h ; Length of LVM Label (Disk/Part/Vol)
|
---|
| 311 | LocLVM_DiskNameLen equ 14h ; Length of LVM DiskName
|
---|
| 312 | LocLVM_VolumeNameLen equ 14h ; Length of LVM VolumeName
|
---|
| 313 | LocLVM_PartitionNameLen equ 14h ; Length of LVM PartitionName
|
---|
[30] | 314 |
|
---|
[34] | 315 |
|
---|
[51] | 316 | ; -----------------------------------------------------------------------------
|
---|
| 317 | ; AiR-BOOT IPT
|
---|
| 318 | ; -----------------------------------------------------------------------------
|
---|
[7] | 319 | ; Offsets for IPT (Internal Partition Table)
|
---|
[51] | 320 | LocIPT_MaxPartitions equ max_partitions ; 45 in v1.07+
|
---|
[37] | 321 | LocIPT_LenOfSizeElement equ 6 ; Size of one Size-Element
|
---|
| 322 | LocIPT_LenOfIPT equ 34 ; Length of an IPT-entry
|
---|
| 323 | LocIPT_Serial equ 0 ; Serial from MBR ?
|
---|
| 324 | LocIPT_Name equ 4 ; Name from FS or LVM (part/vol)
|
---|
| 325 | LocIPT_Drive equ 15 ; Drive-ID (80h,81h)
|
---|
| 326 | LocIPT_SystemID equ 16 ; Partition-Type (06,07,etc)
|
---|
[51] | 327 | LocIPT_Flags equ 17 ; AiR-BOOT Flags for part (see below)
|
---|
[37] | 328 | LocIPT_BootRecordCRC equ 18 ; CRC of Boot-Record
|
---|
| 329 | LocIPT_LocationBegin equ 20 ; Begin of Partition
|
---|
| 330 | LocIPT_LocationPartTable equ 23 ; PartitionTable of Partition
|
---|
| 331 | LocIPT_AbsoluteBegin equ 26 ; Absolute Sector of Begin
|
---|
| 332 | LocIPT_AbsolutePartTable equ 30 ; Absolute Sector of PartTable
|
---|
[7] | 333 |
|
---|
[38] | 334 |
|
---|
[30] | 335 | ; AiR-BOOT IPT-Flags
|
---|
[37] | 336 | LocIPT_DefaultFlags equ 00000011b ; Don't know if boot-able :)
|
---|
[51] | 337 | LocIPT_DefaultNonBootFlags equ 00000010b ; VIBR Detection is always on
|
---|
[7] | 338 |
|
---|
[37] | 339 | Flags_Bootable equ 00000001b
|
---|
| 340 | Flags_VIBR_Detection equ 00000010b
|
---|
| 341 | Flags_HideFeature equ 00000100b
|
---|
| 342 | Flags_DriveLetter equ 00001000b ; OS/2 FAT16/HPFS only
|
---|
[46] | 343 | Flags_ExtPartMShack equ 00010000b ; Ext. Partition M$-Hack req ?
|
---|
[37] | 344 | Flags_NoPartName equ 01000000b
|
---|
| 345 | Flags_NowFound equ 10000000b ; temp only in OldPartTable
|
---|
| 346 | Flags_SpecialMarker equ 10000000b ; temp only for HiddenSetup
|
---|
[7] | 347 |
|
---|
[37] | 348 | FileSysFlags_BootAble equ 00000001b ; Is this Partition boot-able ?
|
---|
| 349 | FileSysFlags_FAT32 equ 00010000b ; FAT 32 specific name getting
|
---|
| 350 | FileSysFlags_NoName equ 00100000b ; No Name - use PartitionName
|
---|
| 351 | FileSysFlags_DriveLetter equ 01000000b ; DriveLetter Feature possible
|
---|
[7] | 352 |
|
---|
[51] | 353 |
|
---|
| 354 | ; -----------------------------------------------------------------------------
|
---|
| 355 | ; AiR-BOOT HPT
|
---|
| 356 | ; -----------------------------------------------------------------------------
|
---|
| 357 | ; Hidden Partition Table
|
---|
| 358 | ; Length of an HPT-entry ((45 * 6 bits-per-part) / 8) * 45
|
---|
| 359 | ; 33.75 = 34 bytes for HPT-entry, coincidently same as length of IPT-entry.
|
---|
| 360 | ; Packed table !
|
---|
| 361 | LocHPT_LenOfHPT equ 34
|
---|
| 362 |
|
---|
| 363 |
|
---|
| 364 | ; -----------------------------------------------------------------------------
|
---|
| 365 | ; NAVIGATION KEYS
|
---|
| 366 | ; -----------------------------------------------------------------------------
|
---|
[30] | 367 | ; Navigation keys
|
---|
[37] | 368 | Keys_Up equ 48h
|
---|
| 369 | Keys_Down equ 50h
|
---|
| 370 | Keys_Left equ 4Bh
|
---|
| 371 | Keys_Right equ 4Dh
|
---|
| 372 | Keys_PageUp equ 49h
|
---|
| 373 | Keys_PageDown equ 51h
|
---|
| 374 | Keys_GrayPlus equ 4Eh
|
---|
| 375 | Keys_GrayMinus equ 4Ah
|
---|
| 376 | Keys_Plus equ 1Bh
|
---|
| 377 | Keys_Minus equ 35h
|
---|
| 378 | Keys_ENTER equ 1Ch
|
---|
| 379 | Keys_ESC equ 1h
|
---|
| 380 | Keys_F1 equ 3Bh
|
---|
| 381 | Keys_F10 equ 44h
|
---|
[51] | 382 | Keys_C equ 2Eh ; Add. Check for Ctrl!
|
---|
[37] | 383 | Keys_Y equ 2Ch
|
---|
| 384 | Keys_Z equ 15h
|
---|
| 385 | Keys_N equ 31h
|
---|
| 386 | Keys_TAB equ 0Fh
|
---|
| 387 | Keys_Delete equ 53h
|
---|
| 388 | Keys_Backspace equ 0Eh
|
---|
| 389 | Keys_Space equ 20h
|
---|
[7] | 390 |
|
---|
[37] | 391 | Keys_Flags_EnterSetup equ 1100b ; Strg+Alt (AL)
|
---|
[7] | 392 |
|
---|
| 393 |
|
---|
[51] | 394 | ; -----------------------------------------------------------------------------
|
---|
| 395 | ; MISC
|
---|
| 396 | ; -----------------------------------------------------------------------------
|
---|
| 397 | ; Initial value for the FreeDriveletterMap
|
---|
| 398 | ; Meaning A,B not free; C-Z free, rest unused. (right to left)
|
---|
| 399 | ; Each partition with an assigned drive-letter clears a bit in this map.
|
---|
| 400 | ; (Not implemented yet)
|
---|
| 401 | InitialFreeDriveletterMap equ 00000011111111111111111111111100b
|
---|
[46] | 402 |
|
---|
[51] | 403 | ;
|
---|
| 404 | ; The first harddisk is BIOS coded 80h.
|
---|
| 405 | ; This makes a total of 128 disks that could be supported using this coding.
|
---|
| 406 | ; This value is used to store disk-information and this info is allocated
|
---|
| 407 | ; in the BSS. 64 disks ought to be enough for everybody :-)
|
---|
| 408 | ;
|
---|
| 409 | MaxDisks equ 64
|
---|
[46] | 410 |
|
---|
| 411 |
|
---|
| 412 |
|
---|
[51] | 413 |
|
---|
| 414 |
|
---|
| 415 |
|
---|
| 416 | ;##############################################################################
|
---|
[46] | 417 | ; AiR-BOOT / MAIN-CODE
|
---|
[51] | 418 | ;##############################################################################
|
---|
[46] | 419 |
|
---|
[51] | 420 | ;
|
---|
[43] | 421 | ; Because of the TASM-bug the processor had to be changed to turn JUMPS
|
---|
| 422 | ; off. Existing movzx instructions were replaced with 286 equivalent code.
|
---|
| 423 | ; Out of range relative jumps have been recoded.
|
---|
[51] | 424 | ;
|
---|
| 425 | ; Since version 1.0.8, JWasm is the preferred assembler and Tasm will be
|
---|
| 426 | ; dropped. Also, the chances of AiR-BOOT being used on a 286-machine are
|
---|
| 427 | ; very slim, so a future version will revert back to .386 and also incorporate
|
---|
| 428 | ; 32-bit code. This will enable some enhanced constructs such as scaled
|
---|
| 429 | ; indexing, bit-instructions, 32-bit registers and what not.
|
---|
| 430 | ;
|
---|
[43] | 431 | .286
|
---|
[30] | 432 |
|
---|
[51] | 433 | ;
|
---|
| 434 | ; For Tasm, MODEL is needed for the USES directive to work.
|
---|
| 435 | ; So always use a model when assembling with Tasm otherwise registers on
|
---|
| 436 | ; function calls that use USES are not saved and restored.
|
---|
| 437 | ; The model itself, has no real effect because we generate a binary image
|
---|
| 438 | ; and not a segmented executable.
|
---|
| 439 | ; For the other assemblers we define no model to get rid of the default C/C++
|
---|
| 440 | ; segments for future object-linked versions of AiR-BOOT.
|
---|
| 441 | ;
|
---|
[43] | 442 | IFDEF TASM
|
---|
[46] | 443 | ;~ .model large, basic
|
---|
[43] | 444 | .model tiny,c
|
---|
| 445 | ENDIF
|
---|
[37] | 446 |
|
---|
| 447 | ;
|
---|
[51] | 448 | ; The below is used to switch between the original 1-segment (code_seg) layout
|
---|
| 449 | ; and the new 2-segment (code_seg and bss_data) layout.
|
---|
| 450 | ; It will be removed in future versions.
|
---|
[37] | 451 | ; The 2-segment layout was needed for JWasm because it does not treat
|
---|
[51] | 452 | ; db ? at the end of a code segment as bss-data.
|
---|
[37] | 453 | ; Therefore, a true BSS segment is now used.
|
---|
[51] | 454 | ; Both the code_seg and the bss_data are grouped to the logical AIRBOOT
|
---|
[37] | 455 | ; segment.
|
---|
| 456 | ; Note that this influences the offsets in the BSS in the list-file and
|
---|
| 457 | ; the wdis disassembly file (.WDA).
|
---|
| 458 | ; They are now segment-relative. The true offset is resolved at link
|
---|
| 459 | ; time.
|
---|
| 460 | ;
|
---|
[43] | 461 | SEGMENTED EQU
|
---|
[37] | 462 |
|
---|
[51] | 463 | IFDEF SEGMENTED
|
---|
| 464 | AIRBOOT GROUP LDRIMAGE,VOLATILE
|
---|
| 465 | ENDIF
|
---|
[37] | 466 |
|
---|
[51] | 467 | ; Our code-segment starts here.
|
---|
| 468 | LDRIMAGE SEGMENT USE16 PUBLIC 'CODE'
|
---|
[7] | 469 |
|
---|
[51] | 470 | IFDEF SEGMENTED
|
---|
| 471 | ASSUME CS:AIRBOOT, DS:AIRBOOT, ES:nothing, SS:nothing
|
---|
| 472 | ELSE
|
---|
| 473 | ASSUME CS:LDRIMAGE,DS:LDRIMAGE,ES:nothing, SS:nothing
|
---|
| 474 | ENDIF
|
---|
[30] | 475 |
|
---|
[51] | 476 |
|
---|
| 477 |
|
---|
[31] | 478 | ;==============================================================================
|
---|
[51] | 479 | ; Sector 1
|
---|
| 480 | ;==============================================================================
|
---|
[30] | 481 |
|
---|
[51] | 482 | ;------------------------------------------------------------------------------
|
---|
[46] | 483 | ; We are not a .COM file at 100h but a BINARY image
|
---|
| 484 | ; of which only the 1st sector gets loaded at 0000:07c00h
|
---|
| 485 | ; by the BIOS. The code in this 1st sector is position
|
---|
| 486 | ; independent and moves itself to a new location at 8000:0000h.
|
---|
| 487 | ; Then it jumps to a new entry-point and loads the rest of
|
---|
| 488 | ; the image to the new location.
|
---|
[51] | 489 | org 00000h
|
---|
| 490 | ;------------------------------------------------------------------------------
|
---|
[30] | 491 |
|
---|
[46] | 492 |
|
---|
| 493 | ;
|
---|
[51] | 494 | ; Since AiR-BOOT is a boot-loader residing in track0, the first 512 bytes
|
---|
| 495 | ; have the layout of a Master Boot Record (MBR). When AiR-BOOT get's installed,
|
---|
| 496 | ; the first 512 bytes of this code get's merged with the Partition Table.
|
---|
| 497 | ; The rest is installed in the remaining sectors with sector 62 (LBA 61)
|
---|
| 498 | ; being the last sector used by AiR-BOOT. Sector 63 is reserved for IBM LVM.
|
---|
| 499 | ; The last sector used by AiR-BOOT is a copy of the MBR that AiR-BOOT makes
|
---|
| 500 | ; every time a system gets booted.
|
---|
[46] | 501 | ;
|
---|
[30] | 502 |
|
---|
[46] | 503 | ;
|
---|
[51] | 504 | ; Due to the addition of an extra 'I13X' sugnature and code to preserve the
|
---|
| 505 | ; values of the registers on entry, the MBR-code has become a bit messy.
|
---|
| 506 | ; This will be cleaned-up in future versions.
|
---|
| 507 | ;
|
---|
| 508 |
|
---|
| 509 | ;
|
---|
[46] | 510 | ; Martin had a short jump followed by the AiRBOOT signature at first.
|
---|
| 511 | ; Then he encountered strange behaviour by some M$ operating-systems
|
---|
| 512 | ; if the the first insruction was not a CLI.
|
---|
[30] | 513 | ; But there was no room to insert the CLI and of course he did not want to
|
---|
[51] | 514 | ; change the location of the AiR-BOOT signature.
|
---|
[30] | 515 | ; He solved this by inserting the M$ needed CLI at offset 0 followed by a short
|
---|
[51] | 516 | ; jump that uses the 'A' of the AiR-BOOT signature as the jump displacement.
|
---|
[46] | 517 | ;
|
---|
[30] | 518 |
|
---|
| 519 |
|
---|
[51] | 520 | ; -----------------------------------------------------------------------------
|
---|
| 521 | ; FIRST ENTRY-POINT
|
---|
| 522 | ; -----------------------------------------------------------------------------
|
---|
[52] | 523 | ; BOOKMARK: FIRST ENTRY-POINT (Invoked by BIOS)
|
---|
[51] | 524 | ; ######################################################
|
---|
| 525 | ; # ENTRY-POINT WHERE THE BIOS TRANSFERS CONTROL TO US #
|
---|
| 526 | ; ######################################################
|
---|
[37] | 527 | AiR_BOOT:
|
---|
[51] | 528 | ; Some M$ operating systems need a CLI
|
---|
| 529 | ; here otherwise they will go beserk
|
---|
| 530 | ; and will do funny things during
|
---|
| 531 | ; boot phase, it's laughable!
|
---|
| 532 | MBR_1stOpc: cli
|
---|
[30] | 533 |
|
---|
[51] | 534 | ; JMP-Short -> MBR_Start
|
---|
| 535 | ; Uses the 'A' from the signature as the displacement !
|
---|
| 536 | MBR_JmpOpc db 0EBh
|
---|
[7] | 537 |
|
---|
[51] | 538 | ; ID String, Date (DD,MM,CC,YY), Version Number, Language ID
|
---|
| 539 | ;~ db 'AiRBOOT',24h,02h,20h,12h,01h,08h,TXT_LanguageID
|
---|
| 540 | MBR_ABSig: InsertAirbootSignature TXT_LanguageID
|
---|
[37] | 541 |
|
---|
[51] | 542 | ; Total Code Sectors Count.
|
---|
| 543 | ; Actual value will be inserted by FIXCODE.
|
---|
| 544 | MBR_CodeSecs db 1
|
---|
[37] | 545 |
|
---|
[51] | 546 | ; Total Code Sectors Count, dynamically calculated.
|
---|
| 547 | ;~ db (code_end-$)/512
|
---|
[37] | 548 |
|
---|
[51] | 549 | ; Check-Sum for Code
|
---|
| 550 | MBR_CheckCode dw 0
|
---|
[37] | 551 |
|
---|
| 552 |
|
---|
| 553 |
|
---|
[51] | 554 | ; -----------------------------------------------------------------------------
|
---|
| 555 | ; THIRD ENTRY-POINT
|
---|
| 556 | ; -----------------------------------------------------------------------------
|
---|
[52] | 557 | ; BOOKMARK: THIRD ENTRY-POINT (Relocate code)
|
---|
[30] | 558 | ;
|
---|
| 559 | ; No single instruction below should be changed, added or removed in the code
|
---|
| 560 | ; below as this will cause the jump-link to go haywire.
|
---|
[31] | 561 | ;
|
---|
[37] | 562 | MBR_Start:
|
---|
[51] | 563 | ;
|
---|
| 564 | ; When we arrive here, no registers have been used yet.
|
---|
| 565 | ; So, they still contain the values the BIOS left in them.
|
---|
| 566 | ; We want to preserve those value's for later inspection
|
---|
| 567 | ; by putting them on the stack.
|
---|
| 568 | ;
|
---|
[30] | 569 |
|
---|
[51] | 570 | ; No space for this instruction here.
|
---|
| 571 | ; We'll enable interrupts later.
|
---|
| 572 | ;sti ; This opcode is dedicated to:
|
---|
| 573 | ; =MICROSOFT JUMP DEPARTMENT=
|
---|
| 574 |
|
---|
| 575 | ; Push all registers with values provided by the BIOS
|
---|
| 576 | ; on the stack.
|
---|
| 577 | pusha
|
---|
| 578 |
|
---|
| 579 | ;
|
---|
[37] | 580 | ; Setup some base stuff
|
---|
| 581 | ; AX got loaded wrongly for debug, changed the instructions
|
---|
| 582 | ; without modifying the number of bytes.
|
---|
[51] | 583 | ; Don't comment-out the redundant instruction below because it
|
---|
[37] | 584 | ; *will* change the number of bytes and break the jump-chain.
|
---|
[51] | 585 | ;
|
---|
| 586 |
|
---|
| 587 | ; The segment we are moving ourself from (NOT USED)
|
---|
| 588 | ;mov ax, StartBaseSeg
|
---|
[37] | 589 | ;mov ds, ax
|
---|
[51] | 590 |
|
---|
| 591 | ; Make sure DS points to CS.
|
---|
[37] | 592 | push cs
|
---|
| 593 | pop ds
|
---|
[51] | 594 |
|
---|
| 595 | ; Setup the source and destination for the code move.
|
---|
| 596 | mov si, StartBasePtr ; The offset we move ourself from
|
---|
| 597 | mov ax, BootBaseSeg ; The target segment we move to
|
---|
[37] | 598 | mov es, ax
|
---|
[51] | 599 | ;mov di, BootBasePtr ; The target offset we move to
|
---|
| 600 | ; Changed the instruction to make room.
|
---|
| 601 | ; So, BootBasePtr is not used !
|
---|
| 602 | ; The offset in the target segment is assumed to be 0000
|
---|
| 603 | ; anyway.
|
---|
| 604 | xor di,di
|
---|
| 605 | ;sti
|
---|
[30] | 606 |
|
---|
[76] | 607 | ; Size of the MBR in words.
|
---|
[37] | 608 | mov cx, 256 ; Pre-boot environment
|
---|
[30] | 609 |
|
---|
[37] | 610 | ;
|
---|
[51] | 611 | ; This moves this 512-byte sector, loaded by the BIOS at
|
---|
| 612 | ; 0000:7c00 to 8000:0000.
|
---|
[37] | 613 | ;
|
---|
[51] | 614 | cld
|
---|
[37] | 615 | rep movsw
|
---|
[30] | 616 |
|
---|
[77] | 617 | ; Temporary save SS and SP so we still have access to this
|
---|
| 618 | ; stack after we have setup our own.
|
---|
| 619 | mov cx,ss
|
---|
| 620 | mov bx,sp
|
---|
| 621 |
|
---|
[51] | 622 | ; Code an intersegment jump to the new location.
|
---|
| 623 | ; jmp BootBaseSeg:BootBaseExec
|
---|
| 624 | ; Note that DX:BX containts the old SS:SP.
|
---|
[37] | 625 | db 0EAh
|
---|
[46] | 626 | dw BootBaseExec ; This is MBR_RealStart + BootBasePtr
|
---|
| 627 | dw BootBaseSeg ; This is 08000h
|
---|
[7] | 628 |
|
---|
[30] | 629 |
|
---|
[51] | 630 |
|
---|
| 631 |
|
---|
| 632 | ; -----------------------------------------------------------------------------
|
---|
| 633 | ; SIMPLE MBR FUNCTIONS
|
---|
| 634 | ; -----------------------------------------------------------------------------
|
---|
[30] | 635 | ;
|
---|
| 636 | ; Some MBR-functions to provide absolute minimum functionality.
|
---|
| 637 | ;
|
---|
| 638 |
|
---|
| 639 | ;
|
---|
[52] | 640 | ; BOOKMARK: Halt System
|
---|
[30] | 641 | ; Entry-point for halting the system.
|
---|
| 642 | ;
|
---|
[7] | 643 | MBR_HaltSystem:
|
---|
[37] | 644 | mov ax, 8600h
|
---|
| 645 | xor cx, cx
|
---|
| 646 | mov dx, 500
|
---|
[46] | 647 | int 15h ; Wait to display the whole screen :]
|
---|
| 648 | MBR_HaltSys:
|
---|
[81] | 649 | ;~ cli
|
---|
[37] | 650 | jmp MBR_HaltSys
|
---|
[7] | 651 |
|
---|
[31] | 652 |
|
---|
[77] | 653 | ; Base of some MBR variables
|
---|
[45] | 654 | ORIGIN 0003Ch
|
---|
| 655 |
|
---|
[77] | 656 | MBR_Variables:
|
---|
| 657 |
|
---|
[51] | 658 | ; Comport settings.
|
---|
| 659 | ; It had to be moved to create room for the double I13X signature.
|
---|
[37] | 660 | ; It cannot be in the config-area (sector 55)
|
---|
[43] | 661 | ; because that area is crc-protected and would not allow 'poking'.
|
---|
| 662 | BIOS_AuxParms dw BIOS_AUXPARMS_DEFAULT
|
---|
[31] | 663 |
|
---|
[77] | 664 | ; When the BIOS turns over control to the MBR, DL holds the BIOS disk-number
|
---|
| 665 | ; from which the boot was initiated. This would normally be 80h, corresponding
|
---|
| 666 | ; to the first physical disk. However, some modern BIOSses can directly boot
|
---|
| 667 | ; from other disks, so AirBoot cannot assume being loaded from 80h anymore.
|
---|
| 668 | ; So here we store the BIOS disk-number passed in DL when AirBoot got control.
|
---|
| 669 | BIOS_BootDisk db BIOS_BOOTDISK_DEFAULT ; Get overwritten with 'DL'
|
---|
[51] | 670 |
|
---|
[77] | 671 | ; Reserved space for future variables.
|
---|
[51] | 672 | IFDEF AUX_DEBUG
|
---|
[77] | 673 | reserved db 5 dup('X')
|
---|
[51] | 674 | ELSE
|
---|
[77] | 675 | reserved db 5 dup(0)
|
---|
[51] | 676 | ENDIF
|
---|
[30] | 677 |
|
---|
[45] | 678 |
|
---|
[51] | 679 |
|
---|
| 680 |
|
---|
| 681 | ; -----------------------------------------------------------------------------
|
---|
| 682 | ; SECOND ENTRY-POINT
|
---|
| 683 | ; -----------------------------------------------------------------------------
|
---|
[77] | 684 |
|
---|
[37] | 685 | ;
|
---|
| 686 | ; We arrive here after the first jump using the 'A' of the
|
---|
[51] | 687 | ; AiR-BOOT signature. So we ensure the jump is always at
|
---|
| 688 | ; this offset. We jump here, because Martin needed to
|
---|
| 689 | ; insert a CLI on start and did not want to change the
|
---|
| 690 | ; AiR-BOOT signature because of Microsoft inventions...
|
---|
[45] | 691 | ;
|
---|
| 692 | ORIGIN 00044h
|
---|
[37] | 693 |
|
---|
| 694 | ; Jump again...
|
---|
[51] | 695 | ; This time to the code that relocates to 8000:0000.
|
---|
[52] | 696 | ; BOOKMARK: SECOND ENTRY_POINT (Skipped over AB signature)
|
---|
[37] | 697 | jmp MBR_Start
|
---|
| 698 |
|
---|
[30] | 699 | ;
|
---|
| 700 | ; Entry-point when loading fails.
|
---|
| 701 | ;
|
---|
[37] | 702 | db 'LOAD ERROR!', 0
|
---|
| 703 | MBR_LoadError Proc Near
|
---|
| 704 | mov si, offset $-12
|
---|
| 705 | push cs
|
---|
| 706 | pop ds
|
---|
| 707 | call MBR_Teletype
|
---|
| 708 | MBRLE_Halt:
|
---|
| 709 | jmp MBRLE_Halt
|
---|
| 710 | MBR_LoadError EndP
|
---|
[7] | 711 |
|
---|
[30] | 712 | ;
|
---|
| 713 | ; Entry-point when saving fails.
|
---|
| 714 | ;
|
---|
[37] | 715 | db 'SAVE ERROR!', 0
|
---|
| 716 | MBR_SaveError Proc Near
|
---|
| 717 | mov si, offset $-12
|
---|
| 718 | push cs
|
---|
| 719 | pop ds
|
---|
| 720 | call MBR_Teletype
|
---|
| 721 | MBRSE_Halt:
|
---|
| 722 | jmp MBRSE_Halt
|
---|
| 723 | MBR_SaveError EndP
|
---|
[7] | 724 |
|
---|
[30] | 725 |
|
---|
| 726 | ; Put text on the screen using the BIOS tele-type function.
|
---|
| 727 | ; No attributes like color are supported.
|
---|
[7] | 728 | ; In: SI - Pointer to begin of string (EOS is 0)
|
---|
| 729 | ; Destroyed: SI
|
---|
[37] | 730 | MBR_Teletype Proc Near Uses ax bx cx
|
---|
| 731 | mov ah, 0Eh
|
---|
| 732 | mov bx, 7
|
---|
| 733 | MBRT_Loop:
|
---|
| 734 | lodsb
|
---|
| 735 | or al, al
|
---|
| 736 | jz MBRT_End
|
---|
| 737 | int 10h
|
---|
| 738 | jmp MBRT_Loop
|
---|
| 739 | MBRT_End:
|
---|
| 740 | ret
|
---|
| 741 | MBR_Teletype EndP
|
---|
[7] | 742 |
|
---|
[30] | 743 | ;
|
---|
| 744 | ; Rousseau: DO NOT ADD CODE TO THIS SECTION !
|
---|
| 745 | ;
|
---|
| 746 |
|
---|
[52] | 747 | ; In: BX - Base Check
|
---|
| 748 | ; DS:SI - Pointer to 512-byte-area to be included
|
---|
| 749 | ; Out: BX - Base Check Result
|
---|
[7] | 750 | ; Destroyed: SI will get updated (+512)
|
---|
[37] | 751 | MBR_GetCheckOfSector Proc Near Uses ax cx
|
---|
| 752 | mov cx, 256
|
---|
| 753 | MBRGCOS_Loop:
|
---|
| 754 | lodsw
|
---|
| 755 | xor ax, 0BABEh
|
---|
| 756 | xor bx, ax
|
---|
| 757 | loop MBRGCOS_Loop
|
---|
| 758 | or bx, bx
|
---|
| 759 | jnz MBRGCOS_NoFixUp
|
---|
| 760 | mov bx, 1 ; dont allow 0, cause 0 == empty
|
---|
| 761 | MBRGCOS_NoFixUp:
|
---|
| 762 | ret
|
---|
| 763 | MBR_GetCheckOfSector EndP
|
---|
[7] | 764 |
|
---|
[30] | 765 |
|
---|
| 766 |
|
---|
| 767 |
|
---|
| 768 |
|
---|
| 769 |
|
---|
[51] | 770 | ; -----------------------------------------------------------------------------
|
---|
| 771 | ; ENTRY-POINT OF MOVED CODE
|
---|
| 772 | ; -----------------------------------------------------------------------------
|
---|
| 773 |
|
---|
[30] | 774 | ;
|
---|
[51] | 775 | ; When we arrive here we are running at 8000:0000.
|
---|
[77] | 776 | ; CX:BX contains the SS:SP of the old stack.
|
---|
[30] | 777 | ;
|
---|
| 778 |
|
---|
[51] | 779 | ;
|
---|
| 780 | ; This is where the rest of AiR-BOOT gets loaded from track0.
|
---|
| 781 | ;
|
---|
[52] | 782 | ; BOOKMARK: Running at relocated position (Load additional sectors)
|
---|
[31] | 783 | ;------------------------------------------------------------------------------
|
---|
[7] | 784 | MBR_RealStart:
|
---|
[51] | 785 | ;
|
---|
| 786 | ; Setup new stack and other segment registers.
|
---|
| 787 | ;
|
---|
[37] | 788 | mov ax, StackSeg ; 07000h, below the moved code
|
---|
| 789 | mov ss, ax
|
---|
| 790 | mov sp, 7FFEh ; Even is better
|
---|
[51] | 791 | push es ; ES holds segment where we moved to
|
---|
[52] | 792 | pop ds ; Set DS=ES to Code Segment
|
---|
[30] | 793 |
|
---|
[51] | 794 | ;
|
---|
[77] | 795 | ; Push the old SS:SP which was saved in CX:BX on the new stack.
|
---|
[51] | 796 | ;
|
---|
[77] | 797 | push cx ; Old SS
|
---|
[51] | 798 | push bx ; Old SP
|
---|
[43] | 799 |
|
---|
[77] | 800 | ;
|
---|
| 801 | ; Store the BIOS disk-number AirBoot was loaded from.
|
---|
| 802 | ;
|
---|
| 803 | mov [BIOS_BootDisk], dl
|
---|
[51] | 804 |
|
---|
[37] | 805 | ; Load the configuration-sectors from disk.
|
---|
[51] | 806 | ; These are the main configuration sector and the various
|
---|
| 807 | ; tables that follow it upto but not including the MBR backup.
|
---|
[77] | 808 | mov bx, offset Configuration ; Location in RAM
|
---|
| 809 | mov cx, 0037h ; Config sector is at 55d
|
---|
| 810 | mov al, (MBR_BackUpMBR - Configuration) / 200h
|
---|
| 811 | mov ah, 02h
|
---|
| 812 | ; DL is already loaded with BIOS disk-number
|
---|
| 813 | int 13h ; Call BIOS service
|
---|
[37] | 814 | jnc MBR_ConfigCopy_NoError
|
---|
[30] | 815 |
|
---|
[37] | 816 | ; Some error occured
|
---|
| 817 | MBR_ConfigCopy_LoadError:
|
---|
[77] | 818 | jmp MBR_LoadError ; Will Abort BootUp
|
---|
[30] | 819 |
|
---|
[77] | 820 | ; Load the code-sectors from disk.
|
---|
| 821 | ; [MBR_CodeSecs] is filled in by the FIXCODE helper that post
|
---|
| 822 | ; processes the AIRBOOT loader image after it has been built.
|
---|
[37] | 823 | MBR_ConfigCopy_NoError:
|
---|
[77] | 824 | mov bx, offset FurtherMoreLoad ; Directly after MBR
|
---|
| 825 | mov cx, 0002h ; Start at 2nd sector
|
---|
| 826 | mov al, [MBR_CodeSecs] ; Number of code sectors
|
---|
| 827 | mov ah, 02h ; Read sectors
|
---|
| 828 | ; DL is already loaded with BIOS disk-number
|
---|
| 829 | int 13h ; Call BIOS service
|
---|
[37] | 830 | jnc MBR_RealStart_NoError
|
---|
[31] | 831 |
|
---|
[77] | 832 | ; Some error occured
|
---|
| 833 | jmp MBR_LoadError ; Will Abort BootUp
|
---|
[31] | 834 |
|
---|
[77] | 835 |
|
---|
| 836 | ; I13X Signatures
|
---|
| 837 | ORIGIN 000d0h
|
---|
| 838 |
|
---|
[37] | 839 | ; [v1.05+]
|
---|
| 840 | ; Signature for IBM's LVM to detect our "powerful" features ;)
|
---|
[45] | 841 | ;
|
---|
[37] | 842 | ; [v1.0.8+]
|
---|
| 843 | ; Reworked MBR code to be able to create a
|
---|
| 844 | ; double 'I13X' signature.
|
---|
| 845 | ; MBR's created with LVM eCS v1.x have the signature at 0d5h
|
---|
| 846 | ; MBR's created with LVM eCS v2.x have the signature at 0d0h
|
---|
| 847 | ; See eCS bugtracker issue #3002
|
---|
[45] | 848 | ;
|
---|
[37] | 849 | ; Update: These are actually MOV EAX,'X31I' instructions
|
---|
| 850 | ; in the eCS LVM MBR-code. They are at different places in
|
---|
[51] | 851 | ; the v1.x and v2.x LVM MBR-code. Other code might depend on
|
---|
| 852 | ; their presence. Let's protect their location.
|
---|
[37] | 853 | db 'I13X',0,'I13X',0
|
---|
[31] | 854 |
|
---|
[30] | 855 |
|
---|
[37] | 856 | MBR_RealStart_NoError:
|
---|
| 857 | ; Now Check Code with CheckSum
|
---|
| 858 | mov si, offset FurtherMoreLoad
|
---|
[30] | 859 |
|
---|
[37] | 860 | ;movzx cx, bptr ds:[10h]
|
---|
| 861 | mov cl, ds:[10h]
|
---|
| 862 | mov ch,0
|
---|
[31] | 863 |
|
---|
[51] | 864 | ; Claculate checksum
|
---|
[37] | 865 | xor bx, bx
|
---|
| 866 | MBR_RealStart_CheckCodeLoop:
|
---|
| 867 | call MBR_GetCheckOfSector
|
---|
| 868 | loop MBR_RealStart_CheckCodeLoop
|
---|
[31] | 869 |
|
---|
[184] | 870 | ; Verify checksum -- EQUAL if OK
|
---|
[37] | 871 | cmp MBR_CheckCode, bx
|
---|
[7] | 872 |
|
---|
[184] | 873 | ;
|
---|
| 874 | ; The CRC is calculated and inserted in the loader image when
|
---|
| 875 | ; AiR-BOOT is installed. Ignoring the CRC enables manually
|
---|
| 876 | ; merging the loader without using the installer. This is used
|
---|
| 877 | ; for debugging in virtual machines, where it is easy to
|
---|
| 878 | ; merge the loader to the disk image of the VM.
|
---|
| 879 | ;
|
---|
| 880 | IFDEF CRC_IGNORE
|
---|
| 881 | jmp MBR_RealStart_CheckSuccess ; Ignore CRC
|
---|
| 882 | ELSE
|
---|
| 883 | je MBR_RealStart_CheckSuccess ; Honor CRC -- EQ is OK
|
---|
| 884 | ENDIF
|
---|
| 885 |
|
---|
| 886 | ;
|
---|
[72] | 887 | ; Oops, checksum mismatch -- halt the system
|
---|
[184] | 888 | ;
|
---|
[37] | 889 | mov si, offset TXT_ERROR_Attention
|
---|
| 890 | call MBR_Teletype
|
---|
| 891 | mov si, offset TXT_ERROR_CheckCode
|
---|
| 892 | call MBR_Teletype
|
---|
| 893 | mov si, offset TXT_ERROR_CheckFailed
|
---|
| 894 | call MBR_Teletype
|
---|
| 895 | jmp MBR_HaltSystem
|
---|
[51] | 896 |
|
---|
| 897 |
|
---|
| 898 | ;
|
---|
| 899 | ; OK, all loading went fine so the rest of the code
|
---|
| 900 | ; is present now, so we jump to it.
|
---|
| 901 | ; The old SS:SP is still on the stack.
|
---|
| 902 | ;
|
---|
[37] | 903 | MBR_RealStart_CheckSuccess:
|
---|
| 904 | jmp AiR_BOOT_Start
|
---|
[30] | 905 |
|
---|
| 906 |
|
---|
| 907 |
|
---|
| 908 |
|
---|
[37] | 909 |
|
---|
[31] | 910 | ;------------------------------------------------------------------------------
|
---|
[186] | 911 | include_from text/%BLD_LANG,mbr.asm ; All translateable Text in MBR
|
---|
[31] | 912 | ;------------------------------------------------------------------------------
|
---|
[30] | 913 |
|
---|
[77] | 914 | ; Disk Signature
|
---|
| 915 | ORIGIN 001B8h
|
---|
[30] | 916 |
|
---|
| 917 |
|
---|
[37] | 918 | ; Disk Signature
|
---|
| 919 | ; Note that in an LVM 2.x MBR this collides
|
---|
| 920 | ; with the dummy PTE that it uses to look for IBM-BM
|
---|
| 921 | ; on the second harddisk.
|
---|
[52] | 922 | ; AiR-BOOT installer will merge the field
|
---|
| 923 | ; from the MBR it replaces.
|
---|
[51] | 924 | MBR_DrvSig db 'DSIG'
|
---|
[31] | 925 |
|
---|
[45] | 926 | ; Unused word at 01BCh.
|
---|
| 927 | ; An LVM 2.x MBR puts 0CC33h here.
|
---|
[52] | 928 | ; AiR-BOOT installer will merge the field
|
---|
| 929 | ; from the MBR it replaces.
|
---|
[51] | 930 | MBR_Spare dw '$$'
|
---|
[35] | 931 |
|
---|
| 932 |
|
---|
[45] | 933 | ; Partition Table.
|
---|
| 934 | ORIGIN 001BEh
|
---|
[43] | 935 |
|
---|
[45] | 936 | ; The 4 entries just for show.
|
---|
[52] | 937 | ; AiR-BOOT installer will merge them from the MBR it replaces.
|
---|
[51] | 938 | MBR_PartTable:
|
---|
[37] | 939 | db 16 dup('0')
|
---|
| 940 | db 16 dup('1')
|
---|
| 941 | db 16 dup('2')
|
---|
| 942 | db 16 dup('3')
|
---|
| 943 |
|
---|
| 944 | ; Boot Sigbature
|
---|
[51] | 945 | MBR_Sig dw 0aa55h
|
---|
[37] | 946 |
|
---|
[30] | 947 |
|
---|
| 948 |
|
---|
| 949 |
|
---|
[37] | 950 |
|
---|
[45] | 951 |
|
---|
[51] | 952 |
|
---|
[31] | 953 | ;==============================================================================
|
---|
[51] | 954 | ; Sector 2
|
---|
| 955 | ;==============================================================================
|
---|
[30] | 956 |
|
---|
[51] | 957 | ; -----------------------------------------------------------------------------
|
---|
| 958 | ; FILE-SYSTEM TABLES
|
---|
| 959 | ; -----------------------------------------------------------------------------
|
---|
| 960 |
|
---|
[77] | 961 | ; First sector the rest of the loader image
|
---|
[45] | 962 | ORIGIN 00200h
|
---|
[30] | 963 |
|
---|
[31] | 964 | ;
|
---|
| 965 | ; Everything beyond this point is loaded on startup
|
---|
| 966 | ; and is NOT existant at first
|
---|
| 967 | ;
|
---|
[7] | 968 | FurtherMoreLoad:
|
---|
[30] | 969 |
|
---|
| 970 | ;
|
---|
| 971 | ; Filesystem table correlating id with name.
|
---|
| 972 | ;
|
---|
| 973 |
|
---|
[244] | 974 | ; -> 44 Partition-Types
|
---|
[37] | 975 | ; first Normal-Partition-ID, Hidden-Partition-ID
|
---|
[51] | 976 | ; and Default-Partition-Flags.
|
---|
[37] | 977 | ; 01h -> Boot-Able
|
---|
| 978 | ; 10h -> FAT32 - Name Getting Scheme
|
---|
| 979 | ; 20h -> No Name To Get (use Partition Name from IPT)
|
---|
| 980 | ; 40h -> 'L' flag possible
|
---|
[7] | 981 | db 'AiRSYS-TABLE'
|
---|
[37] | 982 | FileSysIDs db 01h, 11h,01h, 04h,014h,01h, 06h,016h,41h, 0Eh,00Eh,01h
|
---|
[29] | 983 | db 07h, 17h,41h, 08h,017h,21h, 35h,035h,20h,0FCh,017h,41h
|
---|
| 984 | db 09h, 19h,11h, 0Bh,01Bh,11h, 0Ch,01Ch,11h,0EBh,0EBh,01h
|
---|
[7] | 985 | db 63h, 63h,21h, 81h,081h,21h, 83h,083h,21h, 40h,040h,21h
|
---|
| 986 | db 0A5h,0A5h,21h,0A6h,0A6h,21h, 82h,082h,20h,0A7h,0A7h,21h
|
---|
| 987 | db 63h, 63h,21h, 4Dh,04Dh,21h, 4Eh,04Eh,21h, 4Fh,04Fh,21h
|
---|
| 988 | db 01h, 01h,01h, 01h,001h,01h, 01h,001h,01h, 01h,001h,01h
|
---|
| 989 | db 01h, 01h,01h, 01h,001h,01h, 01h,001h,01h, 01h,001h,01h
|
---|
| 990 | db 01h, 01h,01h, 01h,001h,01h, 01h,001h,01h, 01h,001h,01h
|
---|
| 991 | db 01h, 01h,01h,0FDh,0FDh,20h, 84h,084h,20h,0A0h,0A0h,20h
|
---|
| 992 | db 0Ah, 0Ah,20h,0FEh,0FEh,21h,0FFh,0FFh,21h, 00h,000h,21h
|
---|
| 993 | db 16 dup (0)
|
---|
| 994 |
|
---|
[244] | 995 | ; Filesystem Types / Boot Methods
|
---|
[46] | 996 | FileSysNames db 'FAT12 ', 'FAT16 ', 'FAT16Big', 'FAT16Big'
|
---|
| 997 | db 'HPFS ', 'NTFS ', 'LVM-Data', 'JFS '
|
---|
| 998 | db 'FAT32 ', 'FAT32 ', 'FAT32 ', 'BeOS '
|
---|
| 999 | db 'Unix ', 'Minix ', 'Linux ', 'Venix ' ; x row ;)
|
---|
| 1000 | db 'BSD/386 ', 'OpenBSD ', 'LinuxSwp', 'NeXTSTEP'
|
---|
| 1001 | db 'GNU HURD', 'QNX ', 'QNX ', 'QNX '
|
---|
| 1002 | db ' ', ' ', ' ', ' '
|
---|
| 1003 | db ' ', ' ', ' ', ' '
|
---|
| 1004 | db ' ', ' ', ' ', ' '
|
---|
| 1005 | db ' ', 'Kernel ', ' ', '0V-Award'
|
---|
| 1006 | ; db 'OS/2 Man', 'via BIOS', 'Floppy ', 'Unknown '
|
---|
[244] | 1007 |
|
---|
| 1008 | ; rousseau.comment.201807081141
|
---|
| 1009 | ; These strings should not be separated into language-files because they are
|
---|
| 1010 | ; part of the table above.
|
---|
| 1011 | IF BLD_LANG_TXT EQ 'es'
|
---|
| 1012 | db 'OS2-BMGR', 'v¡a BIOS', 'Flexible', '????????'
|
---|
| 1013 | ELSE
|
---|
[46] | 1014 | db 'OS2-BMGR', 'via BIOS', 'Floppy ', 'Unknown '
|
---|
[244] | 1015 | ENDIF
|
---|
[7] | 1016 |
|
---|
[30] | 1017 |
|
---|
| 1018 |
|
---|
[51] | 1019 | ;==============================================================================
|
---|
| 1020 | ; Sector 3
|
---|
| 1021 | ;==============================================================================
|
---|
[30] | 1022 |
|
---|
[51] | 1023 | ; -----------------------------------------------------------------------------
|
---|
| 1024 | ; ENTRY-POINT AFTER LOADING THE REST OF THE CODE
|
---|
| 1025 | ; -----------------------------------------------------------------------------
|
---|
[30] | 1026 |
|
---|
[77] | 1027 | ; The entry-point jumped to from the MBR code
|
---|
[51] | 1028 | ORIGIN 00400h
|
---|
[30] | 1029 |
|
---|
[43] | 1030 |
|
---|
[77] | 1031 | ;##############################################################################
|
---|
| 1032 | ;# AiR_BOOT_Start :: This is where the real work begins #
|
---|
| 1033 | ;# -------------------------------------------------------------------------- #
|
---|
| 1034 | ;# At this point, all of AirBoot is loaded, including its configuration. #
|
---|
| 1035 | ;# First, some setup is done, which includes the initialization of variables #
|
---|
| 1036 | ;# in the BSS. After that, disks are scanned for partitions and the required #
|
---|
| 1037 | ;# house keeping is done to incorporate changes from the previous boot. Then #
|
---|
| 1038 | ;# the partition list is prepared and the menu is presented. #
|
---|
| 1039 | ;##############################################################################
|
---|
[52] | 1040 | ; BOOKMARK: AiR_BOOT_Start (AiR-BOOT now completely loaded)
|
---|
[36] | 1041 | AiR_BOOT_Start:
|
---|
[30] | 1042 |
|
---|
[36] | 1043 |
|
---|
[51] | 1044 | ;
|
---|
| 1045 | ; Enable interrupts.
|
---|
| 1046 | ;
|
---|
| 1047 | sti
|
---|
[36] | 1048 |
|
---|
| 1049 | ;
|
---|
[51] | 1050 | ; Pop the old SS:SP from the stack and save it in the BSS.
|
---|
[52] | 1051 | ; Note that this is outside the normal variable area that gets cleared.
|
---|
| 1052 | ; This allows AiR-BOOT to restart itself when debugging and come-up
|
---|
| 1053 | ; with access to the original values of registers the BIOS passed.
|
---|
[51] | 1054 | ;
|
---|
| 1055 | pop [OldSP]
|
---|
| 1056 | pop [OldSS]
|
---|
| 1057 |
|
---|
[141] | 1058 | ; Clear the BSS from its real start just upto the end of the variables.
|
---|
| 1059 | ; Here 'real start' means from where the BSS begins, which is below
|
---|
| 1060 | ; the point where the first variables are located. The part after
|
---|
| 1061 | ; the variables is not cleared because that is where the old SS:SP is
|
---|
| 1062 | ; stored, which is needed for AirBoot restarts during debugging.
|
---|
| 1063 | mov bx, offset sobss
|
---|
| 1064 | mov cx, offset EndOfVariables - offset sobss
|
---|
| 1065 | xor ax, ax
|
---|
| 1066 | call FillMemBlock
|
---|
[51] | 1067 |
|
---|
[142] | 1068 | ; Initialize the com-port for debugging
|
---|
| 1069 | IFDEF AUX_DEBUG
|
---|
| 1070 | PUSHRF
|
---|
| 1071 | ; Init com-port
|
---|
| 1072 | call AuxIO_Init
|
---|
| 1073 | ; Hello message
|
---|
| 1074 | mov si, offset [AuxIOHello]
|
---|
| 1075 | call AuxIO_Print
|
---|
| 1076 | ; Show Build Info
|
---|
| 1077 | call AuxIO_PrintBuildInfo
|
---|
| 1078 | call AuxIO_TeletypeNL
|
---|
| 1079 | POPRF
|
---|
| 1080 | ENDIF
|
---|
| 1081 |
|
---|
| 1082 | ; Dump debug information
|
---|
| 1083 | IFDEF AUX_DEBUG
|
---|
| 1084 | IF 1
|
---|
| 1085 | call DEBUG_Dump1
|
---|
| 1086 | ENDIF
|
---|
| 1087 | ENDIF
|
---|
| 1088 |
|
---|
[117] | 1089 | ; Verify we still got the BIOS disk in DL
|
---|
| 1090 | IFDEF AUX_DEBUG
|
---|
| 1091 | IF 1
|
---|
[123] | 1092 | DBG_TEXT_OUT_AUX '## AiR_BOOT_Start ##'
|
---|
| 1093 | PUSHRF
|
---|
[117] | 1094 | call DEBUG_DumpRegisters
|
---|
[123] | 1095 | POPRF
|
---|
[77] | 1096 | ENDIF
|
---|
[117] | 1097 | ENDIF
|
---|
[77] | 1098 |
|
---|
[117] | 1099 |
|
---|
[51] | 1100 | ; -----------------------------------------------------------------------------
|
---|
| 1101 | ; IBM-BM BOOT PREPARATION
|
---|
| 1102 | ; -----------------------------------------------------------------------------
|
---|
| 1103 | ;
|
---|
[36] | 1104 | ; Since v1.0.8, AiR-BOOT is able to chainload IBM-BM.
|
---|
| 1105 | ; When IBM-BM resides above the 1024-cylinder limit, the 'I13X'
|
---|
| 1106 | ; signature is required at 3000:0000, FS needs to contain 3000h
|
---|
| 1107 | ; and the 32-bit LBA address needs to follow the 'I13X' signature.
|
---|
| 1108 | ; For booting IBM-BM from the second disk, a copy of the MBR of the
|
---|
| 1109 | ; first disk is also required at 0000:7E00.
|
---|
| 1110 | ; This information is derived from the eCS 2.x LVM MBR.
|
---|
| 1111 | ;
|
---|
| 1112 | ; So, now is a good time to copy the MBR of the first disk to
|
---|
| 1113 | ; 0000:7E00 in case the partition that will be started is IBM-BM.
|
---|
| 1114 | ; This copy is located at 8000:0000 and DS already points to this
|
---|
[51] | 1115 | ; segment. The 'I13X' signature and FS will be setup later.
|
---|
[36] | 1116 | ;
|
---|
[37] | 1117 | pusha ; Save all the general purpose regs
|
---|
| 1118 | push es ; We need ES too, so save its value
|
---|
| 1119 | xor ax,ax ; Segment 0000h
|
---|
| 1120 | mov es,ax ; Make ES point to it
|
---|
| 1121 | mov si,offset BootBasePtr ; Start of AiR-BOOT which has the MBR
|
---|
| 1122 | mov di,7e00h ; Destination for the MBR for IBM-BM
|
---|
| 1123 | mov cx,100h ; 256 words = 512 bytes
|
---|
| 1124 | cld ; Direction from low to high
|
---|
| 1125 | rep movsw ; Copy the 256 words of the MBR
|
---|
| 1126 | pop es ; Restore previous value of ES
|
---|
| 1127 | popa ; Restore all the general purpose regs
|
---|
[36] | 1128 |
|
---|
| 1129 |
|
---|
[51] | 1130 | ; -----------------------------------------------------------------------------
|
---|
| 1131 | ; PRECRAP
|
---|
| 1132 | ; -----------------------------------------------------------------------------
|
---|
[36] | 1133 |
|
---|
[51] | 1134 | ;
|
---|
| 1135 | ; First it clears the BSS area.
|
---|
[52] | 1136 | ; Note that the old SS:SP is stored outside this area so this
|
---|
[51] | 1137 | ; does not get lost.
|
---|
| 1138 | ; Then initialize various runtime variables and structures.
|
---|
| 1139 | ;
|
---|
[52] | 1140 | ; BOOKMARK: Pre Crap
|
---|
[51] | 1141 | call PRECRAP_Main
|
---|
| 1142 | ; Number of harddisks and other system-info is now known.
|
---|
[43] | 1143 |
|
---|
[117] | 1144 | ;!
|
---|
| 1145 | ;! DEBUG_BLOCK
|
---|
| 1146 | ;! Let's see what the BIOS supplied us with...
|
---|
| 1147 | ;! Uncomment below to activate.
|
---|
| 1148 | ;!
|
---|
| 1149 | IFDEF AUX_DEBUG
|
---|
| 1150 | IF 0
|
---|
| 1151 | pushf
|
---|
| 1152 | pusha
|
---|
[45] | 1153 |
|
---|
[117] | 1154 | ; Print title.
|
---|
| 1155 | mov si,offset [bios_reg]
|
---|
| 1156 | call AuxIO_Print
|
---|
| 1157 | ; Save the current stack (SS:SP).
|
---|
| 1158 | mov ax,ss
|
---|
| 1159 | mov [CurrentSS],ax
|
---|
| 1160 | mov [CurrentSP],sp
|
---|
[30] | 1161 |
|
---|
[117] | 1162 | ; Restore the old stack.
|
---|
| 1163 | mov ss,[OldSS]
|
---|
| 1164 | mov sp,[OldSP]
|
---|
[30] | 1165 |
|
---|
[117] | 1166 | ; Pop the registers with the BIOS values.
|
---|
| 1167 | popa
|
---|
| 1168 | ; Push them back for AiR-BOOT restart (debug mode).
|
---|
| 1169 | pusha
|
---|
| 1170 | ; Dump them to the serial-port.
|
---|
| 1171 | call DEBUG_DumpRegisters
|
---|
| 1172 | ; Restore the current stack.
|
---|
| 1173 | mov ax,[CurrentSS]
|
---|
| 1174 | mov ss,ax
|
---|
| 1175 | mov sp,[CurrentSP]
|
---|
[30] | 1176 |
|
---|
[117] | 1177 | popa
|
---|
| 1178 | popf
|
---|
| 1179 | ENDIF
|
---|
| 1180 | ENDIF
|
---|
[30] | 1181 |
|
---|
[51] | 1182 |
|
---|
[117] | 1183 |
|
---|
[145] | 1184 | ; -----------------------------------------------------------------------------
|
---|
| 1185 | ; UPDATE MBR
|
---|
| 1186 | ; -----------------------------------------------------------------------------
|
---|
[144] | 1187 |
|
---|
[145] | 1188 | ; Write MBR back to disk to sync MBR variables.
|
---|
| 1189 | ; Otherwise subsequent MBR loads will differ from the RAM stored one,
|
---|
| 1190 | ; which is used by MBR protection to validate parts of the MBR.
|
---|
| 1191 | xor bx, bx ; 0000h - our load address (8000:0000)
|
---|
| 1192 | mov cx, 1 ; CHS sector 1, cylinder 0
|
---|
| 1193 | xor dh, dh ; CHS head 0
|
---|
| 1194 | mov dl, [BIOS_BootDisk] ; The disk we were loaded from
|
---|
| 1195 | mov al, 1 ; One sector to write
|
---|
| 1196 | mov ah, 03h ; BIOS write disk (legacy)
|
---|
| 1197 | int 13h ; Call BIOS
|
---|
[175] | 1198 | sti ; Enable ints
|
---|
[145] | 1199 | ;!
|
---|
| 1200 | ;! TODO: Check success
|
---|
| 1201 | ;! Yes, we should check for errors here, coz it would mean AirBoot
|
---|
| 1202 | ;! was loaded from a disk where the MBR cannot be written !
|
---|
| 1203 | ;!
|
---|
| 1204 |
|
---|
[164] | 1205 |
|
---|
| 1206 |
|
---|
[51] | 1207 | ; -----------------------------------------------------------------------------
|
---|
[144] | 1208 | ; SCAN DISKS
|
---|
[51] | 1209 | ; -----------------------------------------------------------------------------
|
---|
[77] | 1210 |
|
---|
[164] | 1211 | ;!
|
---|
| 1212 | ;! DEBUG_BLOCK
|
---|
| 1213 | ;! Dump the registers at this point.
|
---|
| 1214 | ;!
|
---|
| 1215 | IFDEF AUX_DEBUG
|
---|
| 1216 | IF 0
|
---|
| 1217 | PUSHRF
|
---|
| 1218 | call DEBUG_DumpRegisters
|
---|
| 1219 | ;~ call DEBUG_DumpDriveLetters
|
---|
| 1220 | ;~ call DEBUG_DumpVolumeLetters
|
---|
| 1221 | ;~ call DEBUG_DumpPartitionXref
|
---|
| 1222 | POPRF
|
---|
| 1223 | ENDIF
|
---|
| 1224 | ENDIF
|
---|
| 1225 |
|
---|
| 1226 |
|
---|
[144] | 1227 | ;
|
---|
| 1228 | ; Scan disks for information like size etc.
|
---|
| 1229 | ;
|
---|
| 1230 | call DriveIO_ScanDisks
|
---|
[77] | 1231 |
|
---|
[164] | 1232 | ;!
|
---|
| 1233 | ;! DEBUG_BLOCK
|
---|
| 1234 | ;! Dump the registers at this point.
|
---|
| 1235 | ;!
|
---|
| 1236 | IFDEF AUX_DEBUG
|
---|
| 1237 | IF 0
|
---|
| 1238 | PUSHRF
|
---|
| 1239 | call DEBUG_DumpRegisters
|
---|
| 1240 | ;~ call DEBUG_DumpDriveLetters
|
---|
| 1241 | ;~ call DEBUG_DumpVolumeLetters
|
---|
| 1242 | ;~ call DEBUG_DumpPartitionXref
|
---|
| 1243 | POPRF
|
---|
| 1244 | ENDIF
|
---|
| 1245 | ENDIF
|
---|
[77] | 1246 |
|
---|
| 1247 |
|
---|
[144] | 1248 | ; -----------------------------------------------------------------------------
|
---|
| 1249 | ; SCAN FOR PARTITIONS
|
---|
| 1250 | ; -----------------------------------------------------------------------------
|
---|
[77] | 1251 |
|
---|
[51] | 1252 | ;
|
---|
[144] | 1253 | ; Scan disks for partitions
|
---|
[51] | 1254 | ;
|
---|
| 1255 | call PARTSCAN_ScanForPartitions
|
---|
[144] | 1256 |
|
---|
| 1257 | ;
|
---|
[51] | 1258 | ; Internal Partition Table is now populated.
|
---|
[144] | 1259 | ;
|
---|
[51] | 1260 |
|
---|
[117] | 1261 | ;!
|
---|
| 1262 | ;! DEBUG_BLOCK
|
---|
| 1263 | ;! Dump various tables.
|
---|
| 1264 | ;!
|
---|
| 1265 | IFDEF AUX_DEBUG
|
---|
| 1266 | IF 0
|
---|
[164] | 1267 | PUSHRF
|
---|
[117] | 1268 | ;~ call DEBUG_DumpIPT
|
---|
| 1269 | ;~ call DEBUG_DumpPartitionPointers
|
---|
| 1270 | ;~ call DEBUG_DumpNewPartTable
|
---|
| 1271 | ;~ call DEBUG_DumpDriveLetters
|
---|
| 1272 | ;~ call DEBUG_DumpDriveLetters
|
---|
| 1273 | ;~ call DEBUG_DumpVolumeLetters
|
---|
| 1274 | ;~ call DEBUG_DumpPartitionXref
|
---|
[164] | 1275 | POPRF
|
---|
[117] | 1276 | ENDIF
|
---|
| 1277 | ENDIF
|
---|
[49] | 1278 |
|
---|
[30] | 1279 |
|
---|
[51] | 1280 | ; -----------------------------------------------------------------------------
|
---|
| 1281 | ; RESTORE FORCED DRIVELETTER CORRELATION [LVM]
|
---|
| 1282 | ; -----------------------------------------------------------------------------
|
---|
| 1283 |
|
---|
| 1284 | ;
|
---|
| 1285 | ; Reconnect forced drive-letters to their corresponding
|
---|
| 1286 | ; partitions.
|
---|
| 1287 | ;
|
---|
[52] | 1288 | ; BOOKMARK: Update Driveletters so they are in-sync again
|
---|
[51] | 1289 | call PARTSCAN_UpdateDriveLetters
|
---|
| 1290 | ; Driveletter <-> Partition correlation is now restored.
|
---|
| 1291 |
|
---|
| 1292 |
|
---|
| 1293 |
|
---|
[117] | 1294 | ;!
|
---|
| 1295 | ;! DEBUG_BLOCK
|
---|
| 1296 | ;! Dump various tables.
|
---|
| 1297 | ;!
|
---|
| 1298 | IFDEF AUX_DEBUG
|
---|
| 1299 | IF 0
|
---|
[164] | 1300 | PUSHRF
|
---|
[117] | 1301 | ;~ call DEBUG_DumpIPT
|
---|
| 1302 | ;~ call DEBUG_DumpPartitionPointers
|
---|
| 1303 | ;~ call DEBUG_DumpNewPartTable
|
---|
| 1304 | ;~ call DEBUG_DumpDriveLetters
|
---|
| 1305 | ;~ call DEBUG_DumpDriveLetters
|
---|
| 1306 | ;~ call DEBUG_DumpVolumeLetters
|
---|
| 1307 | ;~ call DEBUG_DumpPartitionXref
|
---|
[164] | 1308 | POPRF
|
---|
[117] | 1309 | ENDIF
|
---|
| 1310 | ENDIF
|
---|
[51] | 1311 |
|
---|
| 1312 |
|
---|
| 1313 | ; -----------------------------------------------------------------------------
|
---|
| 1314 | ; SHOW WE ARE ALIVE
|
---|
| 1315 | ; -----------------------------------------------------------------------------
|
---|
| 1316 |
|
---|
| 1317 | ;
|
---|
| 1318 | ; Put some info about AiR-BOOT and the system on the screen.
|
---|
| 1319 | ;
|
---|
| 1320 |
|
---|
[49] | 1321 | ; Display number of physical disks found
|
---|
[165] | 1322 | IFNDEF AUX_DEBUG
|
---|
| 1323 | mov [TextPosY], 3
|
---|
| 1324 | ELSE
|
---|
| 1325 | mov [TextPosY], 4
|
---|
| 1326 | ENDIF
|
---|
| 1327 | mov [TextPosX], 0
|
---|
| 1328 | mov si, offset [DisksFound]
|
---|
| 1329 | call VideoIO_Print
|
---|
[37] | 1330 | mov al, [TotalHarddiscs]
|
---|
[165] | 1331 | mov [TextColorFore], 0fh
|
---|
[37] | 1332 | call VideoIO_PrintByteDynamicNumber
|
---|
[165] | 1333 | mov [TextColorFore], 07h
|
---|
[30] | 1334 |
|
---|
[49] | 1335 | ; Display number of partitions found
|
---|
[165] | 1336 | inc [TextPosY]
|
---|
| 1337 | mov [TextPosX], 0
|
---|
| 1338 | mov si, offset [PartitionsFound]
|
---|
| 1339 | call VideoIO_Print
|
---|
[37] | 1340 | mov al, [CFG_Partitions]
|
---|
| 1341 | call VideoIO_PrintByteDynamicNumber
|
---|
[30] | 1342 |
|
---|
[165] | 1343 | ; Display Phase 1 Indicator
|
---|
| 1344 | inc [TextPosY]
|
---|
| 1345 | mov [TextPosX], 0
|
---|
| 1346 | mov si, offset [Phase1]
|
---|
| 1347 | call VideoIO_Print
|
---|
| 1348 | mov si, offset [OS2_InstallVolume]
|
---|
| 1349 | mov al, [si]
|
---|
| 1350 | test al,al ; See if phase 1 is active
|
---|
| 1351 | jnz @F
|
---|
| 1352 | mov si, offset [No]
|
---|
| 1353 | @@:
|
---|
| 1354 | call VideoIO_Print
|
---|
[30] | 1355 |
|
---|
[167] | 1356 | ; Display information about the disks found
|
---|
| 1357 | call VideoIO_DisplayDiskInfo
|
---|
[30] | 1358 |
|
---|
| 1359 |
|
---|
| 1360 |
|
---|
[51] | 1361 | ; -----------------------------------------------------------------------------
|
---|
[164] | 1362 | ; OS/2 PHASE1 CHECK
|
---|
[51] | 1363 | ; -----------------------------------------------------------------------------
|
---|
| 1364 |
|
---|
| 1365 | ;
|
---|
[67] | 1366 | ; BOOKMARK: Check for OS/2 being installed
|
---|
| 1367 | ; Here we check if OS/2 is being installed.
|
---|
[51] | 1368 | ; If so, we forgo the menu and directly boot it.
|
---|
| 1369 | ;
|
---|
| 1370 |
|
---|
| 1371 | ; If the first byte of the name of the Install Volume is not 0
|
---|
[49] | 1372 | ; then we potentially have a phase1 boot.
|
---|
[67] | 1373 | test byte ptr [OS2_InstallVolume],0ffh
|
---|
[49] | 1374 | ; Nope, so continue normally.
|
---|
| 1375 | jz MBR_Main_ContinueBoot
|
---|
[36] | 1376 |
|
---|
[49] | 1377 | ; Setup phase1.
|
---|
| 1378 | ; It is still possible that a name was set for the
|
---|
| 1379 | ; Install Volume that does not exist.
|
---|
| 1380 | ; In that case CY will be clear and AL=0FFh.
|
---|
| 1381 | call PART_SetupPhase1
|
---|
| 1382 | ; Oops, Install Volume not found, continue normally.
|
---|
| 1383 | jnc MBR_Main_ContinueBoot
|
---|
[30] | 1384 |
|
---|
| 1385 |
|
---|
[51] | 1386 | ;
|
---|
[49] | 1387 | ; == Install Volume Found ==
|
---|
[51] | 1388 | ;
|
---|
[30] | 1389 |
|
---|
[51] | 1390 |
|
---|
[117] | 1391 | ;!
|
---|
| 1392 | ;! DEBUG_BLOCK
|
---|
| 1393 | ;! Dump various tables.
|
---|
| 1394 | ;!
|
---|
| 1395 | IFDEF AUX_DEBUG
|
---|
| 1396 | IF 0
|
---|
[164] | 1397 | PUSHRF
|
---|
[117] | 1398 | ;~ call DEBUG_DumpIPT
|
---|
| 1399 | ;~ call DEBUG_DumpPartitionPointers
|
---|
| 1400 | ;~ call DEBUG_DumpPartitionXref
|
---|
| 1401 | ;~ call DEBUG_DumpNewPartTable
|
---|
| 1402 | ;~ call DEBUG_DumpDriveLetters
|
---|
[164] | 1403 | POPRF
|
---|
[117] | 1404 | ENDIF
|
---|
| 1405 | ENDIF
|
---|
[51] | 1406 |
|
---|
| 1407 |
|
---|
[67] | 1408 | ; BOOKMARK: Scan for Partitions (Only if OS/2 install going on)
|
---|
[51] | 1409 | ; Because one or more partitions are possibly added, the
|
---|
| 1410 | ; PartitionXref table is not 'in sync' and could cause the
|
---|
| 1411 | ; wrong system to be automatically booted.
|
---|
| 1412 | ; So we rescan all partitions causing the PartitionXref
|
---|
| 1413 | ; table to be filled with correct values so the auto-boot
|
---|
| 1414 | ; from the new partition will work correctly.
|
---|
[49] | 1415 | call PARTSCAN_ScanForPartitions
|
---|
[30] | 1416 |
|
---|
| 1417 |
|
---|
[117] | 1418 | ;!
|
---|
| 1419 | ;! DEBUG_BLOCK
|
---|
| 1420 | ;! Dump various tables.
|
---|
| 1421 | ;!
|
---|
| 1422 | IFDEF AUX_DEBUG
|
---|
| 1423 | IF 0
|
---|
[164] | 1424 | PUSHRF
|
---|
[117] | 1425 | ;~ call DEBUG_DumpIPT
|
---|
| 1426 | ;~ call DEBUG_DumpPartitionPointers
|
---|
| 1427 | ;~ call DEBUG_DumpPartitionXref
|
---|
| 1428 | ;~ call DEBUG_DumpNewPartTable
|
---|
| 1429 | ;~ call DEBUG_DumpDriveLetters
|
---|
[164] | 1430 | POPRF
|
---|
[117] | 1431 | ENDIF
|
---|
| 1432 | ENDIF
|
---|
[30] | 1433 |
|
---|
[51] | 1434 | ; Setup automatic boot to forgo the Menu.
|
---|
| 1435 | ; PART_SetupPhase1 has filled in the other variables.
|
---|
| 1436 | mov byte ptr [CFG_AutomaticBoot],1
|
---|
[30] | 1437 |
|
---|
[51] | 1438 | ;
|
---|
| 1439 | ; At this point the AiR-BOOT configuration has been altered
|
---|
| 1440 | ; to automatically boot the newly installed system without
|
---|
| 1441 | ; displaying the menu.
|
---|
| 1442 | ; Code further down the road will take care of that.
|
---|
| 1443 | ;
|
---|
[49] | 1444 | jmp MBR_Main_ContinueBoot
|
---|
[30] | 1445 |
|
---|
| 1446 |
|
---|
[49] | 1447 |
|
---|
| 1448 |
|
---|
[51] | 1449 | ;
|
---|
| 1450 | ; Wether a new system is being installed or not,
|
---|
| 1451 | ; booting continues here.
|
---|
| 1452 | ;
|
---|
| 1453 | MBR_Main_ContinueBoot:
|
---|
[49] | 1454 |
|
---|
[51] | 1455 | ;
|
---|
| 1456 | ; Inform user how to switch between post-screen and menu
|
---|
| 1457 | ; by putting this info on the screen.
|
---|
| 1458 | ;
|
---|
[165] | 1459 | mov [TextPosY], 23
|
---|
| 1460 | mov [TextPosX], 0
|
---|
| 1461 | mov si, offset [TABMessage]
|
---|
| 1462 | call VideoIO_Print
|
---|
| 1463 | inc [TextPosY]
|
---|
[243] | 1464 | mov [TextPosX], 79 - sizeof [PREPMessage]
|
---|
[37] | 1465 | call MBR_TeletypeSyncPos
|
---|
[165] | 1466 | mov si, offset [PREPMessage]
|
---|
[37] | 1467 | call MBR_TeletypeBold
|
---|
[165] | 1468 | mov al,30
|
---|
| 1469 | call TIMER_WaitTicCount
|
---|
| 1470 | mov cl, sizeof [PREPMessage]
|
---|
| 1471 | mov al, ' '
|
---|
| 1472 | call VideoIO_PrintSingleMultiChar
|
---|
[30] | 1473 |
|
---|
[165] | 1474 | mov [TextPosX], 25
|
---|
| 1475 | mov si, offset [BootEndMsg2]
|
---|
| 1476 | add si, 39
|
---|
| 1477 | mov [TextColorFore], 08h
|
---|
| 1478 | call VideoIO_Print
|
---|
[30] | 1479 |
|
---|
[164] | 1480 |
|
---|
[51] | 1481 | ;
|
---|
| 1482 | ; Debug stop.
|
---|
| 1483 | ;
|
---|
[30] | 1484 |
|
---|
[37] | 1485 | ;
|
---|
| 1486 | ; ####################### WAIT FOR KEY ########################
|
---|
| 1487 | ;
|
---|
[30] | 1488 |
|
---|
[37] | 1489 | ; Wait for key so we can see debug log if ab-menu hangs.
|
---|
[49] | 1490 | ;~ xor ax, ax
|
---|
| 1491 | ;~ int 16h
|
---|
[37] | 1492 | ;call SOUND_Beep
|
---|
[30] | 1493 |
|
---|
| 1494 |
|
---|
[51] | 1495 | ; Copy BIOS POST to Second Page
|
---|
[37] | 1496 | mov ax, VideoIO_Page1
|
---|
[51] | 1497 | call VideoIO_BackUpTo
|
---|
[30] | 1498 |
|
---|
[37] | 1499 | ;call SOUND_Beep
|
---|
[30] | 1500 |
|
---|
| 1501 |
|
---|
[52] | 1502 | ; BOOKMARK: Save Configuration
|
---|
[37] | 1503 | ; Save configuration so phase1 boot-through is disabled
|
---|
| 1504 | ; on next boot.
|
---|
[67] | 1505 | mov byte ptr [OS2_InstallVolume], 0
|
---|
[37] | 1506 | call DriveIO_SaveConfiguration
|
---|
[31] | 1507 |
|
---|
| 1508 |
|
---|
| 1509 |
|
---|
[37] | 1510 | ;
|
---|
[51] | 1511 | ; See if setup needs to be entered.
|
---|
[37] | 1512 | ;
|
---|
| 1513 | MBR_Main_ReEnterSetup:
|
---|
| 1514 | call SETUP_CheckEnterSETUP
|
---|
[7] | 1515 |
|
---|
[51] | 1516 | ;
|
---|
| 1517 | ; Do some post processing.
|
---|
| 1518 | ;
|
---|
[52] | 1519 | ; BOOKMARK: After Crap
|
---|
[37] | 1520 | call AFTERCRAP_Main
|
---|
[30] | 1521 |
|
---|
[37] | 1522 | MBR_Main_ReEnterBootMenuPre:
|
---|
| 1523 | ; SetUp PartitionPointers for BootMenu (filter non-bootable)
|
---|
| 1524 | call PART_CalculateMenuPartPointers
|
---|
[7] | 1525 |
|
---|
[37] | 1526 | ; ...and count that one...
|
---|
[46] | 1527 | cmp byte ptr [PartitionPointerCount], 0
|
---|
[37] | 1528 | jne MBR_Main_SomethingBootAble
|
---|
| 1529 | mov si, offset TXT_NoBootAble
|
---|
| 1530 | call MBR_Teletype
|
---|
| 1531 | jmp MBR_HaltSystem
|
---|
[30] | 1532 |
|
---|
[37] | 1533 | MBR_Main_SomethingBootAble:
|
---|
| 1534 | ; FixUp Values, define Timed Setup booting, etc.
|
---|
| 1535 | call PART_FixUpDefaultPartitionValues
|
---|
[7] | 1536 |
|
---|
[30] | 1537 |
|
---|
| 1538 |
|
---|
[37] | 1539 | ; -------------------------------------------------- BOOT-MENU
|
---|
| 1540 | MBR_Main_ReEnterBootMenu:
|
---|
| 1541 | call BOOTMENU_ResetMenuVars ; reset has to be done
|
---|
[46] | 1542 | test byte ptr [CFG_AutomaticBoot], 1
|
---|
[37] | 1543 | jz MBR_Main_NoAutomaticBooting
|
---|
[49] | 1544 |
|
---|
| 1545 |
|
---|
[37] | 1546 | ; ------------------------------------------ AUTOMATIC BOOTING
|
---|
| 1547 | ; Select automatic partition, disable automatic booting for
|
---|
| 1548 | ; next time and boot system...
|
---|
[46] | 1549 | mov byte ptr [CFG_AutomaticBoot], 0
|
---|
[37] | 1550 | call PASSWORD_AskSystemPwd
|
---|
| 1551 | mov al, Menu_EntryAutomatic
|
---|
[30] | 1552 |
|
---|
[37] | 1553 | ;mov al, 2
|
---|
[30] | 1554 |
|
---|
[37] | 1555 | mov Menu_EntrySelected, al ; zero based
|
---|
| 1556 | jmp MBR_Main_NoBootMenu
|
---|
[7] | 1557 |
|
---|
[30] | 1558 |
|
---|
[49] | 1559 | MBR_Main_NoAutomaticBooting:
|
---|
| 1560 |
|
---|
[37] | 1561 | ;call SOUND_Beep
|
---|
[30] | 1562 |
|
---|
[46] | 1563 | test byte ptr [CFG_BootMenuActive], 0FFh
|
---|
[37] | 1564 | jnz MBR_Main_GotBootMenu
|
---|
| 1565 | ; ----------------------------------------------- NO BOOT-MENU
|
---|
| 1566 | ; Select default partition and boot system...
|
---|
| 1567 | call PASSWORD_AskSystemPwd
|
---|
[30] | 1568 |
|
---|
[37] | 1569 | mov al, Menu_EntryDefault
|
---|
| 1570 | ;mov al,0 ; zero based
|
---|
| 1571 | mov Menu_EntrySelected, al
|
---|
| 1572 | jmp MBR_Main_NoBootMenu
|
---|
[7] | 1573 |
|
---|
[37] | 1574 | MBR_Main_GotBootMenu:
|
---|
| 1575 | ; ------------------------------------------ BOOT-MENU VISUALS
|
---|
[51] | 1576 |
|
---|
| 1577 |
|
---|
| 1578 | IFDEF FX_ENABLED
|
---|
[37] | 1579 | call FX_StartScreen
|
---|
[51] | 1580 | ENDIF
|
---|
[30] | 1581 |
|
---|
[52] | 1582 | ; BOOKMARK: Build Main Menu
|
---|
[37] | 1583 | call BOOTMENU_BuildBackground
|
---|
| 1584 | call BOOTMENU_BuildMain
|
---|
[51] | 1585 |
|
---|
| 1586 | IFDEF FX_ENABLED
|
---|
[37] | 1587 | call FX_EndScreenRight
|
---|
[51] | 1588 | ENDIF
|
---|
| 1589 |
|
---|
[37] | 1590 | call PASSWORD_AskSystemPwd
|
---|
| 1591 | call BOOTMENU_ResetTimedBoot
|
---|
[30] | 1592 |
|
---|
[52] | 1593 | ; BOOKMARK: Display Main Menu
|
---|
[37] | 1594 | call BOOTMENU_Execute
|
---|
[30] | 1595 |
|
---|
[37] | 1596 | jc MBR_Main_ReEnterSetup
|
---|
| 1597 | call BOOTMENU_SetVarsAfterMenu
|
---|
[30] | 1598 |
|
---|
[37] | 1599 | ; ---------------------------------------------------- BOOTING
|
---|
| 1600 | MBR_Main_NoBootMenu:
|
---|
[51] | 1601 |
|
---|
| 1602 | IFDEF FX_ENABLED
|
---|
[37] | 1603 | call FX_StartScreen
|
---|
[51] | 1604 | ENDIF
|
---|
| 1605 |
|
---|
[164] | 1606 | IFDEF AUX_DEBUG
|
---|
| 1607 | IF 0
|
---|
| 1608 | DBG_TEXT_OUT_AUX 'HALTING'
|
---|
| 1609 | PUSHRF
|
---|
| 1610 | ;~ call DEBUG_DumpRegisters
|
---|
| 1611 | ;~ call AuxIO_DumpParagraph
|
---|
| 1612 | ;~ call AuxIO_TeletypeNL
|
---|
| 1613 | @@: jmp @B
|
---|
| 1614 | POPRF
|
---|
| 1615 | ENDIF
|
---|
| 1616 | ENDIF
|
---|
[52] | 1617 | ; BOOKMARK: Display bye-screen and start selected partition
|
---|
[37] | 1618 | call BOOTMENU_BuildGoodBye
|
---|
[51] | 1619 |
|
---|
| 1620 | IFDEF FX_ENABLED
|
---|
[37] | 1621 | call FX_EndScreenRight
|
---|
[51] | 1622 | ENDIF
|
---|
| 1623 |
|
---|
[37] | 1624 | call PASSWORD_AskChangeBootPwd
|
---|
[7] | 1625 |
|
---|
[37] | 1626 | call ANTIVIR_SaveBackUpMBR
|
---|
[7] | 1627 |
|
---|
[49] | 1628 | ; Preload the selected menu-entry
|
---|
[67] | 1629 | ; However, this value will be wrong if OS/2 phase1 is
|
---|
[49] | 1630 | ; active and the installation partition is newly created.
|
---|
| 1631 | ; See below for the adjustment.
|
---|
| 1632 | mov dl, byte ptr [Menu_EntrySelected]
|
---|
| 1633 |
|
---|
[51] | 1634 |
|
---|
| 1635 | ;
|
---|
| 1636 | ; Prepare to start the partition.
|
---|
| 1637 | ;
|
---|
[49] | 1638 | jmp MBR_Main_StartPartition
|
---|
| 1639 |
|
---|
| 1640 |
|
---|
| 1641 |
|
---|
[51] | 1642 | ; -----------------------------------------------------------------------------
|
---|
| 1643 | ; START PARTITION
|
---|
| 1644 | ; -----------------------------------------------------------------------------
|
---|
| 1645 |
|
---|
[49] | 1646 | MBR_Main_StartPartition:
|
---|
| 1647 |
|
---|
[117] | 1648 | IFDEF AUX_DEBUG
|
---|
| 1649 | IF 0
|
---|
[164] | 1650 | PUSHRF
|
---|
[117] | 1651 | ;~ call DEBUG_DumpIPT
|
---|
| 1652 | ;~ call DEBUG_DumpPartitionPointers
|
---|
| 1653 | ;~ call DEBUG_DumpPartitionXref
|
---|
| 1654 | ;~ call DEBUG_DumpNewPartTable
|
---|
[164] | 1655 | POPRF
|
---|
[117] | 1656 | ENDIF
|
---|
| 1657 | ENDIF
|
---|
[49] | 1658 |
|
---|
| 1659 |
|
---|
[37] | 1660 | ; -------------------------------------------- START PARTITION
|
---|
[51] | 1661 | ; THIS DOES NOT RETURN !
|
---|
[37] | 1662 | call PART_StartPartition
|
---|
[30] | 1663 |
|
---|
| 1664 |
|
---|
[31] | 1665 |
|
---|
[51] | 1666 |
|
---|
[30] | 1667 | ;
|
---|
[51] | 1668 | ; This entry-point restarts AiR-BOOT almost from scratch.
|
---|
| 1669 | ; It skips the movement of the MBR but otherwise it is a functional restart.
|
---|
| 1670 | ; The old BIOS SS:SP where the registers on entry are stored is passed along.
|
---|
[52] | 1671 | ; This entry-point is used for debugging purposes.
|
---|
[51] | 1672 | ;
|
---|
[52] | 1673 | ; BOOKMARK: AiR-BOOT Restart (used for debugging)
|
---|
[51] | 1674 | AirbootRestart:
|
---|
[79] | 1675 | mov bx, [OldSP] ; Old SP when BIOS transferred control to AB
|
---|
| 1676 | mov cx, [OldSS] ; Old SS when BIOS transferred control to AB
|
---|
| 1677 | xor dh, dh ; Head 0
|
---|
| 1678 | mov dl, [BIOS_BootDisk] ; Disk AirBoot was loaded from
|
---|
[51] | 1679 | jmp MBR_RealStart
|
---|
| 1680 |
|
---|
| 1681 |
|
---|
| 1682 | ;
|
---|
| 1683 | ; This entry-point displays a popup that the system is halted
|
---|
| 1684 | ; and then halts the system.
|
---|
| 1685 | ; It is entered on severe error conditions.
|
---|
| 1686 | ;
|
---|
[52] | 1687 | ; BOOKMARK: Halt System
|
---|
[51] | 1688 | HaltSystem:
|
---|
| 1689 | call VideoIO_ClearScreen
|
---|
| 1690 | mov ax,0ababh
|
---|
| 1691 | mov cx, 0C04h
|
---|
| 1692 | mov si, offset SystemHalted
|
---|
| 1693 | call SETUP_ShowErrorBox
|
---|
| 1694 | ; Halt the system.
|
---|
| 1695 | jmp MBR_HaltSystem
|
---|
| 1696 |
|
---|
| 1697 |
|
---|
| 1698 |
|
---|
| 1699 |
|
---|
| 1700 |
|
---|
| 1701 |
|
---|
| 1702 | ;
|
---|
[52] | 1703 | ; The following section includes various assembler modules
|
---|
| 1704 | ; at the source level. These contain functionality for a
|
---|
| 1705 | ; multitude of categories like disk-access, video-io, lvm,
|
---|
| 1706 | ; debugging, etc. Later versions of AiR-BOOT will use such
|
---|
| 1707 | ; modules at the object-file level so they can be shared
|
---|
| 1708 | ; more easily.
|
---|
[51] | 1709 | ;
|
---|
| 1710 |
|
---|
| 1711 |
|
---|
| 1712 | ; -----------------------------------------------------------------------------
|
---|
| 1713 | ; INCLUDED FILE SECTION
|
---|
| 1714 | ; -----------------------------------------------------------------------------
|
---|
| 1715 |
|
---|
[52] | 1716 | ; BOOKMARK: Include Section
|
---|
| 1717 |
|
---|
[51] | 1718 | ;
|
---|
[30] | 1719 | ; Include other code-modules here.
|
---|
| 1720 | ;
|
---|
[51] | 1721 |
|
---|
[30] | 1722 | b_std_txt:
|
---|
[60] | 1723 | include regular/std_text.asm ; Standard (non-translateable text)
|
---|
[30] | 1724 | size_std_txt = $-b_std_txt
|
---|
| 1725 |
|
---|
| 1726 | b_driveio:
|
---|
[60] | 1727 | include regular/driveio.asm ; Drive I/O, Config Load/Save
|
---|
[30] | 1728 | size_driveio = $-b_driveio
|
---|
| 1729 |
|
---|
[43] | 1730 | b_lvm:
|
---|
[60] | 1731 | include special/lvm.asm ; LVM-specific code
|
---|
[43] | 1732 | size_lvm = $-b_lvm
|
---|
| 1733 |
|
---|
[30] | 1734 | b_videoio:
|
---|
[60] | 1735 | include regular/videoio.asm ; Video I/O
|
---|
[30] | 1736 | size_videoio = $-b_videoio
|
---|
| 1737 |
|
---|
| 1738 | b_timer:
|
---|
[60] | 1739 | include regular/timer.asm ; Timer
|
---|
[30] | 1740 | size_timer = $-b_timer
|
---|
| 1741 |
|
---|
| 1742 | b_partmain:
|
---|
[60] | 1743 | include regular/partmain.asm ; Regular Partition Routines
|
---|
[30] | 1744 | size_partmain = $-b_partmain
|
---|
| 1745 |
|
---|
| 1746 | b_partscan:
|
---|
[60] | 1747 | include regular/partscan.asm ; Partition Scanning
|
---|
[30] | 1748 | size_partscan = $-b_partscan
|
---|
| 1749 |
|
---|
| 1750 | b_bootmenu:
|
---|
[60] | 1751 | include regular/bootmenu.asm ; Boot-Menu
|
---|
[30] | 1752 | size_bootmenu = $-b_bootmenu
|
---|
| 1753 |
|
---|
| 1754 | b_password:
|
---|
[60] | 1755 | include regular/password.asm ; Password related
|
---|
[30] | 1756 | size_password = $-b_password
|
---|
| 1757 |
|
---|
| 1758 | b_other:
|
---|
[60] | 1759 | include regular/other.asm ; Other Routines
|
---|
[30] | 1760 | size_other = $-b_other
|
---|
[7] | 1761 |
|
---|
[30] | 1762 | b_main:
|
---|
[60] | 1763 | include setup/main.asm ; The whole AiR-BOOT SETUP
|
---|
[30] | 1764 | size_main = $-b_main
|
---|
| 1765 |
|
---|
| 1766 | b_math:
|
---|
[60] | 1767 | include regular/math.asm ; Math functions (like 32-bit multiply)
|
---|
[30] | 1768 | size_math = $-b_math
|
---|
| 1769 |
|
---|
| 1770 | b_txtother:
|
---|
[186] | 1771 | include_from text/%BLD_LANG,other.asm ; All translateable Text-Strings
|
---|
[30] | 1772 | size_txtother = $-b_txtother
|
---|
| 1773 |
|
---|
| 1774 | b_txtmenus:
|
---|
[186] | 1775 | include_from text/%BLD_LANG,menus.asm ; All translateable Menu-text
|
---|
[30] | 1776 | size_txtmenus = $-b_txtmenus
|
---|
| 1777 |
|
---|
| 1778 | b_charset:
|
---|
[60] | 1779 | include text/charset.asm ; Special Video Charsets (if needed)
|
---|
[30] | 1780 | size_charset = $-b_charset
|
---|
| 1781 |
|
---|
[36] | 1782 | b_conv:
|
---|
[60] | 1783 | include regular/conv.asm ; Various conversion routines
|
---|
[36] | 1784 | size_conv = $-b_conv
|
---|
[30] | 1785 |
|
---|
| 1786 | b_virus:
|
---|
[60] | 1787 | include special/virus.asm ; Virus Detection / Anti-Virus
|
---|
[30] | 1788 | size_virus = $-b_virus
|
---|
[51] | 1789 |
|
---|
[30] | 1790 | b_billsuxx:
|
---|
[60] | 1791 | include special/f00k/billsuxx.asm ; Extended Partition - Microsoft-Hack
|
---|
[30] | 1792 | size_billsuxx = $-b_billsuxx
|
---|
| 1793 |
|
---|
| 1794 | b_sound:
|
---|
[60] | 1795 | include special/sound.asm ; Sound
|
---|
[30] | 1796 | size_sound = $-b_sound
|
---|
| 1797 |
|
---|
| 1798 | b_apm:
|
---|
[60] | 1799 | include special/apm.asm ; Power Managment Support
|
---|
[30] | 1800 | size_apm = $-b_apm
|
---|
| 1801 |
|
---|
[51] | 1802 |
|
---|
| 1803 |
|
---|
| 1804 | ;
|
---|
[234] | 1805 | ; Extended Charset support.
|
---|
[51] | 1806 | ;
|
---|
[234] | 1807 | IFDEF TXT_LoadCharset
|
---|
[51] | 1808 | b_ccharset:
|
---|
[234] | 1809 | include special/charset.asm ; Charset Support (RU and ES)
|
---|
[51] | 1810 | size_ccharset = $-b_ccharset
|
---|
| 1811 | ENDIF
|
---|
| 1812 |
|
---|
| 1813 | ; Various debugging routines, uses AUXIO and CONV
|
---|
| 1814 | IFDEF AUX_DEBUG
|
---|
| 1815 | b_debug:
|
---|
[60] | 1816 | include regular/debug.asm ; Debug module
|
---|
[51] | 1817 | size_debug = $-b_debug
|
---|
| 1818 | b_auxio:
|
---|
[60] | 1819 | include regular/auxio.asm ; Com-port support for debugging
|
---|
[51] | 1820 | size_auxio = $-b_auxio
|
---|
| 1821 | ENDIF
|
---|
| 1822 |
|
---|
| 1823 | ;
|
---|
| 1824 | ; We only include this if FX_ENABLED is defined.
|
---|
| 1825 | ; FX is disabled when debugging to have more room for debug-code.
|
---|
| 1826 | ; The module compiles to 50eh = 1294 bytes, so that is a lot.
|
---|
| 1827 | ;
|
---|
| 1828 | IFDEF FX_ENABLED
|
---|
[30] | 1829 | b_fx:
|
---|
[60] | 1830 | include special/fx.asm ; l33t Cooper-Bars/Scrolling <bg>
|
---|
[30] | 1831 | size_fx = $-b_fx
|
---|
[51] | 1832 | ENDIF
|
---|
[30] | 1833 |
|
---|
| 1834 |
|
---|
[51] | 1835 | ;
|
---|
| 1836 | ; End of code marker.
|
---|
| 1837 | ;
|
---|
[52] | 1838 | ; BOOKMARK: END OF CODE
|
---|
[51] | 1839 | db 'BABE'
|
---|
| 1840 | db 'FACE'
|
---|
[30] | 1841 |
|
---|
[47] | 1842 |
|
---|
[51] | 1843 | ; -----------------------------------------------------------------------------
|
---|
| 1844 | ; END OF CODE
|
---|
| 1845 | ; -----------------------------------------------------------------------------
|
---|
| 1846 | code_end:
|
---|
| 1847 |
|
---|
| 1848 |
|
---|
| 1849 |
|
---|
| 1850 |
|
---|
| 1851 |
|
---|
| 1852 |
|
---|
| 1853 |
|
---|
| 1854 |
|
---|
| 1855 |
|
---|
| 1856 |
|
---|
| 1857 | ; -----------------------------------------------------------------------------
|
---|
| 1858 | ; BLDLEVEL INFORMATION
|
---|
| 1859 | ; -----------------------------------------------------------------------------
|
---|
| 1860 |
|
---|
[52] | 1861 | ; BOOKMARK: BLDLEVEL Information
|
---|
[51] | 1862 | ORIGIN 068A0h
|
---|
| 1863 |
|
---|
| 1864 | ;
|
---|
| 1865 | ; The space between this offset and code_end is the space
|
---|
| 1866 | ; available for code.
|
---|
| 1867 | ;
|
---|
| 1868 | zzz_code_space = $ - code_end
|
---|
| 1869 |
|
---|
| 1870 |
|
---|
[46] | 1871 | bld_level:
|
---|
[43] | 1872 | ;
|
---|
[46] | 1873 | ; Here we insert the OS/2 BLDLEVEL Information.
|
---|
| 1874 | ; It is composed of the AiR-BOOT version-info and other
|
---|
[51] | 1875 | ; information. It is unique for each release of AiR-BOOT.
|
---|
[46] | 1876 | ;
|
---|
[51] | 1877 |
|
---|
| 1878 | ;
|
---|
[47] | 1879 | ; ?? When AUX_DEBUG is enabled and the above org is active,
|
---|
| 1880 | ; the BLDLEVEL gets corrupted eventhough it gets inserted here
|
---|
| 1881 | ; explicitly. The effect is almost like an 'OR' or a merge
|
---|
| 1882 | ; with the already generated FX code.
|
---|
| 1883 | ; Tasm and JWasm produce different results.
|
---|
| 1884 | ; ??
|
---|
| 1885 | ;
|
---|
[46] | 1886 | InsertBuildLevel
|
---|
| 1887 |
|
---|
[47] | 1888 |
|
---|
[30] | 1889 |
|
---|
[7] | 1890 |
|
---|
| 1891 |
|
---|
[51] | 1892 | ;==============================================================================
|
---|
| 1893 | ; Sector 53
|
---|
| 1894 | ;==============================================================================
|
---|
| 1895 |
|
---|
[45] | 1896 | ;
|
---|
[51] | 1897 | ; From here on, the layout of the image consists of:
|
---|
| 1898 | ; - AiR-BOOT Protection Image
|
---|
| 1899 | ; - AiR-BOOT Configuration
|
---|
| 1900 | ; - DriveLetters
|
---|
| 1901 | ; - Install Volume
|
---|
| 1902 | ; - Floppy/CDROM/BIOS BOOT ENTRIES
|
---|
| 1903 | ; - Internal Partition Table (IPT)
|
---|
| 1904 | ; - Hidden Partition Table (HPT)
|
---|
| 1905 | ; - MBR Backup
|
---|
[45] | 1906 | ;
|
---|
[7] | 1907 |
|
---|
[37] | 1908 | ;
|
---|
[51] | 1909 | ; After that, the BSS follows with several runtime
|
---|
| 1910 | ; variables and structures.
|
---|
| 1911 | ; The BSS is not part of the image on disk of course.
|
---|
| 1912 | ;
|
---|
| 1913 |
|
---|
| 1914 | ; -----------------------------------------------------------------------------
|
---|
| 1915 | ; PROTECTION IMAGE
|
---|
| 1916 | ; -----------------------------------------------------------------------------
|
---|
| 1917 |
|
---|
| 1918 | ;
|
---|
[52] | 1919 | ; This is the AiR-BOOT MBR Protection Image.
|
---|
[46] | 1920 | ; The stuff generated here gets overwritten when the
|
---|
[51] | 1921 | ; MBR_PROT module, which is assembled separately,
|
---|
| 1922 | ; gets binary merged.
|
---|
[37] | 1923 | ; So you won't find the string below in the generated binary.
|
---|
| 1924 | ;
|
---|
[52] | 1925 | ; BOOKMARK: AiR-BOOT MBR Protection Image
|
---|
[51] | 1926 | ORIGIN 06900h
|
---|
[46] | 1927 |
|
---|
| 1928 |
|
---|
[51] | 1929 |
|
---|
| 1930 |
|
---|
[46] | 1931 | ;
|
---|
[51] | 1932 | ; Hardcoded to 768 bytes (MBR_PROT.ASM)
|
---|
[46] | 1933 | ; The string below is searched for by the FIXCODE helper and *must* be
|
---|
[51] | 1934 | ; page (256 bytes) aligned.
|
---|
[46] | 1935 | ;
|
---|
[51] | 1936 | ; It seems to be possible to shrink the protection-image to 768 bytes.
|
---|
| 1937 | ; That gives us an additional 256 bytes of code-space.
|
---|
| 1938 | ; MBR-PROT.ASM,FIXCODE.C,PARTMAIN.ASM and AIR-BOOT.ASM need to be adjusted for that.
|
---|
| 1939 | ; Also the granularity needs to change from 512 bytes to 256 bytes since
|
---|
| 1940 | ; 6900h is not a 512-byte boundary.
|
---|
| 1941 | ;
|
---|
| 1942 | ; 20120908 - Done.
|
---|
| 1943 | ;
|
---|
[37] | 1944 | MBR_Protection db 'AiR-BOOT MBR-Protection Image'
|
---|
| 1945 |
|
---|
[43] | 1946 | ; Just fill.
|
---|
[51] | 1947 | ;~ db 1024-($-MBR_Protection) dup('M')
|
---|
| 1948 | db 768-($-MBR_Protection) dup('M')
|
---|
[37] | 1949 |
|
---|
| 1950 |
|
---|
[51] | 1951 |
|
---|
| 1952 |
|
---|
| 1953 |
|
---|
| 1954 |
|
---|
| 1955 |
|
---|
[31] | 1956 | ;==============================================================================
|
---|
[51] | 1957 | ; Sector 55
|
---|
| 1958 | ;==============================================================================
|
---|
| 1959 | ; -----------------------------------------------------------------------------
|
---|
| 1960 | ; AiR-BOOT CONFIGURATION
|
---|
| 1961 | ; -----------------------------------------------------------------------------
|
---|
[30] | 1962 |
|
---|
[37] | 1963 | ;
|
---|
| 1964 | ; This section contains the AiR-BOOT configuration.
|
---|
| 1965 | ; Note that it has a version that should be updated
|
---|
| 1966 | ; when stuff is added.
|
---|
| 1967 | ; Also add stuff to the end so that offsets of other
|
---|
| 1968 | ; variables remain vaild.
|
---|
| 1969 | ;
|
---|
[52] | 1970 | ; BOOKMARK: AiR-BOOT Configuration Sector
|
---|
[45] | 1971 | ORIGIN 06C00h
|
---|
[30] | 1972 |
|
---|
[37] | 1973 | Configuration:
|
---|
[69] | 1974 | ; This is the signature for the AiR-BOOT Configuration.
|
---|
| 1975 | ; Note that this configuration section, like the code section,
|
---|
| 1976 | ; is CRC protected. This means that poking values in these
|
---|
| 1977 | ; sections on the disk will invalidate AiR-BOOT and cause it
|
---|
| 1978 | ; to halt. This is a protection method against other software
|
---|
| 1979 | ; modifying stuff in track 0.
|
---|
| 1980 | db 'AiRCFG-TABLE',0adh
|
---|
[55] | 1981 | db 01h, 10h, 'U' ; "Compressed" ID String
|
---|
[37] | 1982 | ; Version 1.02 was for code 1.06, 1.03 was internal
|
---|
| 1983 | ; and 1.04,1.05 and 1.06 do not exist.
|
---|
[46] | 1984 | ;
|
---|
| 1985 | ; 1.07 was used with AB v1.07 and introduced the phase1
|
---|
| 1986 | ; system-name. For the rest it is compatible with v1.02.
|
---|
| 1987 | ;
|
---|
| 1988 | ; 1.0.8 is introduced with AB v1.0.8 and indicates the movement
|
---|
| 1989 | ; of several components and the packing of the hideparttable.
|
---|
| 1990 | ; The core configuration has not changed but the generated
|
---|
| 1991 | ; configuration has. The v1.0.8 installer handles upgrading.
|
---|
| 1992 | ;
|
---|
[54] | 1993 | ; It has been decided that uneven minor numbers will be
|
---|
| 1994 | ; test-versions. Therefore v1.0.8 has been bumbed to v1.1.0.
|
---|
[60] | 1995 | ;
|
---|
[37] | 1996 | ; It is not required for the config to have the
|
---|
| 1997 | ; same version as the code, so in the future
|
---|
| 1998 | ; the code version might be higher than the
|
---|
| 1999 | ; config version if there are no changes to the latter.
|
---|
[46] | 2000 | ;
|
---|
[7] | 2001 |
|
---|
[37] | 2002 | CFG_LastTimeEditLow dw 0 ; Last Time Edited Stamp (will incr every setup)
|
---|
| 2003 | CFG_LastTimeEditHi dw 0 ; second 16 bit part...
|
---|
[7] | 2004 |
|
---|
[37] | 2005 | CFG_CheckConfig dw 0 ; Check-Sum for Configuration
|
---|
[7] | 2006 |
|
---|
[37] | 2007 | CFG_Partitions db 0 ; Count of partitions in IPT
|
---|
[51] | 2008 | CFG_MiscFlags db 1 ; Miscellaneous Flags (See EQUates)
|
---|
[37] | 2009 | CFG_PartDefault db 0 ; Default-Partition (Base=0)
|
---|
[7] | 2010 |
|
---|
[37] | 2011 | CFG_PartLast db 0 ; Which Partition was booted last time ? (Base=0)
|
---|
[202] | 2012 |
|
---|
| 2013 | ; Do not enable time-out when debugging.
|
---|
| 2014 | IFDEF AUX_DEBUG
|
---|
| 2015 | CFG_TimedBoot db 0 ; Timed Boot Enable (for REAL Enable look TimedBootEnable)
|
---|
| 2016 | ELSE
|
---|
[176] | 2017 | CFG_TimedBoot db 1 ; Timed Boot Enable (for REAL Enable look TimedBootEnable)
|
---|
[202] | 2018 | ENDIF
|
---|
| 2019 |
|
---|
[37] | 2020 | CFG_TimedSecs db 15 ; Timed Boot - How Many Seconds Till Boot
|
---|
| 2021 | CFG_TimedDelay dw 123 ; Timed Boot - Delay
|
---|
| 2022 | CFG_TimedBootLast db 1 ; Timed Boot - Boot From Last Drive Booted From
|
---|
| 2023 | CFG_RememberBoot db 1 ; Remember Manual Boot Choice
|
---|
| 2024 | CFG_RememberTimed db 0 ; Remember if Timed Boot (if both disabled: Boot Default)
|
---|
| 2025 | CFG_IncludeFloppy db 1 ; Include Floppy Drives in Boot-Menu
|
---|
| 2026 | CFG_BootMenuActive db 1 ; Display Boot-Menu (if Disabled: Boot Default)
|
---|
[7] | 2027 | ; v0.29+ -> 2 - Detailed Bootmenu
|
---|
[37] | 2028 | CFG_PartitionsDetect db 1 ; Autodetect New Partitions (Auto-Add!)
|
---|
| 2029 | CFG_PasswordSetup db 0 ; Ask Password when entering Setup
|
---|
| 2030 | CFG_PasswordSystem db 0 ; Ask Password when booting System
|
---|
| 2031 | CFG_PasswordChangeBoot db 0 ; Ask Password when changing boot partition
|
---|
| 2032 | CFG_ProtectMBR db 0 ; Protect MBR via TSR ?
|
---|
| 2033 | CFG_IgnoreWriteToMBR db 0 ; Just ignore writes to MBR, otherwise crash
|
---|
| 2034 | CFG_FloppyBootGetName db 0 ; Gets floppy name for display purposes
|
---|
| 2035 | CFG_DetectVirus db 0 ; Detect Virus ?
|
---|
| 2036 | CFG_DetectStealth db 0 ; Detect Stealth-Virus ?
|
---|
| 2037 | CFG_DetectVIBR db 0 ; Detect BootRecord-Virus ?
|
---|
| 2038 | CFG_AutoEnterSetup db 0 ; Automatic Enter Setup (first install!)
|
---|
| 2039 | CFG_MasterPassword dw 0101Fh ; Encoded Password (this is just CR)
|
---|
| 2040 | dw 07A53h
|
---|
| 2041 | dw 0E797h
|
---|
| 2042 | dw 0A896h
|
---|
| 2043 | CFG_BootPassword dw 0101Fh ; Another CR... ;-)
|
---|
| 2044 | dw 07A53h
|
---|
| 2045 | dw 0E797h
|
---|
| 2046 | dw 0A896h
|
---|
| 2047 | db 0 ; Rude-Protection - Removed since v0.28b
|
---|
| 2048 | CFG_LinuxRootPartition db 0 ; Linux Root Partition (Base=0)
|
---|
| 2049 | CFG_TimedKeyHandling db 0 ; Timed Key Handling (for Timed Boot)
|
---|
| 2050 | ; 0 - Do Nothing
|
---|
| 2051 | ; 1 - Reset Time
|
---|
| 2052 | ; 2 - Stop Time
|
---|
| 2053 | CFG_MakeSound db 0 ; Should be clear ;)
|
---|
| 2054 | CFG_FloppyBootGetTimer db 0 ; Floppy Name will get updated every 2 secs
|
---|
[51] | 2055 | CFG_ResumeBIOSbootSeq db 1 ; If BIOS Boot Sequence should be resumed
|
---|
[37] | 2056 | ; 0 - Disabled
|
---|
| 2057 | ; 1 - CD-ROM
|
---|
| 2058 | ; 2 - Network
|
---|
| 2059 | ; 3 - ZIP/LS120
|
---|
| 2060 | CFG_CooperBars db 0 ; If Cooper Bars should be shown
|
---|
| 2061 | CFG_LinuxCommandLine db 75 dup (0) ; Linux Command Line
|
---|
| 2062 | CFG_LinuxKrnlPartition db 0FFh ; FAT-16 Linux Kernel Partition (Base=0)
|
---|
| 2063 | ; FFh -> Disabled
|
---|
| 2064 | CFG_LinuxDefaultKernel db 'DEFAULT', 4 dup (32), 0 ; Default Kernel Name
|
---|
| 2065 | CFG_LinuxLastKernel db 11 dup (32), 0 ; Last-Booted Kernel Name
|
---|
| 2066 | CFG_ExtPartitionMShack db 0 ; Extended Partition M$-Hack Global Enable
|
---|
| 2067 | CFG_AutomaticBoot db 0 ; Automatic Booting (only one bootup)
|
---|
| 2068 | CFG_PartAutomatic db 0 ; Partition-No for automatic booting
|
---|
| 2069 | CFG_ForceLBAUsage db 1 ; LBA-BIOS-API forced on any HDD I/O
|
---|
| 2070 | CFG_IgnoreLVM db 0 ; Ignores any LVM-Information
|
---|
[7] | 2071 |
|
---|
[30] | 2072 |
|
---|
| 2073 | ;
|
---|
| 2074 | ; THERE IS ROOM RESERVED HERE FOR MORE VARIABLES
|
---|
| 2075 | ;
|
---|
| 2076 |
|
---|
[45] | 2077 | ;
|
---|
| 2078 | ; Drive Letters.
|
---|
| 2079 | ;
|
---|
[52] | 2080 | ; BOOKMARK: Stored Drive Letters
|
---|
[45] | 2081 | ORIGIN 06CB0h
|
---|
[30] | 2082 |
|
---|
| 2083 |
|
---|
[51] | 2084 | ; -----------------------------------------------------------------------------
|
---|
| 2085 | ; DRIVE LETTERS
|
---|
| 2086 | ; -----------------------------------------------------------------------------
|
---|
| 2087 |
|
---|
[45] | 2088 | ;
|
---|
| 2089 | ; Moved here to make room for packed hiddenparttable.
|
---|
[71] | 2090 | ; This gets filled with drive-letters that are assigned using the dl-feature.
|
---|
[45] | 2091 | ;
|
---|
| 2092 | DriveLetters db LocIPT_MaxPartitions dup (0)
|
---|
| 2093 | ; Format is:
|
---|
| 2094 | ;============
|
---|
| 2095 | ; Drive-Letter : BYTE (80h-C:, 81h-D:)
|
---|
| 2096 | ; --------------------> 1 Byte * 45
|
---|
[30] | 2097 |
|
---|
[51] | 2098 |
|
---|
| 2099 |
|
---|
| 2100 | ; -----------------------------------------------------------------------------
|
---|
| 2101 | ; INSTALL VOLUME
|
---|
| 2102 | ; -----------------------------------------------------------------------------
|
---|
| 2103 |
|
---|
[45] | 2104 | ;
|
---|
[37] | 2105 | ; Allways have the name of the installation volume
|
---|
| 2106 | ; at this offset.
|
---|
| 2107 | ; So future config changes will not break auto-install.
|
---|
[45] | 2108 | ;
|
---|
[67] | 2109 | ; BOOKMARK: Name of OS/2 Installation Volume
|
---|
[45] | 2110 | ORIGIN 06D00h
|
---|
[37] | 2111 |
|
---|
[67] | 2112 | ; SET(A)BOOT stores the volume name of the OS/2 system being installed here.
|
---|
[31] | 2113 | ; It is truncated to 11 chars because AiR-BOOT currently does not support
|
---|
| 2114 | ; longer labelnames. The name is also capitalized.
|
---|
[67] | 2115 | OS2_InstallVolume db 0,'NOPHASEONE' ,0
|
---|
[30] | 2116 |
|
---|
[37] | 2117 | ;
|
---|
| 2118 | ; THERE IS ROOM RESERVED HERE FOR MORE VARIABLES
|
---|
| 2119 | ;
|
---|
| 2120 |
|
---|
[51] | 2121 |
|
---|
| 2122 | ; -----------------------------------------------------------------------------
|
---|
| 2123 | ; FLOPPY/CDROM/BIOS BOOT ENTRIES
|
---|
| 2124 | ; -----------------------------------------------------------------------------
|
---|
| 2125 |
|
---|
[37] | 2126 | ;
|
---|
| 2127 | ; 06DABh - 06C00h = 01ABh = 427 bytes.
|
---|
| 2128 | ; Entries allocated down from 06E00 boundary.
|
---|
| 2129 | ;
|
---|
[52] | 2130 | ; BOOKMARK: Floppy/CD-ROM/BIOS Boot Entries
|
---|
[46] | 2131 | ORIGIN 06DABh ; 427 Boundry
|
---|
[37] | 2132 |
|
---|
| 2133 | ; (432 - 5 = 427)
|
---|
| 2134 | AutoDrvLetter db 0
|
---|
| 2135 | AutoDrvLetterSerial dd 0
|
---|
| 2136 |
|
---|
| 2137 | ; This entry is also 34 bytes long (466 - 34 = 432)
|
---|
| 2138 | BIOScontIPTentry:
|
---|
| 2139 | db 0, 0, 0, 0, ' '
|
---|
| 2140 | db 0, 0FEh, Flags_Bootable
|
---|
| 2141 | dw 0 ; No Checksum :)
|
---|
| 2142 | db 0, 1, 0
|
---|
| 2143 | db 0, 1, 0 ; Location of Partition/Boot Record
|
---|
| 2144 | dd 0, 0
|
---|
| 2145 |
|
---|
[7] | 2146 | ; VIR variables are for the AiR-BOOT Anti Virus Code
|
---|
| 2147 | ; Most of them are backups of Interrupt Points, so we can check, if a
|
---|
| 2148 | ; stealth virus is on-line, we can intercept its call.
|
---|
| 2149 | ; Normal (non stealth) virus are trapped simply by rereading the MBR sector.
|
---|
[46] | 2150 | ; If a virus is found, we will restore MBR from Sektor 60/62 and stop the
|
---|
| 2151 | ; system from working, so the user has to press reset.
|
---|
| 2152 | ; That's saver than a Reboot.
|
---|
[7] | 2153 | ;
|
---|
| 2154 | ; If a virus is found on the partition to boot, the system will ONLY halt,
|
---|
| 2155 | ; nothing more, because we can not remove it. The user shall do it :)
|
---|
| 2156 | ; Those viruses are detected via a real nasty method...Checksum-Checking of the
|
---|
| 2157 | ; boot-record, which is to be executed. If it does not match the one in our
|
---|
| 2158 | ; internal partition table, we will stop. You may however switch this detection
|
---|
| 2159 | ; off or just reset it by switching 'VIBR Detection'.
|
---|
| 2160 |
|
---|
[37] | 2161 | ; 478 - 12 = 466 ; 466 Sub-Part
|
---|
| 2162 | CFG_VIR_INT08 dd 0 ; pointer to saved 08h entry point
|
---|
| 2163 | CFG_VIR_INT13 dd 0 ; pointer to saved 13h entry point
|
---|
| 2164 | CFG_VIR_INT1C dd 0 ; pointer to saved 1Ch entry point
|
---|
[30] | 2165 |
|
---|
[37] | 2166 | ; 478 Boundry (512-34)
|
---|
| 2167 | ; This entry is also 34 bytes long
|
---|
| 2168 | FloppyIPTentry db 0, 0, 0, 0, 'FloppyDrive'
|
---|
| 2169 | db 0, 0FFh, Flags_Bootable
|
---|
| 2170 | dw 0 ; No Checksum :)
|
---|
| 2171 | db 0, 1, 0
|
---|
| 2172 | db 0, 1, 0 ; Location of Partition/Boot Record
|
---|
| 2173 | dd 0, 0
|
---|
[30] | 2174 |
|
---|
| 2175 |
|
---|
[51] | 2176 |
|
---|
| 2177 | ; -----------------------------------------------------------------------------
|
---|
| 2178 | ; INTERNAL PARTITION TABLE (IPT)
|
---|
| 2179 | ; -----------------------------------------------------------------------------
|
---|
| 2180 |
|
---|
[45] | 2181 | ;
|
---|
| 2182 | ; AiR-BOOT Internal Partition Table (IPT)
|
---|
| 2183 | ;
|
---|
[52] | 2184 | ; BOOKMARK: Internal Partition Table
|
---|
[45] | 2185 | ORIGIN % (image_size - 0a00h - (image_size - image_size_60secs))
|
---|
[30] | 2186 |
|
---|
| 2187 |
|
---|
[45] | 2188 | ;
|
---|
| 2189 | ; Rousseau: This is the start of the AiR-BOOT IPT
|
---|
| 2190 | ;
|
---|
| 2191 | PartitionTable db (LocIPT_MaxPartitions * LocIPT_LenOfIPT) dup (0)
|
---|
| 2192 | ; no-partitions detected... :]
|
---|
[7] | 2193 | ; db 1, 0, 0, 0, 'Harddisc 1'
|
---|
| 2194 | ; db 0, 0FFh, Flags_BootAble
|
---|
| 2195 | ; dw 0 ; No Checksum :)
|
---|
| 2196 | ; db 0, 0, 1
|
---|
[46] | 2197 | ; db 0, 0, 1 ; Location of Partition/Boot Record
|
---|
[7] | 2198 | ; dd 0, 0
|
---|
| 2199 |
|
---|
[37] | 2200 | ; Format is:
|
---|
| 2201 | ;============
|
---|
| 2202 | ; SerialNumber * 4
|
---|
| 2203 | ; PartitionName * 11
|
---|
| 2204 | ; Drive * 1
|
---|
| 2205 | ; SystemID * 1 (means the partition type)
|
---|
| 2206 | ; Flags * 1
|
---|
| 2207 | ; Checksum * 2 (for virus checking)
|
---|
| 2208 | ; LocationBegin * 3 (where the partition begins)
|
---|
| 2209 | ; LocationPartTab * 3 (where the partition table is)
|
---|
| 2210 | ; AbsoluteBegin * 4 (where the partition begins, in absolute sectors)
|
---|
| 2211 | ; AbsolutePartTab * 4 (where the partition table is, in absolute sectors)
|
---|
| 2212 | ; --------------------> 34 Bytes (total maximum partition-entries = 30)
|
---|
[7] | 2213 |
|
---|
[30] | 2214 |
|
---|
[37] | 2215 |
|
---|
| 2216 | ; No need to check overlap here because this string will
|
---|
| 2217 | ; be overwritten if the maximum partition count is reached.
|
---|
| 2218 | ; So this is not a critical boundary.
|
---|
[45] | 2219 | ORG (image_size - 600h - (image_size - image_size_60secs) / 2 - 10)
|
---|
[37] | 2220 |
|
---|
| 2221 | db 'AiRBOOTPAR' ; 1K internal partition table
|
---|
[30] | 2222 |
|
---|
| 2223 |
|
---|
| 2224 |
|
---|
[51] | 2225 | ; -----------------------------------------------------------------------------
|
---|
| 2226 | ; HIDDEN PARTITION TABLE (HPT)
|
---|
| 2227 | ; -----------------------------------------------------------------------------
|
---|
[30] | 2228 |
|
---|
[45] | 2229 | ;
|
---|
| 2230 | ; Hidden Partition Table (6-bit packed as of v1.0.8)
|
---|
| 2231 | ;
|
---|
[52] | 2232 | ; BOOKMARK: Hidden Partition Table (packed)
|
---|
[45] | 2233 | ORIGIN % (image_size - 600h - (image_size - image_size_60secs) / 2)
|
---|
[30] | 2234 |
|
---|
[38] | 2235 | HidePartitionTable db (LocIPT_MaxPartitions * LocHPT_LenOfHPT) dup (0FFh)
|
---|
[37] | 2236 | ; Format is:
|
---|
| 2237 | ;============
|
---|
| 2238 | ; PartitionPtr : BYTE * 30
|
---|
[38] | 2239 | ; --------------------> 30 Bytes * 45
|
---|
[30] | 2240 |
|
---|
[37] | 2241 | ;
|
---|
[45] | 2242 | ; Driveletters were here.
|
---|
| 2243 | ; Moved down to make room for packed hideparttable.
|
---|
| 2244 | ;
|
---|
[30] | 2245 |
|
---|
[37] | 2246 |
|
---|
[45] | 2247 | ;
|
---|
| 2248 | ; End of hidden partition table.
|
---|
| 2249 | ; Check overlap here for security reasons.
|
---|
| 2250 | ;
|
---|
| 2251 | ORIGIN % (image_size - 200h - 5)
|
---|
[30] | 2252 |
|
---|
[45] | 2253 | ; 79fa - end of packed hide table
|
---|
| 2254 | db 'ABHID' ; 1K internal Hide-partition table
|
---|
[30] | 2255 |
|
---|
| 2256 |
|
---|
| 2257 |
|
---|
| 2258 |
|
---|
[51] | 2259 | ;==============================================================================
|
---|
| 2260 | ; Sector 62
|
---|
| 2261 | ;==============================================================================
|
---|
| 2262 | ; -----------------------------------------------------------------------------
|
---|
| 2263 | ; MBR BACKUP
|
---|
| 2264 | ; -----------------------------------------------------------------------------
|
---|
[37] | 2265 |
|
---|
[45] | 2266 | ;
|
---|
| 2267 | ; AiR-BOOT MBR Backup.
|
---|
| 2268 | ;
|
---|
[52] | 2269 | ; BOOKMARK: MBR Backup
|
---|
[45] | 2270 | ORIGIN % (image_size - 200h)
|
---|
[37] | 2271 |
|
---|
[31] | 2272 |
|
---|
[46] | 2273 | MBR_BackUpMBR db 'AiR-BOOT MBR-BackUp',\
|
---|
| 2274 | ' - Just to fill this sector with something',0
|
---|
[37] | 2275 | AirBootRocks db 'AiR-BOOT Rocks!',0
|
---|
[7] | 2276 |
|
---|
[45] | 2277 | db (512 - ($-MBR_BackUpMBR) - 2) dup('M')
|
---|
[36] | 2278 |
|
---|
[45] | 2279 | ; End of Image signature.
|
---|
| 2280 | ;
|
---|
| 2281 | ORIGIN % (image_size - 2)
|
---|
| 2282 | dw 0BABEh
|
---|
[30] | 2283 |
|
---|
| 2284 |
|
---|
[45] | 2285 | ;
|
---|
| 2286 | ; End of Image.
|
---|
| 2287 | ;
|
---|
| 2288 | ORIGIN % (image_size)
|
---|
[97] | 2289 | image_end:
|
---|
[30] | 2290 |
|
---|
| 2291 | ;
|
---|
[51] | 2292 | ; Terminate LDRIMAGE segment.
|
---|
[30] | 2293 | ;
|
---|
[51] | 2294 | IFDEF SEGMENTED
|
---|
[43] | 2295 | LDRIMAGE ENDS
|
---|
[51] | 2296 | ENDIF
|
---|
[30] | 2297 |
|
---|
[37] | 2298 |
|
---|
[51] | 2299 |
|
---|
| 2300 |
|
---|
| 2301 |
|
---|
| 2302 |
|
---|
| 2303 |
|
---|
| 2304 | ;##############################################################################
|
---|
| 2305 | ; BSS SEGMENT
|
---|
| 2306 | ;##############################################################################
|
---|
| 2307 |
|
---|
[52] | 2308 | ; BOOKMARK: BSS Segment
|
---|
[51] | 2309 |
|
---|
[30] | 2310 | ;
|
---|
[51] | 2311 | ; Open BSS segment.
|
---|
[30] | 2312 | ;
|
---|
[51] | 2313 | IFDEF SEGMENTED
|
---|
[37] | 2314 | VOLATILE SEGMENT USE16 PUBLIC 'BSS'
|
---|
| 2315 | ENDIF
|
---|
| 2316 |
|
---|
[46] | 2317 |
|
---|
| 2318 |
|
---|
[30] | 2319 | sobss:
|
---|
[112] | 2320 | sobss_abs = offset sobss + image_size
|
---|
[31] | 2321 | ;------------------------------------------------------------------------------
|
---|
[46] | 2322 |
|
---|
| 2323 |
|
---|
[112] | 2324 | ;
|
---|
| 2325 | ; This is the actual start of the BSS.
|
---|
| 2326 | ; In the past however, we have had a code-loop that went out of bounds,
|
---|
| 2327 | ; overwriting the start of the BSS.
|
---|
| 2328 | ;
|
---|
| 2329 | ; Because important runtime data is stored in the BSS, we offset it
|
---|
| 2330 | ; by 400h bytes. Since the loader-image is always 62 sectors, which
|
---|
| 2331 | ; makes it 7c00h in size, the runtime data starts at 8000h.
|
---|
| 2332 | ; This is the 'BeginOfVariables' location.
|
---|
| 2333 | ;
|
---|
[37] | 2334 |
|
---|
[112] | 2335 |
|
---|
[46] | 2336 | ;
|
---|
| 2337 | ; If segmented, offsets are relative to the BSS segment.
|
---|
| 2338 | ; They are resolved at link-time.
|
---|
| 2339 | ; If not segmented, offsets are relative to the CODE segment.
|
---|
| 2340 | ;
|
---|
| 2341 | IFDEF SEGMENTED
|
---|
[112] | 2342 | ORG 00400h ; 7c00h + 400h = 8000h
|
---|
[46] | 2343 | ELSE
|
---|
[112] | 2344 | ORG 08000h ; 8000h
|
---|
[46] | 2345 | ENDIF
|
---|
| 2346 |
|
---|
| 2347 |
|
---|
[51] | 2348 | ; -----------------------------------------------------------------------------
|
---|
| 2349 | ; START OF BSS DATA
|
---|
| 2350 | ; -----------------------------------------------------------------------------
|
---|
[7] | 2351 | ; This space actually gets initialized in PreCrap to NUL (till EndOfVariables)
|
---|
| 2352 | BeginOfVariables:
|
---|
[112] | 2353 | BeginOfVariablesAbs = offset BeginOfVariables + image_size
|
---|
[51] | 2354 |
|
---|
| 2355 |
|
---|
| 2356 | ; -----------------------------------------------------------------------------
|
---|
| 2357 | ; SECTOR BUFFERS
|
---|
| 2358 | ; -----------------------------------------------------------------------------
|
---|
[52] | 2359 | ; BOOKMARK: Sector Buffers
|
---|
[46] | 2360 | PartitionSector db 512 dup (?) ; Temporary Sector for Partition
|
---|
[51] | 2361 | PBRSector db 512 dup (?) ; Temporary Sector for JFS/HPFS writeback
|
---|
[46] | 2362 | LVMSector db 512 dup (?) ; Temporary Sector for LVM
|
---|
| 2363 | TmpSector db 512 dup (?) ; Temporary Sector
|
---|
[82] | 2364 | Scratch db 512 dup (?) ; Scratch buffer
|
---|
[112] | 2365 | ALIGN 16
|
---|
[30] | 2366 |
|
---|
[112] | 2367 |
|
---|
[51] | 2368 | ; -----------------------------------------------------------------------------
|
---|
| 2369 | ; NEW PARTITION TABLE
|
---|
| 2370 | ; -----------------------------------------------------------------------------
|
---|
[7] | 2371 | ; Everything used to build a new IPT and reference it to the old one
|
---|
[52] | 2372 | ; BOOKMARK: New Partition Table
|
---|
[46] | 2373 | NewPartTable db 1536 dup (?) ; New Partition Table
|
---|
[112] | 2374 | ALIGN 16
|
---|
[43] | 2375 |
|
---|
[51] | 2376 |
|
---|
| 2377 | ; -----------------------------------------------------------------------------
|
---|
| 2378 | ; NEW HIDE PARTITION TABLE
|
---|
| 2379 | ; -----------------------------------------------------------------------------
|
---|
[52] | 2380 | ; BOOKMARK: New Hide-Partition Table
|
---|
[51] | 2381 | NewHidePartTable db LocIPT_MaxPartitions * LocHPT_LenOfHPT dup (?)
|
---|
[112] | 2382 | ALIGN 16
|
---|
[7] | 2383 |
|
---|
[51] | 2384 |
|
---|
| 2385 | ; -----------------------------------------------------------------------------
|
---|
| 2386 | ; NEW DRIVE LETTERS
|
---|
| 2387 | ; -----------------------------------------------------------------------------
|
---|
[52] | 2388 | ; BOOKMARK: Logical Drive-Letters
|
---|
[51] | 2389 | NewDriveLetters db LocIPT_MaxPartitions dup (?)
|
---|
[112] | 2390 | ALIGN 16
|
---|
[7] | 2391 |
|
---|
[51] | 2392 |
|
---|
| 2393 | ; -----------------------------------------------------------------------------
|
---|
| 2394 | ; PARTITION SIZE TABLE
|
---|
| 2395 | ; -----------------------------------------------------------------------------
|
---|
[46] | 2396 | ; Size-Table (6 bytes per partition)
|
---|
[52] | 2397 | ; BOOKMARK: Partition Size Table
|
---|
[51] | 2398 | PartitionSizeTable db LocIPT_MaxPartitions * 6 dup (?)
|
---|
[112] | 2399 | ALIGN 16
|
---|
[46] | 2400 |
|
---|
[51] | 2401 |
|
---|
| 2402 | ; -----------------------------------------------------------------------------
|
---|
| 2403 | ; PARTITION POINTERS
|
---|
| 2404 | ; -----------------------------------------------------------------------------
|
---|
[49] | 2405 | ; Maximum is 52 word entries till now
|
---|
[52] | 2406 | ; BOOKMARK: Partition Pointers
|
---|
[46] | 2407 | PartitionPointers dw 52 dup (?)
|
---|
[112] | 2408 | ALIGN 16
|
---|
[46] | 2409 |
|
---|
| 2410 | ; Count of total Partition Pointers
|
---|
| 2411 | PartitionPointerCount db ?
|
---|
[112] | 2412 | ALIGN 16
|
---|
[46] | 2413 |
|
---|
[112] | 2414 |
|
---|
[51] | 2415 | ; -----------------------------------------------------------------------------
|
---|
| 2416 | ; XREF TABLE
|
---|
| 2417 | ; -----------------------------------------------------------------------------
|
---|
[46] | 2418 | ; X-Reference Table (holds new partnr, index is old part nr)
|
---|
[52] | 2419 | ; BOOKMARK: Xref Table
|
---|
[51] | 2420 | PartitionXref db LocIPT_MaxPartitions dup (?)
|
---|
[112] | 2421 | ALIGN 16
|
---|
[46] | 2422 |
|
---|
[112] | 2423 |
|
---|
[51] | 2424 | ; -----------------------------------------------------------------------------
|
---|
| 2425 | ; VOLUME LETTERS
|
---|
| 2426 | ; -----------------------------------------------------------------------------
|
---|
[46] | 2427 | ; Volume-Letters
|
---|
| 2428 | ; 0 - no LVM support
|
---|
| 2429 | ; 1 - LVM support, but no letter
|
---|
| 2430 | ; 'C'-'Z' - assigned drive letter
|
---|
[52] | 2431 | ; BOOKMARK: Volume Drive Letters
|
---|
[51] | 2432 | PartitionVolumeLetters db LocIPT_MaxPartitions dup (?)
|
---|
[112] | 2433 | ALIGN 16
|
---|
[46] | 2434 |
|
---|
| 2435 |
|
---|
[51] | 2436 | ; -----------------------------------------------------------------------------
|
---|
| 2437 | ; MISC VARS AND FLAGS
|
---|
| 2438 | ; -----------------------------------------------------------------------------
|
---|
[52] | 2439 | ; BOOKMARK: Misc Vars and Flags
|
---|
[46] | 2440 | TotalHarddiscs db ? ; Total harddrives (by POST)
|
---|
| 2441 | LBASwitchTable db 128 dup (?) ; Bit 25-18 for CHS/LBA Switching
|
---|
| 2442 | NewPartitions db ? ; Freshly found partitions
|
---|
[37] | 2443 | ; Independent of SaveConfiguration
|
---|
[46] | 2444 | TooManyPartitions db ? ; Non-zero if too many partitions found
|
---|
[7] | 2445 |
|
---|
[46] | 2446 | VideoIO_Segment dw ? ; Segment for Video I/O
|
---|
[7] | 2447 |
|
---|
[46] | 2448 | ExtendedAbsPos dd ? ; Extended Partition Absolute Position
|
---|
| 2449 | ExtendedAbsPosSet db ? ; If Absolute Position set
|
---|
[7] | 2450 |
|
---|
[46] | 2451 | CurPartition_Location dw 4 dup (?) ; Where did current partition come from?
|
---|
| 2452 | CurIO_UseExtension db ? ; 1-Use INT 13h EXTENSIONS
|
---|
| 2453 | ; (filled out by PreCrap)
|
---|
| 2454 | CurIO_Scanning db ? ; 1-AiR-BOOT is scanning partitions
|
---|
[37] | 2455 | ; (for detailed error message)
|
---|
[112] | 2456 | ALIGN 16
|
---|
[7] | 2457 |
|
---|
| 2458 |
|
---|
[51] | 2459 | ; -----------------------------------------------------------------------------
|
---|
| 2460 | ; MENU RELATED VARS
|
---|
| 2461 | ; -----------------------------------------------------------------------------
|
---|
[46] | 2462 | Menu_EntrySelected db ? ; Which partition we boot this time...
|
---|
| 2463 | Menu_UpperPart db ? ; Which number (Base=0) is the partition upper pos
|
---|
| 2464 | Menu_AbsoluteX db ? ; Pos where Menu stuff starts
|
---|
| 2465 | Menu_TotalParts db ? ; Copy of CFG_BootParts
|
---|
| 2466 | Menu_TotalLines db ? ; Total Lines on Screen used for BootMenu
|
---|
| 2467 | Menu_EntryDefault db ? ; Default Entry in filtered View
|
---|
| 2468 | Menu_EntryLast db ? ; LastBooted Entry in filtered View
|
---|
| 2469 | Menu_EntryAutomatic db ? ; Automatic Entry in filtered View
|
---|
[7] | 2470 | ; - All adjusted to menu locations
|
---|
[112] | 2471 | ALIGN 16
|
---|
[7] | 2472 |
|
---|
[112] | 2473 |
|
---|
[51] | 2474 | ; -----------------------------------------------------------------------------
|
---|
| 2475 | ; PARTITION RELATED VARS
|
---|
| 2476 | ; -----------------------------------------------------------------------------
|
---|
[46] | 2477 | PartSetup_UpperPart db ? ; Partition-Setup (like Menu_UpperPart)
|
---|
| 2478 | PartSetup_ActivePart db ? ; Active Partition
|
---|
| 2479 | PartSetup_HiddenUpper db ? ; (like Menu_UpperPart)
|
---|
| 2480 | PartSetup_HiddenX db ? ; Pos for Hidden-Setup
|
---|
| 2481 | PartSetup_HiddenAdd db ? ; Adjust for Hidden-Setup
|
---|
[112] | 2482 | ALIGN 16
|
---|
[7] | 2483 |
|
---|
[112] | 2484 |
|
---|
[51] | 2485 | ; -----------------------------------------------------------------------------
|
---|
| 2486 | ; TIMER / SETUP RELATED VARS
|
---|
| 2487 | ; -----------------------------------------------------------------------------
|
---|
[46] | 2488 | TimedBootEnable db ? ; Local Enable/Disable for timed boot
|
---|
| 2489 | TimedTimeOut dd ? ; TimeOut Timer for TimedBoot (too much time here;)
|
---|
| 2490 | TimedSecondLeft db ? ; How many seconds are left till boom ?
|
---|
| 2491 | TimedSecondBack db ? ; To get a modification noticed
|
---|
| 2492 | TimedBootUsed db ? ; Timed Boot used for bootup ?
|
---|
| 2493 | FloppyGetNameTimer dd ? ; Timer for Floppy-Get-Name
|
---|
| 2494 | SETUP_KeysOnEntry db ? ; which Shift Status was there, when booting ?
|
---|
| 2495 | SETUP_ExitEvent db ? ; Exit Event to end SETUP
|
---|
| 2496 | TempPasswordEntry db 17 dup (?)
|
---|
| 2497 | SETUP_OldPwd db 17 dup (?)
|
---|
| 2498 | SETUP_NewPwd db 17 dup (?)
|
---|
| 2499 | SETUP_VerifyPwd db 17 dup (?)
|
---|
| 2500 | StartSoundPlayed db ?
|
---|
| 2501 | ChangePartNameSave db ? ; Save label after user-edit ?
|
---|
| 2502 | SyncLvmLabels db ? ; Sync LVM labels after user-edit ?
|
---|
[112] | 2503 | ALIGN 16
|
---|
[7] | 2504 |
|
---|
[51] | 2505 |
|
---|
| 2506 | ; -----------------------------------------------------------------------------
|
---|
| 2507 | ; FX RELATED VARS
|
---|
| 2508 | ; -----------------------------------------------------------------------------
|
---|
[37] | 2509 | FX_UseCount dw ?
|
---|
| 2510 | FX_OverallTimer dw ?
|
---|
| 2511 | FX_WideScrollerTimer dw ?
|
---|
| 2512 | FX_WideScrollerCurPos dw ?
|
---|
| 2513 | FX_WideScrollerSpeed db ?
|
---|
| 2514 | FX_WideScrollerSpeedState db ?
|
---|
| 2515 | FX_WideScrollerDirection db ?
|
---|
| 2516 | FX_WideScrollerAbsDirection db ?
|
---|
| 2517 | FX_WideScrollerBounceSpeed db ?
|
---|
| 2518 | FX_CooperBarsTimer dw ?
|
---|
[112] | 2519 | ALIGN 16
|
---|
[7] | 2520 |
|
---|
[51] | 2521 | ; Dynamically Generated Tables - do not need to get initialized with NUL
|
---|
| 2522 | FX_CooperColors db 672 dup (?) ; 7 cooper bars*96 - runtime calculated
|
---|
| 2523 | FX_CooperState db 7 dup (?)
|
---|
| 2524 | FX_SinusPos db 7 dup (?)
|
---|
| 2525 | FX_CooperPos dw 7 dup (?)
|
---|
[112] | 2526 | ALIGN 16
|
---|
[51] | 2527 |
|
---|
| 2528 |
|
---|
| 2529 | ; -----------------------------------------------------------------------------
|
---|
| 2530 | ; CHARSET BUFFER
|
---|
| 2531 | ; -----------------------------------------------------------------------------
|
---|
| 2532 | CharsetTempBuffer db 4096 dup (?) ; Uninitialized Charset buffer
|
---|
[112] | 2533 | ALIGN 16
|
---|
[51] | 2534 |
|
---|
[112] | 2535 |
|
---|
[51] | 2536 | ; -----------------------------------------------------------------------------
|
---|
| 2537 | ; LVM CRC TABLE
|
---|
| 2538 | ; -----------------------------------------------------------------------------
|
---|
| 2539 | LVM_CRCTable dd 256 dup (?) ; LVM-CRC (->SPECiAL\LVM.asm)
|
---|
[112] | 2540 | ALIGN 16
|
---|
[51] | 2541 |
|
---|
[7] | 2542 |
|
---|
[51] | 2543 | ; -----------------------------------------------------------------------------
|
---|
[138] | 2544 | ; LVM DRIVE-LETTER MAP
|
---|
[51] | 2545 | ; -----------------------------------------------------------------------------
|
---|
[138] | 2546 | ; Get's initialized at startup to: 00000011111111111111111111111100b
|
---|
| 2547 | ; Meaning A,B not free; C-Z free, rest unused. (right to left)
|
---|
| 2548 | ; Each partition with an assigned drive-letter clears a bit in this map.
|
---|
| 2549 | FreeDriveletterMap dd ?
|
---|
[112] | 2550 | ALIGN 16
|
---|
[30] | 2551 |
|
---|
[51] | 2552 |
|
---|
| 2553 | ; -----------------------------------------------------------------------------
|
---|
[138] | 2554 | ; OS/2 PHASE1 RELATED
|
---|
[51] | 2555 | ; -----------------------------------------------------------------------------
|
---|
[138] | 2556 | Phase1Active db ?
|
---|
| 2557 | OldPartitionCount db ?
|
---|
[112] | 2558 | ALIGN 16
|
---|
[30] | 2559 |
|
---|
| 2560 |
|
---|
[138] | 2561 | ; -----------------------------------------------------------------------------
|
---|
| 2562 | ; ARRAY OF DISK INFORMATION STRUCTURES
|
---|
| 2563 | ; -----------------------------------------------------------------------------
|
---|
[128] | 2564 | ; Array of DISKINFO structures
|
---|
| 2565 | DiskInformation db MaxDisks dup(DISKINFO_Size dup(?))
|
---|
| 2566 | ALIGN 16
|
---|
[51] | 2567 |
|
---|
[138] | 2568 |
|
---|
[51] | 2569 | ; -----------------------------------------------------------------------------
|
---|
[105] | 2570 | ; INT13X DAP
|
---|
[51] | 2571 | ; -----------------------------------------------------------------------------
|
---|
[105] | 2572 | ; Disk Address Package that holds information for LBA-access using INT13X
|
---|
| 2573 | INT13X_DAP db ? ; Size of paket, inserted by code
|
---|
| 2574 | db ? ; Reserved
|
---|
| 2575 | INT13X_DAP_NumBlocks dw ? ; Number of blocks
|
---|
| 2576 | INT13X_DAP_Transfer dd ? ; Transfer Adress
|
---|
| 2577 | INT13X_DAP_Absolute dd ? ; Absolute Sector
|
---|
| 2578 | dd ? ; Second Part of QWORD
|
---|
| 2579 | INT13X_DAP_Size = $-offset [INT13X_DAP] ; Calculated size
|
---|
[112] | 2580 | ALIGN 16
|
---|
[105] | 2581 |
|
---|
[30] | 2582 |
|
---|
[138] | 2583 | ; -----------------------------------------------------------------------------
|
---|
| 2584 | ; DEBUG
|
---|
| 2585 | ; -----------------------------------------------------------------------------
|
---|
| 2586 | ; Some debug area.
|
---|
| 2587 | dbg_scratch db 512 dup(?)
|
---|
| 2588 | ALIGN 16
|
---|
[30] | 2589 |
|
---|
[46] | 2590 |
|
---|
[51] | 2591 | ; End of transient variables.
|
---|
| 2592 | EndOfVariables:
|
---|
[112] | 2593 | EndOfVariablesAbs = offset EndOfVariables + image_size
|
---|
[51] | 2594 |
|
---|
| 2595 |
|
---|
| 2596 |
|
---|
| 2597 | ; -----------------------------------------------------------------------------
|
---|
| 2598 | ; OLD AND NEW STACKS
|
---|
| 2599 | ; -----------------------------------------------------------------------------
|
---|
[52] | 2600 | ; BOOKMARK: Storage for Old and New Stack Pointers
|
---|
[51] | 2601 | ;
|
---|
| 2602 | ; These need to be outside the variable section because AiR-BOOT can restart
|
---|
| 2603 | ; itself in debug-mode. If the OldSP and OldSS would be in the variable area,
|
---|
| 2604 | ; they would be cleared on AiR-BOOT restart.
|
---|
| 2605 | ;
|
---|
| 2606 |
|
---|
| 2607 | ; The variable section is cleared word-wise, so it could clear one byte extra
|
---|
| 2608 | ; depending on the alignment and size. This DD prevents the OldSP and OldSS
|
---|
| 2609 | ; to be partly overwritten by the clearing routine.
|
---|
| 2610 | dd ?
|
---|
[112] | 2611 | ALIGN 16
|
---|
[51] | 2612 |
|
---|
| 2613 | ; SS:SP from before our relocation.
|
---|
| 2614 | ; The registers values when the BIOS transferred control to us were pushed
|
---|
| 2615 | ; on this stack.
|
---|
| 2616 |
|
---|
| 2617 | OldSP dw ?
|
---|
| 2618 | OldSS dw ?
|
---|
| 2619 |
|
---|
| 2620 | ; SS:SP currently in use.
|
---|
| 2621 | ; They are temporarily dumped here so we can pop the resgisters from
|
---|
| 2622 | ; the old stack to display them in debug mode.
|
---|
| 2623 | CurrentSP dw ?
|
---|
| 2624 | CurrentSS dw ?
|
---|
[112] | 2625 | ALIGN 16
|
---|
[132] | 2626 |
|
---|
| 2627 | ; Usually, commits are buildable and some minor checking has been done that
|
---|
| 2628 | ; whole disks do not get wiped. However, there are situations where stuff is
|
---|
| 2629 | ; in such a flux that it would be better to do non-buildable commits.
|
---|
| 2630 | ; That makes it possible to record the changes piecemeal without the danger of
|
---|
| 2631 | ; accidently using the resulting loader. Of course everyone is clever enough
|
---|
| 2632 | ; to _never_ build commits marked as 'testing' and install the result in
|
---|
| 2633 | ; environments where wiping all attached disks and sticks would be a problem...
|
---|
[172] | 2634 | ;~ force_build_error dd 0f000h dup(?)
|
---|
[132] | 2635 |
|
---|
[51] | 2636 | ;
|
---|
| 2637 | ; End of BSS segment.
|
---|
| 2638 | ;
|
---|
[30] | 2639 | eobss:
|
---|
[112] | 2640 | eobss_abs = offset eobss + image_size
|
---|
[51] | 2641 | ;
|
---|
[97] | 2642 | ; Total RAM occupied, including BSS.
|
---|
| 2643 | ; BASE is 8000:0000, LIMIT is 8000:FFFF.
|
---|
| 2644 | ; Note that the LDRIMAGE is of constant size, 7C00h = 62 sectors of 512 bytes.
|
---|
| 2645 | ;
|
---|
[112] | 2646 | resident_size = offset eobss + image_size
|
---|
[97] | 2647 |
|
---|
| 2648 | ;
|
---|
[51] | 2649 | ; Close BSS segment.
|
---|
| 2650 | ;
|
---|
[37] | 2651 | IFDEF SEGMENTED
|
---|
[46] | 2652 | VOLATILE ENDS
|
---|
[37] | 2653 | ELSE
|
---|
[46] | 2654 | LDRIMAGE ENDS
|
---|
[37] | 2655 | ENDIF
|
---|
[43] | 2656 |
|
---|
[52] | 2657 | ; BOOKMARK: End of Module
|
---|
[45] | 2658 | END AiR_BOOT
|
---|
[30] | 2659 |
|
---|