source: trunk/AIR-BOOT/SOURCE/AIR-BOOT.ASM@ 12

Last change on this file since 12 was 12, checked in by kiewitz, 23 years ago

AIR-BOOT v1.0.
Signature-date: 2003-01-07.
Added SW language and updated images and installers.
Updated language menus.
Note: This comment was created after rebuilding the repo. [2011-07]

File size: 33.7 KB
Line 
1
2; Disclaimer:
3;=============
4; The sourcecode is released via www.netlabs.org CVS *ONLY*.
5; You MUST NOT upload it to other servers nor republish it in any way.
6; The sourcecode is still COPYRIGHTED and NOT YET RELEASED UNDER GPL.
7; It's (c) Copyright 1998-2002 by Martin Kiewitz.
8; You may recompile the source and do *PRIVATE* modifications, but please keep
9; in mind that modifying this code needs at least *some* assembly skill. If
10; you mess up your system, because you needed to hack your way through, don't
11; blame me. Releasing a customized version of AiR-BOOT, selling it in any form
12; or reusing parts of this source is *PROHIBITED*. Ask me, if you have some
13; idea about new functionality *before* developing the code, otherwise I will
14; definitely reject it. Also please accept, that I have some basic design
15; rules on AiR-BOOT and I will maintain them at all costs, so this won't get
16; another GRUB.
17
18;---------------------------------------------------------------------------
19; AiR-BOOT / MAIN-CODE
20;---------------------------------------------------------------------------
21
22; If ReleaseCode is not defined, it will produce debug-able code...
23ReleaseCode equ -1
24
25JUMPS
26
27; All Special Equs for this project
28
29IFDEF ReleaseCode
30 ExecBaseSeg equ 00000h
31 ExecBasePtr equ 07C00h ; BIOS starts our MBR at 0:7C00
32 ELSE
33 ExecBaseSeg equ 03ABFh ; Adjust to DOS segment
34 ExecBasePtr equ 00100h
35ENDIF
36BootBaseSeg equ 8000h
37BootBasePtr equ 0h ; We put our MBR to this location
38BootBaseExec equ BootBasePtr+offset MBR_RealStart
39StackSeg equ 7000h
40
41VideoIO_Page0 equ 0B800h
42VideoIO_Page1 equ 0B900h
43VideoIO_Page2 equ 0BA00h
44VideoIO_Page4 equ 0BC00h
45VideoIO_FXSegment equ 0A000h
46
47Include ..\..\global\asm.inc\stdmacro.inc
48Include ..\INSTALL\GLOBAL.ASM\airboot.inc
49
50TextChar_WinLineRight equ 0C4h ; 'Ä'
51TextChar_WinLineDown equ 0B3h ; '³'
52TextChar_WinRep1 equ 0D1h ; 'Ñ'
53TextChar_WinRep2 equ 0C5h ; 'Å'
54TextChar_WinRep3 equ 0CFh ; 'Ï'
55TextChar_WinRep4 equ 0B5h ; 'µ'
56TextChar_WinRep5 equ 0C6h ; 'Æ'
57TextChar_WinRep6 equ 0D8h ; 'Ø'
58
59; Offsets for Partition-Entries in MBR/EPRs
60LocBRPT_LenOfEntry equ 16
61LocBRPT_Flags equ 0
62LocBRPT_BeginCHS equ 1
63LocBRPT_BeginHead equ 1
64LocBRPT_BeginSector equ 2
65LocBRPT_BeginCylinder equ 3
66LocBRPT_SystemID equ 4
67LocBRPT_EndCHS equ 5
68LocBRPT_EndHead equ 5
69LocBRPT_EndSector equ 6
70LocBRPT_EndCylinder equ 7
71LocBRPT_RelativeBegin equ 8
72LocBRPT_AbsoluteLength equ 12
73
74LocBR_Magic equ 510
75
76; Offsets for IPT (Internal Partition Table)
77LocIPT_MaxPartitions equ 30 ; Maximum LocIPT_MaxPartitions
78LocIPT_LenOfSizeElement equ 6 ; Size of one Size-Element
79LocIPT_LenOfIPT equ 34
80LocIPT_Serial equ 0
81LocIPT_Name equ 4
82LocIPT_Drive equ 15 ; Drive-ID
83LocIPT_SystemID equ 16 ; Partition-Type
84LocIPT_Flags equ 17 ; AiR-BOOT Flags for partition
85LocIPT_BootRecordCRC equ 18 ; CRC of Boot-Record
86LocIPT_LocationBegin equ 20 ; Begin of Partition
87LocIPT_LocationPartTable equ 23 ; PartitionTable of Partition
88LocIPT_AbsoluteBegin equ 26 ; Absolute Sector of Begin
89LocIPT_AbsolutePartTable equ 30 ; Absolute Sector of PartTable
90
91LocIPT_DefaultFlags equ 00000011b ; Don't know if boot-able :)
92LocIPT_DefaultNonBootFlags equ 00000010b ; ...VIBR Detection is always on
93
94Flags_BootAble equ 00000001b
95Flags_VIBR_Detection equ 00000010b
96Flags_HideFeature equ 00000100b
97Flags_DriveLetter equ 00001000b ; OS/2 FAT16/HPFS only
98Flags_ExtPartMShack equ 00010000b ; Extended Partition M$-Hack req ?
99Flags_NoPartName equ 01000000b
100Flags_NowFound equ 10000000b ; temp only in OldPartTable
101Flags_SpecialMarker equ 10000000b ; temp only for HiddenSetup
102
103FileSysFlags_BootAble equ 00000001b ; Is this Partition boot-able ?
104FileSysFlags_FAT32 equ 00010000b ; FAT 32 specific name getting
105FileSysFlags_NoName equ 00100000b ; No Name - use PartitionName
106
107Keys_Up equ 48h
108Keys_Down equ 50h
109Keys_Left equ 4Bh
110Keys_Right equ 4Dh
111Keys_PageUp equ 49h
112Keys_PageDown equ 51h
113Keys_GrayPlus equ 4Eh
114Keys_GrayMinus equ 4Ah
115Keys_Plus equ 1Bh
116Keys_Minus equ 35h
117Keys_Enter equ 1Ch
118Keys_ESC equ 1h
119Keys_F1 equ 3Bh
120Keys_F10 equ 44h
121Keys_C equ 2Eh ; Add. Check auf Ctrl!
122Keys_Y equ 2Ch
123Keys_Z equ 15h
124Keys_N equ 31h
125Keys_TAB equ 0Fh
126Keys_Delete equ 53h
127Keys_Backspace equ 0Eh
128Keys_Space equ 20h
129
130Keys_Flags_EnterSetup equ 1100b ; Strg+Alt (AL)
131
132 .386p
133 model large, basic
134
135code_seg segment public use16
136 assume cs:code_seg, ds:code_seg, es:nothing, ss:nothing
137
138 org 00000h ; Sector 1
139;---------------------------------------------------------------------------
140AiR_BOOT: cli
141 db 0EBh ; JMP-Short -> MBR_Start
142 db 'AiRBOOT', 07h, 01h, 20h, 03h, 01h, 00h, TXT_LanguageID
143 ; ID String, Date and Version Number, U for US version
144 db 1 ; Total Sectors Count,
145 ; Will get overwritten by FIXBSET.exe
146MBR_CheckCode dw 0 ; Check-Sum for Code
147
148MBR_Start: sti ; This opcode is dedicated to:
149 cld ; =FUCK MICROSOFT=
150 mov ax, ExecBaseSeg ; fuck every M$-coder,
151 mov ds, ax ; fuck every M$-executive,
152 mov si, ExecBasePtr ; fuck every M$-supporter and
153 mov ax, BootBaseSeg ; fuck everyone that is working for
154 mov es, ax ; that evil business. k?thx
155 mov di, BootBasePtr
156 IFDEF ReleaseCode
157 mov cx, 256
158 ELSE
159 mov cx, 32700
160 ENDIF
161 rep movsw
162 db 0EAh
163 dw BootBaseExec
164 dw BootBaseSeg
165 ; jmp far ptr BootBaseSeg:BootBaseExec
166
167MBR_HaltSystem:
168 mov ax, 8600h
169 xor cx, cx
170 mov dx, 500
171 int 15h ; Wait to display the whole screen :]
172MBR_FuckUpSys:cli
173 jmp MBR_FuckUpSys
174
175 db '=FUCKMS='
176 jmp MBR_Start ; WE HAVE TO DO THIS CAUSE MICKEYSOFT
177 ; This needs to be at THIS fixed
178 ; location, don't modify it.
179
180 db 'LOAD ERROR!', 0
181MBR_LoadError Proc Near Uses
182 mov si, offset $-12
183 push cs
184 pop ds
185 call MBR_Teletype
186 MBRLE_Halt:
187 jmp MBRLE_Halt
188MBR_LoadError EndP
189
190 db 'SAVE ERROR!', 0
191MBR_SaveError Proc Near Uses
192 mov si, offset $-12
193 push cs
194 pop ds
195 call MBR_Teletype
196 MBRSE_Halt:
197 jmp MBRSE_Halt
198MBR_SaveError EndP
199
200; In: SI - Pointer to begin of string (EOS is 0)
201; Destroyed: SI
202MBR_Teletype Proc Near Uses ax bx cx
203 mov ah, 0Eh
204 mov bx, 7
205 MBRT_Loop:
206 lodsb
207 or al, al
208 jz MBRT_End
209 int 10h
210 jmp MBRT_Loop
211 MBRT_End:
212 ret
213MBR_Teletype EndP
214
215; In: BX - Base Check, DS:SI - Pointer to 512-byte-area to be included
216; Out: BX - Base Check Result
217; Destroyed: SI will get updated (+512)
218MBR_GetCheckOfSector Proc Near Uses ax cx
219 mov cx, 256
220 MBRGCOS_Loop:
221 lodsw
222 xor ax, 0BABEh
223 xor bx, ax
224 loop MBRGCOS_Loop
225 or bx, bx
226 jnz MBRGCOS_NoFixUp
227 mov bx, 1 ; dont allow 0, cause 0 == empty
228 MBRGCOS_NoFixUp:
229 ret
230MBR_GetCheckOfSector EndP
231
232;---------------------------------------------------------------------------
233MBR_RealStart:
234 mov ax, StackSeg
235 mov ss, ax
236 mov sp, 7FFFh
237 mov ax, es
238 mov ds, ax ; Set DS==ES to Code Segment
239 IFNDEF ReleaseCode
240 jmp AiR_BOOT_Start
241 ENDIF
242 ; Load missing parts from harddrive...
243 mov ax, cs
244 mov es, ax
245 mov bx, offset Configuration
246 mov dx, 0080h ; First harddrive, Sector 55
247 mov cx, 0037h
248 mov ax, 0205h ; Read 5 sectors
249 int 13h
250 jnc MBR_ConfigCopy_NoError
251 call MBR_LoadError ; Will Abort BootUp
252 MBR_ConfigCopy_NoError:
253 mov bx, offset FurtherMoreLoad
254 mov dx, 0080h ; First harddrive, Sector 2
255 mov cx, 0002h
256 mov ah, 02h
257 mov al, ds:[TotalSectorsUsedPtr]
258 int 13h
259 jnc MBR_RealStart_NoError
260 call MBR_LoadError ; Will Abort BootUp
261 MBR_RealStart_NoError:
262 ; Now Check Code with CheckSum
263 mov si, offset FurtherMoreLoad
264 movzx cx, bptr ds:[TotalSectorsUsedPtr]
265 xor bx, bx
266 MBR_RealStart_CheckCodeLoop:
267 call MBR_GetCheckOfSector
268 loop MBR_RealStart_CheckCodeLoop
269 cmp MBR_CheckCode, bx
270 je MBR_RealStart_CheckSuccess
271 mov si, offset TXT_ERROR_Attention
272 call MBR_Teletype
273 mov si, offset TXT_ERROR_CheckCode
274 call MBR_Teletype
275 mov si, offset TXT_ERROR_CheckFailed
276 call MBR_Teletype
277 jmp MBR_HaltSystem
278 MBR_RealStart_CheckSuccess:
279 jmp AiR_BOOT_Start
280
281;---------------------------------------------------------------------------
282 Include TEXT\TXTMBR.asm ; All translateable Text in MBR
283;---------------------------------------------------------------------------
284 org 00200h ; Sector 2
285; Everything beyond this point is loaded on startup and is NOT existant at first
286FurtherMoreLoad:
287 ; first Normal-Partition-ID, Hidden-Partition-ID
288 ; and Default-Partition-Flags.
289 ; 01h -> Boot-Able
290 ; 10h -> FAT32 - Name Getting Scheme
291 ; 20h -> No Name To Get (use Partition Name)
292 db 'AiRSYS-TABLE'
293FileSysIDs: db 01h, 11h,01h, 04h,014h,01h, 06h,016h,01h, 0Eh,00Eh,01h
294 db 07h, 17h,01h, 08h,017h,21h, 35h,035h,00h,0EBh,0EBh,01h
295 db 09h, 19h,11h, 0Bh,01Bh,11h, 0Ch,01Ch,11h, 01h,001h,01h
296 db 63h, 63h,21h, 81h,081h,21h, 83h,083h,21h, 40h,040h,21h
297 db 0A5h,0A5h,21h,0A6h,0A6h,21h, 82h,082h,20h,0A7h,0A7h,21h
298 db 63h, 63h,21h, 4Dh,04Dh,21h, 4Eh,04Eh,21h, 4Fh,04Fh,21h
299 db 01h, 01h,01h, 01h,001h,01h, 01h,001h,01h, 01h,001h,01h
300 db 01h, 01h,01h, 01h,001h,01h, 01h,001h,01h, 01h,001h,01h
301 db 01h, 01h,01h, 01h,001h,01h, 01h,001h,01h, 01h,001h,01h
302 db 01h, 01h,01h,0FDh,0FDh,20h, 84h,084h,20h,0A0h,0A0h,20h
303 db 0Ah, 0Ah,20h,0FEh,0FEh,21h,0FFh,0FFh,21h, 00h,000h,21h
304 db 16 dup (0)
305
306FileSysNames: db 'FAT12 ', 'FAT16 ', 'FAT16Big', 'FAT16Big'
307 db 'HPFS ', 'NTFS ', 'LVM-Data', 'BeOS '
308 db 'FAT32 ', 'FAT32 ', 'FAT32 ', ' '
309 db 'Unix ', 'Minix ', 'Linux ', 'Venix ' ; x row ;)
310 db 'BSD/386 ', 'OpenBSD ', 'LinuxSwp', 'NeXTSTEP'
311 db 'GNU HURD', 'QNX ', 'QNX ', 'QNX '
312 db ' ', ' ', ' ', ' '
313 db ' ', ' ', ' ', ' '
314 db ' ', ' ', ' ', ' '
315 db ' ', 'Kernel ', ' ', '0V-Award'
316 db 'OS/2 Man', 'via BIOS', 'Floppy ', 'Unknown '
317 ; -> 44 Partition-Types
318
319;---------------------------------------------------------------------------
320 org 00400h ; Sector 3
321AiR_BOOT_Start: mov ax, VideoIO_Page1
322 call VideoIO_BackUpTo ; Copy BIOS POST to Second Page
323 mov si, offset Copyright
324 call MBR_Teletype
325 ; Initialize Variable-Tables, Detections, etc.
326 call PRECRAP_Main
327 call PARTSCAN_ScanForPartitions
328 MBR_Main_ReEnterSetup:
329 call SETUP_CheckEnterSETUP
330 call AFTERCRAP_Main
331
332 ; Now get FAT16-Linux Kernel Partition, If requested
333 cmp [CFG_LinuxKrnlPartition], 0FFh
334 je MBR_Main_NoLinuxKrnlPartition
335 call LINUX_InitFAT16access
336 MBR_Main_NoLinuxKrnlPartition:
337
338 ; SetUp PartitionPointers for BootMenu (filter non-bootable)
339 call PART_CalculateMenuPartPointers
340
341 ; ...and count that one...
342 cmp PartitionPointerCount, 0
343 jne MBR_Main_SomethingBootAble
344 mov si, offset TXT_NoBootAble
345 call MBR_Teletype
346 jmp MBR_HaltSystem
347
348 MBR_Main_SomethingBootAble:
349 ; FixUp Values, define Timed Setup booting, etc.
350 call PART_FixUpDefaultPartitionValues
351
352 ; -------------------------------------------------- BOOT-MENU
353 MBR_Main_ReEnterBootMenu:
354 call BOOTMENU_ResetMenuVars ; reset has to be done
355 test CFG_AutomaticBoot, 1
356 jz MBR_Main_NoAutomaticBooting
357 ; ------------------------------------------ AUTOMATIC BOOTING
358 ; Select automatic partition, disable automatic booting for
359 ; next time and boot system...
360 mov CFG_AutomaticBoot, 0
361 call PASSWORD_AskSystemPwd
362 mov al, Menu_EntryAutomatic
363 mov Menu_EntrySelected, al
364 jmp MBR_Main_NoBootMenu
365
366 MBR_Main_NoAutomaticBooting:
367 test CFG_BootMenuActive, 0FFh
368 jnz MBR_Main_GotBootMenu
369 ; ----------------------------------------------- NO BOOT-MENU
370 ; Select default partition and boot system...
371 call PASSWORD_AskSystemPwd
372 mov al, Menu_EntryDefault
373 mov Menu_EntrySelected, al
374 jmp MBR_Main_NoBootMenu
375
376 MBR_Main_GotBootMenu:
377 ; ------------------------------------------ BOOT-MENU VISUALS
378 call FX_StartScreen
379 call BOOTMENU_BuildBackground
380 call BOOTMENU_BuildMain
381 call FX_EndScreenRight
382 call PASSWORD_AskSystemPwd
383 call BOOTMENU_ResetTimedBoot
384 call BOOTMENU_Execute
385 jc MBR_Main_ReEnterSetup
386 call BOOTMENU_SetVarsAfterMenu
387 ; ------------------------------------------------- BOOTING...
388 MBR_Main_NoBootMenu:
389 call FX_StartScreen
390 call BOOTMENU_BuildGoodBye
391 call FX_EndScreenRight
392 call PASSWORD_AskChangeBootPwd
393
394 IFNDEF ReleaseCode
395 mov ax, 6200h
396 int 21h
397 mov es, bx
398 mov ax, 4C00h ; Quit program
399 int 21h
400 ENDIF
401 call ANTIVIR_SaveBackUpMBR
402 mov dl, Menu_EntrySelected
403 call PART_StartPartition
404
405Include REGULAR\STD_TEXT.asm ; Standard (non-translateable text)
406Include REGULAR\DRIVEIO.asm ; Drive I/O, Config Load/Save
407Include REGULAR\ViDEOIO.asm ; Video I/O
408Include REGULAR\TIMER.asm ; Timer
409Include REGULAR\PARTMAIN.asm ; Regular Partition Routines
410Include REGULAR\PARTSCAN.asm ; Partition Scanning
411Include REGULAR\BOOTMENU.asm ; Boot-Menu
412Include REGULAR\PASSWORD.asm ; Password related
413Include REGULAR\OTHER.asm ; Other Routines
414
415Include SETUP\MAiN.ASM ; The whole AiR-BOOT SETUP
416Include SPECiAL\ViRUS.asm ; Virus Detection / Anti-Virus
417Include SPECiAL\FAT16.asm ; FAT-16 Support
418Include SPECiAL\LINUX.asm ; Linux Kernel Support
419Include SPECiAL\F00K\BILLSUXX.asm ; Extended Partition - Micro$haft-Hack
420Include SPECiAL\SOUND.asm ; Sound
421Include SPECiAL\APM.asm ; Power Managment Support
422Include SPECiAL\FX.asm ; l33t Cooper-Bars/Scrolling <bg>
423IFDEF TXT_IncludeCyrillic
424 Include SPECiAL\CHARSET.asm ; Charset Support (e.g. Cyrillic)
425ENDIF
426
427;---------------------------------------------------------------------------
428 org 04600h ; Sector 36-37
429MBR_Protection: db 'AiR-BOOT MBR-Protection Image'
430; Hardcoded to 1k (1024 bytes)
431
432;---------------------------------------------------------------------------
433 org 04A00h ; Sector 38-x
434Include TEXT\TXTOTHER.asm ; All translateable Text-Strings
435Include TEXT\TXTMENUS.asm ; All translateable Menu-text
436Include TEXT\CHARSET.asm ; Special Video Charsets (if needed)
437
438;---------------------------------------------------------------------------
439 org 06C00h ; Sector 55
440Configuration:
441 db 'AiRCFG-TABLE­'
442 db 01h, 00h, 'U' ; "Compressed" ID String
443
444CFG_LastTimeEditLow dw 0 ; Last Time Edited Stamp (will incr every setup)
445CFG_LastTimeEditHi dw 0 ; second 16 bit part...
446
447CFG_CheckConfig dw 0 ; Check-Sum for Configuration
448
449CFG_Partitions db 0 ; Count of partitions in IPT
450 db 0 ; Was BootParts - Removed since v0.28b
451CFG_PartDefault db 0 ; Default-Partition (Base=0)
452
453CFG_PartLast db 0 ; Which Partition was booted last time ? (Base=0)
454CFG_TimedBoot db 1 ; Timed Boot Enable (for REAL Enable look TimedBootEnable)
455CFG_TimedSecs db 15 ; Timed Boot - How Many Seconds Till Boot
456CFG_TimedDelay dw 123 ; Timed Boot - Delay
457CFG_TimedBootLast db 0 ; Timed Boot - Boot From Last Drive Booted From
458CFG_RememberBoot db 1 ; Remember Manual Boot Choice
459CFG_RememberTimed db 0 ; Remember if Timed Boot (if both disabled: Boot Default)
460CFG_IncludeFloppy db 1 ; Include Floppy Drives in Boot-Menu
461CFG_BootMenuActive db 1 ; Display Boot-Menu (if Disabled: Boot Default)
462 ; v0.29+ -> 2 - Detailed Bootmenu
463CFG_PartitionsDetect db 1 ; Autodetect New Partitions (Auto-Add!)
464CFG_PasswordSetup db 0 ; Ask Password when entering Setup
465CFG_PasswordSystem db 0 ; Ask Password when booting System
466CFG_PasswordChangeBoot db 0 ; Ask Password when changing boot partition
467CFG_ProtectMBR db 0 ; Protect MBR via TSR ?
468CFG_IgnoreWriteToMBR db 0 ; Just ignore writes to MBR, otherwise crash
469CFG_FloppyBootGetName db 0 ; Gets floppy name for display purposes
470CFG_DetectVirus db 1 ; Detect Virus ?
471CFG_DetectStealth db 1 ; Detect Stealth-Virus ?
472CFG_DetectVIBR db 1 ; Detect BootRecord-Virus ?
473CFG_AutoEnterSetup db 1 ; Automatic Enter Setup (first install!)
474CFG_MasterPassword dw 0101Fh ; Encoded Password (this is just CR)
475 dw 07A53h
476 dw 0E797h
477 dw 0A896h
478CFG_BootPassword dw 0101Fh ; Another CR... ;-)
479 dw 07A53h
480 dw 0E797h
481 dw 0A896h
482 db 0 ; Rude-Protection - Removed since v0.28b
483CFG_LinuxRootPartition db 0 ; Linux Root Partition (Base=0)
484CFG_TimedKeyHandling db 0 ; Timed Key Handling (for Timed Boot)
485 ; 0 - Do Nothing
486 ; 1 - Reset Time
487 ; 2 - Stop Time
488CFG_MakeSound db 0 ; Should be clear ;)
489CFG_FloppyBootGetTimer db 0 ; Floppy Name will get updated every 2 secs
490CFG_ResumeBIOSbootSeq db 0 ; If BIOS Boot Sequence should be resumed
491 ; 0 - Disabled
492 ; 1 - CD-ROM
493 ; 2 - Network
494 ; 3 - ZIP/LS120
495CFG_CooperBars db 0 ; If Cooper Bars should be shown
496CFG_LinuxCommandLine db 75 dup (0) ; Linux Command Line
497CFG_LinuxKrnlPartition db 0FFh ; FAT-16 Linux Kernel Partition (Base=0)
498 ; FFh -> Disabled
499CFG_LinuxDefaultKernel db 'DEFAULT', 4 dup (32), 0 ; Default Kernel Name
500CFG_LinuxLastKernel db 11 dup (32), 0 ; Last-Booted Kernel Name
501CFG_ExtPartitionMShack db 0 ; Extended Partition M$-Hack Global Enable
502CFG_AutomaticBoot db 0 ; Automatic Booting (only one bootup)
503CFG_PartAutomatic db 0 ; Partition-No for automatic booting
504CFG_ForceLBAUsage db 0 ; LBA-BIOS-API forced on any HDD I/O
505
506; VIR variables are for the AiR-BOOT Anti Virus Code
507; Most of them are backups of Interrupt Points, so we can check, if a
508; stealth virus is on-line, we can intercept its call.
509; Normal (non stealth) virus are trapped simply by rereading the MBR sector.
510; If a virus is found, we will restore MBR from Sektor 60 and stop the system
511; from working, so the user has to press reset. That's saver than a Reboot.
512;
513; If a virus is found on the partition to boot, the system will ONLY halt,
514; nothing more, because we can not remove it. The user shall do it :)
515; Those viruses are detected via a real nasty method...Checksum-Checking of the
516; boot-record, which is to be executed. If it does not match the one in our
517; internal partition table, we will stop. You may however switch this detection
518; off or just reset it by switching 'VIBR Detection'.
519
520 org 06DABh ; 427 Boundry
521AutoDrvLetter db 0
522AutoDrvLetterSerial dd 0
523
524BIOScontIPTentry:
525 db 0, 0, 0, 0, ' '
526 db 0, 0FEh, Flags_BootAble
527 dw 0 ; No Checksum :)
528 db 0, 1, 0
529 db 0, 1, 0 ; Location of Partition/Boot Record
530 dd 0, 0
531
532 ; 466 Sub-Part
533CFG_VIR_INT08 dd 0 ; pointer to saved 08h entry point
534CFG_VIR_INT13 dd 0 ; pointer to saved 13h entry point
535CFG_VIR_INT1C dd 0 ; pointer to saved 1Ch entry point
536
537 ; 478 Boundry
538FloppyIPTentry: db 0, 0, 0, 0, 'FloppyDrive'
539 db 0, 0FFh, Flags_BootAble
540 dw 0 ; No Checksum :)
541 db 0, 1, 0
542 db 0, 1, 0 ; Location of Partition/Boot Record
543 dd 0, 0
544;---------------------------------------------------------------------------
545 org 06E00h ; Sector 56-57
546PartitionTable: ; no-partitions detected... :]
547; db 1, 0, 0, 0, 'Harddisc 1'
548; db 0, 0FFh, Flags_BootAble
549; dw 0 ; No Checksum :)
550; db 0, 0, 1
551; db 0, 0, 1 ; Location of Partition/Boot Record
552; dd 0, 0
553
554 ; Format is:
555 ;============
556 ; SerialNumber * 4
557 ; PartitionName * 11
558 ; Drive * 1
559 ; SystemID * 1 (means the partition type)
560 ; Flags * 1
561 ; Checksum * 2 (for virus checking)
562 ; LocationBegin * 3 (where the partition begins)
563 ; LocationPartTab * 3 (where the partition table is)
564 ; AbsoluteBegin * 4 (where the partition begins, in absolute sectors)
565 ; AbsolutePartTab * 4 (where the partition table is, in absolute sectors)
566 ; --------------------> 34 Bytes (total maximum = 30)
567
568 org 071F6h
569 db 'AiRBOOTPAR' ; 1K internal partition table
570;---------------------------------------------------------------------------
571 org 07200h ; Sector 58
572HidePartitionTable: db 900 dup (0FFh)
573 ; Format is:
574 ;============
575 ; PartitionPtr : BYTE * 30
576 ; --------------------> 30 Bytes * 30
577
578DriveLetters: db 30 dup (0)
579 ; Format is:
580 ;============
581 ; Drive-Letter : BYTE (80h-C:, 81h-D:)
582 ; --------------------> 1 Byte * 30
583
584 org 075F6h
585 db 'AiRBOOTHID' ; 1K internal Hide-partition table
586;---------------------------------------------------------------------------
587 org 07600h ; Sector 60
588MBR_BackUpMBR db 'AiR-BOOT MBR-BackUp - Just to fill this sector with something'
589
590 org 077FFh
591 db 0
592;---------------------------------------------------------------------------
593 org 0A000h ; Uninitialized
594; This space actually gets initialized in PreCrap to NUL (till EndOfVariables)
595BeginOfVariables:
596TmpSector: db 512 dup (?) ; Temporary Sector
597TmpSector2:
598; Everything used to build a new IPT and reference it to the old one
599NewPartTable: db 1024 dup (?) ; New Partition Table
600NewHidePartTable: db 900 dup (?) ; New Hide-Partition Table
601NewDriveLetters: db 30 dup (?) ; Logical Drive-Letters
602
603PartitionSizeTable: db 180 dup (?) ; Size-Table (6 bytes per partition)
604PartitionPointers dw 52 dup (?) ; Maximum is 52 entries till now
605PartitionPointerCount db ? ; Count of total Partition Pointers
606PartitionXref db 30 dup (?) ; X-Reference Table
607
608TotalHarddiscs db ? ; Total harddrives (by POST)
609NewPartitions db ? ; Freshly found partitions
610
611VideoIO_Segment dw ? ; Segment for Video I/O
612
613ExtendedAbsPos dd ? ; Extended Partition Absolute Position
614ExtendedAbsPosSet db ? ; If Absolute Position set
615
616CurPartition_Location dw 4 dup (?) ; Where did current partition came from?
617CurIO_UseExtension db ? ; 1-Use INT 13h EXTENSIONS
618 ; Filled out by PreCrap
619
620GotLinux db ? ; 1-Linux found
621
622Menu_EntrySelected db ? ; Which partition we boot this time...
623Menu_UpperPart db ? ; Which number (Base=0) is the partition upper pos
624Menu_AbsoluteX db ? ; Pos where Menu stuff starts
625Menu_TotalParts db ? ; Copy of CFG_BootParts
626Menu_TotalLines db ? ; Total Lines on Screen used for BootMenu
627Menu_EntryDefault db ? ; Default Entry in filtered View
628Menu_EntryLast db ? ; LastBooted Entry in filtered View
629Menu_EntryAutomatic db ? ; Automatic Entry in filtered View
630 ; - All adjusted to menu locations
631
632PartSetup_UpperPart db ? ; Partition-Setup (like Menu_UpperPart)
633PartSetup_ActivePart db ? ; Active Partition
634PartSetup_HiddenUpper db ? ; (like Menu_UpperPart)
635PartSetup_HiddenX db ? ; Pos for Hidden-Setup
636PartSetup_HiddenAdd db ? ; Adjust for Hidden-Setup
637
638TimedBootEnable db ? ; Local Enable/Disable for timed boot
639TimedTimeOut dd ? ; TimeOut Timer for TimedBoot (too much time here ;)
640TimedSecondLeft db ? ; How many seconds are left till boom ?
641TimedSecondBack db ? ; To get a modification noticed
642TimedBootUsed db ? ; Timed Boot used for bootup ?
643FloppyGetNameTimer dd ? ; Timer for Floppy-Get-Name
644SETUP_KeysOnEntry db ? ; which Shift Status was there, when booting ?
645SETUP_ExitEvent db ? ; Exit Event to end SETUP
646TempPasswordEntry db 17 dup (?)
647SETUP_OldPwd db 17 dup (?)
648SETUP_NewPwd db 17 dup (?)
649SETUP_VerifyPwd db 17 dup (?)
650StartSoundPlayed db ?
651
652FX_UseCount dw ?
653FX_OverallTimer dw ?
654FX_WideScrollerTimer dw ?
655FX_WideScrollerCurPos dw ?
656FX_WideScrollerSpeed db ?
657FX_WideScrollerSpeedState db ?
658FX_WideScrollerDirection db ?
659FX_WideScrollerAbsDirection db ?
660FX_WideScrollerBounceSpeed db ?
661FX_CooperBarsTimer dw ?
662
663FAT16_Drive db ? ; FAT-16: Drive of FAT16-partition
664FAT16_AbsPartitionBegin dd ? ; FAT-16: LBA Begin of Partition
665FAT16_SecsPerCluster db ? ; FAT-16: Sectors Per Cluster
666FAT16_NumOfRootEntries dw ? ; FAT-16: Number of Root Entries
667FAT16_SecsPerFAT dw ? ; FAT-16: Sectors Per FAT
668FAT16_AbsFATBegin dd ? ; FAT-16: LBA Begin of FAT
669FAT16_AbsRootBegin dd ? ; FAT-16: LBA Begin of Root
670FAT16_AbsClusterBegin dd ? ; FAT-16: LBA Begin of Clusters
671FAT16_FATCacheSector db ? ; FAT-16: FAT-Sector No in Cache
672FAT16_FATCache db 512 dup (?) ; FAT-16: FAT-Area Cache
673
674LINUX_KernelEntries db 680 dup (?) ; 34*20 -> Space for Kernel-Entries
675LINUX_KernelNo db ? ; Total of Kernels in KernelEntries
676LINUX_KernelSizeTable db 120 dup (?) ; Size-Table (6 bytes per kernel)
677EndOfVariables:
678
679FX_CooperColors db 672 dup (?) ; 7 cooper bars*96 - runtime calculated
680FX_CooperState: db 7 dup (?)
681FX_SinusPos: db 7 dup (?)
682FX_CooperPos: dw 7 dup (?)
683CharsetTempBuffer db 4096 dup (?) ; Uninitialized Charset buffer
684
685code_seg ends
686 end air_boot
Note: See TracBrowser for help on using the repository browser.