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

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

Reworked Build Environment [2012-02-15]

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

Changes

o Reworked build environment
o Start made with coding FIXCODE in C
o Moved MBR protection image
o New overlap macro
o Protect type 0x35 from edit (user popup)
o Protect type 0x35 from adding to menu (user popup)
o More...
! No LVM Label change yet

Note

o Changed license to GPL v3

See file COPYING in trunk.

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