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