source: trunk/bootcode/air-boot.asm@ 57

Last change on this file since 57 was 57, checked in by Ben Rietbroek, 10 years ago

All source-files lowercased [v1.1.1-testing]

Some standard files like 'COPYING', 'LICENSE', etc. have not been
converted to lower case because they are usually distributed uppercased.

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