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