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

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

Updated several Sources.
Note: This comment was created after rebuilding the repo. [2011-07]

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