source: trunk/bootcode/airboot.asm@ 141

Last change on this file since 141 was 141, checked in by Ben Rietbroek, 8 years ago

Moved the clearing of BSS variables to an earlier stage [v1.1.1-testing]

When debugging, we want 'AuxIO' available before 'PRECRAP'.

CAUTION:
This is a testbuild !
AirBoot uses the BIOS to access disks and a small coding error can trash
partition tables or other vital disk structures. You are advised to make
backups of TRACK0 and EBRs before using this testbuild. More info at:
https://rousseaux.github.io/netlabs.air-boot/pdf/AirBoot-v1.1.0-manual.pdf

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