source: trunk/BOOTCODE/AIR-BOOT.ASM@ 45

Last change on this file since 45 was 45, checked in by Ben Rietbroek, 12 years ago

Now using compressed HidePartTable (auxdebug on) [2012-02-24]

WARNING!!

All commits upto and including the commit of [2012-05-13] contain
a severe bug!! Building from these sources and then disabling
the 'force LBA' feature while also using the drive-letter feature or
editing the label can DESTROY THE MBR on ALL ATTACHED DISKS!!
DO NOT DISABLE 'FORCE LBA USAGE' WHEN BUILT FROM THE THESE COMMITS!!

Fixes

o HidePartTabled now uses a 6-bit compressed format

Bitfield functions are used to manipulate the table.
Modifications mostly in PARTSCAN.ASM, PART_SET.ASM and PARTMAIN.ASM.
TODO: Determine impact on upgrading from previous versions.

Changes

o Changed LVM Label behavior

If they are the same, the LVM VolumeName is synced to LVM PartitionName
so they are the same again after the edit.
If they differ, only the LVM VolumeName is updated.

o Implemented stop scanning when partition limit of 45 is exceeded

User is presented with a warning pop-up.
Pressing a key will continue and the partitions that were found
so far are displayed in the menu.
The color of the selection bar is changed to red to indicate this
overflow situation.

o New overlap macro that works correctly with JWasm and Tasm

Now uses DB n DUP (<filler>) to fill space before a new ORG.
When overlap occurs n goes negative causing assembler error.

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