Changeset 31
- Timestamp:
- Jan 13, 2013, 8:15:35 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BOOTCODE/AIR-BOOT.ASM
r30 r31 20 20 ; Rousseau: # Fixes # 21 21 ; ------------------- 22 ; 23 ; v1.08 24 ; ----- 25 ; - Fixed driveletter feature which was broken in v1.07. 26 ; - Reworked MBR-code to provide two I13X signatures. 27 ; - Esc from SETUP would save to disk. 28 ; It now retains the changes only for this boot and 29 ; does not write them to disk. 30 ; - Corrected contact links. 31 ; - 32 ; 33 ; v1.07 34 ; ----- 22 35 ; # Huge Drives and LVM # 23 36 ; When using disks >512GB under eComStation, the drive geometry changes to … … 48 61 49 62 50 ;--------------------------------------------------------------------------- 51 ; AiR-BOOT / MAIN-CODE52 ;--------------------------------------------------------------------------- 63 ;------------------------------------------------------------------------------ 64 ; AiR-BOOT / MAIN-CODE 65 ;------------------------------------------------------------------------------ 53 66 ; 54 67 … … 62 75 ; skipping an unconditional jump to the target on base of complementary 63 76 ; condition logic and temporary labels. 64 ; TASM also has a bug in that when the .ERR2 directive is used when the .386 directive 65 ; is in effect, the JUMPS directive is also active and cannot be turned off. 77 ; TASM also has a bug in that when the .ERR2 directive is used when 78 ; the .386 directive is in effect, the JUMPS directive is also active 79 ; and cannot be turned off. 66 80 ; NOJUMPS seems to have no effect in this situation. 67 81 ; In this case 4 NOP instructions are generated after forward referencing jump … … 87 101 ; in the BSS. 88 102 ; 89 MaxDisks equ 16103 MaxDisks equ 64 90 104 91 105 ; … … 94 108 AuxDebug equ 1 95 109 96 97 BiosComPort equ 0 ; Com-port for debugging, 0 is disabled 98 99 ; bits 7-5 = datarate (000=110,001=150,010=300,011=600,100=1200,101=2400,110=4800,111=9600 bps) 100 ; bits 4-3 = parity (00 or 10 = none, 01 = odd, 11 = even) 101 ; bit 2 = stop-bits (set = 2 stop-bits, clear = 1 stop-bit) 102 ; bits 1-0 = data-bits (00 = 5, 01 = 6, 10 = 7, 11 = 8) 103 AuxInitParms equ 11100011b ; 9600 bps, no parity, 1 stop-bit, 8 bits per char 104 105 BIOS_AuxParmsDefault equ (AuxInitParms SHL 8) OR BiosComPort ; Default word value for offset 77FEh (BIOS_AuxParms) 110 ; Com-port for debugging, 0 is disabled 111 BiosComPort equ 0 112 113 114 ; 115 ; bits 7-5 = datarate 116 ; (000=110,001=150,010=300,011=600,100=1200,101=2400,110=4800,111=9600 bps) 117 ; bits 4-3 = parity 118 ; (00 or 10 = none, 01 = odd, 11 = even) 119 ; bit 2 = stop-bits 120 ; (set = 2 stop-bits, clear = 1 stop-bit) 121 ; bits 1-0 = data-bits 122 ; (00 = 5, 01 = 6, 10 = 7, 11 = 8) 123 ; 124 125 ; 9600 bps, no parity, 1 stop-bit, 8 bits per char 126 AuxInitParms equ 11100011b 127 128 ; Default word value for BIOS_AuxParms variable 129 ; Note that is has moved since v1.07 130 BIOS_AuxParmsDefault equ (AuxInitParms SHL 8) OR BiosComPort 131 106 132 ; 107 133 ; If ReleaseCode is not defined, it will produce debug-able code... 108 134 ; 109 ReleaseCode equ -1 ; Rousseau: this should be replaced110 ; by the complementary debug logic some day. 111 ; Then instead of being on or off it would be 112 ; more handy to use positive integers with each 113 ; higher number increasing the debug functionality. 135 ReleaseCode equ -1 136 137 138 139 114 140 115 141 ; … … 117 143 ; 118 144 119 ; Use different addresses depending on whether in pre-boot or debug environment. 145 ; Use different addresses depending on whether in pre-boot 146 ; or debug environment. 120 147 IFDEF ReleaseCode 121 StartBaseSeg equ 00000h ; Pre-boot, sowe are in low memory148 StartBaseSeg equ 00000h ; Pre-boot, we are in low memory 122 149 StartBasePtr equ 07C00h ; BIOS starts our MBR at 0:7C00 123 150 ELSE 124 StartBaseSeg equ 03A98h ; Adjust to DOS segment ; Rousseau: where does this value come from ? (should be CS; rectified in actual code by ignoring this value) 125 StartBasePtr equ 00100h ; We are a .com file, some DOS is active 151 StartBaseSeg equ 03A98h ; Adjust to DOS segment 152 ; Rousseau: where does this value 153 ; come from ? 154 ; Should be CS; 155 ; Rectified in actual code by 156 ; ignoring this value. 157 StartBasePtr equ 00100h ; We are a .com file,DOS is active 126 158 ENDIF 127 159 128 160 ; Address labels after code-move 129 BootBaseSeg equ 8000h ; Pre-boot, somewherein the low 640K161 BootBaseSeg equ 08000h ; Pre-boot, in the low 640K 130 162 BootBasePtr equ 0h ; We put our MBR to this location 131 BootBaseExec equ BootBasePtr+offset MBR_RealStart132 StackSeg equ 163 BootBaseExec equ BootBasePtr+offset MBR_RealStart 164 StackSeg equ 07000h ; Put the stack below the code 133 165 134 166 ; Video pages, no INT 10h is used for menu-drawing etc. … … 154 186 155 187 ; Offsets for Partition-Entries in MBR/EPRs 156 LocBRPT_LenOfEntry equ 16 157 LocBRPT_Flags equ 0 158 LocBRPT_BeginCHS equ 1 159 LocBRPT_BeginHead equ 1 160 LocBRPT_BeginSector equ 2 161 LocBRPT_BeginCylinder equ 3 162 LocBRPT_SystemID equ 4 163 LocBRPT_EndCHS equ 5 188 LocBRPT_LenOfEntry equ 16 ; Length of a standard MBR or EPR entry 189 LocBRPT_Flags equ 0 ; Bootable, Hidden, etc. 190 LocBRPT_BeginCHS equ 1 ; Combined 10-bits cyl with 6 bits 191 LocBRPT_BeginHead equ 1 ; Start head (0<=H<255) 255 is invalid ! 192 LocBRPT_BeginSector equ 2 ; Start sector (1<=S<=255) 193 LocBRPT_BeginCylinder equ 3 ; Start cylinder (0<=C<[1024,16384,65536,n]) 194 LocBRPT_SystemID equ 4 ; Type of system using the partition 195 LocBRPT_EndCHS equ 5 ; Same for end of partition 164 196 LocBRPT_EndHead equ 5 165 197 LocBRPT_EndSector equ 6 166 198 LocBRPT_EndCylinder equ 7 167 LocBRPT_RelativeBegin equ 8 ; Where the ...168 LocBRPT_AbsoluteLength equ 12 ; ?169 170 LocBR_Magic equ 510 ; ?199 LocBRPT_RelativeBegin equ 8 200 LocBRPT_AbsoluteLength equ 12 201 202 LocBR_Magic equ 510 171 203 172 204 ; Offsets for LVM Information Sector … … 181 213 LocLVM_PartitionSize equ 8 ; is DWORD 182 214 LocLVM_PartitionStart equ 12 ; is DWORD 183 LocLVM_VolumeLetter equ 18 ; is BYTE (Letter C-Z or 0) (relative to entry) 215 LocLVM_VolumeLetter equ 18 ; is BYTE (Letter C-Z or 0) 216 ; (relative to entry) 184 217 185 218 ; Rousseau: added (index in LVM-sector) 186 LocLVM_Secs equ 20h ; Sectors per Track ; Rousseau: this one is used for the OS/2 extended geometry219 LocLVM_Secs equ 20h ; Sectors per Track (OS/2 ext-geo) 187 220 LocLVM_Heads equ 1ch ; Number of heads 188 221 LocLVM_VolumeLetter2 equ 78 ; is BYTE (Letter C-Z or 0) ; FOUT !! niet entry relative ! … … 190 223 LocLVM_OnBootMenu equ 76 ; is on bootmenu ; FOUT !! niet entry relative ! 191 224 225 ; Truncated to 11 chars when displayed in menu 192 226 LocLVM_VolumeName equ 20 ; 20 bytes 193 LocLVM_PartitionName equ 40 ; 20 bytes 227 LocLVM_PartitionName equ 40 ; 20 bytes (Used in menu) 194 228 195 229 … … 197 231 198 232 ; Offsets for IPT (Internal Partition Table) 199 LocIPT_MaxPartitions equ partition_count ; Maximum LocIPT_MaxPartitions233 LocIPT_MaxPartitions equ partition_count ; 45 in v1.07 200 234 LocIPT_LenOfSizeElement equ 6 ; Size of one Size-Element 201 235 LocIPT_LenOfIPT equ 34 ; Length of an IPT-entry 202 236 LocIPT_Serial equ 0 ; Serial from MBR ? 203 LocIPT_Name equ 4 ; Name from FS or LVM 204 LocIPT_Drive equ 15 ; Drive-ID (80h,81h etc. sub 7fh to get 1-based disk-number)205 LocIPT_SystemID equ 16 ; Partition-Type 237 LocIPT_Name equ 4 ; Name from FS or LVM (part/vol) 238 LocIPT_Drive equ 15 ; Drive-ID (80h,81h) 239 LocIPT_SystemID equ 16 ; Partition-Type (06,07,etc) 206 240 LocIPT_Flags equ 17 ; AiR-BOOT Flags for partition (see below) 207 241 LocIPT_BootRecordCRC equ 18 ; CRC of Boot-Record … … 278 312 279 313 280 ;============================================================================== =281 ; Sector 1314 ;============================================================================== 315 ; Sector 1 282 316 283 317 … … 306 340 307 341 308 ;--------------------------------------------------------------------------- 342 ;------------------------------------------------------------------------------ 309 343 AiR_BOOT: cli ; Some M$ operating systems need a CLI 310 ; here otherwise they will go beserk ; Rousseau: M$ osses are beserk by definition.344 ; here otherwise they will go beserk 311 345 ; and will do funny things during 312 346 ; boot phase, it's laughable! 313 db 0EBh ; JMP-Short -> MBR_Start ; Rousseau: uses the 'A' as the displacement ! 314 db 'AiRBOOT', 13h, 03h, 20h, 06h, 01h, 07h, TXT_LanguageID ; Rousseau: version adjusted to v1.07 347 db 0EBh ; JMP-Short -> MBR_Start 348 ; Uses the 'A' as the displacement ! 349 db 'AiRBOOT', 07h, 11h, 20h, 11h, 01h, 08h, TXT_LanguageID 315 350 316 351 ; ID String, Date and Version Number, U for US version 317 352 db 1 ; Total Sectors Count, 318 ; 353 ; Will get overwritten by FIXBSET.exe 319 354 MBR_CheckCode dw 0 ; Check-Sum for Code 320 355 321 356 ; 322 ; This label is jumped to from the jump after 'eCSRocks'.323 357 ; No single instruction below should be changed, added or removed in the code 324 358 ; below as this will cause the jump-link to go haywire. 359 ; 325 360 MBR_Start: sti ; This opcode is dedicated to: 326 361 cld ; =MICROSOFT JUMP DEPARTMENT= … … 329 364 ; AX got loaded wrongly for debug, changed the instructions 330 365 ; without modifying the number of bytes. 331 ; Don't comment-out the redundant instruction below because this *will*332 ; change the number of bytes and break the jump-chain.366 ; Don't comment-out the redundant instruction below because this 367 ; *will* change the number of bytes and break the jump-chain. 333 368 mov ax, StartBaseSeg ; The segment we are moving ourself from (NOT USED) 334 369 ;mov ds, ax … … 345 380 mov cx, 256 ; Pre-boot environment 346 381 ELSE 347 mov cx, 32700 ; Debug environment ; Rousseau: where does 32700 come from ? (30720)382 mov cx, 32700 ; Debug environment (move ~64kB) 348 383 ENDIF 349 384 … … 353 388 rep movsw 354 389 355 ; Code a jump to the390 ; Code an intersegment jump to the new location 356 391 db 0EAh 357 392 dw BootBaseExec ; This is MBR_RealStart + BootBasePtr … … 375 410 jmp MBR_HaltSys 376 411 377 ; 378 ; Never let this part change it's offset, 379 ; or the first MBR jump will go haywire. 380 ; 381 382 ; db 'FUCKMS:>' ; Sorry Martin, we had to change this. 383 db 'eCSRocks' ; Hope you like this one too :-) 384 jmp MBR_Start ; We jump here, because I needed to 385 ; insert a CLI on start and did not 386 ; want to change AiR-BOOT detection 387 ; because of Microsoft inventions... 412 413 414 ; Comport settings 415 ; It had to be moved to create room for the double I13X 416 ; signature. 417 ; It cannot be in the config-area (sector 55) 418 ; because that area 419 ; is crc-protected. 420 BIOS_AuxParms dw BIOS_AuxParmsDefault 421 422 ; 423 ; Reserved space 424 ; Should check overflow here, later... 425 ; 426 reserved db 6 dup(0) 427 428 429 ; 430 ; We jump here after the first instructions of the 431 ; AiR-BOOT signature. 432 ; So we ensure the jump is always at this offset. 433 org 044h 434 jmp MBR_Start ; We jump here, because I needed to 435 ; insert a CLI on start and did not 436 ; want to change AiR-BOOT detection 437 ; because of Microsoft inventions... 388 438 ; 389 439 ; Entry-point when loading fails. … … 461 511 ; 462 512 463 ;--------------------------------------------------------------------------- 513 ;------------------------------------------------------------------------------ 464 514 MBR_RealStart: 465 515 mov ax, StackSeg ; 07000h, below the moved code 466 516 mov ss, ax 467 ;mov sp, 7FFFh 468 mov sp, 7FFEh ; Safe value, could also be 8000h because SP is decremented by 2 before push469 mov ax, es ; ES holds segment where we moved ourself to.517 ;mov sp, 7FFFh ; Odd stack-pointer ?? 518 mov sp, 7FFEh ; Even is better 519 mov ax, es ; ES holds segment where we moved to 470 520 mov ds, ax ; Set DS==ES to Code Segment 471 521 472 522 ; If we are in debug-mode, all code is moved already, 473 523 ; so we can directly jump to it. 474 ; One difference is that in debug-mode, the whole .com image is loaded by dos while 475 ; when air-boot is active from the MBR it does the loading itself. 476 ; When active from the MBR air-boot does not load all sectors ! 477 ; This means that i.e. a value stored at 77E0h is present in the debug-version because the whole 478 ; image is loaded, but is not present in running-mode because this sector is not loaded. 524 ; One difference is that in debug-mode, the whole .com image is 525 ; loaded by dos while when air-boot is active from the MBR it 526 ; does the loading itself. 479 527 IFNDEF ReleaseCode 480 528 jmp AiR_BOOT_Start … … 483 531 484 532 ; Load missing parts from harddrive... 485 mov ax, cs ; actually obsolete486 mov es, ax ; actually obsolete533 ; mov ax, cs ; actually obsolete 534 ; mov es, ax ; actually obsolete 487 535 488 536 ; Load the configuration-sectors from disk. … … 491 539 mov cx, 0037h ; Is 55d is config-sector 492 540 493 494 495 IF image_size EQ image_size_60secs 496 mov ax, 0205h ; Read 5 sectors (55 - 59) 497 ELSE 498 mov ax, 0207h ; Read 7 sectors (55 - 61) 499 ENDIF 500 501 int 13h 541 ; Call the i/o-part 542 call MBR_LoadConfig 543 502 544 jnc MBR_ConfigCopy_NoError 503 545 … … 513 555 mov ah, 02h 514 556 515 mov al, ds:[10h] ; 34h = 52d sectors (35h in extended version)557 mov al, ds:[10h] ; Number of code sectors 516 558 int 13h 517 559 jnc MBR_RealStart_NoError 518 560 jmp MBR_ConfigCopy_LoadError 561 562 563 519 564 ; [v1.05+] 520 565 ; Signature for IBM's LVM to detect our "powerful" features ;) 521 db 'I13X' 566 ; [v1.08+] 567 ; Reworked MBR code to be able to create a double 'I13X' signature. 568 ; MBR's created with LVM eCS v1.x have the signature at 0d5h 569 ; MBR's created with LVM eCS v2.x have the signature at 0d0h 570 ; See eCS bugtracker issue #3002 571 db 0,'I13X',0,'I13X' 572 573 522 574 MBR_RealStart_NoError: 523 575 ; Now Check Code with CheckSum … … 532 584 call MBR_GetCheckOfSector 533 585 loop MBR_RealStart_CheckCodeLoop 586 587 534 588 cmp MBR_CheckCode, bx 535 589 je MBR_RealStart_CheckSuccess 590 536 591 mov si, offset TXT_ERROR_Attention 537 592 call MBR_Teletype … … 547 602 548 603 549 ;--------------------------------------------------------------------------- 550 Include TEXT\TXTMBR.asm ; All translateable Text in MBR 551 ;--------------------------------------------------------------------------- 552 553 554 555 ; Comport settings 556 ; DO NOT MOVE THIS VARIABLE !! 557 ; It cannot be in the config-area (sector 55) because that area 558 ; is crc-protected. 559 org 001B0h 560 BIOS_AuxParms dw BIOS_AuxParmsDefault ; Initialized at start when developing 604 605 ;------------------------------------------------------------------------------ 606 Include TEXT\TXTMBR.asm ; All translateable Text in MBR 607 ;------------------------------------------------------------------------------ 608 609 eot: 610 611 ; Check for overlap 612 slack00 = eos1 - eot 613 IF slack00 LT 0 614 .ERR2 "Location Overlap slack00 !" 615 ENDIF 616 617 618 ; bios aux 619 620 eos1: 621 622 ; This is an ugly kludge function to create space for the 623 ; double 'I13X' signature. 624 ; It loads the configuration sectors, but bx,cx and dx are not initialized 625 ; in this function. That's done around line 500. 626 ; Putting this few bytes here creates just enough room. 627 ; The size of this function should grow. 628 MBR_LoadConfig Proc Near 629 ; Changed from conditional assembler to calculated 630 ; Fixes issue: #2987 -- "air-boot doesn't remember drive letter" 631 mov ax, (MBR_BackUpMBR - Configuration) / 2 ; sizeof(ab-configuration) to write 632 ; TASM does not evaluate expression above corrrectly. 633 ; Listing shows correct opcode but generated opcode has imm. word byteswapped. 634 ; Casting to byte also does not work (overflow). 635 ; So we swap back here -- must be removed in JWasm version !! 636 xchg ah,al 637 mov ah,02h 638 639 int 13h 640 ret 641 MBR_LoadConfig EndP 642 643 org 001B8h 644 db 'DSIG' 645 646 dw '$$' 561 647 562 648 org 00200h 563 649 ; End of sector 1 564 eos1 :650 eos1a: 565 651 566 652 ; Check for overlap 567 slack01 = sos2 - eos1 653 slack01 = sos2 - eos1a 568 654 IF slack01 LT 0 569 655 .ERR2 "Location Overlap slack01 !" … … 571 657 572 658 573 ;============================================================================== =574 ; Sector 2659 ;============================================================================== 660 ; Sector 2 575 661 576 662 ; … … 581 667 sos2: 582 668 583 584 ; Everything beyond this point is loaded on startup and is NOT existant at first 669 ; 670 ; Everything beyond this point is loaded on startup 671 ; and is NOT existant at first 672 ; 585 673 FurtherMoreLoad: 586 674 … … 637 725 638 726 639 ;============================================================================== =640 ; Sector 3727 ;============================================================================== 728 ; Sector 3 641 729 org 00400h 642 730 ; Start of sector 3. … … 736 824 ;inc al 737 825 ;mov [Menu_EntryAutomatic],al 738 mov [CFG_PartAutomatic],al ; Rousseau: setup entry for install-volume826 mov [CFG_PartAutomatic],al ; Setup entry for install-volume 739 827 mov [CFG_PartLast],al 740 828 mov ah, [eCS_InstallVolume] ; 1st byte is 0 if no phase 1 active … … 824 912 825 913 ; 826 ; ####################### #### WAIT FOR KEY ################################914 ; ####################### WAIT FOR KEY ######################### 827 915 ; 828 916 … … 851 939 call AuxIO_TeletypeNL 852 940 941 942 ; Save configuration so phase1 boot-through is disabled 943 ; on next boot. 944 ; Moved here to fix that Esc out of SETUP would also save. 945 ; So moved above the MBR_Main_ReEnterSetup label. 946 call DriveIO_SaveConfiguration 947 948 949 853 950 ; 854 951 ; RE-ENTER SETUP 855 952 ; 856 MBR_Main_ReEnterSetup: ; Rousseau: SETUP re-enters here !953 MBR_Main_ReEnterSetup: 857 954 call SETUP_CheckEnterSETUP 858 955 859 956 ;call SOUND_Beep 860 957 861 862 863 864 ; Rousseau: Prematurely save configuration 865 call DriveIO_SaveConfiguration ; Rousseau: added SAVE CONFIG 866 867 868 call AFTERCRAP_Main ; Rousseau: Every time I see "AfterCrap" I have to laugh :-) 958 ; Rousseau: Every time I see "AfterCrap" I have to laugh :-) 959 call AFTERCRAP_Main 869 960 870 961 ; [Linux support removed since v1.02] … … 906 997 mov al, Menu_EntryAutomatic 907 998 908 ;mov al, 2 ; Rousseau: 0-based909 910 mov Menu_EntrySelected, al 911 jmp MBR_Main_NoBootMenu ; Rousseau: NO-BOOT-MENU999 ;mov al, 2 1000 1001 mov Menu_EntrySelected, al ; zero based 1002 jmp MBR_Main_NoBootMenu 912 1003 913 1004 MBR_Main_NoAutomaticBooting: … … 921 1012 call PASSWORD_AskSystemPwd 922 1013 923 ;call VideoIO_DBG_WriteString2 ; Rousseau1014 ;call VideoIO_DBG_WriteString2 924 1015 925 1016 mov al, Menu_EntryDefault 926 ;mov al,0 ; Rousseau: 0-based1017 ;mov al,0 ; zero based 927 1018 mov Menu_EntrySelected, al 928 1019 jmp MBR_Main_NoBootMenu … … 951 1042 ;call SOUND_Beep 952 1043 953 ; ------------------------------------------------- BOOTING...1044 ; ---------------------------------------------------- BOOTING 954 1045 MBR_Main_NoBootMenu: 955 1046 call FX_StartScreen … … 970 1061 call ANTIVIR_SaveBackUpMBR 971 1062 mov dl, Menu_EntrySelected 972 call PART_StartPartition ; Rousseau: START PARTITION 1063 1064 ; -------------------------------------------- START PARTITION 1065 call PART_StartPartition 973 1066 974 1067 … … 980 1073 ; 981 1074 b_std_txt: 982 Include REGULAR\STD_TEXT.asm 1075 Include REGULAR\STD_TEXT.asm ; Standard (non-translateable text) 983 1076 size_std_txt = $-b_std_txt 984 1077 985 1078 b_driveio: 986 Include REGULAR\DRIVEIO.asm 1079 Include REGULAR\DRIVEIO.asm ; Drive I/O, Config Load/Save 987 1080 size_driveio = $-b_driveio 988 1081 989 1082 b_videoio: 990 Include REGULAR\ViDEOIO.asm 1083 Include REGULAR\ViDEOIO.asm ; Video I/O 991 1084 size_videoio = $-b_videoio 992 1085 993 1086 b_timer: 994 Include REGULAR\TIMER.asm 1087 Include REGULAR\TIMER.asm ; Timer 995 1088 size_timer = $-b_timer 996 1089 997 1090 b_partmain: 998 Include REGULAR\PARTMAIN.asm 1091 Include REGULAR\PARTMAIN.asm ; Regular Partition Routines 999 1092 size_partmain = $-b_partmain 1000 1093 1001 1094 b_partscan: 1002 Include REGULAR\PARTSCAN.asm 1095 Include REGULAR\PARTSCAN.asm ; Partition Scanning 1003 1096 size_partscan = $-b_partscan 1004 1097 1005 1098 b_bootmenu: 1006 Include REGULAR\BOOTMENU.asm 1099 Include REGULAR\BOOTMENU.asm ; Boot-Menu 1007 1100 size_bootmenu = $-b_bootmenu 1008 1101 1009 1102 b_password: 1010 Include REGULAR\PASSWORD.asm 1103 Include REGULAR\PASSWORD.asm ; Password related 1011 1104 size_password = $-b_password 1012 1105 1013 1106 b_other: 1014 Include REGULAR\OTHER.asm 1107 Include REGULAR\OTHER.asm ; Other Routines 1015 1108 size_other = $-b_other 1016 1109 1017 1110 ; Rousseau: Special modules moved upwards. 1018 1111 b_main: 1019 Include SETUP\MAiN.ASM 1112 Include SETUP\MAiN.ASM ; The whole AiR-BOOT SETUP 1020 1113 size_main = $-b_main 1021 1114 … … 1023 1116 IFDEF TXT_IncludeCyrillic 1024 1117 b_ccharset: 1025 Include SPECiAL\CHARSET.asm 1118 Include SPECiAL\CHARSET.asm ; Charset Support (e.g. Cyrillic) 1026 1119 size_ccharset = $-b_ccharset 1027 1120 ENDIF 1028 1121 1029 1122 b_math: 1030 Include REGULAR\MATH.ASM 1123 Include REGULAR\MATH.ASM ; Math functions (like 32-bit multiply) 1031 1124 size_math = $-b_math 1032 1125 1033 1126 b_conv: 1034 Include REGULAR\CONV.ASM 1127 Include REGULAR\CONV.ASM ; Various conversion routines 1035 1128 size_conv = $-b_conv 1036 1129 1037 1130 IFDEF AuxDebug 1038 1131 b_debug: 1039 Include REGULAR\DEBUG.ASM ; Various debugging routines, uses AUXIO and CONV 1132 Include REGULAR\DEBUG.ASM ; Various debugging routines, 1133 ; uses AUXIO and CONV 1040 1134 size_debug = $-b_debug 1041 1135 ENDIF 1042 1136 1043 1137 b_auxio: 1044 Include REGULAR\AUXIO.ASM 1138 Include REGULAR\AUXIO.ASM ; Com-port support for debugging 1045 1139 size_auxio = $-b_auxio 1046 1140 … … 1061 1155 1062 1156 1063 ;============================================================================== =1157 ;============================================================================== 1064 1158 1065 1159 ; … … 1093 1187 1094 1188 1095 ;============================================================================== =1096 1189 ;============================================================================== 1190 ; Sector 38-x 1097 1191 ; 1098 1192 ; This section contains translatable texts. … … 1173 1267 1174 1268 1175 ;============================================================================== =1176 ; Sector 551269 ;============================================================================== 1270 ; Sector 55 1177 1271 1178 1272 ; … … 1187 1281 1188 1282 1189 Configuration: 1190 db 'AiRCFG-TABLE' ; Rousseau: THERE IS AN INVISIBLE CHAR HERE !!1283 Configuration: ; THERE IS AN INVISIBLE CHAR HERE !! 1284 db 'AiRCFG-TABLE' 1191 1285 db 01h, 07h, 'U' ; "Compressed" ID String 1192 ; This is now version 1.07 to have it in sync with the new code version for eCS. 1193 ; Version 1.02 was for code 1.06, 1.03 was internal and 1.04,1.05 and 1.06 do not exist. 1194 ; It is not required for the config to have the same version as the code, so in the future 1195 ; the code version might be higher than the config version if there are no changes to the latter. 1286 ; This is now version 1.07 to have it in sync with 1287 ; the new code version for eCS. 1288 ; Version 1.02 was for code 1.06, 1.03 was internal 1289 ; and 1.04,1.05 and 1.06 do not exist. 1290 ; It is not required for the config to have the 1291 ; same version as the code, so in the future 1292 ; the code version might be higher than the 1293 ; config version if there are no changes to the latter. 1196 1294 1197 1295 CFG_LastTimeEditLow dw 0 ; Last Time Edited Stamp (will incr every setup) … … 1205 1303 1206 1304 CFG_PartLast db 0 ; Which Partition was booted last time ? (Base=0) 1207 CFG_TimedBoot db 1; Timed Boot Enable (for REAL Enable look TimedBootEnable)1305 CFG_TimedBoot db 0 ; Timed Boot Enable (for REAL Enable look TimedBootEnable) 1208 1306 CFG_TimedSecs db 15 ; Timed Boot - How Many Seconds Till Boot 1209 1307 CFG_TimedDelay dw 123 ; Timed Boot - Delay … … 1221 1319 CFG_IgnoreWriteToMBR db 0 ; Just ignore writes to MBR, otherwise crash 1222 1320 CFG_FloppyBootGetName db 0 ; Gets floppy name for display purposes 1223 CFG_DetectVirus db 0 ; Detect Virus ? // Rousseau: disabled1224 CFG_DetectStealth db 0 ; Detect Stealth-Virus ? // Rousseau: disabled1225 CFG_DetectVIBR db 0 ; Detect BootRecord-Virus ? // Rousseau: disabled1226 CFG_AutoEnterSetup db 0 ; Automatic Enter Setup (first install!) // Rousseau: disabled1321 CFG_DetectVirus db 0 ; Detect Virus ? 1322 CFG_DetectStealth db 0 ; Detect Stealth-Virus ? 1323 CFG_DetectVIBR db 0 ; Detect BootRecord-Virus ? 1324 CFG_AutoEnterSetup db 0 ; Automatic Enter Setup (first install!) 1227 1325 CFG_MasterPassword dw 0101Fh ; Encoded Password (this is just CR) 1228 1326 dw 07A53h … … 1255 1353 CFG_AutomaticBoot db 0 ; Automatic Booting (only one bootup) 1256 1354 CFG_PartAutomatic db 0 ; Partition-No for automatic booting 1257 CFG_ForceLBAUsage db 1 ; LBA-BIOS-API forced on any HDD I/O // Rousseau: enabled config (LBA)1355 CFG_ForceLBAUsage db 1 ; LBA-BIOS-API forced on any HDD I/O 1258 1356 CFG_IgnoreLVM db 0 ; Ignores any LVM-Information 1259 1357 … … 1279 1377 soiv: 1280 1378 1281 ; Rousseau: added 1282 ;eCS_InstallVolume db 12 dup (0) ; Rousseau: new install-volume 1283 ;eCS_InstallVolume db 'HIGHLOG' ,0 ; Rousseau: new install-volume 1284 eCS_InstallVolume db 0,'NOPHASEONE' ,0 ; Rousseau: new install-volume 1285 ;eCS_InstallVolume db 'ECS-MIDDLE',0,0 ; Rousseau: new install-volume 1286 ;eCS_InstallVolume db 'ECS-HIGH',0,0,0,0 ; Rousseau: new install-volume 1287 ;eCS_InstallVolume db 'ECS-HIGH',0,'NO',0 ; Rousseau: new install-volume 1379 ; SET(A)BOOT stores the volume name of the eCS system being installed here. 1380 ; It is truncated to 11 chars because AiR-BOOT currently does not support 1381 ; longer labelnames. The name is also capitalized. 1382 ;eCS_InstallVolume db 12 dup (0) 1383 ;eCS_InstallVolume db 'HIGHLOG' ,0 1384 eCS_InstallVolume db 0,'NOPHASEONE' ,0 1385 ;eCS_InstallVolume db 'ECS-MIDDLE',0,0 1386 ;eCS_InstallVolume db 'ECS-HIGH',0,0,0,0 1387 ;eCS_InstallVolume db 'ECS-HIGH',0,'NO',0 1288 1388 1289 1389 … … 1349 1449 db 0, 1, 0 ; Location of Partition/Boot Record 1350 1450 dd 0, 0 1351 ;--------------------------------------------------------------------------- 1451 ;------------------------------------------------------------------------------ 1352 1452 1353 1453 eosvs: … … 1360 1460 1361 1461 1362 ;org 06E00h 1462 ;org 06E00h ; Sector 56-57 1363 1463 org image_size - 0a00h - (image_size - image_size_60secs) 1364 1464 sos56: … … 1416 1516 ENDIF 1417 1517 1418 ;--------------------------------------------------------------------------- 1419 ;org 07200h ; Sector 581420 org image_size - 600h - (image_size - image_size_60secs) / 2 ; Sector 581518 ;------------------------------------------------------------------------------ 1519 ;org 07200h ; Sector 58 1520 org image_size - 600h - (image_size - image_size_60secs) / 2 1421 1521 soipt: 1422 1522 sos58: … … 1461 1561 1462 1562 1463 ;--------------------------------------------------------------------------- 1464 ;org 07600h ; Sector 601465 org image_size - 200h ; Sector 601563 ;------------------------------------------------------------------------------ 1564 ;org 07600h ; Sector 60 1565 org image_size - 200h ; Sector 60 1466 1566 sohid: 1467 1567 sos60: 1568 1468 1569 MBR_BackUpMBR db 'AiR-BOOT MBR-BackUp - Just to fill this sector with something',0 1469 1570 AirBootRocks db 'AiR-BOOT Rocks!',0 … … 1482 1583 org image_size - 2 1483 1584 dw 0BABEh 1484 ;dw 01485 ;BIOS_AuxParms dw BIOS_AuxParmsDefault ; Initialized at start when developing1486 1585 1487 1586 eoab: 1488 1587 1489 1588 ; 1490 ; Rousseau:1491 1589 ; End of AiR-BOOT code and data. 1492 1590 ; … … 1494 1592 1495 1593 ; 1496 ; Rousseau:1497 1594 ; Below functions like a BSS segment, thus uninitialized data. 1498 1595 ; 1499 1596 sobss: 1500 ;--------------------------------------------------------------------------- 1501 org 0A000h 1597 ;------------------------------------------------------------------------------ 1598 org 0A000h ; Uninitialized 1502 1599 ; This space actually gets initialized in PreCrap to NUL (till EndOfVariables) 1503 1600 BeginOfVariables: … … 1507 1604 1508 1605 ; Everything used to build a new IPT and reference it to the old one 1509 NewPartTable: db 1536 dup (?) ; New Partition Table1606 NewPartTable: db 1536 dup (?) ; New Partition Table 1510 1607 NewHidePartTable: db partition_count * 30 dup (?) ; New Hide-Partition Table 1511 NewDriveLetters: db partition_count dup (?) ; Logical Drive-Letters1608 NewDriveLetters: db partition_count dup (?) ; Logical Drive-Letters 1512 1609 1513 1610 PartitionSizeTable: db partition_count * 6 dup (?) ; Size-Table (6 bytes per partition) 1514 PartitionPointers dw 52 dup (?) ; Maximum is 52 entries till now1515 PartitionPointerCount db ? ; Count of total Partition Pointers1611 PartitionPointers dw 52 dup (?) ; Maximum is 52 entries till now 1612 PartitionPointerCount db ? ; Count of total Partition Pointers 1516 1613 PartitionXref db partition_count dup (?) ; X-Reference Table 1517 1614 PartitionVolumeLetters db partition_count dup (?) ; Volume-Letters 1518 ; 0 - no LVM support 1519 ; 1 - LVM support, but no letter 1520 ; 'C'-'Z' - assigned drive letter 1521 1522 TotalHarddiscs db ? ; Total harddrives (by POST) 1523 LBASwitchTable db 128 dup (?) ; Bit 25-18 for CHS/LBA Switching 1524 NewPartitions db ? ; Freshly found partitions ; Independent of SaveConfiguration 1525 1526 VideoIO_Segment dw ? ; Segment for Video I/O 1527 1528 ExtendedAbsPos dd ? ; Extended Partition Absolute Position 1529 ExtendedAbsPosSet db ? ; If Absolute Position set 1530 1531 CurPartition_Location dw 4 dup (?) ; Where did current partition came from? 1532 CurIO_UseExtension db ? ; 1-Use INT 13h EXTENSIONS 1533 ; (filled out by PreCrap) 1534 CurIO_Scanning db ? ; 1-AiR-BOOT is scanning partitions 1535 ; (for detailed error message) 1615 ; 0 - no LVM support 1616 ; 1 - LVM support, but no letter 1617 ; 'C'-'Z' - assigned drive letter 1618 1619 TotalHarddiscs db ? ; Total harddrives (by POST) 1620 LBASwitchTable db 128 dup (?) ; Bit 25-18 for CHS/LBA Switching 1621 NewPartitions db ? ; Freshly found partitions 1622 ; Independent of SaveConfiguration 1623 1624 VideoIO_Segment dw ? ; Segment for Video I/O 1625 1626 ExtendedAbsPos dd ? ; Extended Partition Absolute Position 1627 ExtendedAbsPosSet db ? ; If Absolute Position set 1628 1629 CurPartition_Location dw 4 dup (?) ; Where did current partition came from? 1630 CurIO_UseExtension db ? ; 1-Use INT 13h EXTENSIONS 1631 ; (filled out by PreCrap) 1632 CurIO_Scanning db ? ; 1-AiR-BOOT is scanning partitions 1633 ; (for detailed error message) 1536 1634 1537 1635 ; [Linux support removed since v1.02] … … 1651 1749 ;db 1 dup(?) 1652 1750 1653 i13xbuf dw 1 dup (?) ; Size of the buffer; this param *must* be present. Code inserts it. 1751 i13xbuf dw 1 dup (?) ; Size of the buffer; 1752 ; this param *must* be present. 1753 ; Code inserts it. 1654 1754 db 126 dup(?) ; The buffer itself. 1655 i13xbuf_size = $-offset i13xbuf-2 ; Size of buffer (excluding the size word at the start). 1755 i13xbuf_size = $-offset i13xbuf-2 ; Size of buffer 1756 ; (excluding the size word at the start). 1656 1757 1657 1758 eobss: -
trunk/BOOTCODE/MAKE.BAT
r30 r31 38 38 %exe2bin% air-boot.exe air-boot.com >nul 39 39 if errorlevel 1 goto Failed 40 40 41 ..\tools\internal\fixcode.com 42 41 43 copy AIR-BOOT.com ..\RELEASE\BOOTCODE\AIRBT-%1.bin 42 44 -
trunk/BOOTCODE/MAKEALL.BAT
r30 r31 7 7 @CALL MAKE.BAT 8 8 @CD .. 9 @pause9 rem @pause 10 10 11 11 @cls … … 17 17 @CALL MAKE.BAT 18 18 @CD ..\..\BOOTCODE 19 @pause19 rem @pause 20 20 21 21 @cls … … 27 27 @CALL MAKE.BAT 28 28 @CD ..\..\..\BOOTCODE 29 @pause29 rem @pause 30 30 31 31 @cls … … 37 37 @CALL MAKE.BAT 38 38 @CD ..\..\BOOTCODE 39 @pause39 rem @pause 40 40 41 41 @cls -
trunk/BOOTCODE/REGULAR/AUXIO.ASM
r30 r31 25 25 ; ----------------------- 26 26 ; Output some stuff to the serial port. 27 ; Word at 1B0h inMBR must be initialized for this.27 ; The aux parameters in the MBR must be initialized for this. 28 28 ; Lower byte is com-port, 0=disabled, 1=com1, etc. 29 29 ; High byte is initialization; see below. (0e3h) -
trunk/BOOTCODE/REGULAR/BOOTMENU.ASM
r30 r31 190 190 mov cx, CLR_INFO_WINDOW_BM 191 191 ;mov cx, 0C06h ; brown, main background 192 call VideoIO_Color ; Rousseau:color info window192 call VideoIO_Color ; Ccolor info window 193 193 194 194 mov bx, 1401h … … 211 211 212 212 mov cx, CLR_INFO_TEXT_BM ; Info text 213 call VideoIO_Color ; Rousseau: color info text213 call VideoIO_Color ; Color info text 214 214 215 215 mov si, offset TXT_BootMenuHelpText1 -
trunk/BOOTCODE/REGULAR/DRIVEIO.ASM
r30 r31 61 61 mov si, offset Configuration ; Calculate new checksum 62 62 xor bx, bx 63 mov cx, 5 ; Total of 5 Config-Sectors 63 64 ; Changed from 5 to calculated 65 ; Fixes issue: #2987 -- "air-boot doesn't remember drive letter" 66 mov cx, (MBR_BackUpMBR - Configuration) / 2 ; Size of the ab-configuration 67 ; TASM does not evaluate expression above corrrectly. 68 ; Listing shows correct opcode but generated opcode has imm. word byteswapped. 69 ; Casting to byte also does not work (overflow). 70 ; So we swap back here -- must be removed in JWasm version !! 71 xchg ch,cl 72 64 73 mov dx, [CFG_CheckConfig] 65 74 mov [CFG_CheckConfig], bx … … 73 82 mov dx, 0080h ; First harddrive, Sector 55... 74 83 mov cx, 0037h 75 mov ax, 0305h ; Function 03, 5 sectors to write 84 85 ; Changed from 5 to calculated 86 ; Fixes issue: #2987 -- "air-boot doesn't remember drive letter" 87 mov ax, (MBR_BackUpMBR - Configuration) / 2 ; sizeof(ab-configuration) to write 88 ; TASM does not evaluate expression above corrrectly. 89 ; Listing shows correct opcode but generated opcode has imm. word byteswapped. 90 ; Casting to byte also does not work (overflow). 91 ; So we swap back here -- must be removed in JWasm version !! 92 xchg ah,al 93 mov ah,03h 94 76 95 int 13h 77 96 jnc DIOSC_NoError … … 147 166 ; This is calculated by Sector*Heads. Comparing will get done with Bit 25-10 148 167 ; on LBA sectors, so we actually divide sector number by 1024. 149 DriveIO_InitLBASwitchTable Proc Near Uses es di ; Rousseau: LBA !168 DriveIO_InitLBASwitchTable Proc Near Uses es di 150 169 mov di, offset LBASwitchTable 151 170 mov dh, TotalHarddiscs … … 166 185 mov ah,0 167 186 168 mov bl, dh ; DH -> head count ; Rousseau: nope, it's max head number !187 mov bl, dh ; DH -> max head number 169 188 mul bl ; AX = Sectors*Heads 170 189 shl ah, 1 … … 188 207 ; Rousseau: Enhanced to handle sector-numbers 127 and 255 besides 63 for LVM-info sectors. 189 208 ; Ugly, need to cleanup. 190 DriveIO_LVMAdjustToInfoSector Proc Near Uses ; Rousseau: LVM stuff !209 DriveIO_LVMAdjustToInfoSector Proc Near Uses 191 210 192 211 … … 555 574 mov cx, wptr cs:[CurPartition_Location+6] ; Gets cur. partition location 556 575 557 call DriveIO_LVMAdjustToInfoSector ; Rousseau: LVM stuff !576 call DriveIO_LVMAdjustToInfoSector 558 577 559 578 mov si, offset LVMSector … … 593 612 ;popf 594 613 595 call LVM_CheckSectorSignature ; Rousseau: LVM stuff !614 call LVM_CheckSectorSignature 596 615 jnc DIOLLVMS_NoLVMSector 597 call LVM_CheckSectorCRC ; Rousseau: LVM stuff !616 call LVM_CheckSectorCRC 598 617 jnc DIOLLVMS_NoLVMSector 599 618 ret … … 662 681 ; Preserve: all registers 663 682 ; ######################################################################### 664 DriveIO_LoadSector Proc Near Uses ax bx ds si es di ; Rousseau: Disk IO683 DriveIO_LoadSector Proc Near Uses ax bx ds si es di 665 684 test cs:[CurIO_UseExtension], 1 666 685 jz DIOLS_UseNormal 667 ; Are we forced do use LBA via Setting? 668 test cs:[CFG_ForceLBAUsage], 1 ; Rousseau: LBA 686 ; Are we forced do use LBA via Setting? ; Rousseau: LBA 669 687 jnz DIOLS_UseExtension 670 688 ; Is the drive not a harddrive? … … 685 703 pop es 686 704 mov bx, si ; ES:BX - Destination 687 mov ax, 0201h ; Function 2 - Load Sector ; Rousseau: Disk IO -- legacy BIOS call705 mov ax, 0201h ; Function 2 - Load Sector 688 706 int 13h 689 707 jnc DIOLS_Success … … 704 722 pop ds 705 723 mov si, offset DriveIO_DAP 706 mov ah, 42h ; Extended Read ; Rousseau: Disk IO -- extended BIOS call724 mov ah, 42h ; Extended Read 707 725 int 13h 708 726 pop cx … … 728 746 jz DIOSS_UseNormal 729 747 ; Are we forced do use LBA via Setting? 730 test cs:[CFG_ForceLBAUsage], 1 ; Rousseau: LBA748 test cs:[CFG_ForceLBAUsage], 1 731 749 jnz DIOSS_UseExtension 732 750 ; Is the drive not a harddrive? -
trunk/BOOTCODE/REGULAR/OTHER.ASM
r30 r31 363 363 mov si, offset Configuration 364 364 xor bx, bx 365 mov cx, 5 ; Total of 5 Sectors 365 366 ; Changed from 5 to calculated 367 ; Fixes issue: #2987 -- "air-boot doesn't remember drive letter" 368 mov cx, (MBR_BackUpMBR - Configuration) / 2 ; Size of the ab-configuration 369 ; TASM does not evaluate expression above corrrectly. 370 ; Listing shows correct opcode but generated opcode has imm. word byteswapped. 371 ; Casting to byte also does not work (overflow). 372 ; So we swap back here -- must be removed in JWasm version !! 373 xchg ch,cl 374 366 375 mov dx, CFG_CheckConfig 367 376 mov CFG_CheckConfig, bx -
trunk/BOOTCODE/REGULAR/PARTMAIN.ASM
r30 r31 435 435 ret 436 436 PART_FillOutSizeElement EndP 437 438 439 440 441 442 443 444 445 446 447 448 ; This routine is called to hide a partition 449 ; In: DL - Partition to hide 450 ; Destroyed: None 451 PART_HidePartition Proc Near Uses ax bx cx dx si di 452 call PART_GetPartitionPointer ; Pointer to partition (DL) -> SI 453 454 ; First load the partition table of that partition... 455 mov ax, wptr [si+LocIPT_AbsolutePartTable+0] 456 mov bx, wptr [si+LocIPT_AbsolutePartTable+2] 457 mov cx, wptr [si+LocIPT_LocationPartTable+1] 458 mov dh, bptr [si+LocIPT_LocationPartTable+0] 459 mov dl, [si+LocIPT_Drive] 460 call DriveIO_LoadPartition 461 ; Partition-Table now LOADED 462 mov di, offset PartitionSector+446 ; ES:DI - 1st partitionentry... 463 464 ; Put our partition's location into registers... 465 mov ax, wptr [si+LocIPT_AbsoluteBegin+0] 466 mov bx, wptr [si+LocIPT_AbsoluteBegin+2] 467 sub ax, wptr [si+LocIPT_AbsolutePartTable+0] 468 sbb bx, wptr [si+LocIPT_AbsolutePartTable+2] 469 ; BX:AX - absolute position of partition relative to partition table 470 ; ...and search for it... 471 PHP_SearchLoop: 472 cmp ax, wptr es:[di+LocBRPT_RelativeBegin] 473 jne PHP_SearchMismatch 474 cmp bx, wptr es:[di+LocBRPT_RelativeBegin+2] 475 jne PHP_SearchMismatch 476 jmp PHP_SearchMatch 477 PHP_SearchMismatch: 478 add di, LocBRPT_LenOfEntry ; 16 Bytes per partition entry 479 cmp di, 500+offset PartitionSector 480 jb PHP_SearchLoop 481 jmp MBR_HaltSystem ; not found, something is wrong here 482 483 ; Found entry... 484 PHP_SearchMatch: 485 mov al, bptr es:[di+LocBRPT_SystemID] ; Partition-ID into AL 486 call PART_SearchFileSysHiddenID ; Put on =STEALTH= 487 mov bptr es:[di+LocBRPT_SystemID], al 488 IFDEF ReleaseCode 489 call DriveIO_SavePartition ; Saves Partition-Table 490 ENDIF 491 ret 492 PART_HidePartition EndP 493 494 ; This here is for marking the first "good" non-hidden partition as being 495 ; active. It requires the partition table at EXECBASE. 496 ; Some BIOSes have problems with no primary marked active. Actually this is 497 ; a buggy implementation, because the MBR-code should normally check, 498 ; *not* the BIOS. This one *could* cause havoc to some systems, but I can't 499 ; do anything else. 500 PART_MarkFirstGoodPrimary Proc Near Uses ax si di 501 mov di, offset PartitionSector+446 ; DS:SI - 1st partitionentry 502 ; First action to do: Remove the active flag from every partition 503 push di 504 mov cl, 4 505 PMPP_RemoveActiveFlagLoop: 506 and bptr es:[di+LocBRPT_Flags], 7Fh 507 add di, LocBRPT_LenOfEntry 508 dec cl 509 jnz PMPP_RemoveActiveFlagLoop 510 pop di 511 ; First Search, will hit on any PartitionID that is: 512 ; a) not 0 513 ; b) not hidden 514 ; c) not extended partition (05h or 0Fh) 515 PMPP_Search1Loop: 516 mov al, bptr es:[di+LocBRPT_SystemID] 517 or al, al 518 jz PMPP_Search1NoHit 519 cmp al, 05h 520 je PMPP_Search1NoHit 521 cmp al, 0Fh 522 je PMPP_Search1NoHit 523 mov bl, al ; BL == AL == PartitionID 524 push si 525 call PART_SearchFileSysName 526 pop si ; AL == UnhiddenPartitionID 527 cmp al, bl ; if ID is unhidden... 528 je PMPP_SearchHit 529 PMPP_Search1NoHit: 530 add di, LocBRPT_LenOfEntry ; 16 Bytes per Partition-Entry 531 cmp di, 500+offset PartitionSector 532 jb PMPP_Search1Loop 533 534 mov di, offset PartitionSector+446 ; DS:SI - 1st Partition-Entry 535 ; Second Search, hit on anything that is not an extended partition 536 ; (05 or 0Fh) 537 PMPP_Search2Loop: 538 mov al, bptr es:[di+LocBRPT_SystemID] 539 or al, al 540 jz PMPP_Search2NoHit 541 cmp al, 05h 542 je PMPP_Search2NoHit 543 cmp al, 0Fh 544 jne PMPP_SearchHit 545 PMPP_Search2NoHit: 546 add di, LocBRPT_LenOfEntry ; 16 Bytes per Partition-Entry 547 cmp di, 500+offset PartitionSector 548 jb PMPP_Search2Loop 549 jmp PMPP_SearchFailed 550 551 PMPP_SearchHit: 552 or bptr es:[di], 80h ; SET ACTIVE PARTITION 553 PMPP_SearchFailed: 554 ret 555 PART_MarkFirstGoodPrimary EndP 556 557 ; Searches the Name and Flags to a FileSysID (PartitionID) 558 ; In: AL - FileSysID 559 ; Out: AL - Unhidden File-System-ID, AH - Flags for this File-System 560 ; SI - Pointer to Name (8char) 561 ; Destroyed: *none* 562 PART_SearchFileSysName Proc Near Uses bx dx 563 ;movzx bx, al 564 mov bl,al 565 mov bh,0 566 567 mov si, offset FileSysIDs 568 PSFSN_SearchLoop: 569 lodsw ; AL - NormalID, AH-HiddenID 570 mov dl, ds:[si] ; DL - File-System-Flags 571 inc si 572 cmp al, bl ; Check, if Unhidden-ID matches... 573 je PSFSN_Match 574 cmp ah, bl ; Check, if Hidden-ID matches... 575 je PSFSN_Match 576 mov al, bl ; So Unhidden-ID will be Original-ID 577 cmp ah, 0 ; Unknown (last ID in table) 578 je PSFSN_Match 579 inc bh 580 jmp PSFSN_SearchLoop 581 582 PSFSN_Match: 583 ; AL is already Unhidden-ID 584 mov ah, dl 585 ; AH is now the FileSystem-Flag 586 ;movzx bx, bh 587 mov bl,bh 588 mov bh,0 589 590 shl bx, 3 ; Offsets * 8 591 mov si, offset FileSysNames 592 add si, bx 593 ret 594 PART_SearchFileSysName EndP 595 596 ; Searches the Hidden ID corresponding to a FileSysID (PartitionID) 597 ; In: AL - FileSysID 598 ; Out: AL - Hidden File-System-ID 599 PART_SearchFileSysHiddenID Proc Near Uses bx 600 ;movzx bx, al 601 mov bl,al 602 mov bh,0 603 604 mov si, offset FileSysIDs 605 PSFSHI_SearchLoop: 606 lodsw ; AL - NormalID, AH-HiddenID 607 inc si 608 cmp al, bl ; Check, if Unhidden-ID matches... 609 je PSFSHI_Match 610 cmp ah, bl ; Check, if Hidden-ID matches... 611 je PSFSHI_Match 612 mov ah, bl ; So Unhidden-ID will get replied... 613 cmp ah, 0 ; Unknown (last ID in table) 614 je PSFSHI_Match 615 inc bh 616 jmp PSFSHI_SearchLoop 617 618 PSFSHI_Match: 619 mov al, ah ; AL = Hidden ID 620 ret 621 PART_SearchFileSysHiddenID EndP 622 623 ; In: DS:SI - Partition-Name, CX - Maximum/Total Length 624 ; Out: Carry-Flag set, if valid Partition-Name 625 ; Destroyed: None 626 PART_CheckForValidPartName Proc Near Uses ax cx dx si 627 ; Our logic is as follows: 628 ; If all chars are U -> Invalid (due reformated signature) 629 ; If anything below 32, but 0 -> Invalid (due invalid chars) 630 ; If anything above 165 -> Invalid (due invalid chars) 631 ; If anything between 123-128 -> Invalid (due invalid chars) 632 ; DX - holds count of 'U's 633 push cx 634 or cx, cx 635 jz PCFVPN_InvalidName 636 xor dx, dx 637 PCFVPN_CheckLoop: 638 lodsb 639 cmp al, 0 640 je PCFVPN_ValidChar 641 cmp al, 32 642 jb PCFVPN_InvalidName 643 cmp al, 165 644 ja PCFVPN_InvalidName 645 cmp al, 123 646 jb PCFVPN_ValidChar 647 cmp al, 128 648 jbe PCFVPN_InvalidName 649 PCFVPN_ValidChar: 650 cmp al, 'U' 651 jne PCFVPN_NoMagic 652 inc dx 653 PCFVPN_NoMagic: 654 dec cx 655 jnz PCFVPN_CheckLoop 656 pop cx 657 cmp cx, dx 658 clc 659 je PCFVPN_WasMagic 660 stc 661 PCFVPN_WasMagic: 662 ret 663 PCFVPN_InvalidName: 664 pop cx 665 clc 666 ret 667 PART_CheckForValidPartName EndP 668 669 670 ; Rousseau: added 671 ; Compare a volume-label in the IPT to the install-volume 672 ; SI holds pointer to entry in IPT 673 ; CY set if this entry is also the install-volume 674 PART_IsInstallVolume Proc Near Uses ax cx dx si di 675 cld ; Advance upwards with lodsb 676 mov di, offset eCS_InstallVolume ; Address of install-volume label (max. 11 chars) 677 678 mov cx, 11 ; Maximum length of label 679 xor dl, dl ; Not found yet 680 681 ; Compare next character 682 PART_IsInstallVolumeNext: 683 lodsb ; Load byte from SI (IPT-entry) 684 ;cmp al,' ' ; If space then use zero 685 ;jne PART_IsInstallVolume_skip1 686 ;xor al,al 687 PART_IsInstallVolume_skip1: 688 xchg ah,al ; Save char to AH 689 xchg si,di ; Exchange pointers 690 lodsb ; Load byte from SI (install-volume label) 691 ;cmp al,' ' ; If space then use zero 692 ;jne PART_IsInstallVolume_skip2 693 ;xor al,al 694 PART_IsInstallVolume_skip2: 695 xchg si,di ; Reexchange pointers 696 call AuxIO_Teletype 697 call CONV_ToUpper 698 call AuxIO_Teletype 699 xchg al,ah 700 call AuxIO_Teletype 701 call CONV_ToUpper 702 call AuxIO_Teletype 703 call AuxIO_TeletypeNL 704 705 ; Are both of them zero ? 706 ; Then the names could be the same, but cx must not equal 11 707 ; because that would indicate a null-string. 708 mov dh,al 709 or dh,ah 710 jz PART_IsInstallVolumeFound 711 712 cmp ah,al ; Are the the same ? 713 jnz PART_IsInstallVolumeNotFound ; Nope, compare ended 714 loop PART_IsInstallVolumeNext ; Yep, Compare next character 715 716 PART_IsInstallVolumeFound: 717 ; If CX is still 11 this was a zero string 718 ; and thus not a valid volume-name. 719 ; This should not occur as this function is only called when the first 720 ; byte is non-zero. 721 cmp cx,11 722 je PART_IsInstallVolumeNotFound 723 ; Found ! 724 mov dl,1 ; Found 725 jmp PART_IsInstallVolumeEnd 726 727 728 PART_IsInstallVolumeNotFound: 729 mov dl,0 730 jmp PART_IsInstallVolumeEnd 731 732 733 PART_IsInstallVolumeEnd: 734 ; Set the status in CY 735 mov al,dl 736 add al,'0' 737 call AuxIO_TeletypeHexByte 738 call AuxIO_TeletypeNL 739 rcr dl,1 ; Put found-flag in CY 740 ret 741 PART_IsInstallVolume EndP 437 742 438 743 … … 525 830 mov dh, bptr [si+LocIPT_LocationPartTable+0] 526 831 mov dl, [si+LocIPT_Drive] 527 call DriveIO_LoadPartition ; Load Table... ; Rousseau: LOAD PARTITION ! 832 833 call DriveIO_LoadPartition ; Load Table... [LOAD] 834 528 835 ; --------------------------------------------------- MODIFY PARTITION TABLE 529 836 push cs … … 565 872 or byte ptr es:[di+LocBRPT_Flags], 80h ; set ACTIVE partition 566 873 IFDEF ReleaseCode 567 call DriveIO_SavePartition ; Saves the Partition-Table ; Rousseau: SAVE PARTITION !874 call DriveIO_SavePartition ; Saves the Partition-Table [SAVE] 568 875 ENDIF 569 876 … … 578 885 ; BX:AX -> Absolute End-Position of Partition 579 886 580 test CFG_ForceLBAUsage, 1 ; Rousseau: LBA887 test CFG_ForceLBAUsage, 1 581 888 jnz PSP_ForceI13X 582 889 ; LBA-boundary at 16450560 (FB0400h) (16320x16x63) … … 641 948 mov cx, 0001h ; Cylinder 0, Sector 1 642 949 mov dx, 0080h ; First HD, Head 0 643 call DriveIO_LoadPartition ; Load Primary Partition Table ; Rousseau: LOAD MBR ! 950 ; Load MBR 951 call DriveIO_LoadPartition ; Load Primary Partition Table 644 952 call PART_MarkFirstGoodPrimary 645 953 IFDEF ReleaseCode 646 call DriveIO_SavePartition ; Saves the Partition-Table ; Rousseau: SAVE MBR ! 954 ; Save MBR 955 call DriveIO_SavePartition ; Saves the Partition-Table 647 956 ENDIF 648 957 PSP_NoHideAdjustPrimaryMark: … … 716 1025 mov dh, [si+LocIPT_LocationBegin+0] 717 1026 mov dl, [si+LocIPT_Drive] 718 call DriveIO_LoadPartition ; Loads boot-sector... ; Rousseau: LOAD PART BOOT-SECTOR !!1027 call DriveIO_LoadPartition ; Loads boot-sector... [PARTBOOTSEC] 719 1028 720 1029 test CFG_DetectVIBR, 1 … … 806 1115 807 1116 ; Rousseau: # Boot Logical Partitions) 808 ; FreeDOS and eCS on extpart on non-huge needs special support. (old ja jump) 809 ; PC-DOS7 on huge pri fat16 2G works with both (XP too) when at start of disk. (also when offset at 20MiB) 810 ; PCD7 bonkt vast als in 2GiB log at start of space. "Starting PC DOS..." verschijnt. PCD Loader probleem. 1117 ; FreeDOS and eCS on extpart on non-huge needs special support. 1118 ; (old ja jump) 1119 ; PC-DOS7 on huge pri fat16 2G works with both (XP too) when at start of disk. 1120 ; (also when offset at 20MiB) 1121 ; PCD7 bonkt vast als in 2GiB log at start of space. 1122 ; "Starting PC DOS..." verschijnt. PCD Loader probleem. 811 1123 ; Offset van start-of-disk bij PCD7 niet meer dan 2GiB maken. 812 1124 ; Special is needed to boot ECS-CXXVAC (log-part) on Douwskie Box with 40G disk. … … 819 1131 ; Laatste 63 is MBR. 820 1132 ; 821 ; It seems PRI's already get special treatment in that they get their hidden secs updated. 822 ; (100MB HD, moved 50MB PRI-DOS part UP, DFSee complains about wrong hidden, but AiR-BOOT corrects it before booting) 1133 ; It seems PRI's already get special treatment in that they get their 1134 ; hidden secs updated. 1135 ; (100MB HD, moved 50MB PRI-DOS part UP, DFSee complains about wrong hidden, 1136 ; but AiR-BOOT corrects it before booting) 823 1137 824 1138 ; FreeDOS zet 63 in SPT in BPB op 255/255 geo !!!! … … 829 1143 830 1144 ; Display volume-name 1145 ; Just before booting the selected partition 831 1146 pushf 1147 pusha 832 1148 push si 833 1149 add si, LocIPT_Name 834 1150 call MBR_TeletypeVolName 835 1151 xor si,si 836 call MBR_TeletypeNL ; Rousseau: Just before booting the selected partition1152 call MBR_TeletypeNL 837 1153 pop si 1154 popa 838 1155 popf 839 1156 840 1157 841 1158 842 jmp special ; Rousseau: GOT IT !!! (LOG-BOOT) (alleen op huge disks !) 843 ;jmp PSP_NoSpecialSupport 844 ;ja PSP_NoSpecialSupport ; Rousseau: original M. Kiewitz... 845 ;jbe PSP_NoSpecialSupport ; had to change to opposite ! 1159 1160 1161 1162 ; 1163 ; This section will be sanitized in the JWasm version. 1164 ; 1165 1166 jmp special 1167 ;jmp PSP_NoSpecialSupport 1168 1169 ;ja PSP_NoSpecialSupport 1170 ;jbe PSP_NoSpecialSupport 846 1171 847 1172 … … 855 1180 ; Special Support needed 856 1181 special: 857 ; Write actual drive-letter to partition boot-record. 858 ; This is according to BPB. 1182 ; Write actual drive-letter to partition boot-record in memory. 859 1183 mov al, bptr [si+LocIPT_Drive] 1184 860 1185 ; Also an influence with FreeDOS ! 861 1186 ; Generates JFS ERROR when not set correctly !!! 862 mov bptr es:[di+36], al ; Write Actual Drive-Letter (80h id first drive) !!!!!!!!!!!!!!!!!!!!!!! 1187 mov bptr es:[di+36], al ; Write Actual Drive-Letter to 1188 ; PBR in RAM. (BIOS notation) 1189 1190 ; 1191 ; Display drive info (debug) 1192 ; 1193 push ax 1194 mov al,' ' 1195 call VideoIO_PrintSingleChar 1196 pop ax 1197 call VideoIO_PrintHexByte 1198 mov al,'-' 1199 call VideoIO_PrintSingleChar 1200 1201 ; 1202 ; Absolute offset of volume 1203 ; 1204 mov ax, [si+LocIPT_AbsoluteBegin+2] 1205 call VideoIO_PrintHexWord 1206 mov ax, [si+LocIPT_AbsoluteBegin] 1207 call VideoIO_PrintHexWord 1208 mov al,'-' 1209 call VideoIO_PrintSingleChar 1210 1211 ; 1212 ; Relative offset (3fh/63 with logicals) 1213 ; 1214 mov ax,es:[di+30] 1215 call VideoIO_PrintHexWord 1216 mov ax,es:[di+28] 1217 call VideoIO_PrintHexWord 863 1218 864 1219 ; This could be incorrect when a partition is moved, 865 1220 ; or the system installer puts the wrong value here. 866 ; FreeDOS (log-part) i.e. puts 03fH (63d) here, eventhough it is not a the start of the disk. 1221 ; FreeDOS (log-part) i.e. puts 03fH (63d) here, eventhough it is not 1222 ; at the start of the disk. 867 1223 ; This fixing is done by OS/2 BM as well, according to Martin. 868 1224 mov ax, [si+LocIPT_AbsoluteBegin] … … 876 1232 ;jmp PSP_NoLogicalSupport 877 1233 1234 1235 ; 1236 ; Test if the drive-letter feature is active for this partition. 1237 ; If so, then the drive that the user defined will be placed at 1238 ; byte 25h (37d) of the in-ram PartitionSector (BPB). 1239 ; (BIOS 80h notation: 80h=C, 81h=D, etc.) 1240 ; This is a remedy for when the corresponding field (25h) in the BPB on 1241 ; disk is zero. 1242 ; 878 1243 test byte ptr [si+LocIPT_Flags], Flags_DriveLetter 879 1244 jz PSP_NoLogicalSupport … … 886 1251 mov bptr es:[di+37], al ; Write Drive Letter (OS/2 only) 887 1252 1253 ; Display dl-feature drive if active 1254 push ax 1255 mov al,'-' 1256 call VideoIO_PrintSingleChar 1257 pop ax 1258 call VideoIO_PrintHexByte 1259 888 1260 ; -------------------------------------------- COPY BOOT-RECORD TO STARTBASE 889 1261 PSP_NoLogicalSupport: 1262 1263 1264 mov al,'-' 1265 call VideoIO_PrintSingleChar 1266 mov al,[ExtendedAbsPosSet] 1267 call VideoIO_PrintHexByte 1268 1269 890 1270 push si 891 1271 mov ax, StartBaseSeg … … 896 1276 rep movsw 897 1277 pop si 898 ; ---------------------------------------------------- NOW START BOOT-RECORD ; Rousseau: START PARTITION BOOT-RECORD !! 1278 ; ---------------------------------------------------- NOW START BOOT-RECORD 1279 1280 899 1281 900 1282 … … 903 1285 ENDIF 904 1286 905 ; 906 ; ########################### WAIT FOR KEY ################################ 907 ; 908 909 ; Rousseau: 910 ; Wait for key so we can see which volume is going to be started. 911 ;xor ax, ax 912 ;int 16h 913 ;cmp al, 1bh ; is escape-key ? 914 ;jne skip_reenter 915 916 ;jmp MBR_Main_ReEnterBootMenuPre ; yep, re-enter boot-menu 917 918 skip_reenter: 919 920 921 922 923 924 925 1287 1288 1289 1290 ; 1291 ; ################################## BYE BYE ################################## 1292 ; 1293 1294 ; 1295 ; Wait for keypress 1296 ; 1297 xor ax, ax 1298 int 16h 1299 1300 ; Is escape-key ? 1301 cmp al, 1bh 1302 1303 ; Nope, Go activate PBR loader 1304 jne start_pbr 1305 1306 ; Yep, Reenter bootmenu 1307 jmp MBR_Main_ReEnterBootMenuPre 1308 1309 1310 1311 ; 1312 ; Transfer control to the PBR 1313 ; 1314 start_pbr: 926 1315 927 1316 ; … … 936 1325 mov dl, cs:[si+LocIPT_Drive] ; Drive Physical No 937 1326 1327 ; 1328 ; JUMP TO PBR loader 1329 ; 938 1330 IFDEF ReleaseCode 939 db 0EAh ; JUMP TO Entry Point...Bye Bye1331 db 0EAh 940 1332 dw StartBasePtr 941 1333 dw StartBaseSeg 942 1334 ENDIF 1335 1336 943 1337 PART_StartPartition EndP 944 1338 945 1339 946 947 948 949 950 951 952 953 954 955 ; This routine is called to hide a partition956 ; In: DL - Partition to hide957 ; Destroyed: None958 PART_HidePartition Proc Near Uses ax bx cx dx si di959 call PART_GetPartitionPointer ; Pointer to partition (DL) -> SI960 961 ; First load the partition table of that partition...962 mov ax, wptr [si+LocIPT_AbsolutePartTable+0]963 mov bx, wptr [si+LocIPT_AbsolutePartTable+2]964 mov cx, wptr [si+LocIPT_LocationPartTable+1]965 mov dh, bptr [si+LocIPT_LocationPartTable+0]966 mov dl, [si+LocIPT_Drive]967 call DriveIO_LoadPartition968 ; Partition-Table now LOADED969 mov di, offset PartitionSector+446 ; ES:DI - 1st partitionentry...970 971 ; Put our partition's location into registers...972 mov ax, wptr [si+LocIPT_AbsoluteBegin+0]973 mov bx, wptr [si+LocIPT_AbsoluteBegin+2]974 sub ax, wptr [si+LocIPT_AbsolutePartTable+0]975 sbb bx, wptr [si+LocIPT_AbsolutePartTable+2]976 ; BX:AX - absolute position of partition relative to partition table977 ; ...and search for it...978 PHP_SearchLoop:979 cmp ax, wptr es:[di+LocBRPT_RelativeBegin]980 jne PHP_SearchMismatch981 cmp bx, wptr es:[di+LocBRPT_RelativeBegin+2]982 jne PHP_SearchMismatch983 jmp PHP_SearchMatch984 PHP_SearchMismatch:985 add di, LocBRPT_LenOfEntry ; 16 Bytes per partition entry986 cmp di, 500+offset PartitionSector987 jb PHP_SearchLoop988 jmp MBR_HaltSystem ; not found, something is wrong here989 990 ; Found entry...991 PHP_SearchMatch:992 mov al, bptr es:[di+LocBRPT_SystemID] ; Partition-ID into AL993 call PART_SearchFileSysHiddenID ; Put on =STEALTH=994 mov bptr es:[di+LocBRPT_SystemID], al995 IFDEF ReleaseCode996 call DriveIO_SavePartition ; Saves Partition-Table997 ENDIF998 ret999 PART_HidePartition EndP1000 1001 ; This here is for marking the first "good" non-hidden partition as being1002 ; active. It requires the partition table at EXECBASE.1003 ; Some BIOSes have problems with no primary marked active. Actually this is1004 ; a buggy implementation, because the MBR-code should normally check,1005 ; *not* the BIOS. This one *could* cause havoc to some systems, but I can't1006 ; do anything else.1007 PART_MarkFirstGoodPrimary Proc Near Uses ax si di1008 mov di, offset PartitionSector+446 ; DS:SI - 1st partitionentry1009 ; First action to do: Remove the active flag from every partition1010 push di1011 mov cl, 41012 PMPP_RemoveActiveFlagLoop:1013 and bptr es:[di+LocBRPT_Flags], 7Fh1014 add di, LocBRPT_LenOfEntry1015 dec cl1016 jnz PMPP_RemoveActiveFlagLoop1017 pop di1018 ; First Search, will hit on any PartitionID that is:1019 ; a) not 01020 ; b) not hidden1021 ; c) not extended partition (05h or 0Fh)1022 PMPP_Search1Loop:1023 mov al, bptr es:[di+LocBRPT_SystemID]1024 or al, al1025 jz PMPP_Search1NoHit1026 cmp al, 05h1027 je PMPP_Search1NoHit1028 cmp al, 0Fh1029 je PMPP_Search1NoHit1030 mov bl, al ; BL == AL == PartitionID1031 push si1032 call PART_SearchFileSysName1033 pop si ; AL == UnhiddenPartitionID1034 cmp al, bl ; if ID is unhidden...1035 je PMPP_SearchHit1036 PMPP_Search1NoHit:1037 add di, LocBRPT_LenOfEntry ; 16 Bytes per Partition-Entry1038 cmp di, 500+offset PartitionSector1039 jb PMPP_Search1Loop1040 1041 mov di, offset PartitionSector+446 ; DS:SI - 1st Partition-Entry1042 ; Second Search, hit on anything that is not an extended partition1043 ; (05 or 0Fh)1044 PMPP_Search2Loop:1045 mov al, bptr es:[di+LocBRPT_SystemID]1046 or al, al1047 jz PMPP_Search2NoHit1048 cmp al, 05h1049 je PMPP_Search2NoHit1050 cmp al, 0Fh1051 jne PMPP_SearchHit1052 PMPP_Search2NoHit:1053 add di, LocBRPT_LenOfEntry ; 16 Bytes per Partition-Entry1054 cmp di, 500+offset PartitionSector1055 jb PMPP_Search2Loop1056 jmp PMPP_SearchFailed1057 1058 PMPP_SearchHit:1059 or bptr es:[di], 80h ; SET ACTIVE PARTITION1060 PMPP_SearchFailed:1061 ret1062 PART_MarkFirstGoodPrimary EndP1063 1064 ; Searches the Name and Flags to a FileSysID (PartitionID)1065 ; In: AL - FileSysID1066 ; Out: AL - Unhidden File-System-ID, AH - Flags for this File-System1067 ; SI - Pointer to Name (8char)1068 ; Destroyed: *none*1069 PART_SearchFileSysName Proc Near Uses bx dx1070 ;movzx bx, al1071 mov bl,al1072 mov bh,01073 1074 mov si, offset FileSysIDs1075 PSFSN_SearchLoop:1076 lodsw ; AL - NormalID, AH-HiddenID1077 mov dl, ds:[si] ; DL - File-System-Flags1078 inc si1079 cmp al, bl ; Check, if Unhidden-ID matches...1080 je PSFSN_Match1081 cmp ah, bl ; Check, if Hidden-ID matches...1082 je PSFSN_Match1083 mov al, bl ; So Unhidden-ID will be Original-ID1084 cmp ah, 0 ; Unknown (last ID in table)1085 je PSFSN_Match1086 inc bh1087 jmp PSFSN_SearchLoop1088 1089 PSFSN_Match:1090 ; AL is already Unhidden-ID1091 mov ah, dl1092 ; AH is now the FileSystem-Flag1093 ;movzx bx, bh1094 mov bl,bh1095 mov bh,01096 1097 shl bx, 3 ; Offsets * 81098 mov si, offset FileSysNames1099 add si, bx1100 ret1101 PART_SearchFileSysName EndP1102 1103 ; Searches the Hidden ID corresponding to a FileSysID (PartitionID)1104 ; In: AL - FileSysID1105 ; Out: AL - Hidden File-System-ID1106 PART_SearchFileSysHiddenID Proc Near Uses bx1107 ;movzx bx, al1108 mov bl,al1109 mov bh,01110 1111 mov si, offset FileSysIDs1112 PSFSHI_SearchLoop:1113 lodsw ; AL - NormalID, AH-HiddenID1114 inc si1115 cmp al, bl ; Check, if Unhidden-ID matches...1116 je PSFSHI_Match1117 cmp ah, bl ; Check, if Hidden-ID matches...1118 je PSFSHI_Match1119 mov ah, bl ; So Unhidden-ID will get replied...1120 cmp ah, 0 ; Unknown (last ID in table)1121 je PSFSHI_Match1122 inc bh1123 jmp PSFSHI_SearchLoop1124 1125 PSFSHI_Match:1126 mov al, ah ; AL = Hidden ID1127 ret1128 PART_SearchFileSysHiddenID EndP1129 1130 ; In: DS:SI - Partition-Name, CX - Maximum/Total Length1131 ; Out: Carry-Flag set, if valid Partition-Name1132 ; Destroyed: None1133 PART_CheckForValidPartName Proc Near Uses ax cx dx si1134 ; Our logic is as follows:1135 ; If all chars are U -> Invalid (due reformated signature)1136 ; If anything below 32, but 0 -> Invalid (due invalid chars)1137 ; If anything above 165 -> Invalid (due invalid chars)1138 ; If anything between 123-128 -> Invalid (due invalid chars)1139 ; DX - holds count of 'U's1140 push cx1141 or cx, cx1142 jz PCFVPN_InvalidName1143 xor dx, dx1144 PCFVPN_CheckLoop:1145 lodsb1146 cmp al, 01147 je PCFVPN_ValidChar1148 cmp al, 321149 jb PCFVPN_InvalidName1150 cmp al, 1651151 ja PCFVPN_InvalidName1152 cmp al, 1231153 jb PCFVPN_ValidChar1154 cmp al, 1281155 jbe PCFVPN_InvalidName1156 PCFVPN_ValidChar:1157 cmp al, 'U'1158 jne PCFVPN_NoMagic1159 inc dx1160 PCFVPN_NoMagic:1161 dec cx1162 jnz PCFVPN_CheckLoop1163 pop cx1164 cmp cx, dx1165 clc1166 je PCFVPN_WasMagic1167 stc1168 PCFVPN_WasMagic:1169 ret1170 PCFVPN_InvalidName:1171 pop cx1172 clc1173 ret1174 PART_CheckForValidPartName EndP1175 1176 1177 ; Rousseau: added1178 ; Compare a volume-label in the IPT to the install-volume1179 ; SI holds pointer to entry in IPT1180 ; CY set if this entry is also the install-volume1181 PART_IsInstallVolume Proc Near Uses ax cx dx si di1182 cld ; Advance upwards with lodsb1183 mov di, offset eCS_InstallVolume ; Address of install-volume label (max. 11 chars)1184 1185 mov cx, 11 ; Maximum length of label1186 xor dl, dl ; Not found yet1187 1188 ; Compare next character1189 PART_IsInstallVolumeNext:1190 lodsb ; Load byte from SI (IPT-entry)1191 ;cmp al,' ' ; If space then use zero1192 ;jne PART_IsInstallVolume_skip11193 ;xor al,al1194 PART_IsInstallVolume_skip1:1195 xchg ah,al ; Save char to AH1196 xchg si,di ; Exchange pointers1197 lodsb ; Load byte from SI (install-volume label)1198 ;cmp al,' ' ; If space then use zero1199 ;jne PART_IsInstallVolume_skip21200 ;xor al,al1201 PART_IsInstallVolume_skip2:1202 xchg si,di ; Reexchange pointers1203 call AuxIO_Teletype1204 call CONV_ToUpper1205 call AuxIO_Teletype1206 xchg al,ah1207 call AuxIO_Teletype1208 call CONV_ToUpper1209 call AuxIO_Teletype1210 call AuxIO_TeletypeNL1211 1212 ; Are both of them zero ?1213 ; Then the names could be the same, but cx must not equal 111214 ; because that would indicate a null-string.1215 mov dh,al1216 or dh,ah1217 jz PART_IsInstallVolumeFound1218 1219 cmp ah,al ; Are the the same ?1220 jnz PART_IsInstallVolumeNotFound ; Nope, compare ended1221 loop PART_IsInstallVolumeNext ; Yep, Compare next character1222 1223 PART_IsInstallVolumeFound:1224 ; If CX is still 11 this was a zero string1225 ; and thus not a valid volume-name.1226 ; This should not occur as this function is only called when the first1227 ; byte is non-zero.1228 cmp cx,111229 je PART_IsInstallVolumeNotFound1230 ; Found !1231 mov dl,1 ; Found1232 jmp PART_IsInstallVolumeEnd1233 1234 1235 PART_IsInstallVolumeNotFound:1236 mov dl,01237 jmp PART_IsInstallVolumeEnd1238 1239 1240 PART_IsInstallVolumeEnd:1241 ; Set the status in CY1242 mov al,dl1243 add al,'0'1244 call AuxIO_TeletypeHexByte1245 call AuxIO_TeletypeNL1246 rcr dl,1 ; Put found-flag in CY1247 ret1248 PART_IsInstallVolume EndP -
trunk/BOOTCODE/REGULAR/STD_TEXT.ASM
r30 r31 29 29 CopyrightVersionLen equ 6 30 30 ;Copyright db ' AiR-BOOT v1.06 - (c) 1998-2009 M. Kiewitz, Dedicated to Gerd Kiewitz', 0 31 Copyright db ' AiR-BOOT v1.07 - (c) 1998-2011 M. Kiewitz, Dedicated to Gerd Kiewitz', 032 31 ;Copyright db ' AiR-BOOT v1.07 - (c) 2011 M. Kiewitz - Rousseau test-version >502G (build: #24)', 0 33 32 ;Copyright db ' AiR-BOOT v1.07 - (c) 2011 M. Kiewitz - Release Candidate 1 - (build: #25)', 0 … … 36 35 ;Copyright db ' AiR-BOOT v1.07 - (c) 1998-2011 M. Kiewitz, Dedicated to Gerd Kiewitz (rc4-b33)', 0 37 36 ;Copyright db ' AiR-BOOT v1.07 - (c) 1998-2011 M. Kiewitz, Dedicated to Gerd Kiewitz (rc5-b35)', 0 38 39 ;BootEndMsg db 'Free usage allowed, as long as you dont or have not worked for US government', 037 ;Copyright db ' AiR-BOOT v1.07 - (c) 1998-2011 M. Kiewitz, Dedicated to Gerd Kiewitz', 0 38 Copyright db ' AiR-BOOT v1.08 - (c) 1998-2011 M. Kiewitz, Dedicated to Gerd Kiewitz', 0 40 39 41 40 ; Rousseau: switch around 42 BootEndMsg db 'This is GPLv3+ software. Please visit http:// AiR-BOOT.sourceforge.net', 043 BootEndMsg2 41 BootEndMsg db 'This is GPLv3+ software. Please visit http://svn.netlabs.org/air-boot', 0 42 BootEndMsg2 db 'http://www.gnu.org/licenses/gpl.txt', 0 44 43 45 44 AuxInitMsg db 'Initializing Serial Communications on COM',0 46 45 47 CheckID_MBR 48 BrokenHDD 46 CheckID_MBR db 'AiRBOOT' 47 BrokenHDD db ' (HDDx)', 0 49 48 50 49 ; Colors for special words hard-coded. Keep all 0s. 51 50 TXT_SETUP_LowerMessage db 'This software is released under ', 0, 'GPLv3+.', 0 52 ; db 'It may not be used by US government', 053 51 db 'http://www.gnu.org/licenses/gpl.txt', 0 54 52 db 'For more information and source, please visit', 0 55 db 'http://AiR-BOOT.sourceforge.net', 0 56 ; db 'Contact via e-mail: ', 0, 'm_kiewitz [AT] users.sourceforge.net', 0 53 db 'http://svn.netlabs.org/air-boot', 0 57 54 db 'Contact via e-mail: ', 0, 'airboot@ecomstation.com', 0 58 55 -
trunk/BOOTCODE/SETUP/PART_SET.ASM
r30 r31 1253 1253 mov ah, 0 1254 1254 int 16h 1255 cmp ah, Keys_Backspace 1256 je PSDLS_BackSpace 1255 1257 cmp ah, Keys_Up 1256 1258 je PSDLS_KeyUp … … 1272 1274 jmp PSDLS_MainLoop 1273 1275 1276 1277 ; Clear drive-letter with backspace 1278 PSDLS_BackSpace: 1279 xor dl,dl 1280 call PARTSETUPDL_DrawDriveLetter 1281 jmp PSDLS_MainLoop 1282 1274 1283 PSDLS_KeyUp: 1275 1284 dec dl … … 1297 1306 call PARTSETUPDL_DrawDriveLetter 1298 1307 jmp PSDLS_MainLoop 1308 1299 1309 1300 1310 PSDLS_KeyDONE: -
trunk/BOOTCODE/_build.cmd
r30 r31 21 21 Say '#'; 22 22 Say ''; 23 ' @pause';23 'rem @pause'; -
trunk/INSTALL/C/INSTALL.C
r30 r31 413 413 // SHOULD ADJUST THIS FOR EXTENDED VERSION ! // !!!!!!!!!!! 414 414 */ 415 SectorCount = 5; 415 416 SectorCount = 7; 417 416 418 while (SectorCount>0) { 417 419 Checksum = GetChecksumOfSector(Checksum, SectorPtr); … … 687 689 688 690 SectorPtr = &Bootcode[54 * BYTES_PER_SECTOR]; // Start at sector 55 689 SectorCount = 5; 691 692 SectorCount = 7; 693 690 694 while (SectorCount>0) { 691 695 Checksum = GetChecksumOfSector(Checksum, SectorPtr); … … 988 992 printf("Now rebooting system...\n"); 989 993 } 990 //RebootSystem();994 RebootSystem(); 991 995 } 992 996 ExitOnly = TRUE; -
trunk/MAKEFILE
r30 r31 30 30 @echo Gonna build the installer and setaboot now... 31 31 @echo. 32 @pause32 rem @pause 33 33 34 34 # OS2 and WIN32 installer -
trunk/TOOLS/INTERNAL/FIXCODE.ASM
r30 r31 167 167 mov di, offset MBRProtectionSignature 168 168 mov cx, MBRProtectionSignatureLen 169 mov dx, 54 ; 54 sectors where signature may be 169 mov dx, 54 ; 54 sectors where signature may be (all sectors preceding config sector) 170 170 COM_SignatureLoop: 171 171 push cx si di
Note:
See TracChangeset
for help on using the changeset viewer.