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

Last change on this file since 36 was 36, checked in by Ben Rietbroek, 13 years ago

## RC1 ## -- Various Fixes and Enhancements [2012-01-25]

Fixes

o Fixed BootManager chaining

Chainloaing IBM BootManager would did now work because it was not
supplied with the correct information. It needs some special
signatures and data setup, especially when it is located above the
8 MiB boundary. In addidtion, when IBM BootManager is located on the
secon harddisk, a copy of the 1st harddisk MBR needs to be
at 0000:7E00 before relinguishing control to IBM-BM.

o Fixed Boot from Floppy

This did not work because Int13X was used to access the floppy
instead of the classic Int13 interface. On fresh installations the
booot from floppy menu-item is now enabled by default.

o Fixed drive-letter feature for when using JFS

The JFS boot-strap code does not use the boot-sector passed to it
in memory. Instead is uses the one that resides on disk. This made
the drive-letter feature disfunctional on JFS. Now, when using the
dl-feature on JFS, a modified PBR with the new drive-letter is
written to disk so the JFS boot-strap code uses the new
drive-letter.

o Fixed bug in LVM label editing

When editing an LVM-label, it was padded with spaces instead of
zero's. Labels in the PBR need to be space padded to 8 chars, LVM
labels need to be zero padded to 32-chars in the LVM-record.

o Fixed stuck Phase #1 indicator

When an eCS installation is taking place, and somehow this
installation passed a wrong volume-name or was aborted, the Phase #1
indicator would not be reset on next reboot, causing AiR-BOOT to
skip the menu and try to boot the partition that was being
installed, but has no system due to incorrect name or user abort.

Changes

o Show LVM Volume Label instead of LVM Partition Label

This makes the display of the labels more consistent with IBM-BM.
Since most systems will be partitioned with MiniLVM, which sets
both to the same name, this change will not be noted on the majority
of installations.

o Synchronize LVM-labels

When editing the LVM-lavel from AiR-BOOT SETUP, the LVM Partition
Label is synced with the new LVM Volume Label. This synchronization
only occurs when both were the same before the edit. It they were
different, only the LVM V-label is changed and the P-label remains
untouched.

o Protect type 0x35 partitions from label editing

These are spanned volumes and are not bootable anyway.
The normal eCS Volume Management tools should be used to change
the labels of these partition types.

Note

This commit and all following commits upto and including the RC3
commit [2012-09-09] are delayed commits from a local repository.
Also, the RC (Release Candidate) naming of the corresponding commits
is a bit misleading. One would label a revision with RC when near to
a final release. Since many things have changed between RC1,RC2 & RC3,
these RC's should be interpreted as mile-stones.

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 ABOVE COMMITS!!

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