Changeset 29 for trunk/BOOTCODE/AIR-BOOT.ASM
- Timestamp:
- May 5, 2011, 2:00:00 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BOOTCODE/AIR-BOOT.ASM
r26 r29 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. 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 ; 17 18 18 19 ;--------------------------------------------------------------------------- 19 20 ; AiR-BOOT / MAIN-CODE 20 21 ;--------------------------------------------------------------------------- 22 ; 21 23 22 24 ; If ReleaseCode is not defined, it will produce debug-able code... 23 25 ReleaseCode equ -1 24 ; ReleaseCommercial equ -125 26 26 27 JUMPS … … 29 30 30 31 IFDEF ReleaseCode 31 ExecBaseSegequ 00000h32 ExecBasePtrequ 07C00h ; BIOS starts our MBR at 0:7C0032 StartBaseSeg equ 00000h 33 StartBasePtr equ 07C00h ; BIOS starts our MBR at 0:7C00 33 34 ELSE 34 ExecBaseSeg equ 03567h ; Adjust to DOS segment35 ExecBasePtrequ 00100h35 StartBaseSeg equ 03A98h ; Adjust to DOS segment 36 StartBasePtr equ 00100h 36 37 ENDIF 37 38 BootBaseSeg equ 8000h … … 46 47 VideoIO_FXSegment equ 0A000h 47 48 48 Include ..\ ..\..\JimiHelp\asm.inc\stdmacro.inc49 Include ..\INSTALL\GLOBAL.ASM\airboot.inc49 Include ..\INCLUDE\asm.inc 50 ;Include ..\INCLUDE\DOS\airboot.inc 50 51 51 52 TextChar_WinLineRight equ 0C4h ; 'Ä' … … 75 76 LocBR_Magic equ 510 76 77 78 ; Offsets for LVM Information Sector 79 LocLVM_SignatureStart equ 0 80 LocLVM_SignatureByte0 equ 2 81 LocLVM_CRC equ 8 ; CRC is a DWORD 82 LocLVM_MaxEntries equ 4 83 LocLVM_StartOfEntries equ 60 ; (contains maximum of 4 entries) 84 LocLVM_LenOfEntry equ 60 85 LocLVM_VolumeID equ 0 ; is DWORD 86 LocLVM_PartitionID equ 4 ; is DWORD 87 LocLVM_PartitionSize equ 8 ; is DWORD 88 LocLVM_PartitionStart equ 12 ; is DWORD 89 LocLVM_VolumeLetter equ 18 ; is BYTE (Letter C-Z or 0) 90 LocLVM_VolumeName equ 20 ; 20 bytes 91 LocLVM_PartitionName equ 40 ; 20 bytes 92 77 93 ; Offsets for IPT (Internal Partition Table) 78 94 LocIPT_MaxPartitions equ 30 ; Maximum LocIPT_MaxPartitions … … 105 121 FileSysFlags_FAT32 equ 00010000b ; FAT 32 specific name getting 106 122 FileSysFlags_NoName equ 00100000b ; No Name - use PartitionName 123 FileSysFlags_DriveLetter equ 01000000b ; DriveLetter Feature possible 107 124 108 125 Keys_Up equ 48h … … 139 156 org 00000h ; Sector 1 140 157 ;--------------------------------------------------------------------------- 141 AiR_BOOT: cli 158 AiR_BOOT: cli ; Some M$ operating systems need a CLI 159 ; here otherwise they will go beserk 160 ; and will do funny things during 161 ; boot phase, it's laughable! 142 162 db 0EBh ; JMP-Short -> MBR_Start 143 db 'AiRBOOT', 02h, 03h, 20h, 03h, 01h, 01h, TXT_LanguageID163 db 'AiRBOOT', 13h, 03h, 20h, 06h, 01h, 06h, TXT_LanguageID 144 164 ; ID String, Date and Version Number, U for US version 145 165 db 1 ; Total Sectors Count, … … 148 168 149 169 MBR_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 and154 mov ax, BootBaseSeg ; fuck everyone that is working for155 mov es, ax ; that evil business. k?thx170 cld ; =MICROSOFT JUMP DEPARTMENT= 171 mov ax, StartBaseSeg 172 mov ds, ax 173 mov si, StartBasePtr 174 mov ax, BootBaseSeg 175 mov es, ax 156 176 mov di, BootBasePtr 157 177 IFDEF ReleaseCode … … 171 191 mov dx, 500 172 192 int 15h ; Wait to display the whole screen :] 173 MBR_ FuckUpSys:cli174 jmp MBR_ FuckUpSys193 MBR_HaltSys: cli 194 jmp MBR_HaltSys 175 195 176 196 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. 197 jmp MBR_Start ; We jump here, because I needed to 198 ; insert a CLI on start and did not 199 ; want to change AiR-BOOT detection 200 ; because of Microsoft inventions... 180 201 181 202 db 'LOAD ERROR!', 0 … … 250 271 int 13h 251 272 jnc MBR_ConfigCopy_NoError 273 MBR_ConfigCopy_LoadError: 252 274 call MBR_LoadError ; Will Abort BootUp 253 275 MBR_ConfigCopy_NoError: … … 256 278 mov cx, 0002h 257 279 mov ah, 02h 258 mov al, ds:[ TotalSectorsUsedPtr]280 mov al, ds:[10h] 259 281 int 13h 260 282 jnc MBR_RealStart_NoError 261 call MBR_LoadError ; Will Abort BootUp 283 jmp MBR_ConfigCopy_LoadError 284 ; [v1.05+] 285 ; Signature for IBM's LVM to detect our "powerful" features ;) 286 db 'I13X' 262 287 MBR_RealStart_NoError: 263 288 ; Now Check Code with CheckSum 264 289 mov si, offset FurtherMoreLoad 265 movzx cx, bptr ds:[ TotalSectorsUsedPtr]290 movzx cx, bptr ds:[10h] 266 291 xor bx, bx 267 292 MBR_RealStart_CheckCodeLoop: … … 291 316 ; 10h -> FAT32 - Name Getting Scheme 292 317 ; 20h -> No Name To Get (use Partition Name) 318 ; 40h -> 'L' flag possible 293 319 db 'AiRSYS-TABLE' 294 FileSysIDs: db 01h, 11h,01h, 04h,014h,01h, 06h,016h, 01h, 0Eh,00Eh,01h295 db 07h, 17h, 01h, 08h,017h,21h, 35h,035h,00h,0EBh,0EBh,01h296 db 09h, 19h,11h, 0Bh,01Bh,11h, 0Ch,01Ch,11h, 01h,001h,01h320 FileSysIDs: db 01h, 11h,01h, 04h,014h,01h, 06h,016h,41h, 0Eh,00Eh,01h 321 db 07h, 17h,41h, 08h,017h,21h, 35h,035h,20h,0FCh,017h,41h 322 db 09h, 19h,11h, 0Bh,01Bh,11h, 0Ch,01Ch,11h,0EBh,0EBh,01h 297 323 db 63h, 63h,21h, 81h,081h,21h, 83h,083h,21h, 40h,040h,21h 298 324 db 0A5h,0A5h,21h,0A6h,0A6h,21h, 82h,082h,20h,0A7h,0A7h,21h … … 306 332 307 333 FileSysNames: db 'FAT12 ', 'FAT16 ', 'FAT16Big', 'FAT16Big' 308 db 'HPFS ', 'NTFS ', 'LVM-Data', ' BeOS'309 db 'FAT32 ', 'FAT32 ', 'FAT32 ', ' 334 db 'HPFS ', 'NTFS ', 'LVM-Data', 'JFS ' 335 db 'FAT32 ', 'FAT32 ', 'FAT32 ', 'BeOS ' 310 336 db 'Unix ', 'Minix ', 'Linux ', 'Venix ' ; x row ;) 311 337 db 'BSD/386 ', 'OpenBSD ', 'LinuxSwp', 'NeXTSTEP' … … 331 357 call AFTERCRAP_Main 332 358 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: 359 ; [Linux support removed since v1.02] 360 ; ; Now get FAT16-Linux Kernel Partition, If requested 361 ; cmp [CFG_LinuxKrnlPartition], 0FFh 362 ; je MBR_Main_NoLinuxKrnlPartition 363 ; call LINUX_InitFAT16access 364 ; MBR_Main_NoLinuxKrnlPartition: 338 365 339 366 ; SetUp PartitionPointers for BootMenu (filter non-bootable) … … 394 421 395 422 IFNDEF ReleaseCode 423 ; Debug Code to terminate DOS .COM program - used for 424 ; testing AiR-BOOT 425 int 3 396 426 mov ax, 6200h 397 427 int 21h … … 416 446 Include SETUP\MAiN.ASM ; The whole AiR-BOOT SETUP 417 447 Include SPECiAL\ViRUS.asm ; Virus Detection / Anti-Virus 418 Include SPECiAL\FAT16.asm ; FAT-16 Support 419 Include SPECiAL\LINUX.asm ; Linux Kernel Support 420 Include SPECiAL\F00K\BILLSUXX.asm ; Extended Partition - Micro$haft-Hack 448 ; [Linux support removed since v1.02] 449 ;Include SPECiAL\FAT16.asm ; FAT-16 Support 450 ;Include SPECiAL\LINUX.asm ; Linux Kernel Support 451 Include SPECiAL\F00K\BILLSUXX.asm ; Extended Partition - Microsoft-Hack 421 452 Include SPECiAL\SOUND.asm ; Sound 422 453 Include SPECiAL\APM.asm ; Power Managment Support 423 454 Include SPECiAL\FX.asm ; l33t Cooper-Bars/Scrolling <bg> 455 Include SPECiAL\LVM.asm ; LVM-specific code 424 456 IFDEF TXT_IncludeCyrillic 425 457 Include SPECiAL\CHARSET.asm ; Charset Support (e.g. Cyrillic) … … 441 473 Configuration: 442 474 db 'AiRCFG-TABLE' 443 db 01h, 00h, 'U' ; "Compressed" ID String 475 db 01h, 02h, 'U' ; "Compressed" ID String 476 ; This is still version 1.02, because nothing got 477 ; changed... 444 478 445 479 CFG_LastTimeEditLow dw 0 ; Last Time Edited Stamp (will incr every setup) … … 504 538 CFG_PartAutomatic db 0 ; Partition-No for automatic booting 505 539 CFG_ForceLBAUsage db 0 ; LBA-BIOS-API forced on any HDD I/O 540 CFG_IgnoreLVM db 0 ; Ignores any LVM-Information 506 541 507 542 ; VIR variables are for the AiR-BOOT Anti Virus Code … … 595 630 ; This space actually gets initialized in PreCrap to NUL (till EndOfVariables) 596 631 BeginOfVariables: 632 PartitionSector db 512 dup (?) ; Temporary Sector for Partition 633 LVMSector: db 512 dup (?) ; Temporary Sector for LVM 597 634 TmpSector: db 512 dup (?) ; Temporary Sector 598 635 TmpSector2: … … 606 643 PartitionPointerCount db ? ; Count of total Partition Pointers 607 644 PartitionXref db 30 dup (?) ; X-Reference Table 608 609 TotalHarddiscs db ? ; Total harddrives (by POST) 610 NewPartitions db ? ; Freshly found partitions 645 PartitionVolumeLetters db 30 dup (?) ; Volume-Letters 646 ; 0 - no LVM support 647 ; 1 - LVM support, but no letter 648 ; 'C'-'Z' - assigned drive letter 649 650 TotalHarddiscs db ? ; Total harddrives (by POST) 651 LBASwitchTable db 128 dup (?) ; Bit 25-18 for CHS/LBA Switching 652 NewPartitions db ? ; Freshly found partitions 611 653 612 654 VideoIO_Segment dw ? ; Segment for Video I/O … … 621 663 ; (for detailed error message) 622 664 623 GotLinux db ? ; 1-Linux found 665 ; [Linux support removed since v1.02] 666 ;GotLinux db ? ; 1-Linux found 624 667 625 668 Menu_EntrySelected db ? ; Which partition we boot this time... … … 652 695 SETUP_VerifyPwd db 17 dup (?) 653 696 StartSoundPlayed db ? 697 ChangePartNameSave db ? 654 698 655 699 FX_UseCount dw ? … … 664 708 FX_CooperBarsTimer dw ? 665 709 666 FAT16_Drive db ? ; FAT-16: Drive of FAT16-partition 667 FAT16_AbsPartitionBegin dd ? ; FAT-16: LBA Begin of Partition 668 FAT16_SecsPerCluster db ? ; FAT-16: Sectors Per Cluster 669 FAT16_NumOfRootEntries dw ? ; FAT-16: Number of Root Entries 670 FAT16_SecsPerFAT dw ? ; FAT-16: Sectors Per FAT 671 FAT16_AbsFATBegin dd ? ; FAT-16: LBA Begin of FAT 672 FAT16_AbsRootBegin dd ? ; FAT-16: LBA Begin of Root 673 FAT16_AbsClusterBegin dd ? ; FAT-16: LBA Begin of Clusters 674 FAT16_FATCacheSector db ? ; FAT-16: FAT-Sector No in Cache 675 FAT16_FATCache db 512 dup (?) ; FAT-16: FAT-Area Cache 676 677 LINUX_KernelEntries db 680 dup (?) ; 34*20 -> Space for Kernel-Entries 678 LINUX_KernelNo db ? ; Total of Kernels in KernelEntries 679 LINUX_KernelSizeTable db 120 dup (?) ; Size-Table (6 bytes per kernel) 710 ; [Linux support removed since v1.02] 711 ;FAT16_Drive db ? ; FAT-16: Drive of FAT16-partition 712 ;FAT16_AbsPartitionBegin dd ? ; FAT-16: LBA Begin of Partition 713 ;FAT16_SecsPerCluster db ? ; FAT-16: Sectors Per Cluster 714 ;FAT16_NumOfRootEntries dw ? ; FAT-16: Number of Root Entries 715 ;FAT16_SecsPerFAT dw ? ; FAT-16: Sectors Per FAT 716 ;FAT16_AbsFATBegin dd ? ; FAT-16: LBA Begin of FAT 717 ;FAT16_AbsRootBegin dd ? ; FAT-16: LBA Begin of Root 718 ;FAT16_AbsClusterBegin dd ? ; FAT-16: LBA Begin of Clusters 719 ;FAT16_FATCacheSector db ? ; FAT-16: FAT-Sector No in Cache 720 ;FAT16_FATCache db 512 dup (?) ; FAT-16: FAT-Area Cache 721 ; 722 ;LINUX_KernelEntries db 680 dup (?) ; 34*20 -> Space for Kernel-Entries 723 ;LINUX_KernelNo db ? ; Total of Kernels in KernelEntries 724 ;LINUX_KernelSizeTable db 120 dup (?) ; Size-Table (6 bytes per kernel) 680 725 EndOfVariables: 681 726 727 ; Dynamically Generated Tables - do not need to get initialized with NUL 682 728 FX_CooperColors db 672 dup (?) ; 7 cooper bars*96 - runtime calculated 683 729 FX_CooperState: db 7 dup (?) … … 685 731 FX_CooperPos: dw 7 dup (?) 686 732 CharsetTempBuffer db 4096 dup (?) ; Uninitialized Charset buffer 733 LVM_CRCTable: dd 256 dup (?) ; LVM-CRC (->SPECiAL\LVM.asm) 687 734 688 735 code_seg ends
Note:
See TracChangeset
for help on using the changeset viewer.