| [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 |
|
|---|
| [31] | 21 | ;------------------------------------------------------------------------------
|
|---|
| 22 | ; AiR-BOOT / MAIN-CODE
|
|---|
| 23 | ;------------------------------------------------------------------------------
|
|---|
| [30] | 24 | ;
|
|---|
| [7] | 25 |
|
|---|
| [30] | 26 |
|
|---|
| [36] | 27 | ; -------------------------
|
|---|
| 28 | ; Rousseau: JUMPS disabled
|
|---|
| 29 | ; -------------------------
|
|---|
| [30] | 30 | ; We actually don't want to use this directive because it generates extra
|
|---|
| 31 | ; NOP instructions that we can do without.
|
|---|
| 32 | ; Relative conditional jumps that are out-of-range are manually reworked by
|
|---|
| 33 | ; skipping an unconditional jump to the target on base of complementary
|
|---|
| 34 | ; condition logic and temporary labels.
|
|---|
| [31] | 35 | ; TASM also has a bug in that when the .ERR2 directive is used when
|
|---|
| 36 | ; the .386 directive is in effect, the JUMPS directive is also active
|
|---|
| 37 | ; and cannot be turned off.
|
|---|
| [30] | 38 | ; NOJUMPS seems to have no effect in this situation.
|
|---|
| 39 | ; In this case 4 NOP instructions are generated after forward referencing jump
|
|---|
| 40 | ; instructions, to allow for automatic recoding by TASM.
|
|---|
| 41 | ; This seems to be a TASM bug. (v2,v3,v4, dunno v5)
|
|---|
| [43] | 42 | IFDEF TASM
|
|---|
| 43 | ;~ JUMPS
|
|---|
| 44 | ENDIF
|
|---|
| [30] | 45 |
|
|---|
| 46 | ;
|
|---|
| 47 | ; If defined then each module is prefixed with it's name.
|
|---|
| 48 | ; This is used for debugging purposes.
|
|---|
| 49 | ; It should be off in release code.
|
|---|
| 50 | ;
|
|---|
| [37] | 51 | ;ModuleNames equ 1
|
|---|
| [30] | 52 |
|
|---|
| 53 |
|
|---|
| 54 | ;
|
|---|
| 55 | ; The first harddisk is BIOS coded 80h.
|
|---|
| 56 | ; This makes a total of 128 disk could be supported using this coding.
|
|---|
| 57 | ; This value is used to store disk-information and this info is allocated
|
|---|
| 58 | ; in the BSS.
|
|---|
| 59 | ;
|
|---|
| [37] | 60 | MaxDisks equ 64
|
|---|
| [30] | 61 |
|
|---|
| [43] | 62 | ; Only when assembled with JWasm because Tasm generates too large code.
|
|---|
| 63 | IFDEF JWASM
|
|---|
| 64 | ; If defined then include DEBUG.ASM and output debug-info to serial-port.
|
|---|
| 65 | AUX_DEBUG EQU
|
|---|
| 66 | ELSE
|
|---|
| 67 | ;~ AUX_DEBUG EQU
|
|---|
| 68 | ENDIF
|
|---|
| [30] | 69 |
|
|---|
| 70 |
|
|---|
| [31] | 71 | ;
|
|---|
| 72 | ; bits 7-5 = datarate
|
|---|
| 73 | ; (000=110,001=150,010=300,011=600,100=1200,101=2400,110=4800,111=9600 bps)
|
|---|
| 74 | ; bits 4-3 = parity
|
|---|
| 75 | ; (00 or 10 = none, 01 = odd, 11 = even)
|
|---|
| 76 | ; bit 2 = stop-bits
|
|---|
| 77 | ; (set = 2 stop-bits, clear = 1 stop-bit)
|
|---|
| 78 | ; bits 1-0 = data-bits
|
|---|
| 79 | ; (00 = 5, 01 = 6, 10 = 7, 11 = 8)
|
|---|
| 80 | ;
|
|---|
| [30] | 81 |
|
|---|
| [31] | 82 | ; 9600 bps, no parity, 1 stop-bit, 8 bits per char
|
|---|
| [43] | 83 | AUX_INIT_PARMS EQU 11100011b
|
|---|
| [31] | 84 |
|
|---|
| [43] | 85 | ; Com-port for debugging, 0 is disabled
|
|---|
| 86 | BIOS_COM_PORT EQU 1
|
|---|
| 87 |
|
|---|
| [31] | 88 | ; Default word value for BIOS_AuxParms variable
|
|---|
| 89 | ; Note that is has moved since v1.07
|
|---|
| [43] | 90 | BIOS_AUXPARMS_DEFAULT EQU (AUX_INIT_PARMS SHL 8) OR BIOS_COM_PORT
|
|---|
| [31] | 91 |
|
|---|
| [43] | 92 |
|
|---|
| 93 |
|
|---|
| 94 |
|
|---|
| [30] | 95 | ;
|
|---|
| [7] | 96 | ; If ReleaseCode is not defined, it will produce debug-able code...
|
|---|
| [30] | 97 | ;
|
|---|
| [37] | 98 | ReleaseCode equ -1
|
|---|
| [7] | 99 |
|
|---|
| [31] | 100 |
|
|---|
| [30] | 101 | ;
|
|---|
| [37] | 102 | ; All Special Equ's for this project
|
|---|
| [30] | 103 | ;
|
|---|
| [7] | 104 |
|
|---|
| [31] | 105 | ; Use different addresses depending on whether in pre-boot
|
|---|
| [37] | 106 | ; or debug (dos) environment.
|
|---|
| [7] | 107 | IFDEF ReleaseCode
|
|---|
| [37] | 108 | StartBaseSeg equ 00000h ; Pre-boot, we are in low memory
|
|---|
| 109 | StartBasePtr equ 07C00h ; BIOS starts our MBR at 0:7C00
|
|---|
| 110 | ELSE
|
|---|
| 111 | ; Rousseau: where does this value come from ?
|
|---|
| 112 | ; Should be CS.
|
|---|
| 113 | ; Rectified in actual code by ignoring this value.
|
|---|
| 114 | StartBaseSeg equ 03A98h ; Adjust to DOS segment
|
|---|
| 115 | StartBasePtr equ 00100h ; We are a .COM file, DOS is active
|
|---|
| [7] | 116 | ENDIF
|
|---|
| 117 |
|
|---|
| [30] | 118 | ; Address labels after code-move
|
|---|
| [31] | 119 | BootBaseSeg equ 08000h ; Pre-boot, in the low 640K
|
|---|
| [30] | 120 | BootBasePtr equ 0h ; We put our MBR to this location
|
|---|
| [31] | 121 | BootBaseExec equ BootBasePtr+offset MBR_RealStart
|
|---|
| 122 | StackSeg equ 07000h ; Put the stack below the code
|
|---|
| [30] | 123 |
|
|---|
| 124 | ; Video pages, no INT 10h is used for menu-drawing etc.
|
|---|
| [7] | 125 | VideoIO_Page0 equ 0B800h
|
|---|
| 126 | VideoIO_Page1 equ 0B900h
|
|---|
| 127 | VideoIO_Page2 equ 0BA00h
|
|---|
| 128 | VideoIO_Page4 equ 0BC00h
|
|---|
| 129 | VideoIO_FXSegment equ 0A000h
|
|---|
| 130 |
|
|---|
| [30] | 131 | ; Include
|
|---|
| [37] | 132 | Include ../INCLUDE/ASM.INC
|
|---|
| [7] | 133 |
|
|---|
| [30] | 134 | ; Special line-drawing characters
|
|---|
| [37] | 135 | TextChar_WinLineRight equ 0C4h ; 'Ä'
|
|---|
| 136 | TextChar_WinLineDown equ 0B3h ; '³'
|
|---|
| 137 | TextChar_WinRep1 equ 0D1h ; 'Ñ'
|
|---|
| 138 | TextChar_WinRep2 equ 0C5h ; 'Å'
|
|---|
| 139 | TextChar_WinRep3 equ 0CFh ; 'Ï'
|
|---|
| 140 | TextChar_WinRep4 equ 0B5h ; 'µ'
|
|---|
| 141 | TextChar_WinRep5 equ 0C6h ; 'Æ'
|
|---|
| 142 | TextChar_WinRep6 equ 0D8h ; 'Ø'
|
|---|
| [7] | 143 |
|
|---|
| 144 | ; Offsets for Partition-Entries in MBR/EPRs
|
|---|
| [37] | 145 | LocBRPT_LenOfEntry equ 16 ; Length of a standard MBR or EPR entry
|
|---|
| 146 | LocBRPT_Flags equ 0 ; Bootable, Hidden, etc.
|
|---|
| 147 | LocBRPT_BeginCHS equ 1 ; Combined 10-bits cyl with 6 bits
|
|---|
| 148 | LocBRPT_BeginHead equ 1 ; Start head (0<=H<255) 255 is invalid !
|
|---|
| 149 | LocBRPT_BeginSector equ 2 ; Start sector (1<=S<=255)
|
|---|
| 150 | LocBRPT_BeginCylinder equ 3 ; Start cylinder (0<=C<[1024,16384,65536,n])
|
|---|
| 151 | LocBRPT_SystemID equ 4 ; Type of system using the partition
|
|---|
| 152 | LocBRPT_EndCHS equ 5 ; Same for end of partition
|
|---|
| 153 | LocBRPT_EndHead equ 5
|
|---|
| 154 | LocBRPT_EndSector equ 6
|
|---|
| 155 | LocBRPT_EndCylinder equ 7
|
|---|
| 156 | LocBRPT_RelativeBegin equ 8
|
|---|
| 157 | LocBRPT_AbsoluteLength equ 12
|
|---|
| [7] | 158 |
|
|---|
| [37] | 159 | LocBR_Magic equ 510
|
|---|
| [7] | 160 |
|
|---|
| [29] | 161 |
|
|---|
| [34] | 162 | ; Used as a quick compare in LVM.ASM
|
|---|
| [37] | 163 | LocLVM_SignatureByte0 equ 02h
|
|---|
| [30] | 164 |
|
|---|
| [34] | 165 | ; Offsets for LVM Information Sector.
|
|---|
| 166 | ; These are relative to the start of the LVM sector.
|
|---|
| [37] | 167 | LocLVM_SignatureStart equ 00h ; 02h,'RMBPMFD' (8 bytes)
|
|---|
| 168 | LocLVM_CRC equ 08h ; CRC is a DWORD
|
|---|
| 169 | LocLVM_Heads equ 1ch ; Number of heads
|
|---|
| 170 | LocLVM_Secs equ 20h ; Sectors per Track
|
|---|
| 171 | LocLVM_DiskName equ 24h ; Name of the disk
|
|---|
| 172 | LocLVM_StartOfEntries equ 3ch ; (contains maximum of 4 entries)
|
|---|
| 173 | LocLVM_LenOfEntry equ 3ch ; Length of an LVM-entry
|
|---|
| [30] | 174 |
|
|---|
| [34] | 175 | ; An LVM info-sector can contain information on max. 4 partitions.
|
|---|
| 176 | ; All 4 entries will be used when there 4 primary partitions defined.
|
|---|
| 177 | ; For logical partitions, the LVM info-sector is located below the start
|
|---|
| 178 | ; of the logical partition and only one LVM entry is used in that logical
|
|---|
| 179 | ; LVM info-sector.
|
|---|
| [37] | 180 | LocLVM_MaxEntries equ 4 ; Max entries in an LVM-sector
|
|---|
| [30] | 181 |
|
|---|
| [34] | 182 | ; Offsets for LVM entry.
|
|---|
| 183 | ; These are relative to the start of the entry.
|
|---|
| [37] | 184 | LocLVM_VolumeID equ 00h ; is DWORD
|
|---|
| 185 | LocLVM_PartitionID equ 04h ; is DWORD
|
|---|
| 186 | LocLVM_PartitionSize equ 08h ; is DWORD
|
|---|
| 187 | LocLVM_PartitionStart equ 0ch ; is DWORD
|
|---|
| 188 | LocLVM_OnBootMenu equ 10h ; is on IBM BM Bootmenu
|
|---|
| 189 | LocLVM_Startable equ 11h ; is Startable (newly installed system)
|
|---|
| 190 | LocLVM_VolumeLetter equ 12h ; is Drive Letter for partition (C-Z or 0)
|
|---|
| 191 | LocLVM_Unknown equ 13h ; unknown BYTE
|
|---|
| 192 |
|
|---|
| [34] | 193 | ; Truncated to 11 chars when displayed in menu.
|
|---|
| 194 | ; MiniLVM sets both to the same value.
|
|---|
| 195 | ; Also, MiniLVM uses a 0-byte terminator, so the maximum length is 19d.
|
|---|
| 196 | ; Same goes for LocLVM_DiskName.
|
|---|
| [37] | 197 | LocLVM_VolumeName equ 14h ; 20 bytes
|
|---|
| 198 | LocLVM_PartitionName equ 28h ; 20 bytes (Used in menu)
|
|---|
| [30] | 199 |
|
|---|
| 200 |
|
|---|
| [34] | 201 |
|
|---|
| [7] | 202 | ; Offsets for IPT (Internal Partition Table)
|
|---|
| [37] | 203 | LocIPT_MaxPartitions equ partition_count ; 45 in v1.07
|
|---|
| 204 | LocIPT_LenOfSizeElement equ 6 ; Size of one Size-Element
|
|---|
| 205 | LocIPT_LenOfIPT equ 34 ; Length of an IPT-entry
|
|---|
| 206 | LocIPT_Serial equ 0 ; Serial from MBR ?
|
|---|
| 207 | LocIPT_Name equ 4 ; Name from FS or LVM (part/vol)
|
|---|
| 208 | LocIPT_Drive equ 15 ; Drive-ID (80h,81h)
|
|---|
| 209 | LocIPT_SystemID equ 16 ; Partition-Type (06,07,etc)
|
|---|
| 210 | LocIPT_Flags equ 17 ; AiR-BOOT Flags for partition (see below)
|
|---|
| 211 | LocIPT_BootRecordCRC equ 18 ; CRC of Boot-Record
|
|---|
| 212 | LocIPT_LocationBegin equ 20 ; Begin of Partition
|
|---|
| 213 | LocIPT_LocationPartTable equ 23 ; PartitionTable of Partition
|
|---|
| 214 | LocIPT_AbsoluteBegin equ 26 ; Absolute Sector of Begin
|
|---|
| 215 | LocIPT_AbsolutePartTable equ 30 ; Absolute Sector of PartTable
|
|---|
| [7] | 216 |
|
|---|
| [38] | 217 | ; Hidden Partition Table
|
|---|
| 218 | LocHPT_LenOfHPT equ 30 ; Length of an HPT-entry
|
|---|
| 219 |
|
|---|
| [30] | 220 | ; AiR-BOOT IPT-Flags
|
|---|
| [37] | 221 | LocIPT_DefaultFlags equ 00000011b ; Don't know if boot-able :)
|
|---|
| 222 | LocIPT_DefaultNonBootFlags equ 00000010b ; ...VIBR Detection is always on
|
|---|
| [7] | 223 |
|
|---|
| [37] | 224 | Flags_Bootable equ 00000001b
|
|---|
| 225 | Flags_VIBR_Detection equ 00000010b
|
|---|
| 226 | Flags_HideFeature equ 00000100b
|
|---|
| 227 | Flags_DriveLetter equ 00001000b ; OS/2 FAT16/HPFS only
|
|---|
| 228 | Flags_ExtPartMShack equ 00010000b ; Extended Partition M$-Hack req ?
|
|---|
| 229 | Flags_NoPartName equ 01000000b
|
|---|
| 230 | Flags_NowFound equ 10000000b ; temp only in OldPartTable
|
|---|
| 231 | Flags_SpecialMarker equ 10000000b ; temp only for HiddenSetup
|
|---|
| [7] | 232 |
|
|---|
| [37] | 233 | FileSysFlags_BootAble equ 00000001b ; Is this Partition boot-able ?
|
|---|
| 234 | FileSysFlags_FAT32 equ 00010000b ; FAT 32 specific name getting
|
|---|
| 235 | FileSysFlags_NoName equ 00100000b ; No Name - use PartitionName
|
|---|
| 236 | FileSysFlags_DriveLetter equ 01000000b ; DriveLetter Feature possible
|
|---|
| [7] | 237 |
|
|---|
| [30] | 238 | ; Navigation keys
|
|---|
| [37] | 239 | Keys_Up equ 48h
|
|---|
| 240 | Keys_Down equ 50h
|
|---|
| 241 | Keys_Left equ 4Bh
|
|---|
| 242 | Keys_Right equ 4Dh
|
|---|
| 243 | Keys_PageUp equ 49h
|
|---|
| 244 | Keys_PageDown equ 51h
|
|---|
| 245 | Keys_GrayPlus equ 4Eh
|
|---|
| 246 | Keys_GrayMinus equ 4Ah
|
|---|
| 247 | Keys_Plus equ 1Bh
|
|---|
| 248 | Keys_Minus equ 35h
|
|---|
| 249 | Keys_ENTER equ 1Ch
|
|---|
| 250 | Keys_ESC equ 1h
|
|---|
| 251 | Keys_F1 equ 3Bh
|
|---|
| 252 | Keys_F10 equ 44h
|
|---|
| 253 | Keys_C equ 2Eh ; Add. Check auf Ctrl!
|
|---|
| 254 | Keys_Y equ 2Ch
|
|---|
| 255 | Keys_Z equ 15h
|
|---|
| 256 | Keys_N equ 31h
|
|---|
| 257 | Keys_TAB equ 0Fh
|
|---|
| 258 | Keys_Delete equ 53h
|
|---|
| 259 | Keys_Backspace equ 0Eh
|
|---|
| 260 | Keys_Space equ 20h
|
|---|
| [7] | 261 |
|
|---|
| [37] | 262 | Keys_Flags_EnterSetup equ 1100b ; Strg+Alt (AL)
|
|---|
| [7] | 263 |
|
|---|
| 264 |
|
|---|
| [43] | 265 | ; ------------------------------------------
|
|---|
| 266 | ; Rousseau: # Changed this from .386 to .286
|
|---|
| 267 | ; ------------------------------------------
|
|---|
| 268 | ; Because of the TASM-bug the processor had to be changed to turn JUMPS
|
|---|
| 269 | ; off. Existing movzx instructions were replaced with 286 equivalent code.
|
|---|
| 270 | ; Out of range relative jumps have been recoded.
|
|---|
| 271 | ; TASM still generates an extra NOP after test [mem],1
|
|---|
| 272 | ; instructions.
|
|---|
| 273 | ; JWasm produces tighter code.
|
|---|
| 274 | ; JWasm:
|
|---|
| 275 | ; With segment overrides, the address is expanded to the bit-width.
|
|---|
| 276 | ; So, .386 will generate a 32-bit address, even in a USE16 segment.
|
|---|
| 277 | .286
|
|---|
| [30] | 278 |
|
|---|
| [43] | 279 | ; This influences the uses directive and other stuff,
|
|---|
| 280 | ; like calling-style and local variables.
|
|---|
| 281 | ; The model itself,large, has no effect because we generate
|
|---|
| 282 | ; a binairy image and not a segmented executable.
|
|---|
| [30] | 283 |
|
|---|
| [43] | 284 | ; Tasm needs a memory model for USES on PROC to work.
|
|---|
| 285 | IFDEF TASM
|
|---|
| 286 | ;.model large, basic
|
|---|
| 287 | .model tiny,c
|
|---|
| 288 | ENDIF
|
|---|
| [37] | 289 |
|
|---|
| 290 | ;
|
|---|
| 291 | ; This is used to switch between the original 1-segment (code_seg) and the
|
|---|
| 292 | ; 2-segment (code_seg and bss_data).
|
|---|
| 293 | ; The 2-segment layout was needed for JWasm because it does not treat
|
|---|
| 294 | ; db ? in a code segment as bss-data, even if at the end of the code segment.
|
|---|
| 295 | ; Therefore, a true BSS segment is now used.
|
|---|
| 296 | ; Both the code_seg and the bss_data are grouped to the logical airboot
|
|---|
| 297 | ; segment.
|
|---|
| 298 | ; Note that this influences the offsets in the BSS in the list-file and
|
|---|
| 299 | ; the wdis disassembly file (.WDA).
|
|---|
| 300 | ; They are now segment-relative. The true offset is resolved at link
|
|---|
| 301 | ; time.
|
|---|
| 302 | ;
|
|---|
| [43] | 303 | SEGMENTED EQU
|
|---|
| [37] | 304 |
|
|---|
| 305 | IFDEF SEGMENTED
|
|---|
| [43] | 306 | AIRBOOT GROUP LDRIMAGE,VOLATILE
|
|---|
| [37] | 307 | ENDIF
|
|---|
| 308 |
|
|---|
| [30] | 309 | ; Our code-segment starts here.
|
|---|
| [43] | 310 | LDRIMAGE SEGMENT USE16 PUBLIC 'MIXED'
|
|---|
| [7] | 311 |
|
|---|
| [37] | 312 | IFDEF SEGMENTED
|
|---|
| [43] | 313 | ASSUME CS:AIRBOOT, DS:AIRBOOT, ES:nothing, SS:nothing
|
|---|
| [37] | 314 | ELSE
|
|---|
| [43] | 315 | ASSUME CS:LDRIMAGE,DS:LDRIMAGE,ES:nothing, SS:nothing
|
|---|
| [37] | 316 | ENDIF
|
|---|
| [30] | 317 |
|
|---|
| [31] | 318 | ;==============================================================================
|
|---|
| 319 | ; Sector 1
|
|---|
| [30] | 320 |
|
|---|
| 321 |
|
|---|
| [37] | 322 | ; We are not a .com file at 100h but a binary image
|
|---|
| 323 | ; of which only the 1st sector gets loaded at 07c00h.
|
|---|
| 324 | org 00000h ; Sector 1
|
|---|
| [30] | 325 |
|
|---|
| 326 | ; Start of sector 1
|
|---|
| 327 | ; This is the MBR, note the AiRBOOT signature, it's date (2006), version and
|
|---|
| 328 | ; language.
|
|---|
| 329 | ; Version 1.07 was intruduced in 2011.
|
|---|
| 330 | ; It fixes issues with huge drives and lvm and more.
|
|---|
| 331 |
|
|---|
| 332 | sos1:
|
|---|
| 333 |
|
|---|
| 334 | ; ---------------------------------------------
|
|---|
| 335 | ; Rousseau: # Combined letter and jump offset #
|
|---|
| 336 | ; ---------------------------------------------
|
|---|
| 337 | ; My guess is Martin had a short jump followed by the AiRBOOT signature at first.
|
|---|
| 338 | ; Then he encountered strange behaviour by some M$ operating-systems if the
|
|---|
| 339 | ; the first insruction was not a CLI.
|
|---|
| 340 | ; But there was no room to insert the CLI and of course he did not want to
|
|---|
| 341 | ; change the location of the AiRBOOT signature.
|
|---|
| 342 | ; He solved this by inserting the M$ needed CLI at offset 0 followed by a short
|
|---|
| 343 | ; jump that uses the 'A' of the AiRBOOT signature as the jump displacement.
|
|---|
| 344 |
|
|---|
| 345 |
|
|---|
| [31] | 346 | ;------------------------------------------------------------------------------
|
|---|
| [37] | 347 | AiR_BOOT:
|
|---|
| [30] | 348 |
|
|---|
| [37] | 349 | ; Some M$ operating systems need a CLI
|
|---|
| 350 | ; here otherwise they will go beserk
|
|---|
| 351 | ; and will do funny things during
|
|---|
| 352 | ; boot phase, it's laughable!
|
|---|
| 353 | cli
|
|---|
| [7] | 354 |
|
|---|
| [37] | 355 | ; JMP-Short -> MBR_Start
|
|---|
| 356 | ; Uses the 'A' from the signature as the displacement !
|
|---|
| 357 | db 0EBh
|
|---|
| 358 |
|
|---|
| 359 | ; ID String, Date (DD,MM,CC,YY), Version Number, Language ID
|
|---|
| [44] | 360 | db 'AiRBOOT', 21h, 02h, 20h, 12h, 01h, 08h, TXT_LanguageID
|
|---|
| [37] | 361 |
|
|---|
| 362 | ; Total Sectors Count.
|
|---|
| 363 | ; Will get overwritten by FIXCODE.
|
|---|
| 364 | db 1
|
|---|
| 365 |
|
|---|
| 366 | ; Total Sectors Count,
|
|---|
| 367 | ; Dynamic calculation.
|
|---|
| 368 | ;~ db (CODE_END-$)/512
|
|---|
| 369 |
|
|---|
| 370 |
|
|---|
| 371 | MBR_CheckCode dw 0 ; Check-Sum for Code
|
|---|
| 372 |
|
|---|
| [30] | 373 | ;
|
|---|
| 374 | ; No single instruction below should be changed, added or removed in the code
|
|---|
| 375 | ; below as this will cause the jump-link to go haywire.
|
|---|
| [31] | 376 | ;
|
|---|
| [37] | 377 | MBR_Start:
|
|---|
| 378 | sti ; This opcode is dedicated to:
|
|---|
| 379 | cld ; =MICROSOFT JUMP DEPARTMENT=
|
|---|
| [30] | 380 |
|
|---|
| [37] | 381 | ; Setup some base stuff
|
|---|
| 382 | ; AX got loaded wrongly for debug, changed the instructions
|
|---|
| 383 | ; without modifying the number of bytes.
|
|---|
| 384 | ; Don't comment-out the redundant instruction below because this
|
|---|
| 385 | ; *will* change the number of bytes and break the jump-chain.
|
|---|
| 386 | mov ax, StartBaseSeg ; The segment we are moving ourself from (NOT USED)
|
|---|
| 387 | ;mov ds, ax
|
|---|
| 388 | push cs
|
|---|
| 389 | pop ds
|
|---|
| 390 | mov si, StartBasePtr ; The offset we are moving ourself from
|
|---|
| 391 | mov ax, BootBaseSeg ; The target segment we are moving ourself to
|
|---|
| 392 | mov es, ax
|
|---|
| 393 | mov di, BootBasePtr ; The target offset we are moving ourself to
|
|---|
| [30] | 394 |
|
|---|
| [37] | 395 | ; Depending on pre-boot or debug,
|
|---|
| 396 | ; only move first 512 bytes or the whole she-bang++ (65400 bytes)
|
|---|
| 397 | IFDEF ReleaseCode
|
|---|
| 398 | mov cx, 256 ; Pre-boot environment
|
|---|
| 399 | ELSE
|
|---|
| 400 | mov cx, 32700 ; Debug environment (move ~64kB)
|
|---|
| 401 | ENDIF
|
|---|
| [30] | 402 |
|
|---|
| [37] | 403 | ;
|
|---|
| 404 | ; LET's MOVE OURSELVES !
|
|---|
| 405 | ;
|
|---|
| 406 | rep movsw
|
|---|
| [30] | 407 |
|
|---|
| [37] | 408 | ; Code an intersegment jump to the new location
|
|---|
| 409 | db 0EAh
|
|---|
| 410 | dw BootBaseExec ; This is MBR_RealStart + BootBasePtr
|
|---|
| 411 | dw BootBaseSeg ; This is 08000h
|
|---|
| 412 | ;jmp far ptr BootBaseSeg:BootBaseExec
|
|---|
| [7] | 413 |
|
|---|
| [30] | 414 |
|
|---|
| 415 | ;
|
|---|
| 416 | ; Some MBR-functions to provide absolute minimum functionality.
|
|---|
| 417 | ;
|
|---|
| 418 |
|
|---|
| 419 | ;
|
|---|
| 420 | ; Entry-point for halting the system.
|
|---|
| 421 | ;
|
|---|
| [7] | 422 | MBR_HaltSystem:
|
|---|
| [37] | 423 | mov ax, 8600h
|
|---|
| 424 | xor cx, cx
|
|---|
| 425 | mov dx, 500
|
|---|
| 426 | int 15h ; Wait to display the whole screen :]
|
|---|
| 427 | MBR_HaltSys: cli
|
|---|
| 428 | jmp MBR_HaltSys
|
|---|
| [7] | 429 |
|
|---|
| [31] | 430 |
|
|---|
| [37] | 431 | ; Comport settings
|
|---|
| 432 | ; It had to be moved to create room for the double I13X
|
|---|
| 433 | ; signature.
|
|---|
| 434 | ; It cannot be in the config-area (sector 55)
|
|---|
| [43] | 435 | ; because that area is crc-protected and would not allow 'poking'.
|
|---|
| 436 | here = $
|
|---|
| 437 | org 0003Ch
|
|---|
| 438 | check_overlap here
|
|---|
| 439 | BIOS_AuxParms dw BIOS_AUXPARMS_DEFAULT
|
|---|
| [31] | 440 |
|
|---|
| [37] | 441 | reserved db 6 dup('X')
|
|---|
| [30] | 442 |
|
|---|
| [37] | 443 | ;
|
|---|
| 444 | ; We arrive here after the first jump using the 'A' of the
|
|---|
| 445 | ; AiR-BOOT signature.
|
|---|
| 446 | ; So we ensure the jump is always at this offset.
|
|---|
| 447 | ; We jump here, because Martin needed to
|
|---|
| 448 | ; insert a CLI on start and did not
|
|---|
| 449 | ; want to change the AiR-BOOT signature
|
|---|
| 450 | ; because of Microsoft inventions...
|
|---|
| 451 | here = $
|
|---|
| 452 | org 044h
|
|---|
| 453 | check_overlap here
|
|---|
| 454 |
|
|---|
| 455 |
|
|---|
| 456 |
|
|---|
| 457 | ; Jump again...
|
|---|
| 458 | ; This time to the setup-code.
|
|---|
| 459 | jmp MBR_Start
|
|---|
| 460 |
|
|---|
| [30] | 461 | ;
|
|---|
| 462 | ; Entry-point when loading fails.
|
|---|
| 463 | ;
|
|---|
| [37] | 464 | db 'LOAD ERROR!', 0
|
|---|
| 465 | MBR_LoadError Proc Near
|
|---|
| 466 | mov si, offset $-12
|
|---|
| 467 | push cs
|
|---|
| 468 | pop ds
|
|---|
| 469 | call MBR_Teletype
|
|---|
| 470 | MBRLE_Halt:
|
|---|
| 471 | jmp MBRLE_Halt
|
|---|
| 472 | MBR_LoadError EndP
|
|---|
| [7] | 473 |
|
|---|
| [30] | 474 |
|
|---|
| 475 | ;
|
|---|
| 476 | ; Entry-point when saving fails.
|
|---|
| 477 | ;
|
|---|
| [37] | 478 | db 'SAVE ERROR!', 0
|
|---|
| 479 | MBR_SaveError Proc Near
|
|---|
| 480 | mov si, offset $-12
|
|---|
| 481 | push cs
|
|---|
| 482 | pop ds
|
|---|
| 483 | call MBR_Teletype
|
|---|
| 484 | MBRSE_Halt:
|
|---|
| 485 | jmp MBRSE_Halt
|
|---|
| 486 | MBR_SaveError EndP
|
|---|
| [7] | 487 |
|
|---|
| [30] | 488 |
|
|---|
| 489 | ; Put text on the screen using the BIOS tele-type function.
|
|---|
| 490 | ; No attributes like color are supported.
|
|---|
| [7] | 491 | ; In: SI - Pointer to begin of string (EOS is 0)
|
|---|
| 492 | ; Destroyed: SI
|
|---|
| [37] | 493 | MBR_Teletype Proc Near Uses ax bx cx
|
|---|
| 494 | mov ah, 0Eh
|
|---|
| 495 | mov bx, 7
|
|---|
| 496 | MBRT_Loop:
|
|---|
| 497 | lodsb
|
|---|
| 498 | or al, al
|
|---|
| 499 | jz MBRT_End
|
|---|
| 500 | int 10h
|
|---|
| 501 | jmp MBRT_Loop
|
|---|
| 502 | MBRT_End:
|
|---|
| 503 | ret
|
|---|
| 504 | MBR_Teletype EndP
|
|---|
| [7] | 505 |
|
|---|
| [30] | 506 | ;
|
|---|
| 507 | ; Rousseau: DO NOT ADD CODE TO THIS SECTION !
|
|---|
| 508 | ;
|
|---|
| 509 |
|
|---|
| [7] | 510 | ; In: BX - Base Check, DS:SI - Pointer to 512-byte-area to be included
|
|---|
| 511 | ; Out: BX - Base Check Result
|
|---|
| 512 | ; Destroyed: SI will get updated (+512)
|
|---|
| [37] | 513 | MBR_GetCheckOfSector Proc Near Uses ax cx
|
|---|
| 514 | mov cx, 256
|
|---|
| 515 | MBRGCOS_Loop:
|
|---|
| 516 | lodsw
|
|---|
| 517 | xor ax, 0BABEh
|
|---|
| 518 | xor bx, ax
|
|---|
| 519 | loop MBRGCOS_Loop
|
|---|
| 520 | or bx, bx
|
|---|
| 521 | jnz MBRGCOS_NoFixUp
|
|---|
| 522 | mov bx, 1 ; dont allow 0, cause 0 == empty
|
|---|
| 523 | MBRGCOS_NoFixUp:
|
|---|
| 524 | ret
|
|---|
| 525 | MBR_GetCheckOfSector EndP
|
|---|
| [7] | 526 |
|
|---|
| [30] | 527 |
|
|---|
| 528 |
|
|---|
| 529 |
|
|---|
| 530 |
|
|---|
| 531 |
|
|---|
| 532 | ;
|
|---|
| 533 | ; This is where the rest of AiR-BOOT gets loaded.
|
|---|
| 534 | ;
|
|---|
| 535 |
|
|---|
| [31] | 536 | ;------------------------------------------------------------------------------
|
|---|
| [7] | 537 | MBR_RealStart:
|
|---|
| [37] | 538 | mov ax, StackSeg ; 07000h, below the moved code
|
|---|
| 539 | mov ss, ax
|
|---|
| 540 | ;mov sp, 7FFFh ; Odd stack-pointer ??
|
|---|
| 541 | mov sp, 7FFEh ; Even is better
|
|---|
| 542 | mov ax, es ; ES holds segment where we moved to
|
|---|
| 543 | mov ds, ax ; Set DS==ES to Code Segment
|
|---|
| [30] | 544 |
|
|---|
| [43] | 545 |
|
|---|
| [37] | 546 | ; If we are in debug-mode, all code is moved already,
|
|---|
| 547 | ; so we can directly jump to it.
|
|---|
| 548 | ; One difference is that in debug-mode, the whole .com image is
|
|---|
| 549 | ; loaded by dos while when air-boot is active from the MBR it
|
|---|
| 550 | ; does the loading itself.
|
|---|
| 551 | IFNDEF ReleaseCode
|
|---|
| 552 | jmp AiR_BOOT_Start
|
|---|
| 553 | ENDIF
|
|---|
| [30] | 554 |
|
|---|
| 555 |
|
|---|
| [37] | 556 | ; Load missing parts from harddrive...
|
|---|
| 557 | ;mov ax, cs ; actually obsolete
|
|---|
| 558 | ;mov es, ax ; actually obsolete
|
|---|
| [30] | 559 |
|
|---|
| [37] | 560 | ; Load the configuration-sectors from disk.
|
|---|
| 561 | mov bx, offset Configuration
|
|---|
| 562 | mov dx, 0080h ; First harddrive, Sector 55
|
|---|
| 563 | mov cx, 0037h ; Is 55d is config-sector
|
|---|
| [30] | 564 |
|
|---|
| [37] | 565 | ; Call the i/o-part
|
|---|
| 566 | call MBR_LoadConfig
|
|---|
| [30] | 567 |
|
|---|
| [37] | 568 | jnc MBR_ConfigCopy_NoError
|
|---|
| [30] | 569 |
|
|---|
| [37] | 570 | ; Some error occured
|
|---|
| 571 | MBR_ConfigCopy_LoadError:
|
|---|
| 572 | call MBR_LoadError ; Will Abort BootUp
|
|---|
| [30] | 573 |
|
|---|
| [37] | 574 | ; Load the code sectors
|
|---|
| 575 | MBR_ConfigCopy_NoError:
|
|---|
| 576 | mov bx, offset FurtherMoreLoad
|
|---|
| 577 | mov dx, 0080h ; First harddrive
|
|---|
| 578 | mov cx, 0002h ; Second sector
|
|---|
| 579 | mov ah, 02h
|
|---|
| [30] | 580 |
|
|---|
| [37] | 581 | ; This location is in the code-segment.
|
|---|
| 582 | ; When segment overrides are applied, the address is
|
|---|
| 583 | ; expanded to the bit-with.
|
|---|
| 584 | ; So the .286 or .386 directive influences the length
|
|---|
| 585 | ; of the instruction, even with a USE16 segment.
|
|---|
| 586 | mov al, ds:[10h] ; Number of code sectors
|
|---|
| 587 | int 13h
|
|---|
| 588 | jnc MBR_RealStart_NoError
|
|---|
| 589 | jmp MBR_ConfigCopy_LoadError
|
|---|
| [31] | 590 |
|
|---|
| 591 |
|
|---|
| 592 |
|
|---|
| [37] | 593 | ; [v1.05+]
|
|---|
| 594 | ; Signature for IBM's LVM to detect our "powerful" features ;)
|
|---|
| 595 | ; [v1.0.8+]
|
|---|
| 596 | ; Reworked MBR code to be able to create a
|
|---|
| 597 | ; double 'I13X' signature.
|
|---|
| 598 | ; MBR's created with LVM eCS v1.x have the signature at 0d5h
|
|---|
| 599 | ; MBR's created with LVM eCS v2.x have the signature at 0d0h
|
|---|
| 600 | ; See eCS bugtracker issue #3002
|
|---|
| 601 | ; Update: These are actually MOV EAX,'X31I' instructions
|
|---|
| 602 | ; in the eCS LVM MBR-code. They are at different places in
|
|---|
| 603 | ; the v1.x and v2.x LVM code.
|
|---|
| 604 | ; Let's protect them with an org directive.
|
|---|
| [31] | 605 |
|
|---|
| [37] | 606 | here = $
|
|---|
| 607 | org 00d0h
|
|---|
| 608 | check_overlap here
|
|---|
| 609 | ;org 00d0h
|
|---|
| 610 | db 'I13X',0,'I13X',0
|
|---|
| [31] | 611 |
|
|---|
| [30] | 612 |
|
|---|
| [37] | 613 | MBR_RealStart_NoError:
|
|---|
| 614 | ; Now Check Code with CheckSum
|
|---|
| 615 | mov si, offset FurtherMoreLoad
|
|---|
| [30] | 616 |
|
|---|
| [37] | 617 | ;movzx cx, bptr ds:[10h]
|
|---|
| 618 | mov cl, ds:[10h]
|
|---|
| 619 | mov ch,0
|
|---|
| [31] | 620 |
|
|---|
| [37] | 621 | xor bx, bx
|
|---|
| 622 | MBR_RealStart_CheckCodeLoop:
|
|---|
| 623 | call MBR_GetCheckOfSector
|
|---|
| 624 | loop MBR_RealStart_CheckCodeLoop
|
|---|
| [31] | 625 |
|
|---|
| 626 |
|
|---|
| [37] | 627 | cmp MBR_CheckCode, bx
|
|---|
| 628 | je MBR_RealStart_CheckSuccess
|
|---|
| [7] | 629 |
|
|---|
| [37] | 630 | mov si, offset TXT_ERROR_Attention
|
|---|
| 631 | call MBR_Teletype
|
|---|
| 632 | mov si, offset TXT_ERROR_CheckCode
|
|---|
| 633 | call MBR_Teletype
|
|---|
| 634 | mov si, offset TXT_ERROR_CheckFailed
|
|---|
| 635 | call MBR_Teletype
|
|---|
| 636 | jmp MBR_HaltSystem
|
|---|
| 637 | MBR_RealStart_CheckSuccess:
|
|---|
| 638 | jmp AiR_BOOT_Start
|
|---|
| [30] | 639 |
|
|---|
| 640 |
|
|---|
| 641 |
|
|---|
| 642 |
|
|---|
| [37] | 643 |
|
|---|
| [31] | 644 | ;------------------------------------------------------------------------------
|
|---|
| [37] | 645 | Include TEXT/TXTMBR.ASM ; All translateable Text in MBR
|
|---|
| [31] | 646 | ;------------------------------------------------------------------------------
|
|---|
| [30] | 647 |
|
|---|
| 648 |
|
|---|
| 649 |
|
|---|
| [31] | 650 | ; This is an ugly kludge function to create space for the
|
|---|
| 651 | ; double 'I13X' signature.
|
|---|
| 652 | ; It loads the configuration sectors, but bx,cx and dx are not initialized
|
|---|
| 653 | ; in this function. That's done around line 500.
|
|---|
| 654 | ; Putting this few bytes here creates just enough room.
|
|---|
| [37] | 655 | MBR_LoadConfig Proc Near
|
|---|
| 656 | ; Changed from conditional assembler to calculated value
|
|---|
| 657 | ; Fixes issue: #2987 -- "air-boot doesn't remember drive letter"
|
|---|
| 658 | ; Size of the ab-configuration in 512 byte sectors
|
|---|
| 659 | mov al, (MBR_BackUpMBR - Configuration) / 200h
|
|---|
| 660 | mov ah,02h
|
|---|
| 661 | int 13h
|
|---|
| 662 | ret
|
|---|
| 663 | MBR_LoadConfig EndP
|
|---|
| [31] | 664 |
|
|---|
| [35] | 665 |
|
|---|
| [37] | 666 | here = $
|
|---|
| 667 | org 001b8h
|
|---|
| 668 | check_overlap here
|
|---|
| [31] | 669 |
|
|---|
| [37] | 670 | ; Disk Signature
|
|---|
| 671 | ; Note that in an LVM 2.x MBR this collides
|
|---|
| 672 | ; with the dummy PTE that it uses to look for IBM-BM
|
|---|
| 673 | ; on the second harddisk.
|
|---|
| 674 | db 'DSIG'
|
|---|
| [31] | 675 |
|
|---|
| [37] | 676 | ; Unused word at 01BCh
|
|---|
| 677 | ; An LVM 2.x MBR puts 'CC33' here.
|
|---|
| 678 | dw '$$'
|
|---|
| [35] | 679 |
|
|---|
| 680 |
|
|---|
| [43] | 681 | here = $
|
|---|
| 682 | org 001beh
|
|---|
| 683 | check_overlap here
|
|---|
| 684 |
|
|---|
| [37] | 685 | ; Partition Table
|
|---|
| 686 | db 16 dup('0')
|
|---|
| 687 | db 16 dup('1')
|
|---|
| 688 | db 16 dup('2')
|
|---|
| 689 | db 16 dup('3')
|
|---|
| 690 |
|
|---|
| 691 | ; Boot Sigbature
|
|---|
| 692 | dw 0aa55h
|
|---|
| 693 |
|
|---|
| [30] | 694 | ; End of sector 1
|
|---|
| [31] | 695 | eos1a:
|
|---|
| [30] | 696 |
|
|---|
| 697 |
|
|---|
| 698 |
|
|---|
| [37] | 699 |
|
|---|
| [31] | 700 | ;==============================================================================
|
|---|
| 701 | ; Sector 2
|
|---|
| [30] | 702 |
|
|---|
| [37] | 703 | ;
|
|---|
| 704 | ; Here starts the second sector, sector 2
|
|---|
| 705 | ;
|
|---|
| 706 | org 00200h
|
|---|
| [30] | 707 | ; Start of sector 2.
|
|---|
| 708 | sos2:
|
|---|
| 709 |
|
|---|
| [31] | 710 | ;
|
|---|
| 711 | ; Everything beyond this point is loaded on startup
|
|---|
| 712 | ; and is NOT existant at first
|
|---|
| 713 | ;
|
|---|
| [7] | 714 | FurtherMoreLoad:
|
|---|
| [30] | 715 |
|
|---|
| 716 | ;
|
|---|
| 717 | ; Filesystem table correlating id with name.
|
|---|
| 718 | ;
|
|---|
| 719 |
|
|---|
| [37] | 720 | ; first Normal-Partition-ID, Hidden-Partition-ID
|
|---|
| 721 | ; and Default-Partition-Flags.
|
|---|
| 722 | ; 01h -> Boot-Able
|
|---|
| 723 | ; 10h -> FAT32 - Name Getting Scheme
|
|---|
| 724 | ; 20h -> No Name To Get (use Partition Name from IPT)
|
|---|
| 725 | ; 40h -> 'L' flag possible
|
|---|
| [7] | 726 | db 'AiRSYS-TABLE'
|
|---|
| [37] | 727 | FileSysIDs db 01h, 11h,01h, 04h,014h,01h, 06h,016h,41h, 0Eh,00Eh,01h
|
|---|
| [29] | 728 | db 07h, 17h,41h, 08h,017h,21h, 35h,035h,20h,0FCh,017h,41h
|
|---|
| 729 | db 09h, 19h,11h, 0Bh,01Bh,11h, 0Ch,01Ch,11h,0EBh,0EBh,01h
|
|---|
| [7] | 730 | db 63h, 63h,21h, 81h,081h,21h, 83h,083h,21h, 40h,040h,21h
|
|---|
| 731 | db 0A5h,0A5h,21h,0A6h,0A6h,21h, 82h,082h,20h,0A7h,0A7h,21h
|
|---|
| 732 | db 63h, 63h,21h, 4Dh,04Dh,21h, 4Eh,04Eh,21h, 4Fh,04Fh,21h
|
|---|
| 733 | db 01h, 01h,01h, 01h,001h,01h, 01h,001h,01h, 01h,001h,01h
|
|---|
| 734 | db 01h, 01h,01h, 01h,001h,01h, 01h,001h,01h, 01h,001h,01h
|
|---|
| 735 | db 01h, 01h,01h, 01h,001h,01h, 01h,001h,01h, 01h,001h,01h
|
|---|
| 736 | db 01h, 01h,01h,0FDh,0FDh,20h, 84h,084h,20h,0A0h,0A0h,20h
|
|---|
| 737 | db 0Ah, 0Ah,20h,0FEh,0FEh,21h,0FFh,0FFh,21h, 00h,000h,21h
|
|---|
| 738 | db 16 dup (0)
|
|---|
| 739 |
|
|---|
| [37] | 740 | FileSysNames db 'FAT12 ', 'FAT16 ', 'FAT16Big', 'FAT16Big'
|
|---|
| [29] | 741 | db 'HPFS ', 'NTFS ', 'LVM-Data', 'JFS '
|
|---|
| 742 | db 'FAT32 ', 'FAT32 ', 'FAT32 ', 'BeOS '
|
|---|
| [7] | 743 | db 'Unix ', 'Minix ', 'Linux ', 'Venix ' ; x row ;)
|
|---|
| 744 | db 'BSD/386 ', 'OpenBSD ', 'LinuxSwp', 'NeXTSTEP'
|
|---|
| 745 | db 'GNU HURD', 'QNX ', 'QNX ', 'QNX '
|
|---|
| 746 | db ' ', ' ', ' ', ' '
|
|---|
| 747 | db ' ', ' ', ' ', ' '
|
|---|
| 748 | db ' ', ' ', ' ', ' '
|
|---|
| 749 | db ' ', 'Kernel ', ' ', '0V-Award'
|
|---|
| [36] | 750 | ; db 'OS/2 Man', 'via BIOS', 'Floppy ', 'Unknown '
|
|---|
| 751 | db 'OS2-BMGR', 'via BIOS', 'Floppy ', 'Unknown '
|
|---|
| [7] | 752 | ; -> 44 Partition-Types
|
|---|
| 753 |
|
|---|
| [30] | 754 | ; End of sector 2.
|
|---|
| 755 | eos2:
|
|---|
| 756 |
|
|---|
| 757 |
|
|---|
| 758 |
|
|---|
| 759 |
|
|---|
| 760 |
|
|---|
| 761 |
|
|---|
| 762 |
|
|---|
| 763 |
|
|---|
| [31] | 764 | ;==============================================================================
|
|---|
| 765 | ; Sector 3
|
|---|
| [37] | 766 | here = $
|
|---|
| 767 | org 00400h
|
|---|
| 768 | check_overlap here
|
|---|
| 769 |
|
|---|
| 770 |
|
|---|
| [30] | 771 | ; Start of sector 3.
|
|---|
| 772 | sos3:
|
|---|
| 773 |
|
|---|
| 774 |
|
|---|
| [37] | 775 | ; ##############################################
|
|---|
| 776 | ; ## ENTRY-POINT AFTER ALL THE INITIAL HASSLE ##
|
|---|
| 777 | ; ##############################################
|
|---|
| [30] | 778 |
|
|---|
| 779 |
|
|---|
| 780 |
|
|---|
| [43] | 781 |
|
|---|
| [36] | 782 | AiR_BOOT_Start:
|
|---|
| [30] | 783 |
|
|---|
| [36] | 784 |
|
|---|
| 785 |
|
|---|
| 786 | ;
|
|---|
| 787 | ; Since v1.0.8, AiR-BOOT is able to chainload IBM-BM.
|
|---|
| 788 | ; When IBM-BM resides above the 1024-cylinder limit, the 'I13X'
|
|---|
| 789 | ; signature is required at 3000:0000, FS needs to contain 3000h
|
|---|
| 790 | ; and the 32-bit LBA address needs to follow the 'I13X' signature.
|
|---|
| 791 | ; For booting IBM-BM from the second disk, a copy of the MBR of the
|
|---|
| 792 | ; first disk is also required at 0000:7E00.
|
|---|
| 793 | ; This information is derived from the eCS 2.x LVM MBR.
|
|---|
| 794 | ;
|
|---|
| 795 | ; So, now is a good time to copy the MBR of the first disk to
|
|---|
| 796 | ; 0000:7E00 in case the partition that will be started is IBM-BM.
|
|---|
| 797 | ; This copy is located at 8000:0000 and DS already points to this
|
|---|
| 798 | ; segment.
|
|---|
| 799 | ;
|
|---|
| [37] | 800 | pusha ; Save all the general purpose regs
|
|---|
| 801 | push es ; We need ES too, so save its value
|
|---|
| 802 | xor ax,ax ; Segment 0000h
|
|---|
| 803 | mov es,ax ; Make ES point to it
|
|---|
| 804 | mov si,offset BootBasePtr ; Start of AiR-BOOT which has the MBR
|
|---|
| 805 | mov di,7e00h ; Destination for the MBR for IBM-BM
|
|---|
| 806 | mov cx,100h ; 256 words = 512 bytes
|
|---|
| 807 | cld ; Direction from low to high
|
|---|
| 808 | rep movsw ; Copy the 256 words of the MBR
|
|---|
| 809 | pop es ; Restore previous value of ES
|
|---|
| 810 | popa ; Restore all the general purpose regs
|
|---|
| [36] | 811 |
|
|---|
| 812 |
|
|---|
| [43] | 813 | mov ax, offset sobss
|
|---|
| 814 | mov ax,offset BeginOfVariables
|
|---|
| 815 | mov ax,offset [TrueSecs]
|
|---|
| 816 | lea ax, [TrueSecs]
|
|---|
| 817 | mov ax,word ptr [TrueSecs]
|
|---|
| 818 | mov ax,offset EndOfVariables
|
|---|
| 819 | mov ax, offset eobss
|
|---|
| 820 | nop
|
|---|
| 821 | ;~ mov ax, offset qqqq
|
|---|
| [36] | 822 |
|
|---|
| [43] | 823 |
|
|---|
| [37] | 824 | ;jmp skip
|
|---|
| [30] | 825 |
|
|---|
| [37] | 826 | ; Rousseau:
|
|---|
| 827 | ; I should cleanup my garbage here...
|
|---|
| [30] | 828 |
|
|---|
| [37] | 829 | ; Initialize Variable-Tables, Detections, etc.
|
|---|
| 830 | call PRECRAP_Main
|
|---|
| [30] | 831 |
|
|---|
| [37] | 832 | ; Number of harddisks is now known
|
|---|
| [30] | 833 |
|
|---|
| [37] | 834 | call PARTSCAN_ScanForPartitions
|
|---|
| [30] | 835 |
|
|---|
| 836 |
|
|---|
| [37] | 837 | ; Number of disks found
|
|---|
| 838 | mov si, offset DisksFound
|
|---|
| 839 | call MBR_Teletype
|
|---|
| [30] | 840 |
|
|---|
| [37] | 841 | mov al, [TotalHarddiscs]
|
|---|
| 842 | call VideoIO_SyncPos
|
|---|
| 843 | call VideoIO_PrintByteDynamicNumber
|
|---|
| 844 | xor si,si
|
|---|
| 845 | call MBR_TeletypeNL
|
|---|
| [30] | 846 |
|
|---|
| [37] | 847 | ; Number of bootable systems indicator
|
|---|
| 848 | mov si, offset PartitionsFound
|
|---|
| 849 | call MBR_Teletype
|
|---|
| [30] | 850 |
|
|---|
| [37] | 851 | mov al, [CFG_Partitions]
|
|---|
| 852 | call VideoIO_SyncPos
|
|---|
| 853 | call VideoIO_PrintByteDynamicNumber
|
|---|
| [30] | 854 |
|
|---|
| [37] | 855 | xor si,si
|
|---|
| 856 | call MBR_TeletypeNL
|
|---|
| 857 | call MBR_TeletypeNL
|
|---|
| [30] | 858 |
|
|---|
| [37] | 859 | call VideoIO_SyncPos
|
|---|
| [30] | 860 |
|
|---|
| [37] | 861 | mov dl,80h
|
|---|
| 862 | call VideoIO_DumpDiskInfo
|
|---|
| [30] | 863 |
|
|---|
| [37] | 864 | ;
|
|---|
| 865 | ; Enumberate Bootable Systems by name
|
|---|
| 866 | ; and prepare Phase 1 if active.
|
|---|
| 867 | ;
|
|---|
| 868 | ; This can also be implemented using the
|
|---|
| 869 | ; Installable LVM-flag I think.
|
|---|
| 870 | ; But at the time I had lesser knowledge about LVM...
|
|---|
| 871 | ; So this algorithm may change in the future.
|
|---|
| 872 | ;
|
|---|
| 873 | mov si, offset PartitionTable
|
|---|
| 874 | xor cx,cx
|
|---|
| 875 | mov cl,[CFG_Partitions]
|
|---|
| 876 | MBR_Parts:
|
|---|
| 877 | add si, 4
|
|---|
| 878 | push si
|
|---|
| 879 | push si
|
|---|
| 880 | ;call MBR_TeletypeVolName
|
|---|
| 881 | pop si
|
|---|
| 882 | call PART_IsInstallVolume
|
|---|
| 883 | jnc MBR_Parts_NI
|
|---|
| [30] | 884 |
|
|---|
| [37] | 885 | ; Install Volume
|
|---|
| 886 | mov al,' '
|
|---|
| 887 | mov bl,7
|
|---|
| 888 | mov ah, 0eh
|
|---|
| 889 | int 10h
|
|---|
| [30] | 890 |
|
|---|
| [37] | 891 | mov al,'('
|
|---|
| 892 | mov bl,7
|
|---|
| 893 | mov ah, 0eh
|
|---|
| 894 | int 10h
|
|---|
| [30] | 895 |
|
|---|
| [37] | 896 | mov al,[CFG_Partitions]
|
|---|
| 897 | sub al,cl
|
|---|
| 898 | ;inc al
|
|---|
| 899 | ;mov [Menu_EntryAutomatic],al
|
|---|
| 900 | mov [CFG_PartAutomatic],al ; Setup entry for install-volume
|
|---|
| 901 | mov [CFG_PartLast],al
|
|---|
| 902 | mov ah, [eCS_InstallVolume] ; 1st byte is 0 if no phase 1 active
|
|---|
| 903 | test ah,ah ; test the byte, ZF is 0 if phase 1 active
|
|---|
| 904 | lahf ; flags in ah
|
|---|
| 905 | xor ah, 40h ; complement ZF
|
|---|
| 906 | and ah, 40h ; mask ZF
|
|---|
| 907 | shr ah, 6 ; move ZF to LSB
|
|---|
| 908 | mov [CFG_AutomaticBoot], ah ; automatic boot if phase 1 is active
|
|---|
| [30] | 909 |
|
|---|
| [36] | 910 |
|
|---|
| [37] | 911 | add al,'1'
|
|---|
| 912 | mov bl,7
|
|---|
| 913 | mov ah, 0eh
|
|---|
| 914 | int 10h
|
|---|
| [30] | 915 |
|
|---|
| [37] | 916 | mov al,')'
|
|---|
| 917 | mov bl,7
|
|---|
| 918 | mov ah, 0eh
|
|---|
| 919 | int 10h
|
|---|
| [30] | 920 |
|
|---|
| [37] | 921 | mov bx,cx
|
|---|
| [30] | 922 |
|
|---|
| [37] | 923 | MBR_Parts_NI:
|
|---|
| 924 | xor si,si
|
|---|
| 925 | ;call MBR_TeletypeNL
|
|---|
| 926 | pop si
|
|---|
| [38] | 927 | add si, 30 ; Add remainder of IPT entry
|
|---|
| [37] | 928 | loop MBR_Parts
|
|---|
| [30] | 929 |
|
|---|
| 930 |
|
|---|
| 931 |
|
|---|
| 932 |
|
|---|
| [37] | 933 | ; Index of automatic start partition
|
|---|
| 934 | ;mov si, offset AutoStartPart
|
|---|
| 935 | ;call MBR_Teletype
|
|---|
| [30] | 936 |
|
|---|
| [37] | 937 | ;mov al, [CFG_PartAutomatic]
|
|---|
| 938 | ;add al, 31h
|
|---|
| 939 | ;mov ah, 09h
|
|---|
| 940 | ;mov bx, 15
|
|---|
| 941 | ;mov cx, 1
|
|---|
| 942 | ;int 10h
|
|---|
| [30] | 943 |
|
|---|
| [37] | 944 | ;mov al, [CFG_PartAutomatic]
|
|---|
| 945 | ;add al, 31h
|
|---|
| 946 | ;mov ah, 0eh
|
|---|
| 947 | ;mov bx, 15
|
|---|
| 948 | ;mov cx, 1
|
|---|
| 949 | ;int 10h
|
|---|
| [30] | 950 |
|
|---|
| [37] | 951 | xor si,si
|
|---|
| 952 | call MBR_TeletypeNL
|
|---|
| 953 | xor si,si
|
|---|
| 954 | call MBR_TeletypeNL
|
|---|
| [30] | 955 |
|
|---|
| [37] | 956 | ;mov ax,[BIOS_AuxParms]
|
|---|
| 957 | ;call VideoIO_SyncPos
|
|---|
| 958 | ;push ax
|
|---|
| 959 | ;add al,'0'
|
|---|
| 960 | ;mov bl,7
|
|---|
| 961 | ;mov ah, 0eh
|
|---|
| 962 | ;int 10h
|
|---|
| 963 | ;pop ax
|
|---|
| 964 | ;xchg al,ah
|
|---|
| 965 | ;sub al,0a2h
|
|---|
| 966 | ;mov bl,7
|
|---|
| 967 | ;mov ah, 0eh
|
|---|
| 968 | ;int 10h
|
|---|
| [30] | 969 |
|
|---|
| 970 |
|
|---|
| [37] | 971 | call MBR_TeletypeSyncPos
|
|---|
| [30] | 972 |
|
|---|
| [37] | 973 | xor si,si
|
|---|
| 974 | call MBR_TeletypeNL
|
|---|
| 975 | call MBR_TeletypeNL
|
|---|
| [30] | 976 |
|
|---|
| 977 |
|
|---|
| 978 |
|
|---|
| [37] | 979 | mov si, offset ShowMenu
|
|---|
| 980 | call MBR_TeletypeBold
|
|---|
| [30] | 981 |
|
|---|
| 982 |
|
|---|
| [43] | 983 | skip:
|
|---|
| [30] | 984 |
|
|---|
| 985 |
|
|---|
| 986 |
|
|---|
| [37] | 987 | ;
|
|---|
| 988 | ; ####################### WAIT FOR KEY ########################
|
|---|
| 989 | ;
|
|---|
| [30] | 990 |
|
|---|
| 991 |
|
|---|
| [37] | 992 | ; Rousseau:
|
|---|
| 993 | ; Wait for key so we can see debug log if ab-menu hangs.
|
|---|
| 994 | ;;xor ax, ax
|
|---|
| 995 | ;;int 16h
|
|---|
| [30] | 996 |
|
|---|
| [37] | 997 | ;call SOUND_Beep
|
|---|
| [30] | 998 |
|
|---|
| [37] | 999 | ; Rousseau: delayed save of video-page
|
|---|
| [30] | 1000 |
|
|---|
| [37] | 1001 | mov ax, VideoIO_Page1
|
|---|
| 1002 | call VideoIO_BackUpTo ; Copy BIOS POST to Second Page
|
|---|
| [30] | 1003 |
|
|---|
| [37] | 1004 | ;call SOUND_Beep
|
|---|
| [30] | 1005 |
|
|---|
| 1006 |
|
|---|
| [37] | 1007 | ;
|
|---|
| 1008 | ; COM-PORT DEBUG
|
|---|
| 1009 | ;
|
|---|
| 1010 | ;call AuxIO_TeletypeNL
|
|---|
| 1011 | mov si, offset PartitionTable
|
|---|
| 1012 | ;call AuxIO_DumpSector
|
|---|
| 1013 | ;call AuxIO_TeletypeNL
|
|---|
| [30] | 1014 |
|
|---|
| [31] | 1015 |
|
|---|
| [37] | 1016 | ; Save configuration so phase1 boot-through is disabled
|
|---|
| 1017 | ; on next boot.
|
|---|
| 1018 | ; Moved here to fix that Esc out of SETUP would also save.
|
|---|
| 1019 | ; So moved above the MBR_Main_ReEnterSetup label.
|
|---|
| 1020 | mov [eCS_InstallVolume], 0 ; disable phase 1 for next boot
|
|---|
| 1021 | call DriveIO_SaveConfiguration
|
|---|
| [31] | 1022 |
|
|---|
| 1023 |
|
|---|
| 1024 |
|
|---|
| [37] | 1025 | ;
|
|---|
| 1026 | ; RE-ENTER SETUP
|
|---|
| 1027 | ;
|
|---|
| 1028 | MBR_Main_ReEnterSetup:
|
|---|
| 1029 | call SETUP_CheckEnterSETUP
|
|---|
| [7] | 1030 |
|
|---|
| [37] | 1031 | ;call SOUND_Beep
|
|---|
| [30] | 1032 |
|
|---|
| [37] | 1033 | ; Rousseau: Every time I see "AfterCrap" I have to laugh :-)
|
|---|
| 1034 | call AFTERCRAP_Main
|
|---|
| [30] | 1035 |
|
|---|
| [37] | 1036 | ; [Linux support removed since v1.02]
|
|---|
| 1037 | ; Now get FAT16-Linux Kernel Partition, If requested
|
|---|
| 1038 | ;cmp [CFG_LinuxKrnlPartition], 0FFh
|
|---|
| 1039 | ;je MBR_Main_NoLinuxKrnlPartition
|
|---|
| 1040 | ;call LINUX_InitFAT16access
|
|---|
| 1041 | ;MBR_Main_NoLinuxKrnlPartition:
|
|---|
| [7] | 1042 |
|
|---|
| [30] | 1043 |
|
|---|
| [37] | 1044 | MBR_Main_ReEnterBootMenuPre:
|
|---|
| [30] | 1045 |
|
|---|
| [37] | 1046 | ; SetUp PartitionPointers for BootMenu (filter non-bootable)
|
|---|
| 1047 | call PART_CalculateMenuPartPointers
|
|---|
| [7] | 1048 |
|
|---|
| [37] | 1049 | ; ...and count that one...
|
|---|
| 1050 | cmp PartitionPointerCount, 0
|
|---|
| 1051 | jne MBR_Main_SomethingBootAble
|
|---|
| 1052 | mov si, offset TXT_NoBootAble
|
|---|
| 1053 | call MBR_Teletype
|
|---|
| 1054 | jmp MBR_HaltSystem
|
|---|
| [30] | 1055 |
|
|---|
| [37] | 1056 | MBR_Main_SomethingBootAble:
|
|---|
| 1057 | ; FixUp Values, define Timed Setup booting, etc.
|
|---|
| 1058 | call PART_FixUpDefaultPartitionValues
|
|---|
| [7] | 1059 |
|
|---|
| [30] | 1060 |
|
|---|
| 1061 |
|
|---|
| [37] | 1062 | ; -------------------------------------------------- BOOT-MENU
|
|---|
| 1063 | MBR_Main_ReEnterBootMenu:
|
|---|
| 1064 | call BOOTMENU_ResetMenuVars ; reset has to be done
|
|---|
| 1065 | test CFG_AutomaticBoot, 1
|
|---|
| 1066 | jz MBR_Main_NoAutomaticBooting
|
|---|
| 1067 | ; ------------------------------------------ AUTOMATIC BOOTING
|
|---|
| 1068 | ; Select automatic partition, disable automatic booting for
|
|---|
| 1069 | ; next time and boot system...
|
|---|
| 1070 | mov CFG_AutomaticBoot, 0
|
|---|
| 1071 | call PASSWORD_AskSystemPwd
|
|---|
| 1072 | mov al, Menu_EntryAutomatic
|
|---|
| [30] | 1073 |
|
|---|
| [37] | 1074 | ;mov al, 2
|
|---|
| [30] | 1075 |
|
|---|
| [37] | 1076 | mov Menu_EntrySelected, al ; zero based
|
|---|
| 1077 | jmp MBR_Main_NoBootMenu
|
|---|
| [7] | 1078 |
|
|---|
| 1079 | MBR_Main_NoAutomaticBooting:
|
|---|
| [30] | 1080 |
|
|---|
| [37] | 1081 | ;call SOUND_Beep
|
|---|
| [30] | 1082 |
|
|---|
| [37] | 1083 | test CFG_BootMenuActive, 0FFh
|
|---|
| 1084 | jnz MBR_Main_GotBootMenu
|
|---|
| 1085 | ; ----------------------------------------------- NO BOOT-MENU
|
|---|
| 1086 | ; Select default partition and boot system...
|
|---|
| 1087 | call PASSWORD_AskSystemPwd
|
|---|
| [30] | 1088 |
|
|---|
| [37] | 1089 | ;call VideoIO_DBG_WriteString2
|
|---|
| [30] | 1090 |
|
|---|
| [37] | 1091 | mov al, Menu_EntryDefault
|
|---|
| 1092 | ;mov al,0 ; zero based
|
|---|
| 1093 | mov Menu_EntrySelected, al
|
|---|
| 1094 | jmp MBR_Main_NoBootMenu
|
|---|
| [7] | 1095 |
|
|---|
| [37] | 1096 | MBR_Main_GotBootMenu:
|
|---|
| 1097 | ; ------------------------------------------ BOOT-MENU VISUALS
|
|---|
| 1098 | call FX_StartScreen
|
|---|
| [30] | 1099 |
|
|---|
| [37] | 1100 | ;call SOUND_Beep
|
|---|
| [30] | 1101 |
|
|---|
| [37] | 1102 | call BOOTMENU_BuildBackground
|
|---|
| 1103 | call BOOTMENU_BuildMain
|
|---|
| 1104 | call FX_EndScreenRight
|
|---|
| 1105 | call PASSWORD_AskSystemPwd
|
|---|
| 1106 | call BOOTMENU_ResetTimedBoot
|
|---|
| [30] | 1107 |
|
|---|
| [37] | 1108 | ;call SOUND_Beep
|
|---|
| [30] | 1109 |
|
|---|
| [37] | 1110 | call BOOTMENU_Execute
|
|---|
| [30] | 1111 |
|
|---|
| [37] | 1112 | ;call SOUND_Beep
|
|---|
| [30] | 1113 |
|
|---|
| [37] | 1114 | jc MBR_Main_ReEnterSetup
|
|---|
| 1115 | call BOOTMENU_SetVarsAfterMenu
|
|---|
| [30] | 1116 |
|
|---|
| [37] | 1117 | ;call SOUND_Beep
|
|---|
| [30] | 1118 |
|
|---|
| [37] | 1119 | ; ---------------------------------------------------- BOOTING
|
|---|
| 1120 | MBR_Main_NoBootMenu:
|
|---|
| 1121 | call FX_StartScreen
|
|---|
| 1122 | call BOOTMENU_BuildGoodBye
|
|---|
| 1123 | call FX_EndScreenRight
|
|---|
| 1124 | call PASSWORD_AskChangeBootPwd
|
|---|
| [7] | 1125 |
|
|---|
| [37] | 1126 | IFNDEF ReleaseCode
|
|---|
| 1127 | ; Debug Code to terminate DOS .COM program - used for
|
|---|
| 1128 | ; testing AiR-BOOT
|
|---|
| 1129 | int 3
|
|---|
| 1130 | mov ax, 6200h
|
|---|
| 1131 | int 21h
|
|---|
| 1132 | mov es, bx
|
|---|
| 1133 | mov ax, 4C00h ; Quit program
|
|---|
| 1134 | int 21h
|
|---|
| 1135 | ENDIF
|
|---|
| 1136 | call ANTIVIR_SaveBackUpMBR
|
|---|
| 1137 | mov dl, Menu_EntrySelected
|
|---|
| [7] | 1138 |
|
|---|
| [37] | 1139 | ; -------------------------------------------- START PARTITION
|
|---|
| 1140 | call PART_StartPartition
|
|---|
| [30] | 1141 |
|
|---|
| 1142 |
|
|---|
| [31] | 1143 |
|
|---|
| [30] | 1144 | ;
|
|---|
| 1145 | ; Include other code-modules here.
|
|---|
| 1146 | ; Because TASM is a multiple pass assembler, forward references
|
|---|
| 1147 | ; are possible.
|
|---|
| 1148 | ;
|
|---|
| 1149 | b_std_txt:
|
|---|
| [37] | 1150 | Include REGULAR/STD_TEXT.ASM ; Standard (non-translateable text)
|
|---|
| [30] | 1151 | size_std_txt = $-b_std_txt
|
|---|
| 1152 |
|
|---|
| 1153 | b_driveio:
|
|---|
| [37] | 1154 | Include REGULAR/DRIVEIO.ASM ; Drive I/O, Config Load/Save
|
|---|
| [30] | 1155 | size_driveio = $-b_driveio
|
|---|
| 1156 |
|
|---|
| [43] | 1157 | b_lvm:
|
|---|
| 1158 | Include SPECIAL/LVM.ASM ; LVM-specific code
|
|---|
| 1159 | size_lvm = $-b_lvm
|
|---|
| 1160 |
|
|---|
| [30] | 1161 | b_videoio:
|
|---|
| [37] | 1162 | Include REGULAR/VIDEOIO.ASM ; Video I/O
|
|---|
| [30] | 1163 | size_videoio = $-b_videoio
|
|---|
| 1164 |
|
|---|
| 1165 | b_timer:
|
|---|
| [37] | 1166 | Include REGULAR/TIMER.ASM ; Timer
|
|---|
| [30] | 1167 | size_timer = $-b_timer
|
|---|
| 1168 |
|
|---|
| 1169 | b_partmain:
|
|---|
| [37] | 1170 | Include REGULAR/PARTMAIN.ASM ; Regular Partition Routines
|
|---|
| [30] | 1171 | size_partmain = $-b_partmain
|
|---|
| 1172 |
|
|---|
| 1173 | b_partscan:
|
|---|
| [37] | 1174 | Include REGULAR/PARTSCAN.ASM ; Partition Scanning
|
|---|
| [30] | 1175 | size_partscan = $-b_partscan
|
|---|
| 1176 |
|
|---|
| 1177 | b_bootmenu:
|
|---|
| [37] | 1178 | Include REGULAR/BOOTMENU.ASM ; Boot-Menu
|
|---|
| [30] | 1179 | size_bootmenu = $-b_bootmenu
|
|---|
| 1180 |
|
|---|
| 1181 | b_password:
|
|---|
| [37] | 1182 | Include REGULAR/PASSWORD.ASM ; Password related
|
|---|
| [30] | 1183 | size_password = $-b_password
|
|---|
| 1184 |
|
|---|
| 1185 | b_other:
|
|---|
| [37] | 1186 | Include REGULAR/OTHER.ASM ; Other Routines
|
|---|
| [30] | 1187 | size_other = $-b_other
|
|---|
| [7] | 1188 |
|
|---|
| [30] | 1189 | b_main:
|
|---|
| [37] | 1190 | Include SETUP/MAIN.ASM ; The whole AiR-BOOT SETUP
|
|---|
| [30] | 1191 | size_main = $-b_main
|
|---|
| 1192 |
|
|---|
| 1193 |
|
|---|
| [43] | 1194 |
|
|---|
| [30] | 1195 | IFDEF TXT_IncludeCyrillic
|
|---|
| 1196 | b_ccharset:
|
|---|
| [37] | 1197 | Include SPECIAL/CHARSET.ASM ; Charset Support (e.g. Cyrillic)
|
|---|
| [30] | 1198 | size_ccharset = $-b_ccharset
|
|---|
| 1199 | ENDIF
|
|---|
| 1200 |
|
|---|
| [43] | 1201 |
|
|---|
| [30] | 1202 | b_math:
|
|---|
| [37] | 1203 | Include REGULAR/MATH.ASM ; Math functions (like 32-bit multiply)
|
|---|
| [30] | 1204 | size_math = $-b_math
|
|---|
| 1205 |
|
|---|
| 1206 |
|
|---|
| [36] | 1207 |
|
|---|
| [43] | 1208 |
|
|---|
| 1209 | ; Various debugging routines, uses AUXIO and CONV
|
|---|
| 1210 | IFDEF AUX_DEBUG
|
|---|
| [30] | 1211 | b_debug:
|
|---|
| [43] | 1212 | Include REGULAR/DEBUG.ASM
|
|---|
| [30] | 1213 | size_debug = $-b_debug
|
|---|
| 1214 | b_auxio:
|
|---|
| [43] | 1215 | Include REGULAR/AUXIO.ASM ; Com-port support for debugging
|
|---|
| [30] | 1216 | size_auxio = $-b_auxio
|
|---|
| [43] | 1217 | ENDIF
|
|---|
| [30] | 1218 |
|
|---|
| 1219 |
|
|---|
| 1220 | ; End of sector 3.
|
|---|
| 1221 | eos3:
|
|---|
| 1222 |
|
|---|
| 1223 |
|
|---|
| 1224 |
|
|---|
| 1225 |
|
|---|
| [37] | 1226 |
|
|---|
| [31] | 1227 | ;==============================================================================
|
|---|
| [30] | 1228 |
|
|---|
| [37] | 1229 | ;
|
|---|
| 1230 | ; This is the AiR-BOOT MBR-Protection Image.
|
|---|
| 1231 | ; 04600 / 200h = 23h = 35d sectors are before this point.
|
|---|
| 1232 | ; The stuff generated here gets overwritten when the MBR_PROT.ASM
|
|---|
| 1233 | ; module, which is assembled separately, gets merged.
|
|---|
| 1234 | ; So you won't find the string below in the generated binary.
|
|---|
| 1235 | ;
|
|---|
| 1236 | ; MOVED TO 6800h to create space and have a continuous
|
|---|
| 1237 | ; code block.
|
|---|
| 1238 | ; This makes the RU version buildable again with Tasm.
|
|---|
| 1239 | ;
|
|---|
| 1240 | ;org 04600h ; Sector 36-37
|
|---|
| [30] | 1241 |
|
|---|
| 1242 | ; Start of sector 36.
|
|---|
| 1243 | sos36:
|
|---|
| 1244 |
|
|---|
| 1245 |
|
|---|
| [37] | 1246 |
|
|---|
| [30] | 1247 | ; End of sector 37, yes this section is 2 sectors long.
|
|---|
| 1248 | eos37:
|
|---|
| 1249 |
|
|---|
| 1250 |
|
|---|
| 1251 |
|
|---|
| 1252 |
|
|---|
| 1253 |
|
|---|
| 1254 |
|
|---|
| 1255 |
|
|---|
| [37] | 1256 |
|
|---|
| [31] | 1257 | ;==============================================================================
|
|---|
| 1258 | ; Sector 38-x
|
|---|
| [37] | 1259 | ;
|
|---|
| 1260 | ; This section contains translatable texts.
|
|---|
| 1261 | ;
|
|---|
| 1262 | ;org 04A00h
|
|---|
| [30] | 1263 |
|
|---|
| 1264 | ; Start of sector 28.
|
|---|
| 1265 | sos38:
|
|---|
| 1266 |
|
|---|
| 1267 | b_txtother:
|
|---|
| [37] | 1268 | Include TEXT/TXTOTHER.ASM ; All translateable Text-Strings
|
|---|
| [30] | 1269 | size_txtother = $-b_txtother
|
|---|
| 1270 |
|
|---|
| 1271 | b_txtmenus:
|
|---|
| [37] | 1272 | Include TEXT/TXTMENUS.ASM ; All translateable Menu-text
|
|---|
| [30] | 1273 | size_txtmenus = $-b_txtmenus
|
|---|
| 1274 |
|
|---|
| 1275 | b_charset:
|
|---|
| [37] | 1276 | Include TEXT/CHARSET.ASM ; Special Video Charsets (if needed)
|
|---|
| [30] | 1277 | size_charset = $-b_charset
|
|---|
| 1278 |
|
|---|
| [36] | 1279 | b_conv:
|
|---|
| [37] | 1280 | Include REGULAR/CONV.ASM ; Various conversion routines
|
|---|
| [36] | 1281 | size_conv = $-b_conv
|
|---|
| [30] | 1282 |
|
|---|
| 1283 | b_virus:
|
|---|
| [37] | 1284 | Include SPECIAL/VIRUS.ASM ; Virus Detection / Anti-Virus
|
|---|
| [30] | 1285 | size_virus = $-b_virus
|
|---|
| [29] | 1286 | ; [Linux support removed since v1.02]
|
|---|
| [37] | 1287 | ;Include SPECIAL/FAT16.ASM ; FAT-16 Support
|
|---|
| 1288 | ;Include SPECIAL/LINUX.ASM ; Linux Kernel Support
|
|---|
| [30] | 1289 | b_billsuxx:
|
|---|
| [37] | 1290 | Include SPECIAL/F00K/BILLSUXX.ASM ; Extended Partition - Microsoft-Hack
|
|---|
| [30] | 1291 | size_billsuxx = $-b_billsuxx
|
|---|
| 1292 |
|
|---|
| 1293 | b_sound:
|
|---|
| [37] | 1294 | Include SPECIAL/SOUND.ASM ; Sound
|
|---|
| [30] | 1295 | size_sound = $-b_sound
|
|---|
| 1296 |
|
|---|
| 1297 | b_apm:
|
|---|
| [37] | 1298 | Include SPECIAL/APM.ASM ; Power Managment Support
|
|---|
| [30] | 1299 | size_apm = $-b_apm
|
|---|
| 1300 |
|
|---|
| 1301 | b_fx:
|
|---|
| [37] | 1302 | Include SPECIAL/FX.ASM ; l33t Cooper-Bars/Scrolling <bg>
|
|---|
| [30] | 1303 | size_fx = $-b_fx
|
|---|
| 1304 |
|
|---|
| 1305 |
|
|---|
| 1306 | ;
|
|---|
| 1307 | ; Let's make this always the last module in this section.
|
|---|
| 1308 | ;
|
|---|
| [37] | 1309 | Include BLDDATE.ASM ; Build Date generated by _build.cmd
|
|---|
| [30] | 1310 |
|
|---|
| 1311 | ; End of sector x depending on size of translatable texts.
|
|---|
| 1312 | eosx:
|
|---|
| 1313 |
|
|---|
| 1314 |
|
|---|
| [43] | 1315 | ;
|
|---|
| 1316 | ; End of code marker.
|
|---|
| 1317 | ;
|
|---|
| 1318 | db 'BABE'
|
|---|
| 1319 | db 'FACE'
|
|---|
| [30] | 1320 |
|
|---|
| [43] | 1321 | code_end:
|
|---|
| [7] | 1322 |
|
|---|
| 1323 |
|
|---|
| 1324 |
|
|---|
| [43] | 1325 | here = $
|
|---|
| 1326 | org 06800h
|
|---|
| 1327 | ; For some reason, this overlap check does not work !!
|
|---|
| 1328 | ; I gues it's because 'here' has no definitive value yet
|
|---|
| 1329 | ; and since JWasm is a single pass assembler, it won't
|
|---|
| 1330 | ; change anymore. it is off by 1dh bytes.
|
|---|
| 1331 | ; (Changing the ORG to 6700h produces an overlap of 11dh.
|
|---|
| 1332 | ; This 1dh is by sheer coincidence the same length as the
|
|---|
| 1333 | ; MBR_Prot signature on my system, but it's not related.
|
|---|
| 1334 | check_overlap here
|
|---|
| 1335 |
|
|---|
| [37] | 1336 | ;
|
|---|
| 1337 | ; This is the AiR-BOOT MBR-Protection Image.
|
|---|
| [43] | 1338 | ; 06800 / 200h = 34h = 52d sectors are before this point.
|
|---|
| [37] | 1339 | ; The stuff generated here gets overwritten when the MBR_PROT.ASM
|
|---|
| 1340 | ; module, which is assembled separately, gets merged.
|
|---|
| 1341 | ; So you won't find the string below in the generated binary.
|
|---|
| 1342 | ;
|
|---|
| [43] | 1343 | ; Hardcoded to 1k (1024 bytes) (MBR_PROT.ASM)
|
|---|
| [37] | 1344 | MBR_Protection db 'AiR-BOOT MBR-Protection Image'
|
|---|
| 1345 |
|
|---|
| [43] | 1346 | ; Just fill.
|
|---|
| 1347 | db 1024-($-MBR_Protection) dup('M')
|
|---|
| [37] | 1348 |
|
|---|
| [43] | 1349 | ;LDRIMAGE ENDS
|
|---|
| [37] | 1350 | ;DATA_SEG SEGMENT USE16 PUBLIC 'CODE'
|
|---|
| 1351 |
|
|---|
| [43] | 1352 |
|
|---|
| 1353 |
|
|---|
| 1354 | ;~ MYDATA SEGMENT COMMON 'MIXED'
|
|---|
| 1355 | ;~ qqqq dw 'QQ'
|
|---|
| 1356 | ;~ MYDATA ENDS
|
|---|
| 1357 |
|
|---|
| [31] | 1358 | ;==============================================================================
|
|---|
| 1359 | ; Sector 55
|
|---|
| [30] | 1360 |
|
|---|
| [37] | 1361 | ;
|
|---|
| 1362 | ; This section contains the AiR-BOOT configuration.
|
|---|
| 1363 | ; Note that it has a version that should be updated
|
|---|
| 1364 | ; when stuff is added.
|
|---|
| 1365 | ; Also add stuff to the end so that offsets of other
|
|---|
| 1366 | ; variables remain vaild.
|
|---|
| 1367 | ;
|
|---|
| 1368 | here = $
|
|---|
| 1369 | org 06C00h
|
|---|
| 1370 | check_overlap here
|
|---|
| [30] | 1371 | sos55:
|
|---|
| 1372 |
|
|---|
| 1373 |
|
|---|
| [36] | 1374 |
|
|---|
| [37] | 1375 | Configuration:
|
|---|
| 1376 | ; THERE IS AN INVISIBLE CHAR HERE !!
|
|---|
| 1377 | ; Your editor may not display the invisible
|
|---|
| 1378 | ; character at the end if the 'AiRCFG-TABLE'
|
|---|
| 1379 | ; string. When this character get's deleted,
|
|---|
| 1380 | ; AiR-BOOT will not function because it cannot
|
|---|
| 1381 | ; find the config-signature which includes this
|
|---|
| 1382 | ; invisible character. The code is: 0x0ad.
|
|---|
| 1383 | db 'AiRCFG-TABLE'
|
|---|
| 1384 | db 01h, 07h, 'U' ; "Compressed" ID String
|
|---|
| 1385 | ; This is now version 1.07 to have it in sync with
|
|---|
| 1386 | ; the new code version for eCS.
|
|---|
| 1387 | ; Version 1.02 was for code 1.06, 1.03 was internal
|
|---|
| 1388 | ; and 1.04,1.05 and 1.06 do not exist.
|
|---|
| 1389 | ; It is not required for the config to have the
|
|---|
| 1390 | ; same version as the code, so in the future
|
|---|
| 1391 | ; the code version might be higher than the
|
|---|
| 1392 | ; config version if there are no changes to the latter.
|
|---|
| [7] | 1393 |
|
|---|
| [37] | 1394 | CFG_LastTimeEditLow dw 0 ; Last Time Edited Stamp (will incr every setup)
|
|---|
| 1395 | CFG_LastTimeEditHi dw 0 ; second 16 bit part...
|
|---|
| [7] | 1396 |
|
|---|
| [37] | 1397 | CFG_CheckConfig dw 0 ; Check-Sum for Configuration
|
|---|
| [7] | 1398 |
|
|---|
| [37] | 1399 | CFG_Partitions db 0 ; Count of partitions in IPT
|
|---|
| 1400 | db 0 ; Was BootParts - Removed since v0.28b
|
|---|
| 1401 | CFG_PartDefault db 0 ; Default-Partition (Base=0)
|
|---|
| [7] | 1402 |
|
|---|
| [37] | 1403 | CFG_PartLast db 0 ; Which Partition was booted last time ? (Base=0)
|
|---|
| 1404 | CFG_TimedBoot db 0 ; Timed Boot Enable (for REAL Enable look TimedBootEnable)
|
|---|
| 1405 | CFG_TimedSecs db 15 ; Timed Boot - How Many Seconds Till Boot
|
|---|
| 1406 | CFG_TimedDelay dw 123 ; Timed Boot - Delay
|
|---|
| 1407 | CFG_TimedBootLast db 1 ; Timed Boot - Boot From Last Drive Booted From
|
|---|
| 1408 | CFG_RememberBoot db 1 ; Remember Manual Boot Choice
|
|---|
| 1409 | CFG_RememberTimed db 0 ; Remember if Timed Boot (if both disabled: Boot Default)
|
|---|
| 1410 | CFG_IncludeFloppy db 1 ; Include Floppy Drives in Boot-Menu
|
|---|
| 1411 | CFG_BootMenuActive db 1 ; Display Boot-Menu (if Disabled: Boot Default)
|
|---|
| [7] | 1412 | ; v0.29+ -> 2 - Detailed Bootmenu
|
|---|
| [37] | 1413 | CFG_PartitionsDetect db 1 ; Autodetect New Partitions (Auto-Add!)
|
|---|
| 1414 | CFG_PasswordSetup db 0 ; Ask Password when entering Setup
|
|---|
| 1415 | CFG_PasswordSystem db 0 ; Ask Password when booting System
|
|---|
| 1416 | CFG_PasswordChangeBoot db 0 ; Ask Password when changing boot partition
|
|---|
| 1417 | CFG_ProtectMBR db 0 ; Protect MBR via TSR ?
|
|---|
| 1418 | CFG_IgnoreWriteToMBR db 0 ; Just ignore writes to MBR, otherwise crash
|
|---|
| 1419 | CFG_FloppyBootGetName db 0 ; Gets floppy name for display purposes
|
|---|
| 1420 | CFG_DetectVirus db 0 ; Detect Virus ?
|
|---|
| 1421 | CFG_DetectStealth db 0 ; Detect Stealth-Virus ?
|
|---|
| 1422 | CFG_DetectVIBR db 0 ; Detect BootRecord-Virus ?
|
|---|
| 1423 | CFG_AutoEnterSetup db 0 ; Automatic Enter Setup (first install!)
|
|---|
| 1424 | CFG_MasterPassword dw 0101Fh ; Encoded Password (this is just CR)
|
|---|
| 1425 | dw 07A53h
|
|---|
| 1426 | dw 0E797h
|
|---|
| 1427 | dw 0A896h
|
|---|
| 1428 | CFG_BootPassword dw 0101Fh ; Another CR... ;-)
|
|---|
| 1429 | dw 07A53h
|
|---|
| 1430 | dw 0E797h
|
|---|
| 1431 | dw 0A896h
|
|---|
| 1432 | db 0 ; Rude-Protection - Removed since v0.28b
|
|---|
| 1433 | CFG_LinuxRootPartition db 0 ; Linux Root Partition (Base=0)
|
|---|
| 1434 | CFG_TimedKeyHandling db 0 ; Timed Key Handling (for Timed Boot)
|
|---|
| 1435 | ; 0 - Do Nothing
|
|---|
| 1436 | ; 1 - Reset Time
|
|---|
| 1437 | ; 2 - Stop Time
|
|---|
| 1438 | CFG_MakeSound db 0 ; Should be clear ;)
|
|---|
| 1439 | CFG_FloppyBootGetTimer db 0 ; Floppy Name will get updated every 2 secs
|
|---|
| 1440 | CFG_ResumeBIOSbootSeq db 0 ; If BIOS Boot Sequence should be resumed
|
|---|
| 1441 | ; 0 - Disabled
|
|---|
| 1442 | ; 1 - CD-ROM
|
|---|
| 1443 | ; 2 - Network
|
|---|
| 1444 | ; 3 - ZIP/LS120
|
|---|
| 1445 | CFG_CooperBars db 0 ; If Cooper Bars should be shown
|
|---|
| 1446 | CFG_LinuxCommandLine db 75 dup (0) ; Linux Command Line
|
|---|
| 1447 | CFG_LinuxKrnlPartition db 0FFh ; FAT-16 Linux Kernel Partition (Base=0)
|
|---|
| 1448 | ; FFh -> Disabled
|
|---|
| 1449 | CFG_LinuxDefaultKernel db 'DEFAULT', 4 dup (32), 0 ; Default Kernel Name
|
|---|
| 1450 | CFG_LinuxLastKernel db 11 dup (32), 0 ; Last-Booted Kernel Name
|
|---|
| 1451 | CFG_ExtPartitionMShack db 0 ; Extended Partition M$-Hack Global Enable
|
|---|
| 1452 | CFG_AutomaticBoot db 0 ; Automatic Booting (only one bootup)
|
|---|
| 1453 | CFG_PartAutomatic db 0 ; Partition-No for automatic booting
|
|---|
| 1454 | CFG_ForceLBAUsage db 1 ; LBA-BIOS-API forced on any HDD I/O
|
|---|
| 1455 | CFG_IgnoreLVM db 0 ; Ignores any LVM-Information
|
|---|
| [7] | 1456 |
|
|---|
| [30] | 1457 |
|
|---|
| 1458 | ;
|
|---|
| 1459 | ; THERE IS ROOM RESERVED HERE FOR MORE VARIABLES
|
|---|
| 1460 | ;
|
|---|
| 1461 |
|
|---|
| [37] | 1462 | ; 6cae
|
|---|
| [30] | 1463 | eoc:
|
|---|
| 1464 |
|
|---|
| 1465 |
|
|---|
| 1466 |
|
|---|
| [37] | 1467 | ; Allways have the name of the installation volume
|
|---|
| 1468 | ; at this offset.
|
|---|
| 1469 | ; So future config changes will not break auto-install.
|
|---|
| 1470 | here = $
|
|---|
| 1471 | org 06D00h
|
|---|
| 1472 | check_overlap here
|
|---|
| 1473 |
|
|---|
| [30] | 1474 | soiv:
|
|---|
| 1475 |
|
|---|
| [31] | 1476 | ; SET(A)BOOT stores the volume name of the eCS system being installed here.
|
|---|
| 1477 | ; It is truncated to 11 chars because AiR-BOOT currently does not support
|
|---|
| 1478 | ; longer labelnames. The name is also capitalized.
|
|---|
| [37] | 1479 | ;eCS_InstallVolume db 12 dup (0)
|
|---|
| 1480 | ;eCS_InstallVolume db 'HIGHLOG' ,0
|
|---|
| 1481 | eCS_InstallVolume db 0,'NOPHASEONE' ,0
|
|---|
| 1482 | ;eCS_InstallVolume db 'ECS-MIDDLE',0,0
|
|---|
| 1483 | ;eCS_InstallVolume db 'ECS-HIGH',0,0,0,0
|
|---|
| 1484 | ;eCS_InstallVolume db 'ECS-HIGH',0,'NO',0
|
|---|
| [30] | 1485 |
|
|---|
| 1486 |
|
|---|
| [37] | 1487 | ; 6d0c
|
|---|
| [30] | 1488 | ; End of sector 55.
|
|---|
| 1489 | eos55:
|
|---|
| 1490 |
|
|---|
| 1491 |
|
|---|
| 1492 |
|
|---|
| 1493 |
|
|---|
| 1494 |
|
|---|
| 1495 |
|
|---|
| [37] | 1496 | ;
|
|---|
| 1497 | ; THERE IS ROOM RESERVED HERE FOR MORE VARIABLES
|
|---|
| 1498 | ;
|
|---|
| 1499 |
|
|---|
| 1500 |
|
|---|
| 1501 |
|
|---|
| 1502 | ;
|
|---|
| 1503 | ; 06DABh - 06C00h = 01ABh = 427 bytes.
|
|---|
| 1504 | ; Entries allocated down from 06E00 boundary.
|
|---|
| 1505 | ;
|
|---|
| 1506 | here = $
|
|---|
| 1507 | org 06DABh ; 427 Boundry
|
|---|
| 1508 | check_overlap here
|
|---|
| 1509 | sosvs:
|
|---|
| 1510 |
|
|---|
| 1511 | ; (432 - 5 = 427)
|
|---|
| 1512 | AutoDrvLetter db 0
|
|---|
| 1513 | AutoDrvLetterSerial dd 0
|
|---|
| 1514 |
|
|---|
| 1515 | ; This entry is also 34 bytes long (466 - 34 = 432)
|
|---|
| 1516 | BIOScontIPTentry:
|
|---|
| 1517 | db 0, 0, 0, 0, ' '
|
|---|
| 1518 | db 0, 0FEh, Flags_Bootable
|
|---|
| 1519 | dw 0 ; No Checksum :)
|
|---|
| 1520 | db 0, 1, 0
|
|---|
| 1521 | db 0, 1, 0 ; Location of Partition/Boot Record
|
|---|
| 1522 | dd 0, 0
|
|---|
| 1523 |
|
|---|
| [7] | 1524 | ; VIR variables are for the AiR-BOOT Anti Virus Code
|
|---|
| 1525 | ; Most of them are backups of Interrupt Points, so we can check, if a
|
|---|
| 1526 | ; stealth virus is on-line, we can intercept its call.
|
|---|
| 1527 | ; Normal (non stealth) virus are trapped simply by rereading the MBR sector.
|
|---|
| [30] | 1528 | ; If a virus is found, we will restore MBR from Sektor 60/62 and stop the system
|
|---|
| [7] | 1529 | ; from working, so the user has to press reset. That's saver than a Reboot.
|
|---|
| 1530 | ;
|
|---|
| 1531 | ; If a virus is found on the partition to boot, the system will ONLY halt,
|
|---|
| 1532 | ; nothing more, because we can not remove it. The user shall do it :)
|
|---|
| 1533 | ; Those viruses are detected via a real nasty method...Checksum-Checking of the
|
|---|
| 1534 | ; boot-record, which is to be executed. If it does not match the one in our
|
|---|
| 1535 | ; internal partition table, we will stop. You may however switch this detection
|
|---|
| 1536 | ; off or just reset it by switching 'VIBR Detection'.
|
|---|
| 1537 |
|
|---|
| [37] | 1538 | ; 478 - 12 = 466 ; 466 Sub-Part
|
|---|
| 1539 | CFG_VIR_INT08 dd 0 ; pointer to saved 08h entry point
|
|---|
| 1540 | CFG_VIR_INT13 dd 0 ; pointer to saved 13h entry point
|
|---|
| 1541 | CFG_VIR_INT1C dd 0 ; pointer to saved 1Ch entry point
|
|---|
| [30] | 1542 |
|
|---|
| [37] | 1543 | ; 478 Boundry (512-34)
|
|---|
| 1544 | ; This entry is also 34 bytes long
|
|---|
| 1545 | FloppyIPTentry db 0, 0, 0, 0, 'FloppyDrive'
|
|---|
| 1546 | db 0, 0FFh, Flags_Bootable
|
|---|
| 1547 | dw 0 ; No Checksum :)
|
|---|
| 1548 | db 0, 1, 0
|
|---|
| 1549 | db 0, 1, 0 ; Location of Partition/Boot Record
|
|---|
| 1550 | dd 0, 0
|
|---|
| 1551 | ;------------------------------------------------------------------------------
|
|---|
| [30] | 1552 |
|
|---|
| [37] | 1553 | eosvs:
|
|---|
| [30] | 1554 |
|
|---|
| [7] | 1555 |
|
|---|
| 1556 |
|
|---|
| 1557 |
|
|---|
| [37] | 1558 | ;org 06E00h ; Sector 56-57
|
|---|
| [30] | 1559 |
|
|---|
| [37] | 1560 | here = $
|
|---|
| 1561 | org image_size - 0a00h - (image_size - image_size_60secs)
|
|---|
| 1562 | check_overlap here
|
|---|
| [30] | 1563 |
|
|---|
| 1564 | sos56:
|
|---|
| 1565 |
|
|---|
| 1566 |
|
|---|
| 1567 |
|
|---|
| 1568 | ; Rousseau: This is the start of the AiR-BOOT IPT
|
|---|
| 1569 |
|
|---|
| [37] | 1570 | PartitionTable: ; no-partitions detected... :]
|
|---|
| [7] | 1571 | ; db 1, 0, 0, 0, 'Harddisc 1'
|
|---|
| 1572 | ; db 0, 0FFh, Flags_BootAble
|
|---|
| 1573 | ; dw 0 ; No Checksum :)
|
|---|
| 1574 | ; db 0, 0, 1
|
|---|
| 1575 | ; db 0, 0, 1 ; Location of Partition/Boot Record
|
|---|
| 1576 | ; dd 0, 0
|
|---|
| 1577 |
|
|---|
| [37] | 1578 | ; Format is:
|
|---|
| 1579 | ;============
|
|---|
| 1580 | ; SerialNumber * 4
|
|---|
| 1581 | ; PartitionName * 11
|
|---|
| 1582 | ; Drive * 1
|
|---|
| 1583 | ; SystemID * 1 (means the partition type)
|
|---|
| 1584 | ; Flags * 1
|
|---|
| 1585 | ; Checksum * 2 (for virus checking)
|
|---|
| 1586 | ; LocationBegin * 3 (where the partition begins)
|
|---|
| 1587 | ; LocationPartTab * 3 (where the partition table is)
|
|---|
| 1588 | ; AbsoluteBegin * 4 (where the partition begins, in absolute sectors)
|
|---|
| 1589 | ; AbsolutePartTab * 4 (where the partition table is, in absolute sectors)
|
|---|
| 1590 | ; --------------------> 34 Bytes (total maximum partition-entries = 30)
|
|---|
| [7] | 1591 |
|
|---|
| [38] | 1592 | db (LocIPT_MaxPartitions * LocIPT_LenOfIPT) dup (0)
|
|---|
| [30] | 1593 |
|
|---|
| [37] | 1594 |
|
|---|
| 1595 | ; 73fa !!!!!!!!!!!!!!
|
|---|
| [30] | 1596 | eos56:
|
|---|
| 1597 |
|
|---|
| 1598 |
|
|---|
| 1599 |
|
|---|
| [37] | 1600 |
|
|---|
| 1601 | ;org 071F6h
|
|---|
| 1602 | ; 73F6
|
|---|
| 1603 |
|
|---|
| 1604 | ; No need to check overlap here because this string will
|
|---|
| 1605 | ; be overwritten if the maximum partition count is reached.
|
|---|
| 1606 | ; So this is not a critical boundary.
|
|---|
| 1607 | org image_size - 600h - (image_size - image_size_60secs) / 2 - 0ah
|
|---|
| 1608 |
|
|---|
| [30] | 1609 | soiptsig:
|
|---|
| [37] | 1610 | db 'AiRBOOTPAR' ; 1K internal partition table
|
|---|
| [30] | 1611 |
|
|---|
| 1612 |
|
|---|
| 1613 |
|
|---|
| 1614 | eoiptsig:
|
|---|
| 1615 |
|
|---|
| 1616 |
|
|---|
| [37] | 1617 |
|
|---|
| [31] | 1618 | ;------------------------------------------------------------------------------
|
|---|
| 1619 | ;org 07200h ; Sector 58
|
|---|
| [37] | 1620 |
|
|---|
| 1621 | here = $
|
|---|
| 1622 | org image_size - 600h - (image_size - image_size_60secs) / 2
|
|---|
| 1623 | check_overlap here
|
|---|
| [30] | 1624 | soipt:
|
|---|
| 1625 | sos58:
|
|---|
| [37] | 1626 | ; 7400h
|
|---|
| [38] | 1627 | HidePartitionTable db (LocIPT_MaxPartitions * LocHPT_LenOfHPT) dup (0FFh)
|
|---|
| [37] | 1628 | ; Format is:
|
|---|
| 1629 | ;============
|
|---|
| 1630 | ; PartitionPtr : BYTE * 30
|
|---|
| [38] | 1631 | ; --------------------> 30 Bytes * 45
|
|---|
| [30] | 1632 |
|
|---|
| [38] | 1633 | DriveLetters db LocIPT_MaxPartitions dup (0)
|
|---|
| [37] | 1634 | ; Format is:
|
|---|
| 1635 | ;============
|
|---|
| 1636 | ; Drive-Letter : BYTE (80h-C:, 81h-D:)
|
|---|
| [38] | 1637 | ; --------------------> 1 Byte * 45
|
|---|
| [7] | 1638 |
|
|---|
| [36] | 1639 | ;
|
|---|
| 1640 | ; There is some room here, but this is the configuration section.
|
|---|
| 1641 | ; So not available for code.
|
|---|
| 1642 | ;
|
|---|
| 1643 |
|
|---|
| [30] | 1644 | eos58:
|
|---|
| 1645 | eoipt:
|
|---|
| [7] | 1646 |
|
|---|
| [30] | 1647 |
|
|---|
| 1648 |
|
|---|
| 1649 |
|
|---|
| [37] | 1650 | ;org 075F6h
|
|---|
| 1651 | ; No need to check overlap here because this string will
|
|---|
| 1652 | ; be overwritten if the maximum partition count is reached.
|
|---|
| 1653 | ; So this is not a critical boundary.
|
|---|
| 1654 | org image_size - 200h -0ah
|
|---|
| 1655 | check_overlap here
|
|---|
| [30] | 1656 |
|
|---|
| 1657 | sohidsig:
|
|---|
| [37] | 1658 | ;
|
|---|
| 1659 | db 'AiRBOOTHID' ; 1K internal Hide-partition table
|
|---|
| [30] | 1660 |
|
|---|
| [37] | 1661 |
|
|---|
| [30] | 1662 | eohidsig:
|
|---|
| 1663 |
|
|---|
| 1664 |
|
|---|
| 1665 |
|
|---|
| 1666 |
|
|---|
| 1667 |
|
|---|
| [37] | 1668 |
|
|---|
| [31] | 1669 | ;------------------------------------------------------------------------------
|
|---|
| [37] | 1670 | ;org 07600h
|
|---|
| 1671 |
|
|---|
| 1672 | here = $
|
|---|
| 1673 | org image_size - 200h ; Sector 60
|
|---|
| 1674 | check_overlap here
|
|---|
| 1675 |
|
|---|
| [30] | 1676 | sohid:
|
|---|
| 1677 | sos60:
|
|---|
| [31] | 1678 |
|
|---|
| [37] | 1679 | MBR_BackUpMBR db 'AiR-BOOT MBR-BackUp - Just to fill this sector with something',0
|
|---|
| 1680 | AirBootRocks db 'AiR-BOOT Rocks!',0
|
|---|
| [7] | 1681 |
|
|---|
| [37] | 1682 | db 512-($-sohid)-2 dup(0)
|
|---|
| [36] | 1683 |
|
|---|
| [30] | 1684 | eos60:
|
|---|
| 1685 | eohid:
|
|---|
| 1686 |
|
|---|
| 1687 |
|
|---|
| 1688 |
|
|---|
| 1689 |
|
|---|
| [37] | 1690 | ;org 077FEh
|
|---|
| 1691 |
|
|---|
| 1692 | here = $
|
|---|
| 1693 | org image_size - 2
|
|---|
| 1694 | check_overlap here
|
|---|
| 1695 | dw 0BABEh
|
|---|
| 1696 |
|
|---|
| [30] | 1697 | eoab:
|
|---|
| 1698 |
|
|---|
| [37] | 1699 |
|
|---|
| 1700 | IFDEF SEGMENTED
|
|---|
| [30] | 1701 | ;
|
|---|
| 1702 | ; End of AiR-BOOT code and data.
|
|---|
| 1703 | ;
|
|---|
| 1704 |
|
|---|
| [43] | 1705 | LDRIMAGE ENDS
|
|---|
| [30] | 1706 |
|
|---|
| [43] | 1707 | ;DATA_SEG ENDS
|
|---|
| [37] | 1708 |
|
|---|
| [30] | 1709 | ;
|
|---|
| [37] | 1710 | ; Uninitialized Data (BSS)
|
|---|
| [30] | 1711 | ;
|
|---|
| [37] | 1712 | VOLATILE SEGMENT USE16 PUBLIC 'BSS'
|
|---|
| 1713 |
|
|---|
| 1714 | ENDIF
|
|---|
| 1715 |
|
|---|
| [30] | 1716 | sobss:
|
|---|
| [31] | 1717 | ;------------------------------------------------------------------------------
|
|---|
| [37] | 1718 | ;
|
|---|
| [38] | 1719 | ; Removed org for BSS data to be more compatible
|
|---|
| 1720 | ; with segment-concatenated layout.
|
|---|
| [37] | 1721 | ;
|
|---|
| [42] | 1722 | ; What happens before this space ??
|
|---|
| 1723 | ; If org 0 corruption occurs.
|
|---|
| 1724 | ;
|
|---|
| 1725 | org 02400h ; Uninitialized
|
|---|
| [43] | 1726 | ;~ org 00200h ; 200h geeft 3 floppies !
|
|---|
| [37] | 1727 |
|
|---|
| [7] | 1728 | ; This space actually gets initialized in PreCrap to NUL (till EndOfVariables)
|
|---|
| 1729 | BeginOfVariables:
|
|---|
| [37] | 1730 | PartitionSector db 512 dup (?) ; Temporary Sector for Partition
|
|---|
| 1731 | JfsPBR db 512 dup (?) ; Temporary Sector for JFS PBR writeback
|
|---|
| 1732 | LVMSector db 512 dup (?) ; Temporary Sector for LVM
|
|---|
| 1733 | TmpSector db 512 dup (?) ; Temporary Sector
|
|---|
| [30] | 1734 |
|
|---|
| [7] | 1735 | ; Everything used to build a new IPT and reference it to the old one
|
|---|
| [43] | 1736 | ; IETS OVERSCHRIJFT DIT !!
|
|---|
| [37] | 1737 | NewPartTable db 1536 dup (?) ; New Partition Table
|
|---|
| [43] | 1738 |
|
|---|
| [38] | 1739 | NewHidePartTable db partition_count * LocHPT_LenOfHPT dup (?) ; New Hide-Partition Table
|
|---|
| [37] | 1740 | NewDriveLetters db partition_count dup (?) ; Logical Drive-Letters
|
|---|
| [7] | 1741 |
|
|---|
| [37] | 1742 | PartitionSizeTable db partition_count * 6 dup (?) ; Size-Table (6 bytes per partition)
|
|---|
| 1743 | PartitionPointers dw 52 dup (?) ; Maximum is 52 entries till now
|
|---|
| 1744 | PartitionPointerCount db ? ; Count of total Partition Pointers
|
|---|
| [44] | 1745 | PartitionXref db partition_count dup (?) ; X-Reference Table (holds new partnr, index is old part nr)
|
|---|
| [37] | 1746 | PartitionVolumeLetters db partition_count dup (?) ; Volume-Letters
|
|---|
| [31] | 1747 | ; 0 - no LVM support
|
|---|
| 1748 | ; 1 - LVM support, but no letter
|
|---|
| 1749 | ; 'C'-'Z' - assigned drive letter
|
|---|
| [7] | 1750 |
|
|---|
| [37] | 1751 | TotalHarddiscs db ? ; Total harddrives (by POST)
|
|---|
| 1752 | LBASwitchTable db 128 dup (?) ; Bit 25-18 for CHS/LBA Switching
|
|---|
| 1753 | NewPartitions db ? ; Freshly found partitions
|
|---|
| 1754 | ; Independent of SaveConfiguration
|
|---|
| [7] | 1755 |
|
|---|
| [37] | 1756 | VideoIO_Segment dw ? ; Segment for Video I/O
|
|---|
| [7] | 1757 |
|
|---|
| [37] | 1758 | ExtendedAbsPos dd ? ; Extended Partition Absolute Position
|
|---|
| 1759 | ExtendedAbsPosSet db ? ; If Absolute Position set
|
|---|
| [7] | 1760 |
|
|---|
| [37] | 1761 | CurPartition_Location dw 4 dup (?) ; Where did current partition come from?
|
|---|
| 1762 | CurIO_UseExtension db ? ; 1-Use INT 13h EXTENSIONS
|
|---|
| 1763 | ; (filled out by PreCrap)
|
|---|
| 1764 | CurIO_Scanning db ? ; 1-AiR-BOOT is scanning partitions
|
|---|
| 1765 | ; (for detailed error message)
|
|---|
| [7] | 1766 |
|
|---|
| [29] | 1767 | ; [Linux support removed since v1.02]
|
|---|
| 1768 | ;GotLinux db ? ; 1-Linux found
|
|---|
| [7] | 1769 |
|
|---|
| [37] | 1770 | Menu_EntrySelected db ? ; Which partition we boot this time...
|
|---|
| 1771 | Menu_UpperPart db ? ; Which number (Base=0) is the partition upper pos
|
|---|
| 1772 | Menu_AbsoluteX db ? ; Pos where Menu stuff starts
|
|---|
| 1773 | Menu_TotalParts db ? ; Copy of CFG_BootParts
|
|---|
| 1774 | Menu_TotalLines db ? ; Total Lines on Screen used for BootMenu
|
|---|
| 1775 | Menu_EntryDefault db ? ; Default Entry in filtered View
|
|---|
| 1776 | Menu_EntryLast db ? ; LastBooted Entry in filtered View
|
|---|
| 1777 | Menu_EntryAutomatic db ? ; Automatic Entry in filtered View
|
|---|
| [7] | 1778 | ; - All adjusted to menu locations
|
|---|
| 1779 |
|
|---|
| [37] | 1780 | PartSetup_UpperPart db ? ; Partition-Setup (like Menu_UpperPart)
|
|---|
| 1781 | PartSetup_ActivePart db ? ; Active Partition
|
|---|
| 1782 | PartSetup_HiddenUpper db ? ; (like Menu_UpperPart)
|
|---|
| 1783 | PartSetup_HiddenX db ? ; Pos for Hidden-Setup
|
|---|
| 1784 | PartSetup_HiddenAdd db ? ; Adjust for Hidden-Setup
|
|---|
| [7] | 1785 |
|
|---|
| [37] | 1786 | TimedBootEnable db ? ; Local Enable/Disable for timed boot
|
|---|
| 1787 | TimedTimeOut dd ? ; TimeOut Timer for TimedBoot (too much time here ;)
|
|---|
| 1788 | TimedSecondLeft db ? ; How many seconds are left till boom ?
|
|---|
| 1789 | TimedSecondBack db ? ; To get a modification noticed
|
|---|
| 1790 | TimedBootUsed db ? ; Timed Boot used for bootup ?
|
|---|
| 1791 | FloppyGetNameTimer dd ? ; Timer for Floppy-Get-Name
|
|---|
| 1792 | SETUP_KeysOnEntry db ? ; which Shift Status was there, when booting ?
|
|---|
| 1793 | SETUP_ExitEvent db ? ; Exit Event to end SETUP
|
|---|
| 1794 | TempPasswordEntry db 17 dup (?)
|
|---|
| 1795 | SETUP_OldPwd db 17 dup (?)
|
|---|
| 1796 | SETUP_NewPwd db 17 dup (?)
|
|---|
| 1797 | SETUP_VerifyPwd db 17 dup (?)
|
|---|
| 1798 | StartSoundPlayed db ?
|
|---|
| 1799 | ChangePartNameSave db ?
|
|---|
| [7] | 1800 |
|
|---|
| [37] | 1801 | FX_UseCount dw ?
|
|---|
| 1802 | FX_OverallTimer dw ?
|
|---|
| 1803 | FX_WideScrollerTimer dw ?
|
|---|
| 1804 | FX_WideScrollerCurPos dw ?
|
|---|
| 1805 | FX_WideScrollerSpeed db ?
|
|---|
| 1806 | FX_WideScrollerSpeedState db ?
|
|---|
| 1807 | FX_WideScrollerDirection db ?
|
|---|
| 1808 | FX_WideScrollerAbsDirection db ?
|
|---|
| 1809 | FX_WideScrollerBounceSpeed db ?
|
|---|
| 1810 | FX_CooperBarsTimer dw ?
|
|---|
| [7] | 1811 |
|
|---|
| [29] | 1812 | ; [Linux support removed since v1.02]
|
|---|
| 1813 | ;FAT16_Drive db ? ; FAT-16: Drive of FAT16-partition
|
|---|
| 1814 | ;FAT16_AbsPartitionBegin dd ? ; FAT-16: LBA Begin of Partition
|
|---|
| 1815 | ;FAT16_SecsPerCluster db ? ; FAT-16: Sectors Per Cluster
|
|---|
| 1816 | ;FAT16_NumOfRootEntries dw ? ; FAT-16: Number of Root Entries
|
|---|
| 1817 | ;FAT16_SecsPerFAT dw ? ; FAT-16: Sectors Per FAT
|
|---|
| 1818 | ;FAT16_AbsFATBegin dd ? ; FAT-16: LBA Begin of FAT
|
|---|
| 1819 | ;FAT16_AbsRootBegin dd ? ; FAT-16: LBA Begin of Root
|
|---|
| 1820 | ;FAT16_AbsClusterBegin dd ? ; FAT-16: LBA Begin of Clusters
|
|---|
| 1821 | ;FAT16_FATCacheSector db ? ; FAT-16: FAT-Sector No in Cache
|
|---|
| 1822 | ;FAT16_FATCache db 512 dup (?) ; FAT-16: FAT-Area Cache
|
|---|
| 1823 | ;
|
|---|
| 1824 | ;LINUX_KernelEntries db 680 dup (?) ; 34*20 -> Space for Kernel-Entries
|
|---|
| 1825 | ;LINUX_KernelNo db ? ; Total of Kernels in KernelEntries
|
|---|
| 1826 | ;LINUX_KernelSizeTable db 120 dup (?) ; Size-Table (6 bytes per kernel)
|
|---|
| [30] | 1827 | ;EndOfVariables:
|
|---|
| [7] | 1828 |
|
|---|
| [29] | 1829 | ; Dynamically Generated Tables - do not need to get initialized with NUL
|
|---|
| [37] | 1830 | FX_CooperColors db 672 dup (?) ; 7 cooper bars*96 - runtime calculated
|
|---|
| 1831 | FX_CooperState db 7 dup (?)
|
|---|
| 1832 | FX_SinusPos db 7 dup (?)
|
|---|
| 1833 | FX_CooperPos dw 7 dup (?)
|
|---|
| 1834 | CharsetTempBuffer db 4096 dup (?) ; Uninitialized Charset buffer
|
|---|
| 1835 | LVM_CRCTable dd 256 dup (?) ; LVM-CRC (->SPECiAL\LVM.asm)
|
|---|
| [7] | 1836 |
|
|---|
| [30] | 1837 |
|
|---|
| 1838 |
|
|---|
| 1839 | ;
|
|---|
| 1840 | ; Rousseau: added some stuff.
|
|---|
| 1841 | ;
|
|---|
| 1842 |
|
|---|
| 1843 |
|
|---|
| 1844 | ;EVEN
|
|---|
| [37] | 1845 | HugeDisk db MaxDisks dup(?)
|
|---|
| 1846 | TrueSecs dd MaxDisks dup(?)
|
|---|
| [30] | 1847 |
|
|---|
| 1848 | ; BIOS geometry of the boot-drive
|
|---|
| 1849 | ; Note that heads cannot be 256 due to legacy DOS/BIOS bug
|
|---|
| 1850 | ; If Int13X is supported those values are used, otherwise the legacy values.
|
|---|
| [37] | 1851 | BIOS_Cyls dd MaxDisks dup(?)
|
|---|
| 1852 | BIOS_Heads dd MaxDisks dup(?)
|
|---|
| 1853 | BIOS_Secs dd MaxDisks dup(?)
|
|---|
| 1854 | BIOS_Bytes dw MaxDisks dup(?)
|
|---|
| 1855 | BIOS_TotalSecs dq MaxDisks dup(?)
|
|---|
| [30] | 1856 |
|
|---|
| 1857 | ; LBA geometry of the boot-drive
|
|---|
| 1858 | ; Note that these values are taken from the BPB of a partition boot-record
|
|---|
| [37] | 1859 | LVM_Cyls dd MaxDisks dup(?)
|
|---|
| 1860 | LVM_Heads dd MaxDisks dup(?)
|
|---|
| 1861 | LVM_Secs dd MaxDisks dup(?)
|
|---|
| 1862 | LVM_Bytes dw MaxDisks dup(?)
|
|---|
| 1863 | LVM_TotalSecs dq MaxDisks dup(?)
|
|---|
| [30] | 1864 |
|
|---|
| 1865 | ; OS/2 geometry of the boot-drive
|
|---|
| 1866 | ; Note that these values are taken from the BPB of a partition boot-record
|
|---|
| [37] | 1867 | LOG_Cyls dd MaxDisks dup(?)
|
|---|
| 1868 | LOG_Heads dd MaxDisks dup(?)
|
|---|
| 1869 | LOG_Secs dd MaxDisks dup(?)
|
|---|
| 1870 | LOG_Bytes dw MaxDisks dup(?)
|
|---|
| 1871 | LOG_TotalSecs dq MaxDisks dup(?)
|
|---|
| [30] | 1872 |
|
|---|
| 1873 | ; Rousseau: moved here
|
|---|
| 1874 | EndOfVariables:
|
|---|
| 1875 |
|
|---|
| 1876 | ; Temporary buffer for 48h INT13X bios call
|
|---|
| 1877 | ; Word aligned
|
|---|
| 1878 | ;even
|
|---|
| 1879 | ;align 2
|
|---|
| 1880 |
|
|---|
| 1881 | ;db 1 dup(?)
|
|---|
| 1882 |
|
|---|
| [37] | 1883 | i13xbuf dw 1 dup (?) ; Size of the buffer;
|
|---|
| 1884 | ; this param *must* be present.
|
|---|
| 1885 | ; Code inserts it.
|
|---|
| 1886 | db 126 dup(?) ; The buffer itself.
|
|---|
| 1887 | i13xbuf_size = $-offset i13xbuf-2 ; Size of buffer
|
|---|
| 1888 | ; (excluding the size word at the start).
|
|---|
| [30] | 1889 |
|
|---|
| [44] | 1890 | ott db 512 dup(?)
|
|---|
| 1891 |
|
|---|
| [30] | 1892 | eobss:
|
|---|
| 1893 |
|
|---|
| [37] | 1894 | IFDEF SEGMENTED
|
|---|
| 1895 | VOLATILE ENDS
|
|---|
| 1896 | ELSE
|
|---|
| [43] | 1897 | LDRIMAGE ENDS
|
|---|
| [37] | 1898 | ENDIF
|
|---|
| [43] | 1899 |
|
|---|
| [37] | 1900 | END AIR_BOOT
|
|---|
| [30] | 1901 |
|
|---|