Changeset 30
- Timestamp:
- May 6, 2011, 4:25:19 AM (14 years ago)
- Files:
-
- 71 added
- 164 deleted
- 96 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
tags/v1.07r/BOOTCODE/AIR-BOOT.ASM
r29 r30 17 17 ; 18 18 19 ; ------------------- 20 ; Rousseau: # Fixes # 21 ; ------------------- 22 ; # Huge Drives and LVM # 23 ; When using disks >512GB under eComStation, the drive geometry changes to 24 ; 127 or 255 sectors per track. Since LVM-info is written at the last sector 25 ; of a track, and AiR-BOOT uses the geometry of the MBR, it cannot find the 26 ; LVM-info and the eCS partition / volume bootsector. 27 ; This has been fixed. 28 ; Now, when an eCS-partition is discovered and the drive is >512GB, AiR-BOOT 29 ; will use the eCS geometry to locate the LVM-info and the bootsector. 30 ; 31 ; # Special loader handling # 32 ; The special handling of partition boot-loaders has been enhanced to 33 ; enable booting of legacy sysems on huge drives with or without OS/2 34 ; extended geometry. 35 ; 36 ; # eComStation boot-through after phase 1 # 37 ; A special functionality is implemented to directly boot the newly 38 ; installed system ; when installing eCS without showing the Boot Menu, 39 ; independant of user settings. 40 ; This works in conjuntion with the OS/2 specific SETABOOT.EXE program, 41 ; also part of this AiR-BOOT package. 42 ; 43 ; # Math, Debug, Conv and Aux modules # 44 ; These are used for 32-bit arithmatic on 16-bit code, 45 ; debug the booting process, converting between data-types 46 ; and outputting log-data to the com-port. 47 48 49 19 50 ;--------------------------------------------------------------------------- 20 51 ; AiR-BOOT / MAIN-CODE 21 52 ;--------------------------------------------------------------------------- 22 ; 23 53 ; 54 55 56 ; ---------------------------- 57 ; Rousseau: # JUMPS disabled # 58 ; ---------------------------- 59 ; We actually don't want to use this directive because it generates extra 60 ; NOP instructions that we can do without. 61 ; Relative conditional jumps that are out-of-range are manually reworked by 62 ; skipping an unconditional jump to the target on base of complementary 63 ; 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. 66 ; NOJUMPS seems to have no effect in this situation. 67 ; In this case 4 NOP instructions are generated after forward referencing jump 68 ; instructions, to allow for automatic recoding by TASM. 69 ; This seems to be a TASM bug. (v2,v3,v4, dunno v5) 70 ; 71 ;JUMPS 72 ; 73 74 ; 75 ; If defined then each module is prefixed with it's name. 76 ; This is used for debugging purposes. 77 ; It should be off in release code. 78 ; 79 ;ModuleNames equ 1 80 81 82 83 ; 84 ; The first harddisk is BIOS coded 80h. 85 ; This makes a total of 128 disk could be supported using this coding. 86 ; This value is used to store disk-information and this info is allocated 87 ; in the BSS. 88 ; 89 MaxDisks equ 16 90 91 ; 92 ; If defined then include DEBUG.ASM and output debug-info to serial-port. 93 ; 94 AuxDebug equ 1 95 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) 106 ; 24 107 ; If ReleaseCode is not defined, it will produce debug-able code... 25 ReleaseCode equ -1 26 27 JUMPS 28 108 ; 109 ReleaseCode equ -1 ; Rousseau: this should be replaced 110 ; 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. 114 115 ; 29 116 ; All Special Equs for this project 30 117 ; 118 119 ; Use different addresses depending on whether in pre-boot or debug environment. 31 120 IFDEF ReleaseCode 32 StartBaseSeg equ 00000h 33 StartBasePtr equ 07C00h ; BIOS starts our MBR at 0:7C00121 StartBaseSeg equ 00000h ; Pre-boot, so we are in low memory 122 StartBasePtr equ 07C00h ; BIOS starts our MBR at 0:7C00 34 123 ELSE 35 StartBaseSeg equ 03A98h ; Adjust to DOS segment36 StartBasePtr equ 00100h 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 37 126 ENDIF 38 BootBaseSeg equ 8000h 39 BootBasePtr equ 0h ; We put our MBR to this location 40 BootBaseExec equ BootBasePtr+offset MBR_RealStart 41 StackSeg equ 7000h 42 127 128 ; Address labels after code-move 129 BootBaseSeg equ 8000h ; Pre-boot, somewhere in the low 640K 130 BootBasePtr equ 0h ; We put our MBR to this location 131 BootBaseExec equ BootBasePtr+offset MBR_RealStart 132 StackSeg equ 7000h ; Put the stack below the code 133 134 ; Video pages, no INT 10h is used for menu-drawing etc. 43 135 VideoIO_Page0 equ 0B800h 44 136 VideoIO_Page1 equ 0B900h … … 47 139 VideoIO_FXSegment equ 0A000h 48 140 141 ; Include 49 142 Include ..\INCLUDE\asm.inc 50 ;Include ..\INCLUDE\DOS\airboot.inc 51 143 ;Include ..\INCLUDE\DOS\airboot.inc ; does not exist anymore 144 145 ; Special line-drawing characters 52 146 TextChar_WinLineRight equ 0C4h ; 'Ä' 53 147 TextChar_WinLineDown equ 0B3h ; '³' … … 60 154 61 155 ; Offsets for Partition-Entries in MBR/EPRs 62 LocBRPT_LenOfEntry equ 16 63 LocBRPT_Flags equ 0 64 LocBRPT_BeginCHS equ 1 65 LocBRPT_BeginHead equ 1 66 LocBRPT_BeginSector equ 2 67 LocBRPT_BeginCylinder equ 3 68 LocBRPT_SystemID equ 4 69 LocBRPT_EndCHS equ 5 156 LocBRPT_LenOfEntry equ 16 ; Length of a standard MBR or EPR entry 157 LocBRPT_Flags equ 0 ; Bootable, Hidden, etc. 158 LocBRPT_BeginCHS equ 1 ; Combined 10-bits cyl with 6 bits 159 LocBRPT_BeginHead equ 1 ; Start head (0<=H<255) 255 is invalid ! 160 LocBRPT_BeginSector equ 2 ; Start sector (1<=S<=255) 161 LocBRPT_BeginCylinder equ 3 ; Start cylinder (0<=C<[1024,16384,65536,n]) 162 LocBRPT_SystemID equ 4 ; Type of system using the partition 163 LocBRPT_EndCHS equ 5 ; Same for end of partition 70 164 LocBRPT_EndHead equ 5 71 165 LocBRPT_EndSector equ 6 72 166 LocBRPT_EndCylinder equ 7 73 LocBRPT_RelativeBegin equ 8 74 LocBRPT_AbsoluteLength equ 12 75 76 LocBR_Magic equ 510 167 LocBRPT_RelativeBegin equ 8 ; Where the ... 168 LocBRPT_AbsoluteLength equ 12 ; ? 169 170 LocBR_Magic equ 510 ; ? 77 171 78 172 ; 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 173 LocLVM_SignatureStart equ 0 ; 174 LocLVM_SignatureByte0 equ 2 ; 175 LocLVM_CRC equ 8 ; CRC is a DWORD 176 LocLVM_MaxEntries equ 4 ; Max entries in the track0 LVM-sector 177 LocLVM_StartOfEntries equ 60 ; (contains maximum of 4 entries) 178 LocLVM_LenOfEntry equ 60 ; ? 179 LocLVM_VolumeID equ 0 ; is DWORD 180 LocLVM_PartitionID equ 4 ; is DWORD 181 LocLVM_PartitionSize equ 8 ; is DWORD 182 LocLVM_PartitionStart equ 12 ; is DWORD 183 LocLVM_VolumeLetter equ 18 ; is BYTE (Letter C-Z or 0) (relative to entry) 184 185 ; Rousseau: added (index in LVM-sector) 186 LocLVM_Secs equ 20h ; Sectors per Track ; Rousseau: this one is used for the OS/2 extended geometry 187 LocLVM_Heads equ 1ch ; Number of heads 188 LocLVM_VolumeLetter2 equ 78 ; is BYTE (Letter C-Z or 0) ; FOUT !! niet entry relative ! 189 LocLVM_Startable equ 77 ; is startable (newly installed system) ; FOUT !! niet entry relative ! 190 LocLVM_OnBootMenu equ 76 ; is on bootmenu ; FOUT !! niet entry relative ! 191 192 LocLVM_VolumeName equ 20 ; 20 bytes 193 LocLVM_PartitionName equ 40 ; 20 bytes 194 195 196 92 197 93 198 ; Offsets for IPT (Internal Partition Table) 94 LocIPT_MaxPartitions equ 30 ; Maximum LocIPT_MaxPartitions 95 LocIPT_LenOfSizeElement equ 6 ; Size of one Size-Element 96 LocIPT_LenOfIPT equ 34 97 LocIPT_Serial equ 0 98 LocIPT_Name equ 4 99 LocIPT_Drive equ 15 ; Drive-ID 100 LocIPT_SystemID equ 16 ; Partition-Type 101 LocIPT_Flags equ 17 ; AiR-BOOT Flags for partition 102 LocIPT_BootRecordCRC equ 18 ; CRC of Boot-Record 103 LocIPT_LocationBegin equ 20 ; Begin of Partition 104 LocIPT_LocationPartTable equ 23 ; PartitionTable of Partition 105 LocIPT_AbsoluteBegin equ 26 ; Absolute Sector of Begin 106 LocIPT_AbsolutePartTable equ 30 ; Absolute Sector of PartTable 107 108 LocIPT_DefaultFlags equ 00000011b ; Don't know if boot-able :) 109 LocIPT_DefaultNonBootFlags equ 00000010b ; ...VIBR Detection is always on 199 LocIPT_MaxPartitions equ partition_count ; Maximum LocIPT_MaxPartitions 200 LocIPT_LenOfSizeElement equ 6 ; Size of one Size-Element 201 LocIPT_LenOfIPT equ 34 ; Length of an IPT-entry 202 LocIPT_Serial equ 0 ; Serial from MBR ? 203 LocIPT_Name equ 4 ; Name from FS or LVM (part/vol) 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 (06,07,etc) 206 LocIPT_Flags equ 17 ; AiR-BOOT Flags for partition (see below) 207 LocIPT_BootRecordCRC equ 18 ; CRC of Boot-Record 208 LocIPT_LocationBegin equ 20 ; Begin of Partition 209 LocIPT_LocationPartTable equ 23 ; PartitionTable of Partition 210 LocIPT_AbsoluteBegin equ 26 ; Absolute Sector of Begin 211 LocIPT_AbsolutePartTable equ 30 ; Absolute Sector of PartTable 212 213 ; AiR-BOOT IPT-Flags 214 LocIPT_DefaultFlags equ 00000011b ; Don't know if boot-able :) 215 LocIPT_DefaultNonBootFlags equ 00000010b ; ...VIBR Detection is always on 110 216 111 217 Flags_BootAble equ 00000001b 112 218 Flags_VIBR_Detection equ 00000010b 113 219 Flags_HideFeature equ 00000100b 114 Flags_DriveLetter equ 00001000b ; OS/2 FAT16/HPFS only115 Flags_ExtPartMShack equ 00010000b ; Extended Partition M$-Hack req ?220 Flags_DriveLetter equ 00001000b ; OS/2 FAT16/HPFS only 221 Flags_ExtPartMShack equ 00010000b ; Extended Partition M$-Hack req ? 116 222 Flags_NoPartName equ 01000000b 117 Flags_NowFound equ 10000000b ; temp only in OldPartTable 118 Flags_SpecialMarker equ 10000000b ; temp only for HiddenSetup 119 120 FileSysFlags_BootAble equ 00000001b ; Is this Partition boot-able ? 121 FileSysFlags_FAT32 equ 00010000b ; FAT 32 specific name getting 122 FileSysFlags_NoName equ 00100000b ; No Name - use PartitionName 123 FileSysFlags_DriveLetter equ 01000000b ; DriveLetter Feature possible 124 223 Flags_NowFound equ 10000000b ; temp only in OldPartTable 224 Flags_SpecialMarker equ 10000000b ; temp only for HiddenSetup 225 226 FileSysFlags_BootAble equ 00000001b ; Is this Partition boot-able ? 227 FileSysFlags_FAT32 equ 00010000b ; FAT 32 specific name getting 228 FileSysFlags_NoName equ 00100000b ; No Name - use PartitionName 229 FileSysFlags_DriveLetter equ 01000000b ; DriveLetter Feature possible 230 231 ; Navigation keys 125 232 Keys_Up equ 48h 126 233 Keys_Down equ 50h … … 148 255 Keys_Flags_EnterSetup equ 1100b ; Strg+Alt (AL) 149 256 150 .386p 151 model large, basic 152 257 258 ; ------------------------------------------ 259 ; Rousseau: # Changed this from .386 to .286 260 ; ------------------------------------------ 261 ; Because of the TASM-bug the processor had to be changed to turn JUMPS 262 ; off. Existing movzx instructions were replaced with 286 equivalent code. 263 ; Out of range relative jumps have been recoded. 264 ; AiR-BOOT can now run on a 286 processor :-) 265 .286 266 267 ; This influences the uses directive and other stuff, 268 ; like calling-style. 269 ; The model itself,large, has no effect because we generate 270 ; a binairy image and not a segmented executable. 271 .model large, basic 272 273 ; Our code-segment starts here. 274 ; We are running in 16-bit and we like it 153 275 code_seg segment public use16 154 276 assume cs:code_seg, ds:code_seg, es:nothing, ss:nothing 155 277 156 org 00000h ; Sector 1 278 279 280 ;=============================================================================== 281 ; Sector 1 282 283 284 ; We are not a .com file at 100h but a binary image 285 ; of which only the 1st sector gets loaded at 07c00h. 286 org 00000h ; Sector 1 287 288 ; Start of sector 1 289 ; This is the MBR, note the AiRBOOT signature, it's date (2006), version and 290 ; language. 291 ; Version 1.07 was intruduced in 2011. 292 ; It fixes issues with huge drives and lvm and more. 293 294 sos1: 295 296 ; --------------------------------------------- 297 ; Rousseau: # Combined letter and jump offset # 298 ; --------------------------------------------- 299 ; My guess is Martin had a short jump followed by the AiRBOOT signature at first. 300 ; Then he encountered strange behaviour by some M$ operating-systems if the 301 ; the first insruction was not a CLI. 302 ; But there was no room to insert the CLI and of course he did not want to 303 ; change the location of the AiRBOOT signature. 304 ; He solved this by inserting the M$ needed CLI at offset 0 followed by a short 305 ; jump that uses the 'A' of the AiRBOOT signature as the jump displacement. 306 307 157 308 ;--------------------------------------------------------------------------- 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! 162 db 0EBh ; JMP-Short -> MBR_Start 163 db 'AiRBOOT', 13h, 03h, 20h, 06h, 01h, 06h, TXT_LanguageID 309 AiR_BOOT: cli ; Some M$ operating systems need a CLI 310 ; here otherwise they will go beserk ; Rousseau: M$ osses are beserk by definition. 311 ; and will do funny things during 312 ; 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 315 164 316 ; ID String, Date and Version Number, U for US version 165 db 1 ; Total Sectors Count, 166 ; Will get overwritten by FIXBSET.exe 167 MBR_CheckCode dw 0 ; Check-Sum for Code 168 169 MBR_Start: sti ; This opcode is dedicated to: 170 cld ; =MICROSOFT JUMP DEPARTMENT= 171 mov ax, StartBaseSeg 172 mov ds, ax 173 mov si, StartBasePtr 174 mov ax, BootBaseSeg 317 db 1 ; Total Sectors Count, 318 ; Will get overwritten by FIXBSET.exe 319 MBR_CheckCode dw 0 ; Check-Sum for Code 320 321 ; 322 ; This label is jumped to from the jump after 'eCSRocks'. 323 ; No single instruction below should be changed, added or removed in the code 324 ; below as this will cause the jump-link to go haywire. 325 MBR_Start: sti ; This opcode is dedicated to: 326 cld ; =MICROSOFT JUMP DEPARTMENT= 327 328 ; Setup some base stuff 329 ; AX got loaded wrongly for debug, changed the instructions 330 ; 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. 333 mov ax, StartBaseSeg ; The segment we are moving ourself from (NOT USED) 334 ;mov ds, ax 335 push cs 336 pop ds 337 mov si, StartBasePtr ; The offset we are moving ourself from 338 mov ax, BootBaseSeg ; The target segment we are moving ourself to 175 339 mov es, ax 176 mov di, BootBasePtr 340 mov di, BootBasePtr ; The target offset we are moving ourself to 341 342 ; Depending on pre-boot or debug, 343 ; only move first 512 bytes or the whole she-bang++ (65400 bytes) 177 344 IFDEF ReleaseCode 178 mov cx, 256 345 mov cx, 256 ; Pre-boot environment 179 346 ELSE 180 mov cx, 32700 347 mov cx, 32700 ; Debug environment ; Rousseau: where does 32700 come from ? (30720) 181 348 ENDIF 349 350 ; 351 ; LET's MOVE OURSELVES ! 352 ; 182 353 rep movsw 354 355 ; Code a jump to the 183 356 db 0EAh 184 dw BootBaseExec 185 dw BootBaseSeg 357 dw BootBaseExec ; This is MBR_RealStart + BootBasePtr 358 dw BootBaseSeg ; This is 08000h 186 359 ; jmp far ptr BootBaseSeg:BootBaseExec 187 360 361 362 ; 363 ; Some MBR-functions to provide absolute minimum functionality. 364 ; 365 366 ; 367 ; Entry-point for halting the system. 368 ; 188 369 MBR_HaltSystem: 189 370 mov ax, 8600h … … 194 375 jmp MBR_HaltSys 195 376 196 db 'FUCKMS:>' 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 :-) 197 384 jmp MBR_Start ; We jump here, because I needed to 198 385 ; insert a CLI on start and did not 199 386 ; want to change AiR-BOOT detection 200 387 ; because of Microsoft inventions... 201 388 ; 389 ; Entry-point when loading fails. 390 ; 202 391 db 'LOAD ERROR!', 0 203 MBR_LoadError Proc Near Uses 204 mov si, offset $-12 205 push cs 206 pop ds 207 call MBR_Teletype 208 MBRLE_Halt: 209 jmp MBRLE_Halt 210 MBR_LoadError EndP 211 392 MBR_LoadError Proc Near 393 mov si, offset $-12 394 push cs 395 pop ds 396 call MBR_Teletype 397 MBRLE_Halt: 398 jmp MBRLE_Halt 399 MBR_LoadError EndP 400 401 402 ; 403 ; Entry-point when saving fails. 404 ; 212 405 db 'SAVE ERROR!', 0 213 MBR_SaveError Proc Near Uses 214 mov si, offset $-12 215 push cs 216 pop ds 217 call MBR_Teletype 218 MBRSE_Halt: 219 jmp MBRSE_Halt 220 MBR_SaveError EndP 221 406 MBR_SaveError Proc Near 407 mov si, offset $-12 408 push cs 409 pop ds 410 call MBR_Teletype 411 MBRSE_Halt: 412 jmp MBRSE_Halt 413 MBR_SaveError EndP 414 415 416 ; Put text on the screen using the BIOS tele-type function. 417 ; No attributes like color are supported. 222 418 ; In: SI - Pointer to begin of string (EOS is 0) 223 419 ; Destroyed: SI 224 420 MBR_Teletype Proc Near Uses ax bx cx 225 movah, 0Eh226 movbx, 7227 MBRT_Loop:228 lodsb229 oral, al230 jzMBRT_End231 int10h232 jmpMBRT_Loop233 MBRT_End:234 ret421 mov ah, 0Eh 422 mov bx, 7 423 MBRT_Loop: 424 lodsb 425 or al, al 426 jz MBRT_End 427 int 10h 428 jmp MBRT_Loop 429 MBRT_End: 430 ret 235 431 MBR_Teletype EndP 432 433 ; 434 ; Rousseau: DO NOT ADD CODE TO THIS SECTION ! 435 ; 236 436 237 437 ; In: BX - Base Check, DS:SI - Pointer to 512-byte-area to be included … … 252 452 MBR_GetCheckOfSector EndP 253 453 454 455 456 457 458 459 ; 460 ; This is where the rest of AiR-BOOT gets loaded. 461 ; 462 254 463 ;--------------------------------------------------------------------------- 255 464 MBR_RealStart: 256 mov ax, StackSeg 465 mov ax, StackSeg ; 07000h, below the moved code 257 466 mov ss, ax 258 mov sp, 7FFFh 259 mov ax, es 260 mov ds, ax ; Set DS==ES to Code Segment 467 ;mov sp, 7FFFh ; Odd stack-pointer ?? 468 mov sp, 7FFEh ; Safe value, could also be 8000h because SP is decremented by 2 before push 469 mov ax, es ; ES holds segment where we moved ourself to. 470 mov ds, ax ; Set DS==ES to Code Segment 471 472 ; If we are in debug-mode, all code is moved already, 473 ; 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. 261 479 IFNDEF ReleaseCode 262 480 jmp AiR_BOOT_Start 263 481 ENDIF 482 483 264 484 ; Load missing parts from harddrive... 265 mov ax, cs 266 mov es, ax 485 mov ax, cs ; actually obsolete 486 mov es, ax ; actually obsolete 487 488 ; Load the configuration-sectors from disk. 267 489 mov bx, offset Configuration 268 mov dx, 0080h ; First harddrive, Sector 55 269 mov cx, 0037h 270 mov ax, 0205h ; Read 5 sectors 490 mov dx, 0080h ; First harddrive, Sector 55 491 mov cx, 0037h ; Is 55d is config-sector 492 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 271 501 int 13h 272 502 jnc MBR_ConfigCopy_NoError 503 504 ; Some error occured 273 505 MBR_ConfigCopy_LoadError: 274 call MBR_LoadError ; Will Abort BootUp 506 call MBR_LoadError ; Will Abort BootUp 507 508 ; Load the code sectors 275 509 MBR_ConfigCopy_NoError: 276 510 mov bx, offset FurtherMoreLoad 277 mov dx, 0080h ; First harddrive, Sector 2278 mov cx, 0002h 511 mov dx, 0080h ; First harddrive 512 mov cx, 0002h ; Second sector 279 513 mov ah, 02h 280 mov al, ds:[10h] 514 515 mov al, ds:[10h] ; 34h = 52d sectors (35h in extended version) 281 516 int 13h 282 517 jnc MBR_RealStart_NoError … … 288 523 ; Now Check Code with CheckSum 289 524 mov si, offset FurtherMoreLoad 290 movzx cx, bptr ds:[10h] 525 526 ;movzx cx, bptr ds:[10h] 527 mov cl, ds:[10h] 528 mov ch,0 529 291 530 xor bx, bx 292 531 MBR_RealStart_CheckCodeLoop: … … 305 544 jmp AiR_BOOT_Start 306 545 546 547 548 307 549 ;--------------------------------------------------------------------------- 308 550 Include TEXT\TXTMBR.asm ; All translateable Text in MBR 309 551 ;--------------------------------------------------------------------------- 310 org 00200h ; Sector 2 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 561 562 org 00200h 563 ; End of sector 1 564 eos1: 565 566 ; Check for overlap 567 slack01 = sos2 - eos1 568 IF slack01 LT 0 569 .ERR2 "Location Overlap slack01 !" 570 ENDIF 571 572 573 ;=============================================================================== 574 ; Sector 2 575 576 ; 577 ; Here starts the second sector, sector 2 578 ; 579 org 00200h 580 ; Start of sector 2. 581 sos2: 582 583 311 584 ; Everything beyond this point is loaded on startup and is NOT existant at first 312 585 FurtherMoreLoad: 586 587 ; 588 ; Filesystem table correlating id with name. 589 ; 590 313 591 ; first Normal-Partition-ID, Hidden-Partition-ID 314 592 ; and Default-Partition-Flags. … … 344 622 ; -> 44 Partition-Types 345 623 346 ;--------------------------------------------------------------------------- 347 org 00400h ; Sector 3 348 AiR_BOOT_Start: mov ax, VideoIO_Page1 349 call VideoIO_BackUpTo ; Copy BIOS POST to Second Page 350 mov si, offset Copyright 351 call MBR_Teletype 624 ; End of sector 2. 625 eos2: 626 627 628 629 ; Check for overlap 630 slack02 = sos3 - eos2 631 IF slack02 LT 0 632 .ERR2 "Location Overlap slack02 !" 633 ENDIF 634 635 636 637 638 639 ;=============================================================================== 640 ; Sector 3 641 org 00400h 642 ; Start of sector 3. 643 sos3: 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 ; ############################################## 660 ; ## ENTRY-POINT AFTER ALL THE INITIAL HASSLE ## 661 ; ############################################## 662 663 664 665 AiR_BOOT_Start: nop 666 667 ;jmp skip 668 669 ; Rousseau: 670 ; I should cleanup my garbage here... 671 352 672 ; Initialize Variable-Tables, Detections, etc. 353 673 call PRECRAP_Main 674 675 ; Number of harddisks is now known 676 354 677 call PARTSCAN_ScanForPartitions 355 MBR_Main_ReEnterSetup: 678 679 680 ; Number of disks found 681 mov si, offset DisksFound 682 call MBR_Teletype 683 684 mov al, [TotalHarddiscs] 685 call VideoIO_SyncPos 686 call VideoIO_PrintByteDynamicNumber 687 xor si,si 688 call MBR_TeletypeNL 689 690 ; Number of bootable systems indicator 691 mov si, offset PartitionsFound 692 call MBR_Teletype 693 694 mov al, [CFG_Partitions] 695 call VideoIO_SyncPos 696 call VideoIO_PrintByteDynamicNumber 697 698 xor si,si 699 call MBR_TeletypeNL 700 call MBR_TeletypeNL 701 702 call VideoIO_SyncPos 703 704 mov dl,80h 705 call VideoIO_DumpDiskInfo 706 707 ; 708 ; Enumberate Bootable Systemen by name 709 ; And prepare Phase 1 if active 710 ; 711 mov si, offset PartitionTable 712 xor cx,cx 713 mov cl,[CFG_Partitions] 714 MBR_Parts: 715 add si, 4 716 push si 717 push si 718 ;call MBR_TeletypeVolName 719 pop si 720 call PART_IsInstallVolume 721 jnc MBR_Parts_NI 722 723 ; install volume 724 mov al,' ' 725 mov bl,7 726 mov ah, 0eh 727 int 10h 728 729 mov al,'(' 730 mov bl,7 731 mov ah, 0eh 732 int 10h 733 734 mov al,[CFG_Partitions] 735 sub al,cl 736 ;inc al 737 ;mov [Menu_EntryAutomatic],al 738 mov [CFG_PartAutomatic],al ; Rousseau: setup entry for install-volume 739 mov [CFG_PartLast],al 740 mov ah, [eCS_InstallVolume] ; 1st byte is 0 if no phase 1 active 741 test ah,ah ; test the byte, ZF is 0 if phase 1 active 742 lahf ; flags in ah 743 xor ah, 40h ; complement ZF 744 and ah, 40h ; mask ZF 745 shr ah, 6 ; move ZF to LSB 746 mov [CFG_AutomaticBoot], ah ; automatic boot if phase 1 is active 747 mov [eCS_InstallVolume], 0 ; disable phase 1 for next boot 748 749 add al,'1' 750 mov bl,7 751 mov ah, 0eh 752 int 10h 753 754 mov al,')' 755 mov bl,7 756 mov ah, 0eh 757 int 10h 758 759 mov bx,cx 760 761 MBR_Parts_NI: 762 xor si,si 763 ;call MBR_TeletypeNL 764 pop si 765 add si, 30 766 loop MBR_Parts 767 768 769 770 771 ; Index of automatic start partition 772 ; mov si, offset AutoStartPart 773 ;call MBR_Teletype 774 775 mov al, [CFG_PartAutomatic] 776 add al, 31h 777 mov ah, 09h 778 mov bx, 15 779 mov cx, 1 780 ;int 10h 781 782 mov al, [CFG_PartAutomatic] 783 add al, 31h 784 mov ah, 0eh 785 mov bx, 15 786 mov cx, 1 787 ;int 10h 788 789 xor si,si 790 call MBR_TeletypeNL 791 xor si,si 792 call MBR_TeletypeNL 793 794 mov ax,[BIOS_AuxParms] 795 ;call VideoIO_SyncPos 796 push ax 797 add al,'0' 798 mov bl,7 799 mov ah, 0eh 800 ;int 10h 801 pop ax 802 xchg al,ah 803 sub al,0a2h 804 mov bl,7 805 mov ah, 0eh 806 ;int 10h 807 808 809 call MBR_TeletypeSyncPos 810 811 xor si,si 812 call MBR_TeletypeNL 813 call MBR_TeletypeNL 814 815 816 817 mov si, offset ShowMenu 818 call MBR_TeletypeBold 819 820 821 skip: 822 823 824 825 ; 826 ; ########################### WAIT FOR KEY ################################ 827 ; 828 829 830 ; Rousseau: 831 ; Wait for key so we can see debug log if ab-menu hangs. 832 ;;xor ax, ax 833 ;;int 16h 834 835 ;call SOUND_Beep 836 837 ; Rousseau: delayed save of video-page 838 839 mov ax, VideoIO_Page1 840 call VideoIO_BackUpTo ; Copy BIOS POST to Second Page 841 842 ;call SOUND_Beep 843 844 845 ; 846 ; COM-PORT DEBUG 847 ; 848 call AuxIO_TeletypeNL 849 mov si, offset PartitionTable 850 call AuxIO_DumpSector 851 call AuxIO_TeletypeNL 852 853 ; 854 ; RE-ENTER SETUP 855 ; 856 MBR_Main_ReEnterSetup: ; Rousseau: SETUP re-enters here ! 356 857 call SETUP_CheckEnterSETUP 357 call AFTERCRAP_Main 858 859 ;call SOUND_Beep 860 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 :-) 358 869 359 870 ; [Linux support removed since v1.02] … … 364 875 ; MBR_Main_NoLinuxKrnlPartition: 365 876 877 878 MBR_Main_ReEnterBootMenuPre: 879 366 880 ; SetUp PartitionPointers for BootMenu (filter non-bootable) 367 881 call PART_CalculateMenuPartPointers … … 373 887 call MBR_Teletype 374 888 jmp MBR_HaltSystem 375 889 376 890 MBR_Main_SomethingBootAble: 377 891 ; FixUp Values, define Timed Setup booting, etc. 378 892 call PART_FixUpDefaultPartitionValues 893 894 379 895 380 896 ; -------------------------------------------------- BOOT-MENU … … 389 905 call PASSWORD_AskSystemPwd 390 906 mov al, Menu_EntryAutomatic 907 908 ;mov al, 2 ; Rousseau: 0-based 909 391 910 mov Menu_EntrySelected, al 392 jmp MBR_Main_NoBootMenu 911 jmp MBR_Main_NoBootMenu ; Rousseau: NO-BOOT-MENU 393 912 394 913 MBR_Main_NoAutomaticBooting: 914 915 ;call SOUND_Beep 916 395 917 test CFG_BootMenuActive, 0FFh 396 918 jnz MBR_Main_GotBootMenu … … 398 920 ; Select default partition and boot system... 399 921 call PASSWORD_AskSystemPwd 922 923 ;call VideoIO_DBG_WriteString2 ; Rousseau 924 400 925 mov al, Menu_EntryDefault 926 ;mov al,0 ; Rousseau: 0-based 401 927 mov Menu_EntrySelected, al 402 928 jmp MBR_Main_NoBootMenu … … 405 931 ; ------------------------------------------ BOOT-MENU VISUALS 406 932 call FX_StartScreen 933 934 ;call SOUND_Beep 935 407 936 call BOOTMENU_BuildBackground 408 937 call BOOTMENU_BuildMain … … 410 939 call PASSWORD_AskSystemPwd 411 940 call BOOTMENU_ResetTimedBoot 941 942 ;call SOUND_Beep 943 412 944 call BOOTMENU_Execute 945 946 ;call SOUND_Beep 947 413 948 jc MBR_Main_ReEnterSetup 414 949 call BOOTMENU_SetVarsAfterMenu 950 951 ;call SOUND_Beep 952 415 953 ; ------------------------------------------------- BOOTING... 416 954 MBR_Main_NoBootMenu: … … 432 970 call ANTIVIR_SaveBackUpMBR 433 971 mov dl, Menu_EntrySelected 434 call PART_StartPartition 435 972 call PART_StartPartition ; Rousseau: START PARTITION 973 974 975 976 ; 977 ; Include other code-modules here. 978 ; Because TASM is a multiple pass assembler, forward references 979 ; are possible. 980 ; 981 b_std_txt: 436 982 Include REGULAR\STD_TEXT.asm ; Standard (non-translateable text) 983 size_std_txt = $-b_std_txt 984 985 b_driveio: 437 986 Include REGULAR\DRIVEIO.asm ; Drive I/O, Config Load/Save 987 size_driveio = $-b_driveio 988 989 b_videoio: 438 990 Include REGULAR\ViDEOIO.asm ; Video I/O 991 size_videoio = $-b_videoio 992 993 b_timer: 439 994 Include REGULAR\TIMER.asm ; Timer 995 size_timer = $-b_timer 996 997 b_partmain: 440 998 Include REGULAR\PARTMAIN.asm ; Regular Partition Routines 999 size_partmain = $-b_partmain 1000 1001 b_partscan: 441 1002 Include REGULAR\PARTSCAN.asm ; Partition Scanning 1003 size_partscan = $-b_partscan 1004 1005 b_bootmenu: 442 1006 Include REGULAR\BOOTMENU.asm ; Boot-Menu 1007 size_bootmenu = $-b_bootmenu 1008 1009 b_password: 443 1010 Include REGULAR\PASSWORD.asm ; Password related 1011 size_password = $-b_password 1012 1013 b_other: 444 1014 Include REGULAR\OTHER.asm ; Other Routines 445 1015 size_other = $-b_other 1016 1017 ; Rousseau: Special modules moved upwards. 1018 b_main: 446 1019 Include SETUP\MAiN.ASM ; The whole AiR-BOOT SETUP 1020 size_main = $-b_main 1021 1022 1023 IFDEF TXT_IncludeCyrillic 1024 b_ccharset: 1025 Include SPECiAL\CHARSET.asm ; Charset Support (e.g. Cyrillic) 1026 size_ccharset = $-b_ccharset 1027 ENDIF 1028 1029 b_math: 1030 Include REGULAR\MATH.ASM ; Math functions (like 32-bit multiply) 1031 size_math = $-b_math 1032 1033 b_conv: 1034 Include REGULAR\CONV.ASM ; Various conversion routines 1035 size_conv = $-b_conv 1036 1037 IFDEF AuxDebug 1038 b_debug: 1039 Include REGULAR\DEBUG.ASM ; Various debugging routines, uses AUXIO and CONV 1040 size_debug = $-b_debug 1041 ENDIF 1042 1043 b_auxio: 1044 Include REGULAR\AUXIO.ASM ; Com-port support for debugging 1045 size_auxio = $-b_auxio 1046 1047 ; Rousseau: moved upwards 1048 ;IFDEF TXT_IncludeCyrillic 1049 ; Include SPECiAL\CHARSET.asm ; Charset Support (e.g. Cyrillic) 1050 ;ENDIF 1051 1052 ; End of sector 3. 1053 eos3: 1054 1055 1056 ; Check for overlap 1057 slack03 = sos36 - eos3 1058 IF slack03 LT 0 1059 .ERR2 "Location Overlap slack03 !" 1060 ENDIF 1061 1062 1063 ;=============================================================================== 1064 1065 ; 1066 ; This is the AiR-BOOT MBR-Protection Image. 1067 ; 04600 / 200h = 23h = 35d sectors are before this point. 1068 ; The stuff generated here gets overwritten when the MBR_PROT.ASM 1069 ; module, which is assembled separately, gets merged. 1070 ; So you won't find the string below in the generated binary. 1071 ; 1072 org 04600h ; Sector 36-37 1073 1074 ; Start of sector 36. 1075 sos36: 1076 1077 MBR_Protection: db 'AiR-BOOT MBR-Protection Image' 1078 ; Hardcoded to 1k (1024 bytes) 1079 db 1024-($-MBR_Protection) dup('X') 1080 1081 ; End of sector 37, yes this section is 2 sectors long. 1082 eos37: 1083 1084 1085 1086 ; Check for overlap 1087 slack04 = sos38 - eos37 1088 IF slack04 LT 0 1089 .ERR2 "Location Overlap slack04 !" 1090 ENDIF 1091 1092 1093 1094 1095 ;=============================================================================== 1096 ; Sector 38-x 1097 ; 1098 ; This section contains translatable texts. 1099 ; 1100 org 04A00h 1101 1102 ; Start of sector 28. 1103 sos38: 1104 1105 b_txtother: 1106 Include TEXT\TXTOTHER.asm ; All translateable Text-Strings 1107 size_txtother = $-b_txtother 1108 1109 b_txtmenus: 1110 Include TEXT\TXTMENUS.asm ; All translateable Menu-text 1111 size_txtmenus = $-b_txtmenus 1112 1113 b_charset: 1114 Include TEXT\CHARSET.asm ; Special Video Charsets (if needed) 1115 size_charset = $-b_charset 1116 1117 1118 ; 1119 ; Here is room for more code. 1120 ; Let's move the special modules here... 1121 ; The come from the previous section. 1122 ; 1123 b_virus: 447 1124 Include SPECiAL\ViRUS.asm ; Virus Detection / Anti-Virus 1125 size_virus = $-b_virus 448 1126 ; [Linux support removed since v1.02] 449 1127 ;Include SPECiAL\FAT16.asm ; FAT-16 Support 450 1128 ;Include SPECiAL\LINUX.asm ; Linux Kernel Support 1129 b_billsuxx: 451 1130 Include SPECiAL\F00K\BILLSUXX.asm ; Extended Partition - Microsoft-Hack 1131 size_billsuxx = $-b_billsuxx 1132 1133 b_sound: 452 1134 Include SPECiAL\SOUND.asm ; Sound 1135 size_sound = $-b_sound 1136 1137 b_apm: 453 1138 Include SPECiAL\APM.asm ; Power Managment Support 1139 size_apm = $-b_apm 1140 1141 b_fx: 454 1142 Include SPECiAL\FX.asm ; l33t Cooper-Bars/Scrolling <bg> 1143 size_fx = $-b_fx 1144 1145 b_lvm: 455 1146 Include SPECiAL\LVM.asm ; LVM-specific code 456 IFDEF TXT_IncludeCyrillic 457 Include SPECiAL\CHARSET.asm ; Charset Support (e.g. Cyrillic) 1147 size_lvm = $-b_lvm 1148 1149 1150 1151 1152 1153 ; 1154 ; Let's make this always the last module in this section. 1155 ; 1156 Include BLDDATE.asm ; Build Date generated by _build.cmd 1157 1158 ; End of sector x depending on size of translatable texts. 1159 eosx: 1160 1161 org 06A00h - 4 1162 ;db 'BABE' 1163 1164 org 06A00h 1165 ; db 'FACE' 1166 1167 ; Check for overlap 1168 slack05 = sos55 - eosx 1169 IF slack05 LT 0 1170 .ERR2 "Location Overlap slack05 !" 458 1171 ENDIF 459 1172 460 ;--------------------------------------------------------------------------- 461 org 04600h ; Sector 36-37 462 MBR_Protection: db 'AiR-BOOT MBR-Protection Image' 463 ; Hardcoded to 1k (1024 bytes) 464 465 ;--------------------------------------------------------------------------- 466 org 04A00h ; Sector 38-x 467 Include TEXT\TXTOTHER.asm ; All translateable Text-Strings 468 Include TEXT\TXTMENUS.asm ; All translateable Menu-text 469 Include TEXT\CHARSET.asm ; Special Video Charsets (if needed) 470 471 ;--------------------------------------------------------------------------- 472 org 06C00h ; Sector 55 1173 1174 1175 ;=============================================================================== 1176 ; Sector 55 1177 1178 ; 1179 ; This section contains the AiR-BOOT configuration. 1180 ; Note that it has a version that should be updated 1181 ; when stuff is added. 1182 ; Also add stuff to the end so that offsets of other 1183 ; variables remain vaild. 1184 ; 1185 org 06C00h 1186 sos55: 1187 1188 473 1189 Configuration: 474 db 'AiRCFG-TABLE' 475 db 01h, 02h, 'U' ; "Compressed" ID String 476 ; This is still version 1.02, because nothing got 477 ; changed... 1190 db 'AiRCFG-TABLE' ; Rousseau: THERE IS AN INVISIBLE CHAR HERE !! 1191 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. 478 1196 479 1197 CFG_LastTimeEditLow dw 0 ; Last Time Edited Stamp (will incr every setup) … … 490 1208 CFG_TimedSecs db 15 ; Timed Boot - How Many Seconds Till Boot 491 1209 CFG_TimedDelay dw 123 ; Timed Boot - Delay 492 CFG_TimedBootLast db 0; Timed Boot - Boot From Last Drive Booted From1210 CFG_TimedBootLast db 1 ; Timed Boot - Boot From Last Drive Booted From 493 1211 CFG_RememberBoot db 1 ; Remember Manual Boot Choice 494 1212 CFG_RememberTimed db 0 ; Remember if Timed Boot (if both disabled: Boot Default) 495 CFG_IncludeFloppy db 1; Include Floppy Drives in Boot-Menu1213 CFG_IncludeFloppy db 0 ; Include Floppy Drives in Boot-Menu 496 1214 CFG_BootMenuActive db 1 ; Display Boot-Menu (if Disabled: Boot Default) 497 1215 ; v0.29+ -> 2 - Detailed Bootmenu … … 503 1221 CFG_IgnoreWriteToMBR db 0 ; Just ignore writes to MBR, otherwise crash 504 1222 CFG_FloppyBootGetName db 0 ; Gets floppy name for display purposes 505 CFG_DetectVirus db 1 ; Detect Virus ?506 CFG_DetectStealth db 1 ; Detect Stealth-Virus ?507 CFG_DetectVIBR db 1 ; Detect BootRecord-Virus ?508 CFG_AutoEnterSetup db 1 ; Automatic Enter Setup (first install!)1223 CFG_DetectVirus db 0 ; Detect Virus ? // Rousseau: disabled 1224 CFG_DetectStealth db 0 ; Detect Stealth-Virus ? // Rousseau: disabled 1225 CFG_DetectVIBR db 0 ; Detect BootRecord-Virus ? // Rousseau: disabled 1226 CFG_AutoEnterSetup db 0 ; Automatic Enter Setup (first install!) // Rousseau: disabled 509 1227 CFG_MasterPassword dw 0101Fh ; Encoded Password (this is just CR) 510 1228 dw 07A53h … … 537 1255 CFG_AutomaticBoot db 0 ; Automatic Booting (only one bootup) 538 1256 CFG_PartAutomatic db 0 ; Partition-No for automatic booting 539 CFG_ForceLBAUsage db 0 ; LBA-BIOS-API forced on any HDD I/O1257 CFG_ForceLBAUsage db 1 ; LBA-BIOS-API forced on any HDD I/O // Rousseau: enabled config (LBA) 540 1258 CFG_IgnoreLVM db 0 ; Ignores any LVM-Information 1259 1260 1261 ; 1262 ; THERE IS ROOM RESERVED HERE FOR MORE VARIABLES 1263 ; 1264 1265 1266 eoc: 1267 1268 ; Check for overlap 1269 slack05a = soiv - eoc 1270 IF slack05a LT 0 1271 .ERR2 "Location Overlap slack05a !" 1272 ENDIF 1273 1274 ; Allways have the name of the installation volume 1275 ; at this offset. 1276 ; So future config changes will not break auto-install. 1277 org 06D00h 1278 1279 soiv: 1280 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 1288 1289 1290 1291 ; End of sector 55. 1292 eos55: 1293 1294 1295 1296 ; Check for overlap 1297 slack06 = sosvs - eos55 1298 IF slack06 LT 0 1299 .ERR2 "Location Overlap slack06 !" 1300 ENDIF 1301 1302 541 1303 542 1304 ; VIR variables are for the AiR-BOOT Anti Virus Code … … 544 1306 ; stealth virus is on-line, we can intercept its call. 545 1307 ; Normal (non stealth) virus are trapped simply by rereading the MBR sector. 546 ; If a virus is found, we will restore MBR from Sektor 60 and stop the system1308 ; If a virus is found, we will restore MBR from Sektor 60/62 and stop the system 547 1309 ; from working, so the user has to press reset. That's saver than a Reboot. 548 1310 ; … … 554 1316 ; off or just reset it by switching 'VIBR Detection'. 555 1317 1318 1319 ; 1320 ; 06DABh - 06C00h = 01ABh = 427 bytes. 1321 ; 556 1322 org 06DABh ; 427 Boundry 1323 1324 sosvs: 1325 557 1326 AutoDrvLetter db 0 558 1327 AutoDrvLetterSerial dd 0 559 1328 1329 ; This entry is also 34 bytes long 560 1330 BIOScontIPTentry: 561 1331 db 0, 0, 0, 0, ' ' … … 571 1341 CFG_VIR_INT1C dd 0 ; pointer to saved 1Ch entry point 572 1342 573 ; 478 Boundry 1343 ; 478 Boundry 1344 ; This entry is also 34 bytes long 574 1345 FloppyIPTentry: db 0, 0, 0, 0, 'FloppyDrive' 575 1346 db 0, 0FFh, Flags_BootAble … … 579 1350 dd 0, 0 580 1351 ;--------------------------------------------------------------------------- 581 org 06E00h ; Sector 56-57 1352 1353 eosvs: 1354 1355 ; Check for overlap 1356 slack07 = sos56 - eosvs 1357 IF slack07 LT 0 1358 .ERR2 "Location Overlap slack07 !" 1359 ENDIF 1360 1361 1362 ;org 06E00h ; Sector 56-57 1363 org image_size - 0a00h - (image_size - image_size_60secs) 1364 sos56: 1365 1366 1367 1368 ; Rousseau: This is the start of the AiR-BOOT IPT 1369 582 1370 PartitionTable: ; no-partitions detected... :] 583 1371 ; db 1, 0, 0, 0, 'Harddisc 1' … … 600 1388 ; AbsoluteBegin * 4 (where the partition begins, in absolute sectors) 601 1389 ; AbsolutePartTab * 4 (where the partition table is, in absolute sectors) 602 ; --------------------> 34 Bytes (total maximum = 30) 603 604 org 071F6h 1390 ; --------------------> 34 Bytes (total maximum partition-entries = 30) 1391 1392 db (partition_count * 34) dup ('P') 1393 1394 eos56: 1395 1396 ; Check for overlap 1397 slack08 = eoiptsig - eos56 1398 IF slack08 LT 0 1399 .ERR2 "Location Overlap slack08 !" 1400 ENDIF 1401 1402 1403 ;org 071F6h 1404 org image_size - 600h - (image_size - image_size_60secs) / 2 - 0ah 1405 soiptsig: 605 1406 db 'AiRBOOTPAR' ; 1K internal partition table 1407 1408 1409 1410 eoiptsig: 1411 1412 ; Check for overlap 1413 slack09 = soipt - eoiptsig 1414 IF slack09 LT 0 1415 .ERR2 "Location Overlap slack09 !" 1416 ENDIF 1417 606 1418 ;--------------------------------------------------------------------------- 607 org 07200h ; Sector 58 608 HidePartitionTable: db 900 dup (0FFh) 1419 ;org 07200h ; Sector 58 1420 org image_size - 600h - (image_size - image_size_60secs) / 2 ; Sector 58 1421 soipt: 1422 sos58: 1423 1424 HidePartitionTable: db (partition_count * 30) dup (0FFh) 609 1425 ; Format is: 610 1426 ;============ … … 612 1428 ; --------------------> 30 Bytes * 30 613 1429 614 DriveLetters: db 30dup (0)1430 DriveLetters: db partition_count dup (0) 615 1431 ; Format is: 616 1432 ;============ 617 1433 ; Drive-Letter : BYTE (80h-C:, 81h-D:) 618 1434 ; --------------------> 1 Byte * 30 619 620 org 075F6h 1435 eos58: 1436 eoipt: 1437 1438 ; Check foroverlap 1439 slack10 = sohidsig - eoipt 1440 IF slack10 LT 0 1441 .ERR2 "Location Overlap slack10 !" 1442 ENDIF 1443 1444 1445 1446 ;org 075F6h 1447 org image_size - 200h -0ah 1448 1449 sohidsig: 621 1450 db 'AiRBOOTHID' ; 1K internal Hide-partition table 1451 1452 eohidsig: 1453 1454 ; Check for overlap 1455 slack11 = sohid - eohidsig 1456 IF slack11 LT 0 1457 .ERR2 "Location Overlap slack11 !" 1458 ENDIF 1459 1460 1461 1462 622 1463 ;--------------------------------------------------------------------------- 623 org 07600h ; Sector 60 624 MBR_BackUpMBR db 'AiR-BOOT MBR-BackUp - Just to fill this sector with something' 625 626 org 077FFh 627 db 0 1464 ;org 07600h ; Sector 60 1465 org image_size - 200h ; Sector 60 1466 sohid: 1467 sos60: 1468 MBR_BackUpMBR db 'AiR-BOOT MBR-BackUp - Just to fill this sector with something',0 1469 AirBootRocks db 'AiR-BOOT Rocks!',0 1470 1471 eos60: 1472 eohid: 1473 1474 ; Check for overlap 1475 slack12 = eoab - eohid 1476 IF slack12 LT 0 1477 .ERR2 "Location Overlap slack12 !" 1478 ENDIF 1479 1480 1481 ;org 077FEh 1482 org image_size - 2 1483 dw 0BABEh 1484 ;dw 0 1485 ;BIOS_AuxParms dw BIOS_AuxParmsDefault ; Initialized at start when developing 1486 1487 eoab: 1488 1489 ; 1490 ; Rousseau: 1491 ; End of AiR-BOOT code and data. 1492 ; 1493 1494 1495 ; 1496 ; Rousseau: 1497 ; Below functions like a BSS segment, thus uninitialized data. 1498 ; 1499 sobss: 628 1500 ;--------------------------------------------------------------------------- 629 1501 org 0A000h ; Uninitialized … … 633 1505 LVMSector: db 512 dup (?) ; Temporary Sector for LVM 634 1506 TmpSector: db 512 dup (?) ; Temporary Sector 635 TmpSector2: 1507 636 1508 ; Everything used to build a new IPT and reference it to the old one 637 NewPartTable: db 1 024dup (?) ; New Partition Table638 NewHidePartTable: db 900 dup (?) ; New Hide-Partition Table639 NewDriveLetters: db 30dup (?) ; Logical Drive-Letters640 641 PartitionSizeTable: db 180dup (?) ; Size-Table (6 bytes per partition)1509 NewPartTable: db 1536 dup (?) ; New Partition Table 1510 NewHidePartTable: db partition_count * 30 dup (?) ; New Hide-Partition Table 1511 NewDriveLetters: db partition_count dup (?) ; Logical Drive-Letters 1512 1513 PartitionSizeTable: db partition_count * 6 dup (?) ; Size-Table (6 bytes per partition) 642 1514 PartitionPointers dw 52 dup (?) ; Maximum is 52 entries till now 643 1515 PartitionPointerCount db ? ; Count of total Partition Pointers 644 PartitionXref db 30dup (?) ; X-Reference Table645 PartitionVolumeLetters db 30dup (?) ; Volume-Letters1516 PartitionXref db partition_count dup (?) ; X-Reference Table 1517 PartitionVolumeLetters db partition_count dup (?) ; Volume-Letters 646 1518 ; 0 - no LVM support 647 1519 ; 1 - LVM support, but no letter … … 650 1522 TotalHarddiscs db ? ; Total harddrives (by POST) 651 1523 LBASwitchTable db 128 dup (?) ; Bit 25-18 for CHS/LBA Switching 652 NewPartitions db ? ; Freshly found partitions 1524 NewPartitions db ? ; Freshly found partitions ; Independent of SaveConfiguration 653 1525 654 1526 VideoIO_Segment dw ? ; Segment for Video I/O … … 723 1595 ;LINUX_KernelNo db ? ; Total of Kernels in KernelEntries 724 1596 ;LINUX_KernelSizeTable db 120 dup (?) ; Size-Table (6 bytes per kernel) 725 EndOfVariables:1597 ;EndOfVariables: 726 1598 727 1599 ; Dynamically Generated Tables - do not need to get initialized with NUL … … 733 1605 LVM_CRCTable: dd 256 dup (?) ; LVM-CRC (->SPECiAL\LVM.asm) 734 1606 1607 1608 1609 ; 1610 ; Rousseau: added some stuff. 1611 ; 1612 1613 1614 ;EVEN 1615 HugeDisk db MaxDisks dup(?) 1616 TrueSecs dd MaxDisks dup(?) 1617 1618 ; BIOS geometry of the boot-drive 1619 ; Note that heads cannot be 256 due to legacy DOS/BIOS bug 1620 ; If Int13X is supported those values are used, otherwise the legacy values. 1621 BIOS_Cyls dd MaxDisks dup(?) 1622 BIOS_Heads dd MaxDisks dup(?) 1623 BIOS_Secs dd MaxDisks dup(?) 1624 BIOS_Bytes dw MaxDisks dup(?) 1625 BIOS_TotalSecs dq MaxDisks dup(?) 1626 1627 ; LBA geometry of the boot-drive 1628 ; Note that these values are taken from the BPB of a partition boot-record 1629 LVM_Cyls dd MaxDisks dup(?) 1630 LVM_Heads dd MaxDisks dup(?) 1631 LVM_Secs dd MaxDisks dup(?) 1632 LVM_Bytes dw MaxDisks dup(?) 1633 LVM_TotalSecs dq MaxDisks dup(?) 1634 1635 ; OS/2 geometry of the boot-drive 1636 ; Note that these values are taken from the BPB of a partition boot-record 1637 LOG_Cyls dd MaxDisks dup(?) 1638 LOG_Heads dd MaxDisks dup(?) 1639 LOG_Secs dd MaxDisks dup(?) 1640 LOG_Bytes dw MaxDisks dup(?) 1641 LOG_TotalSecs dq MaxDisks dup(?) 1642 1643 ; Rousseau: moved here 1644 EndOfVariables: 1645 1646 ; Temporary buffer for 48h INT13X bios call 1647 ; Word aligned 1648 ;even 1649 ;align 2 1650 1651 ;db 1 dup(?) 1652 1653 i13xbuf dw 1 dup (?) ; Size of the buffer; this param *must* be present. Code inserts it. 1654 db 126 dup(?) ; The buffer itself. 1655 i13xbuf_size = $-offset i13xbuf-2 ; Size of buffer (excluding the size word at the start). 1656 1657 eobss: 1658 1659 735 1660 code_seg ends 736 1661 end air_boot -
tags/v1.07r/BOOTCODE/MAKE.BAT
r29 r30 3 3 if "%1"=="EN" goto Valid 4 4 if "%1"=="DE" goto Valid 5 if "%1"==" DT" goto Valid5 if "%1"=="NL" goto Valid 6 6 if "%1"=="FR" goto Valid 7 7 if "%1"=="IT" goto Valid … … 13 13 14 14 :BuildAll 15 call make.bat EN16 15 call make.bat DE 17 call make.bat DT16 call make.bat NL 18 17 call make.bat FR 19 18 call make.bat IT 20 19 call make.bat RU 21 20 call make.bat SW 21 call make.bat EN 22 22 goto ExitMe 23 23 24 24 :Valid 25 echo. 26 echo. 25 27 echo Making %1 language version of AiR-BOOT bootcode... 26 28 echo Include TEXT\%1\MBR.asm >TEXT\TXTMBR.asm … … 37 39 if errorlevel 1 goto Failed 38 40 ..\tools\internal\fixcode.com 39 copy AIR-BOOT.com ..\RELEASE\BOOTCODE\%1.bin 41 copy AIR-BOOT.com ..\RELEASE\BOOTCODE\AIRBT-%1.bin 42 43 copy AIR-BOOT.COM AIRBOOT.BIN 40 44 41 45 rem Cleanup 42 remdel AiR-BOOT.com46 del AiR-BOOT.com 43 47 del AiR-BOOT.exe 44 48 del AiR-BOOT.obj … … 48 52 echo Errorlevel not 0, make failed 49 53 :ExitMe 54 rem @pause -
tags/v1.07r/BOOTCODE/MBR-PROT/MAKE.BAT
r29 r30 6 6 %linker% mbr_prot.obj >nul 7 7 if errorlevel 1 goto Failed 8 %exe2bin% mbr_prot.exe fixcode.com >nul 8 %exe2bin% mbr_prot.exe mbr_prot.com 9 if errorlevel 1 goto Failed 10 copy mbr_prot.com fixcode.com 9 11 if errorlevel 1 goto Failed 10 12 11 13 rem Cleanup 12 del mbr_prot.exe13 del mbr_prot.obj14 ::del mbr_prot.exe 15 ::del mbr_prot.obj 14 16 goto ExitMe 15 17 … … 17 19 echo Errorlevel not 0, make failed 18 20 :ExitMe 19 pause21 rem pause -
tags/v1.07r/BOOTCODE/MBR-PROT/MBR_PROT.ASM
r29 r30 27 27 org 0000h 28 28 29 OldInterrupt10 dd 'kcuf' ; we are nice aren't we ;-) 30 OldInterrupt13 dd 'kcuf' 29 ; Yes you are :-) 30 ;OldInterrupt10 dd 'kcuf' ; we are nice aren't we ;-) 31 ;OldInterrupt13 dd 'kcuf' 32 33 OldInterrupt10 dd 0 34 OldInterrupt13 dd 0 35 31 36 MBR_IgnoreWrite db 0 32 37 … … 143 148 MBRProt_WriteBorderLine EndP 144 149 145 MBRP_Line1: db 'ÕÍÍŽ!ATTENTION! -> A V IRUSWAS FOUND <- !ATTENTION!ÃÍÍž'150 MBRP_Line1: db 'ÕÍÍŽ!ATTENTION! -> A V1RU5 WAS FOUND <- !ATTENTION!ÃÍÍž' 146 151 MBRP_EmptyLine: db '³ ³' 147 152 db '³ A program tried to write to your Master Boot Record ³' … … 151 156 db '³ you have to deactivate MBR PROTECTION in AiR-BOOT ³' 152 157 db '³ or contact your supervisor. ³' 153 MBRP_Line3: db 'ÔÍÍÍŽAiR-BOOT (c) Copyright by M. Kiewitz 1999-2009ÃÍÍŸ' 158 ;MBRP_Line3: db 'ÔÍÍÍŽAiR-BOOT (c) Copyright by M. Kiewitz 1999-2009ÃÍÍŸ' 159 MBRP_Line3: db 'ÔÍÍÍŽAiR-BOOT (c) Copyright by M. Kiewitz 1999-2011ÃÍÍŸ' 154 160 155 161 org 1023 -
tags/v1.07r/BOOTCODE/REGULAR/BOOTMENU.ASM
r29 r30 20 20 ;--------------------------------------------------------------------------- 21 21 22 IFDEF ModuleNames 23 DB 'BOOTMENU',0 24 ENDIF 25 22 26 BOOTMENU_BuildBackground Proc Near Uses es di 23 27 call VideoIO_CursorOff … … 32 36 BOOTMENU_BuildBackground EndP 33 37 38 CLR_COPYRIGHT_CLASSIC = 0f00h 39 CLR_COPYRIGHT_BM = 0700h 40 34 41 BOOTMENU_BuildMain Proc Near Uses es di 35 42 ; 1st line with Copyright information... 36 43 mov cx, 0101h 37 44 call VideoIO_Locate 38 mov cx, 0F00h45 mov cx, CLR_COPYRIGHT_BM 39 46 call VideoIO_Color 40 47 mov si, offset Copyright … … 42 49 43 50 ; Boot-Window... 44 mov cx, 0901h 51 CLR_BOOT_WINDOW_CLASSIC = 0901h 52 CLR_BOOT_WINDOW_BM = 0701h 53 54 mov cx, CLR_BOOT_WINDOW_BM 45 55 call VideoIO_Color 46 56 mov bx, 0201h … … 53 63 mov al, TextChar_WinLineRight 54 64 mov cl, 78 55 call VideoIO_Internal_MakeWinRight 65 call VideoIO_Internal_MakeWinRight 56 66 57 67 mov dl, 18h … … 63 73 64 74 ; Display Top-Infos in Boot-Window 65 mov cx, 0B01h 75 76 CLR_TOP_INFOS_CLASSIC = 0b01h 77 CLR_TOP_INFOS_BM = 0301h 78 79 mov cx, CLR_TOP_INFOS_BM 66 80 call VideoIO_Color 67 81 mov ch, 03h … … 91 105 92 106 ; Now make the separating vertical lines... 93 mov cx, 0901h 107 CLR_SEP_VERT_LINES_CLASSIC = 0901h 108 CLR_SEP_VERT_LINES_BM = 0701h 109 110 mov cx, CLR_SEP_VERT_LINES_BM 94 111 call VideoIO_Color 95 112 mov ch, 03h … … 157 174 ; Boot-Window is DONE 158 175 159 mov cx, 0C04h 160 call VideoIO_Color 176 ; Rousseau: = Colors = 177 ; FG 178 ; BG 179 ; 7 = grey 180 ; 6 = brown 181 ; 5 = magenta 182 ; 4 = red 183 ; 3 = cyan 184 ; 2 = green 185 ; 1 = blue 186 187 CLR_INFO_WINDOW_CLASSIC = 0c04h 188 CLR_INFO_WINDOW_BM = 0701h 189 190 mov cx, CLR_INFO_WINDOW_BM 191 ;mov cx, 0C06h ; brown, main background 192 call VideoIO_Color ; Rousseau: color info window 193 161 194 mov bx, 1401h 162 195 mov dx, 1950h … … 173 206 mov cx, 1703h 174 207 call VideoIO_Locate 175 mov cx, 0F04h 176 call VideoIO_Color 208 209 CLR_INFO_TEXT_CLASSIC = 0f04h 210 CLR_INFO_TEXT_BM = 0701h 211 212 mov cx, CLR_INFO_TEXT_BM ; Info text 213 call VideoIO_Color ; Rousseau: color info text 214 177 215 mov si, offset TXT_BootMenuHelpText1 178 216 call VideoIO_Print … … 182 220 call VideoIO_Print 183 221 184 mov cx, 0C04h 222 223 CLR_F10_SETUP_CLASSIC = 0c04h 224 CLR_F10_SETUP_BM = 0901h 225 226 mov cx, CLR_F10_SETUP_BM ; background F10 enter Setup 185 227 call VideoIO_Color 186 228 … … 198 240 call VideoIO_PrintSingleChar 199 241 ; HelpWindow done... 242 243 244 ; Rousseau: Debug Stuff, put here after building Main Menu 245 ;call VideoIO_DBG_WriteString 246 ;call VideoIO_DBG_WriteString2 247 200 248 ret 201 249 BOOTMENU_BuildMain EndP 250 251 202 252 203 253 BOOTMENU_BuildGoodBye Proc Near Uses es di … … 209 259 rep stosw 210 260 ; ------------------------------------------- 211 mov cx, 0D05h 261 262 CLR_GOODBYE_WINDOW_CLASSIC = 0d05h 263 CLR_GOODBYE_WINDOW_BM = 0f01h 264 265 mov cx, CLR_GOODBYE_WINDOW_BM 212 266 call VideoIO_Color 213 267 mov bx, 0101h … … 221 275 mov cx, 9 222 276 mov al, WinCharRight 223 mov ah, 05Dh 277 278 ; Little part before version in goodbye-window 279 ; Does not use color-function 280 ;mov ah, 05Dh 281 mov ah, 01fh 224 282 rep stosw 283 225 284 mov cx, 010Bh 226 285 call VideoIO_Locate … … 240 299 mov al, TextChar_WinRep4 241 300 call VideoIO_PrintSingleChar 242 mov cx, 0E01h 301 302 CLR_GOODBYE_AB_VERSION_CLASSIC = 0e01h 303 CLR_GOODBYE_AB_VERSION_BM = 0e03h 304 305 mov cx, CLR_GOODBYE_AB_VERSION_BM 243 306 call VideoIO_Color 244 307 mov si, offset Copyright 245 308 mov cl, 11+CopyrightVersionLen 246 309 call VideoIO_FixedPrint 247 mov cx, 0D05h 310 311 mov cx, CLR_GOODBYE_WINDOW_BM 312 248 313 call VideoIO_Color 249 314 mov al, TextChar_WinRep5 … … 251 316 mov cx, 020Dh 252 317 call VideoIO_Locate 253 mov cx, 0F05h 318 319 CLR_GOODBYE_WINDOW_CLASSIC_2 = 0f05h 320 CLR_GOODBYE_WINDOW_BM_2 = 0701h 321 322 mov cx, CLR_GOODBYE_WINDOW_BM_2 254 323 call VideoIO_Color 255 324 inc si … … 272 341 BOOTMENU_BuildGoodBye EndP 273 342 343 344 274 345 ; Must preserve AX! 275 346 BOOTMENU_BuildTimedBootText Proc Near Uses ax cx si es di 276 mov cx, 1503h 277 call VideoIO_Locate 278 mov cx, 0E04h 347 mov cx, 1503h ; 348 call VideoIO_Locate 349 350 CLR_NON_TIMED_BAR_CLASSIC = 0e04h 351 CLR_NON_TIMED_BAR_BM = 0701h 352 353 mov cx, CLR_NON_TIMED_BAR_BM ; non-timed time bar 279 354 call VideoIO_Color 280 355 call VideoIO_Internal_SetRegs … … 294 369 mov cx, 1503h 295 370 call VideoIO_Locate 296 mov cx, 0E04h 371 372 CLR_TIMED_BAR_CLASSIC = 0e04h 373 CLR_TIMED_BAR_BM = 0e04h 374 375 mov cx, CLR_TIMED_BAR_BM ; timed time bar, yellow on red 297 376 call VideoIO_Color 298 377 mov si, offset TXT_TimedBootLine ; will print TimedBootEntryName too … … 325 404 BOOTMENU_RefreshPartitionText EndP 326 405 406 407 CLR_VOLUME_INDEX_CLASSIC = 0f01h 408 CLR_VOLUME_INDEX_BM = 0f01h 409 327 410 ; Writes Partition-Information to Screen (Boot-Menu) 328 411 ; In: CH - Line to print info … … 339 422 mov dh, cl 340 423 call VideoIO_Locate 341 mov cx, 0F01h; Bwhite, blue424 mov cx, CLR_VOLUME_INDEX_BM ; Bwhite, blue 342 425 call VideoIO_Color 343 426 mov al, dl … … 347 430 ; === Display Drive-Number and Size (Size only in detailed view) === 348 431 add dh, 5 349 movzx cx, dh 350 call VideoIO_Locate 351 mov cx, 0D01h 432 ;movzx cx, dh 433 mov cl,dh 434 mov ch,0 435 436 call VideoIO_Locate 437 438 CLR_HD_INDEX_CLASSIC = 0d01h 439 CLR_HD_INDEX_BM = 0701h 440 441 mov cx, CLR_HD_INDEX_BM 352 442 call VideoIO_Color ; Violet, blue 353 443 mov si, PartPointer … … 367 457 BMBPT_IsHarddrive: 368 458 ; Now display Size-Element... 369 mov cx, 0501h 459 460 CLR_HD_SIZE_CLASSIC = 0501h 461 CLR_HD_SIZE_BM = 0701h 462 463 mov cx, CLR_HD_SIZE_BM 370 464 call VideoIO_Color ; Dark-Violet, Blue 371 465 mov al, '/' 372 466 call VideoIO_PrintSingleChar 373 mov cx, 0D01h467 mov cx, CLR_HD_SIZE_BM 374 468 call VideoIO_Color ; Violet, Blue 375 469 mov ax, PartPointer ; Get Size-Element from PartPtr (AX) … … 383 477 384 478 ; === Display Label === 385 movzx cx, dh 386 call VideoIO_Locate 387 mov cx, 0E01h 479 ;movzx cx, dh 480 mov cl,dh 481 mov ch,0 482 483 call VideoIO_Locate 484 485 CLR_LABEL_CLASSIC = 0e01h 486 CLR_LABEL_BM = 0f01h 487 488 mov cx, CLR_LABEL_BM 388 489 call VideoIO_Color ; Yellow, blue 389 490 mov si, PartPointer … … 394 495 ; === Display Type === 395 496 add dh, 14 396 movzx cx, dh 497 ;movzx cx, dh 498 mov cl,dh 499 mov ch,0 500 397 501 call VideoIO_Locate 398 502 mov si, PartPointer 399 503 mov al, [si+LocIPT_SystemID] 400 504 call PART_SearchFileSysName 401 mov cx, 0C01h 505 506 CLR_FS_NAME_CLASSIC = 0c01h 507 CLR_FS_NAME_BM = 0701h 508 509 mov cx, CLR_FS_NAME_BM 402 510 call VideoIO_Color ; Hrot, Blau 403 511 mov cl, 8 … … 410 518 ; Out: DX - will get returned (fixed, if needed) 411 519 BOOTMENU_BuildChoiceBar Proc near Uses ax es di 520 521 ;call SOUND_Beep 522 412 523 call VideoIO_WaitRetrace 524 525 526 ;call SOUND_Beep 527 413 528 mov cl, 10h ; Color BLUE, Partition DL 414 529 call BOOTMENU_ReColorPart 530 531 ;call SOUND_Beep 415 532 416 533 ; Check, if clipping needed... … … 448 565 call BOOTMENU_RefreshPartitionText 449 566 567 568 ; Keuze bar 569 ; 00h black 570 ; 10h blue 571 ; 20h green (also nice) 572 ; 30h cyan (also nice) 573 ; 40h red 574 ; 50h magenta 575 ; 60h brown (nice) 576 ; 70h white 577 ; 80h grey 578 ; 90h light blue (nice) 579 ; 0a0h bright green 580 ; 0b0h bright cyan 581 ; 0c0h bright red 582 ; 0d0h bright magenta 583 ; 0e0h bright yellow 584 ; 0f0h bright white 585 586 587 CLR_SELECTION_BAR_CLASSIC = 50h 588 CLR_SELECTION_BAR_BM = 090h 589 590 591 450 592 BMBCB_AfterScrolling: 451 mov cl, 50h; Color PINK, Partition DL593 mov cl, CLR_SELECTION_BAR_BM ; Color PINK, Partition DL 452 594 call BOOTMENU_ReColorPart 453 595 ret … … 457 599 ; Destroyed: None, but Locate-Pointer gets set 458 600 BOOTMENU_ReColorPart Proc Near Uses bx cx es di 601 602 ; call SOUND_Beep 603 459 604 mov bh, cl ; Color to BH 460 605 ; First calculate location of bar … … 475 620 and al, 0Fh 476 621 or al, bh ; Adds background color (from BH) 622 623 ;mov al,97h 624 477 625 mov es:[di], al 478 626 add di, 2 … … 615 763 ; Got it, so display bar... 616 764 mov dh, dl 765 766 ;call SOUND_Beep 767 617 768 call BOOTMENU_BuildChoiceBar ; DH - Active, DL - Last Active 769 770 ;call SOUND_Beep 771 618 772 call SOUND_PreBootMenu 619 773 774 620 775 BME_MainLoop: 776 777 ;call VideoIO_DBG_WriteString2 ; Rousseau 778 621 779 test TimedBootEnable, 1 622 780 jz BME_NoTimedBoot -
tags/v1.07r/BOOTCODE/REGULAR/DRIVEIO.ASM
r29 r30 19 19 ; AiR-BOOT / DRIVE I/O 20 20 ;--------------------------------------------------------------------------- 21 22 23 24 IFDEF ModuleNames 25 DB 'DRIVEIO',0 26 ENDIF 21 27 22 28 ; Note: Some routines set DS/ES to CS or even address via CS, even if its not … … 141 147 ; This is calculated by Sector*Heads. Comparing will get done with Bit 25-10 142 148 ; on LBA sectors, so we actually divide sector number by 1024. 143 DriveIO_InitLBASwitchTable Proc Near Uses es di 149 DriveIO_InitLBASwitchTable Proc Near Uses es di ; Rousseau: LBA ! 144 150 mov di, offset LBASwitchTable 145 151 mov dh, TotalHarddiscs … … 152 158 jc DIOILUT_Error 153 159 and cl, 111111b ; Isolate lower 6 bits of CL -> sector count 154 movzx ax, cl 155 mov bl, dh ; DH -> head count 160 161 ; huge disk 127 sec/track on <1TB using DANI 162 ; mov cl, 07Fh 163 164 ;movzx ax, cl 165 mov al,cl 166 mov ah,0 167 168 mov bl, dh ; DH -> head count ; Rousseau: nope, it's max head number ! 156 169 mul bl ; AX = Sectors*Heads 157 170 shl ah, 1 … … 168 181 DriveIO_InitLBASwitchTable EndP 169 182 183 184 185 170 186 ; Adjusts BX:AX / CX:DX to meet LVM sector location 171 187 ; Destroys SI 172 DriveIO_LVMAdjustToInfoSector Proc Near Uses 173 push cx 174 xor ch, ch 175 and cl, 63 ; Isolate lower bits, because upper 176 mov si, 63 ; ones may be used for cylinder 177 sub si, cx 178 pop cx 179 add ax, si 180 adc bx, 0 ; Adjust LBA Sector (BX:AX) 181 or cl, 63 ; Set Sector to 63 182 ret 188 ; Rousseau: Enhanced to handle sector-numbers 127 and 255 besides 63 for LVM-info sectors. 189 ; Ugly, need to cleanup. 190 DriveIO_LVMAdjustToInfoSector Proc Near Uses ; Rousseau: LVM stuff ! 191 192 193 194 ; pusha 195 ; call AuxIO_TeletypeNL 196 197 ; LBA 198 ; xchg dx,bx 199 ; call AuxIO_TeletypeHexDWord 200 ; call AuxIO_TeletypeNL 201 ; xchg bx,dx 202 203 ; CYL 204 ; mov al,ch 205 ; call AuxIO_TeletypeHexByte 206 ; call AuxIO_TeletypeNL 207 208 ; HEAD 209 ; mov al,dh 210 ; call AuxIO_TeletypeHexByte 211 ; call AuxIO_TeletypeNL 212 213 ; SEC 214 ; mov al,cl 215 ; call AuxIO_TeletypeHexByte 216 ; call AuxIO_TeletypeNL 217 218 ; DRIVE 219 ; mov al,dl 220 ; call AuxIO_TeletypeHexByte 221 ; call AuxIO_TeletypeNL 222 223 ; popa 224 225 226 ;local ts:word 227 ;local ts2:word 228 229 pusha 230 231 ; Dump drive 232 mov si,offset drive 233 call AuxIO_Print 234 xchg al,dl 235 call AuxIO_TeletypeHexByte 236 call AuxIO_TeletypeNL 237 xchg dl,al 238 239 ; Dump SPT 240 mov si,offset spt_used 241 call AuxIO_Print 242 push dx 243 push bx 244 xor dh,dh 245 and dl,01111111b 246 shl dx,1 247 shl dx,1 248 mov bx, offset TrueSecs 249 add bx,dx 250 mov ax,word ptr [bx] 251 252 ;mov [ts],ax 253 254 call AuxIO_TeletypeHexWord 255 call AuxIO_TeletypeNL 256 pop bx 257 pop dx 258 259 pusha 260 push dx 261 ; Location of extended position 262 mov dx,word ptr [ExtendedAbsPos+02] 263 mov ax,word ptr [ExtendedAbsPos+00] 264 call AuxIO_TeletypeHexDWord 265 call AuxIO_TeletypeNL 266 pop dx 267 268 xor dh,dh 269 and dl,01111111b 270 shl dx,1 271 shl dx,1 272 mov bx, offset TrueSecs 273 add bx,dx 274 275 mov ax, word ptr[bx] 276 call AuxIO_TeletypeHexWord 277 call AuxIO_TeletypeNL 278 mov al,[ExtendedAbsPosSet] ; if true -> 1st sector of extpart (EBR), not logpart(BPB) 279 call AuxIO_TeletypeHexByte 280 call AuxIO_TeletypeNL 281 ; mov si,offset PartitionSector 282 ; call AuxIO_DumpSector 283 popa 284 285 ; LBA 286 mov si,offset before_lvm_adjust 287 call AuxIO_Print 288 289 xchg dx,bx 290 call AuxIO_TeletypeHexDWord 291 call AuxIO_TeletypeNL 292 xchg bx,dx 293 popa 294 295 296 ;or bx,ax 297 test [ExtendedAbsPosSet],1 298 jz pri 299 300 301 302 303 pusha 304 mov si,offset before_lvm_adjust_log 305 call AuxIO_Print 306 ; LBA 307 xchg dx,bx 308 call AuxIO_TeletypeHexDWord 309 call AuxIO_TeletypeNL 310 xchg bx,dx 311 popa 312 313 314 push dx 315 push bx 316 xor dh,dh 317 and dl,01111111b 318 shl dx,1 319 shl dx,1 320 mov bx,offset TrueSecs 321 add bx,dx 322 mov dx,[bx] 323 dec dx 324 add ax,dx 325 pop bx 326 pop dx 327 adc bx,0 328 329 330 pusha 331 mov si,offset after_lvm_adjust_log 332 call AuxIO_Print 333 ; LBA 334 xchg dx,bx 335 call AuxIO_TeletypeHexDWord 336 call AuxIO_TeletypeNL 337 xchg bx,dx 338 popa 339 340 jmp done 341 342 343 344 345 pri: 346 347 348 push ax 349 push cx 350 xor ch, ch ; Zero out upper-byte 351 352 push dx 353 xor dh,dh 354 and dl,01111111b 355 shl dx,1 356 shl dx,1 357 push bx 358 mov bx,offset TrueSecs 359 add bx,dx 360 mov ax,[bx] 361 ;mov [ts2],ax 362 pop bx 363 pop dx 364 365 366 367 ;mov al, 63 368 ;call VideoIO_PrintByteDynamicNumber 369 ;self: jmp self 370 371 372 373 ; DEZE WERKT SOMS NIET GOED 374 ; ROMMELT MET CYLINDERS 375 ; ALLEEN TOEPASSEN ALS INT13X NIET ACTIEF ! 376 377 and cl, al ; Isolate lower bits, because upper 378 mov ah, 0 379 mov si, ax ; ones may be used for cylinder 380 sub si, cx 381 382 pop cx 383 pop ax 384 385 or cl, al ; Set sector to last sector 386 387 add ax, si ; Adjust lower LBA 388 adc bx, 0 ; Adjust LBA Sector (BX:AX) 389 390 391 392 ;push ax 393 ;call AuxIO_TeletypeHexWord 394 ;call AuxIO_TeletypeNL 395 ;mov ax,[ts] 396 ;call AuxIO_TeletypeHexWord 397 ;call AuxIO_TeletypeNL 398 ;mov ax,[ts2] 399 ;call AuxIO_TeletypeHexWord 400 ;call AuxIO_TeletypeNL 401 ;pop ax 402 403 ;and ax,[ts] 404 405 jmp done 406 407 408 409 done: 410 411 412 413 pusha 414 mov si,offset after_lvm_adjust 415 call AuxIO_Print 416 ; LBA 417 xchg dx,bx 418 call AuxIO_TeletypeHexDWord 419 call AuxIO_TeletypeNL 420 xchg bx,dx 421 popa 422 423 424 425 ; pusha 426 ; call AuxIO_TeletypeNL 427 428 ; CYL 429 ; mov al,ch 430 ; call AuxIO_TeletypeHexByte 431 ; call AuxIO_TeletypeNL 432 433 ; HEAD 434 ; mov al,dh 435 ; call AuxIO_TeletypeHexByte 436 ; call AuxIO_TeletypeNL 437 438 ; SEC 439 ; mov al,cl 440 ; call AuxIO_TeletypeHexByte 441 ; call AuxIO_TeletypeNL 442 443 ; DRIVE 444 ; mov al,dl 445 ; call AuxIO_TeletypeHexByte 446 ; call AuxIO_TeletypeNL 447 448 ; popa 449 450 451 452 ret 183 453 DriveIO_LVMAdjustToInfoSector EndP 184 454 185 Comment *ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 186 Routine: Loads partition to ExecBase and checks for validity 187 ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ 188 Calling : bx:ax - Absolute sector 189 cx:dx - Cylinder/Sector, Side/Drive (hi/lo-byte) 190 Returns : Carry Set if invalid partition encountered 191 Preserve: all registers 192 ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ* 455 drive: db 'drive : ',0 456 before_lvm_adjust: db 'before lvm adjust : ',0 457 after_lvm_adjust: db 'after lvm adjust : ',0 458 before_lvm_adjust_log: db 'before lvm logical adjust: ',0 459 after_lvm_adjust_log: db 'after lvm logical adjust : ',0 460 spt_used: db 'spt used : ',0 461 462 463 464 ; ######################################################################### 465 ; Routine: Loads partition to ExecBase and checks for validity 466 ; ######################################################################### 467 ; Calling : bx:ax - Absolute sector 468 ; cx:dx - Cylinder/Sector, Side/Drive (hi/lo-byte) 469 ; Returns : Carry Set if invalid partition encountered 470 ; Preserve: all registers 471 ; ######################################################################### 193 472 DriveIO_LoadPartition Proc Near Uses si 194 473 mov wptr cs:[CurPartition_Location+0], ax … … 209 488 stc ; Set carry, so no partition table 210 489 DIOLP_Success: 490 491 IFDEF AuxDebug 492 ; show current partition location 493 pushf 494 pusha 495 call AuxIO_TeletypeNL 496 mov si,offset db_curpartloc 497 call AuxIO_Print 498 mov dx,word ptr [CurPartition_Location+02] 499 mov ax,word ptr [CurPartition_Location+00] 500 call AuxIO_TeletypeHexDWord 501 call AuxIO_TeletypeNL 502 mov si,offset PartitionSector 503 call AuxIO_DumpSector 504 call AuxIO_TeletypeNL 505 popa 506 popf 507 ENDIF 508 211 509 ret 212 510 DIOLP_Failed: … … 214 512 DriveIO_LoadPartition EndP 215 513 216 Comment *ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 217 Routine: Writes a partition from ExecBase to its original sector218 ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ 219 Calling : none220 Returns : none221 Preserve: all registers222 ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ* 514 ; ######################################################################### 515 ; Routine: Writes a partition from ExecBase to its original sector 516 ; ######################################################################### 517 ; Calling : none 518 ; Returns : none 519 ; Preserve: all registers 520 ; ######################################################################### 223 521 DriveIO_SavePartition Proc Near Uses ax bx cx dx si 224 522 mov ax, wptr cs:[CurPartition_Location+0] … … 237 535 DriveIO_LoadTmpSector Proc Near Uses 238 536 mov si, offset TmpSector 239 call DriveIO_LoadSector 537 call DriveIO_LoadSector ; Uses INT13X if needed 240 538 ret 241 539 DriveIO_LoadTmpSector EndP … … 256 554 mov dx, wptr cs:[CurPartition_Location+4] 257 555 mov cx, wptr cs:[CurPartition_Location+6] ; Gets cur. partition location 258 call DriveIO_LVMAdjustToInfoSector 556 557 call DriveIO_LVMAdjustToInfoSector ; Rousseau: LVM stuff ! 558 259 559 mov si, offset LVMSector 260 560 call DriveIO_LoadSector 261 call LVM_CheckSectorSignature 561 562 IFDEF AuxDebug 563 ; show current partition location 564 pushf 565 pusha 566 call AuxIO_TeletypeNL 567 mov si,offset db_curlvmsec 568 call AuxIO_Print 569 mov dx,bx 570 call AuxIO_TeletypeHexDWord 571 call AuxIO_TeletypeNL 572 mov si,offset LVMSector 573 call AuxIO_DumpSector 574 call AuxIO_TeletypeNL 575 popa 576 popf 577 ENDIF 578 579 ; Rousseau 580 ;pushf 581 ;pusha 582 ;mov si, offset MyText4 583 ;call VideoIO_Print 584 ;mov si, offset LVMSector 585 ;mov al, [si+LocLVM_VolumeLetter2] 586 ;call VideoIO_PrintByteDynamicNumber 587 ;mov al, [si+LocLVM_Startable] 588 ;call VideoIO_PrintByteDynamicNumber 589 ;mov al, [si+LocLVM_OnBootMenu] 590 ;call VideoIO_PrintByteDynamicNumber 591 ;;self: jmp self 592 ;popa 593 ;popf 594 595 call LVM_CheckSectorSignature ; Rousseau: LVM stuff ! 262 596 jnc DIOLLVMS_NoLVMSector 263 call LVM_CheckSectorCRC 597 call LVM_CheckSectorCRC ; Rousseau: LVM stuff ! 264 598 jnc DIOLLVMS_NoLVMSector 265 599 ret … … 303 637 jnz InScanMode 304 638 jmp MBR_LoadError 305 InScanMode: 639 InScanMode: 306 640 mov si, offset TXT_BrokenPartitionTable 307 641 push cs … … 319 653 DriveIO_GotLoadError EndP 320 654 321 Comment *ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 322 Routine: Loads a specified sector to DS:DI323 ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ 324 Calling : bx:ax - Absolute sector325 cx:dx - Cylinder/Sector, Side/Drive (hi/lo-byte)326 ds:si - Destination-Adress327 Returns : none328 Preserve: all registers329 ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ* 330 DriveIO_LoadSector Proc Near Uses ax bx ds si es di 655 ; ######################################################################### 656 ; Routine: Loads a specified sector to DS:DI 657 ; ######################################################################### 658 ; Calling : bx:ax - Absolute sector 659 ; cx:dx - Cylinder/Sector, Side/Drive (hi/lo-byte) 660 ; ds:si - Destination-Adress 661 ; Returns : none 662 ; Preserve: all registers 663 ; ######################################################################### 664 DriveIO_LoadSector Proc Near Uses ax bx ds si es di ; Rousseau: Disk IO 331 665 test cs:[CurIO_UseExtension], 1 332 666 jz DIOLS_UseNormal 333 667 ; Are we forced do use LBA via Setting? 334 test cs:[CFG_ForceLBAUsage], 1 668 test cs:[CFG_ForceLBAUsage], 1 ; Rousseau: LBA 335 669 jnz DIOLS_UseExtension 336 670 ; Is the drive not a harddrive? … … 351 685 pop es 352 686 mov bx, si ; ES:BX - Destination 353 mov ax, 0201h ; Function 2 - Load Sector 687 mov ax, 0201h ; Function 2 - Load Sector ; Rousseau: Disk IO -- legacy BIOS call 354 688 int 13h 355 689 jnc DIOLS_Success … … 370 704 pop ds 371 705 mov si, offset DriveIO_DAP 372 mov ah, 42h ; Extended Read 706 mov ah, 42h ; Extended Read ; Rousseau: Disk IO -- extended BIOS call 373 707 int 13h 374 708 pop cx … … 381 715 DriveIO_LoadSector EndP 382 716 383 Comment *ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 384 Routine: Writes DS:SI to a specified sector385 ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ 386 Calling : bx:ax - Absolute sector387 cx:dx - Cylinder/Sector, Side/Drive (hi/lo-byte)388 ds:si - Source-Adress389 Returns : none390 Preserve: all registers391 ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ* 717 ; ######################################################################### 718 ; Routine: Writes DS:SI to a specified sector 719 ; ######################################################################### 720 ; Calling : bx:ax - Absolute sector 721 ; cx:dx - Cylinder/Sector, Side/Drive (hi/lo-byte) 722 ; ds:si - Source-Adress 723 ; Returns : none 724 ; Preserve: all registers 725 ; ######################################################################### 392 726 DriveIO_SaveSector Proc Near Uses ax bx cx ds si es di 393 727 test cs:[CurIO_UseExtension], 1 394 728 jz DIOSS_UseNormal 395 729 ; Are we forced do use LBA via Setting? 396 test cs:[CFG_ForceLBAUsage], 1 730 test cs:[CFG_ForceLBAUsage], 1 ; Rousseau: LBA 397 731 jnz DIOSS_UseExtension 398 732 ; Is the drive not a harddrive? … … 440 774 ret 441 775 DriveIO_SaveSector EndP 776 777 778 ; See if a LVM-sector is valid. 779 ; In : si, pointer to sector 780 ; Out : ZF=true, not valid; ZF=false, valid 781 DriveIO_LVMSectorValid Proc Near 782 pusha 783 784 call LVM_CheckSectorSignature 785 mov al,0 786 rcl al,1 ; Move CY to AL.0 787 call AuxIO_TeletypeHexByte 788 call AuxIO_TeletypeNL 789 or al,al ; Zero if not a valid sector 790 jz DriveIO_LVMSectorValid_End ; Not a valid sector 791 792 call LVM_CheckSectorCRC 793 stc 794 mov al,0 795 rcl al,1 ; Move CY to AL.0 796 call AuxIO_TeletypeHexByte 797 call AuxIO_TeletypeNL 798 or al,al ; Zero if not a valid sector 799 800 DriveIO_LVMSectorValid_End: 801 802 popa 803 ret 804 DriveIO_LVMSectorValid EndP 805 806 ; ------------------------------------------------------ 807 ; Rousseau: # Load the master LVM-sector is one exists # 808 ; ------------------------------------------------------ 809 ; Load the master LVM-sector to get the number of sectors per track as eCS views the drive. 810 ; If no master LVM-sector is found it is assumed eCS is not installed. 811 ; The master LVM-sector can be located at three different places according to drive size 812 ; and partitioning scheme and driver used. 813 ; When DANIS506.ADD is used, the eCS extended geometry will be 255/127 for drives >502GiB but <1TiB. 814 ; Then the location will be sector 127 which is LBA 126 (7Eh). 815 ; IBM1S506.ADD will always use 255/255 for the extended eCS geometry. 816 ; DANIS506.ADD will use 255/255 for drives >1TiB. 817 ; Then the location of the master LVM-sector will be 255 which is LBA 254 (FEh). 818 ; When eCS is installed on a huge drive that alread had a system on it, eCS will be confined to the 819 ; lower 502GiB of the drive. In this case the normal geometry from Int13X will be used. 820 ; This is also the case when no valid master LVM-sector can be found. 821 ; 822 ; Return ZF=true if not found, ZF=false when valid master LVM-sector found. 823 DriveIO_LoadMasterLVMSector Proc Near 824 pusha 825 826 mov si,offset db_lmlvm 827 ;call AuxIO_Print 828 829 mov al,dl 830 ;call AuxIO_TeletypeHexByte 831 ;call AuxIO_TeletypeNL 832 833 834 ; Loop over the sector-translation table, 835 ; process the first three values from high (255) to low (bios spt, most likely 63) 836 mov cx,3 837 DriveIO_LoadMasterLVMSector_NextTry: 838 mov bx,offset secs_per_track_table ; sector translation table that corresponds with IsHugeDrive 839 mov si, offset LVMSector ; space to load the master LVM-sector 840 mov [DriveIO_DAP_NumBlocks],1 ; number of sectors to read 841 mov wptr [DriveIO_DAP_Transfer+0],si ; low part of transfer address 842 mov ax, ds 843 mov wptr [DriveIO_DAP_Transfer+2],ax ; high part of transfer address 844 mov ax,cx ; use the counter... 845 dec ax ; as an index into the table 846 xlatb ; translate to number of sectors 847 dec al ; LBA is zero-based, so adjust 848 849 IFDEF AuxDebug 850 ; Dump the value 851 ;call AuxIO_TeletypeHexByte 852 ;call AuxIO_TeletypeNL 853 ENDIF 854 855 mov wptr [DriveIO_DAP_Absolute+0],ax ; LBA low ; 856 mov wptr [DriveIO_DAP_Absolute+2],00h ; LBA high 857 mov si, offset DriveIO_DAP ; address request packet 858 mov ah, 42h 859 int 13h ; do the i/o 860 jc DriveIO_LoadMasterLVMSector_NotFound ; oops, there was an error 861 862 IFDEF AuxDebug 863 ; Dump title 864 mov si,offset db_masterlvm 865 ;call AuxIO_Print 866 867 ; Dum sector 868 mov si, offset LVMSector 869 ;call AuxIO_DumpSector 870 ;call AuxIO_TeletypeNL 871 ENDIF 872 ; See is this is a valid LVM-sector 873 call DriveIO_LVMSectorValid 874 875 IFDEF AuxDebug 876 pushf 877 ;call AuxIO_TeletypeNL 878 popf 879 ENDIF 880 ; Yep, we found the master LVM-sector 881 jnz DriveIO_LoadMasterLVMSector_Found 882 ; Try next location 883 loop DriveIO_LoadMasterLVMSector_NextTry 884 885 ; No master LVM-sector found, set ZF=true 886 DriveIO_LoadMasterLVMSector_NotFound: 887 xor ax,ax 888 889 ; Jump here with ZF=false if found 890 DriveIO_LoadMasterLVMSector_Found: 891 892 popa 893 ret 894 DriveIO_LoadMasterLVMSector Endp 895 896 897 898 899 ; --------------------------------------------------- 900 ; Rousseau ## Large drives, (eCS) geometry and LBA ## 901 ; --------------------------------------------------- 902 ; A sector size of 512 bytes is assumed in the below calculations. 903 ; Note that this scheme changes when the sector size will be 4096 or larger, 904 ; like with modern drives that do not translate to 512 bytes per sector anymore. 905 ; These drives will have a capacity above the 2TiB LBA32 boundary. 906 ; For now, we assume drives <=2TiB with a sector size of 512 bytes. 907 908 ; There are a few boundaries that are of importance. 909 ; Note that these are disk-boundaries and not partition boundaries. 910 ; Even with a small partition, like <502GiB, OS/2 will use extended geometry on an 911 ; empty huge disk. 912 ; These boundaries are (from high to low): 913 914 ; (code 5) 915 ; 2^32 = 4294967296 = 100000000 sectors = 2048 GiB 916 ; This is the LBA32 2TiB boundary. 917 ; Everything above it must be addressed using LBA48. 918 ; OS/2 can currently not address this space above. 919 920 ; (code4) 921 ; 65536*255*255 = 4261478400 = FE010000 sectors ~ 2032 GiB 922 ; This is the max OS/2 boundary using 255/255 extended geometry. 923 ; OS/2 can currently not address this space above. 924 925 ; (code 3) 926 ; 2^31 = 2147483648 = 80000000 sectors = 1024 GiB 927 ; This is the LBA32 1TiB boundary. 928 ; OS/2 can address this space and will use 255/255 extended geometry. 929 930 ; (code 2) 931 ; 65536*255*127 = 2122383360 = 7E810000 sectors ~ 1012 GiB 932 ; This is the DANI 1TiB boundary. 933 ; OS/2 can address this space and will use 255/255 extended geometry. 934 ; Below this DANI will use 255/127 extended geometry. 935 ; This matters on where the LVM-sectors are located ! 936 937 ; (code 1) 938 ; 65536*255*63 = 1052835840 = 3EC10000 sectors ~ 502 GiB 939 ; This is the current OS/2 limit using this geometry because OS/2 can currently 940 ; not address more than 65536 cylinders. 941 ; DANI will address space above with 255/127 extended geometry up until the DANI 1TiB boundary (code 2) 942 943 ; (code 0) 944 ; Everything below 65536*255*63 will be addressed using standard geometry. 945 946 947 ; 948 ; This function will return the following values: 949 ; 950 951 ; 5 = This drive is above the 2^32 LBA32 (2TB) boundary and has more than 4294967296 sectors. 952 ; LBA48 addressing is needed to access the complete capacity of the drive. 953 ; OS/2 is currently unable to do so. 954 955 ; 4 = This drive is above the 65536*255*255 (4261478400) boundary but below 2^32. 956 ; This is an OS/2 boundary and OS/2 is not able to access the drive above this boundary. 957 958 ; 3 = This drive is above the 2^31 (1TB) boundary and has more than 2147483648 sectors. 959 ; OS/2 is able to access the drive using it's extended geometry. 960 ; Both DANIS506 and IBM1S506 will use the 255/255 scheme. 961 962 ; 2 = This drive is above the 65536*255*127 (2122383360) boundary but below 2^31. 963 ; OS/2 is able to access the drive using it's extended geometry. 964 ; Both DANIS506 and IBM1S506 will use the 255/255 scheme. 965 966 ; 1 = This drive is above the 65536*255*63 (1052835840) boundary but below 65536*255*127. 967 ; OS/2 is able to access the drive using it's extended geometry. 968 ; Note that DANIS506 will use 255/127 and IBM1S506 will use 255/255 geometry ! 969 ; Using DANI or IBM influences the location of the LVM info-sectors ! 970 971 ; 0 = This drive is below the 65536*255*63 (1052835840) boundary. 972 ; OS/2 is able to access this drive using the standard 255/63 geometry. 973 974 ; So, any return value >0 means OS/2 extended geometry will be used. 975 ; Value 1 will use 255/127 with DANIS506 but 255/255 with IBM1S506. 976 ; Values 2 and 3 will use 255/255 on both drivers. 977 ; You can or with 0x01 and check for 3 in this case. 978 ; Any value above 3 will be a drive who's capacity cannot be fully used by OS/2 979 ; The upper limit of 65536*255*255 will be in effect here. 980 981 ; Note this function currently handles the boot-drive only ! 982 ; It should be extended and use dl for the drive-number as a parameter. 983 ; Because we use this function to get this info in a number of places, 984 ; all regs and flags except AX are saved and restored. 985 986 ; DL contains BIOS disk-number; 80h for first, 81h for second, etc. 987 DriveIO_GatherDiskInfo Proc Near 988 pushf 989 push bx 990 push cx 991 push dx 992 push si 993 push di 994 push es 995 996 ; Set ES to CS for buffer clearing 997 push cs 998 pop es 999 1000 ; Clear the buffer 1001 ; Don't overwrite the word of the buffersize at index 0 ! 1002 ; Old Phoenix BIOSses require word (flags) at 02 to be zero, 1003 ; so we clear the whole buffer to be sure. 1004 mov cx, i13xbuf_size 1005 mov di, offset i13xbuf 1006 mov [di],cx 1007 inc di 1008 inc di 1009 xor ah,ah 1010 cld 1011 rep stosb 1012 1013 ; Get the drive parameters 1014 mov ah, 48h ; Get Drive Parameters (extended version) 1015 ;mov dl, 80h ; Drive number 1016 mov si, offset i13xbuf ; Buffer for result-info 1017 push dx 1018 int 13h ; Call the BIOS-function 1019 pop dx 1020 1021 ; Do some error-checking 1022 or ah,ah ; AH is zero if no error (ZF=1 if no error) 1023 mov ax,0 ; Setup code for non-huge drive (does not influence ZF) 1024 jz DriveIO_GatherDiskInfo_ok ; Return if error (AL<>0 thus ZF=0) but CY not set, assuming non-huge drive 1025 jnc DriveIO_GatherDiskInfo_ok ; Return if error (CY=1), assuming non-huge drive 1026 jmp DriveIO_GatherDiskInfo_ret 1027 1028 1029 DriveIO_GatherDiskInfo_ok: 1030 1031 ; 1032 ; Store the drive geometry 1033 ; 1034 1035 mov si, offset i13xbuf 1036 1037 xor dh,dh 1038 and dl,01111111b 1039 shl dx,1 1040 shl dx,1 1041 1042 ; Store number of cylinders on disk 1043 mov bx, offset BIOS_Cyls 1044 add bx,dx 1045 mov ax,[si+04h] 1046 1047 mov word ptr [bx+00],ax 1048 mov ax,[si+06] 1049 mov word ptr [bx+02],ax 1050 1051 ; Store number of heads per cylinder 1052 mov bx, offset BIOS_Heads 1053 add bx,dx 1054 mov ax,[si+08h] 1055 mov word ptr [bx+00],ax 1056 mov ax,[si+0ah] 1057 mov word ptr [bx+02],ax 1058 1059 ; Store number of sectors per track 1060 mov bx, offset BIOS_Secs 1061 add bx,dx 1062 mov ax,[si+0ch] 1063 mov word ptr [bx+00],ax 1064 1065 ; Update first byte of translation-table to conform to BIOS SPT 1066 mov byte ptr [secs_per_track_table], al 1067 1068 mov ax,[si+0eh] 1069 mov word ptr [bx+02],ax 1070 1071 ; Store total secs 1072 mov bx, offset BIOS_TotalSecs 1073 add bx,dx 1074 add bx,dx 1075 mov ax,[si+10h] 1076 1077 mov word ptr [bx+00],ax 1078 mov ax,[si+12h] 1079 mov word ptr [bx+02],ax 1080 mov ax,[si+14h] 1081 mov word ptr [bx+04],ax 1082 mov ax,[si+18h] 1083 mov word ptr [bx+06],ax 1084 1085 ; Store number of bytes per sector 1086 mov bx, offset BIOS_Bytes 1087 add bx,dx 1088 mov ax,[si+18h] 1089 mov [bx],ax 1090 1091 1092 ; 1093 ; See of it's a huge drive of not 1094 ; 1095 1096 ; Drive is larger than 2TiB 1097 mov ax,5 ; Drive code (5) 1098 mov bx, [si+14h] ; Low word of high dword of sector-count 1099 or bx, [si+16h] ; High word of high dword of sector-count 1100 jnz DriveIO_GatherDiskInfo_ret ; If non-zero we have a drive with >2^32 sectors and thus LBA48 addressing 1101 1102 ; Drive is larger than max OS/2 capacity 1103 dec ax ; Drive code (4) 1104 mov bx, [si+12h] ; High word of low dword of sector-count 1105 cmp bx, 0fe01h ; Boundary 1106 jae DriveIO_GatherDiskInfo_ret ; If above or equal to boundary, 1107 ; we have a drive larger than to 65536*255*255 = FE010000 sectors 1108 1109 ; Drive can be completely utilized by OS/2 1110 dec ax ; Drive code (3) 1111 cmp bx, 8000h ; Boundary 1112 jae DriveIO_GatherDiskInfo_ret ; If above or equal to boundary, 1113 ; we have a drive larger than 2^31 sectors but smaller than 65536*255*255 1114 1115 ; This is the small area between DANI 1TiB and LBA 1TiB 1116 dec ax ; Drive code (2) 1117 cmp bx, 7e81h ; Boundary 1118 jae DriveIO_GatherDiskInfo_ret ; If above or equal to boundary, 1119 ; we have a drive larger than 65536*255*127 but <65536*255*255 1120 ; DANIS506.ADD will use 255/255 extended geometry 1121 1122 ; DANI will use 255/127 in this area, this could impact the location of LVM-sectors ! (last sec on track) 1123 dec ax ; Drive code (1) 1124 cmp bx, 3ec1h ; Boundary 1125 jae DriveIO_GatherDiskInfo_ret ; If above or equal to boundary, 1126 ; we have a drive larger than 65536*255*63 sectors (OS/2 502GiB Limit!) 1127 ; DANIS506.ADD will use 255/127 extended geometry ! 1128 ; IBM1S506.ADD will use 255/255 extended geometry ! 1129 1130 ; We have a drive that can be addressed using standard 255/63 geometry 1131 dec ax ; Drive code (0) 1132 ; We have a drive smaller than 65536*255*63 = 3EC10000 sectors 1133 1134 DriveIO_GatherDiskInfo_ret: 1135 pop es 1136 pop di 1137 pop si 1138 pop dx 1139 pop cx 1140 pop bx 1141 1142 mov [CurIO_UseExtension],1 1143 1144 popf 1145 ret 1146 DriveIO_GatherDiskInfo EndP 1147 1148 1149 1150 ; Values for sectors per track table corresponding to DriveIO_IsHugeDrive return value. 1151 secs_per_track_table: db 63,127,255,255,255,255 1152 1153 db_lmlvm: db 'Load Master LVM -- disk: ',0 -
tags/v1.07r/BOOTCODE/REGULAR/OTHER.ASM
r29 r30 20 20 ;--------------------------------------------------------------------------- 21 21 22 IFDEF ModuleNames 23 DB 'OTHER',0 24 ENDIF 25 22 26 ; In: DS:SI - Pointer to begin of string 23 27 ; CX - Len of string … … 72 76 dec dh 73 77 jnz GLOSS_StringsLoop 74 movzx cx, dl 78 ;movzx cx, dl 79 mov cl,dl 80 mov ch,0 81 75 82 ret 76 83 GetLenOfStrings EndP … … 87 94 mov VideoIO_Segment, VideoIO_Page0 88 95 96 ; Don't use blinking attribute 97 call VideoIO_NoBlinking 98 99 ; Get HardDriveCount 100 call DriveIO_GetHardDriveCount 101 102 103 ; Rousseau: added 104 call VideoIO_ClearScreen 105 106 ; Cursor to upper-left 107 mov TextPosX, 0 108 mov TextPosY, 0 109 call VideoIO_CursorSet 110 111 ;mov ax, VideoIO_Page1 112 ;call VideoIO_BackUpTo ; Copy BIOS POST to Second Page 113 114 ; Copyright 115 mov si, offset Copyright 116 call MBR_Teletype 117 xor si,si 118 call MBR_TeletypeNL 119 120 121 ;call SOUND_Beep 122 123 ; Build Date 124 mov si, offset BUILD_DATE 125 call MBR_TeletypeNL 126 127 ; Initialize the com-port for debugging 128 call AuxIO_Init 129 130 xor si,si 131 call MBR_TeletypeNL 132 133 xor cx,cx 134 PRECRAP_Main_next_disk: 135 136 mov dl,cl 137 or dl,80h 138 139 call DriveIO_GatherDiskInfo ; Also used to fill the geo, should be separate function 140 141 mov bx,offset HugeDisk 142 add bx,cx 143 mov [bx], al 144 145 call DriveIO_LoadMasterLVMSector ; returns ZF=1 if no valid LVM record found 146 147 pushf 148 mov bx, offset TrueSecs 149 add bx,cx 150 add bx,cx 151 add bx,cx 152 add bx,cx 153 popf 154 155 ; bx now contains pointer to truesecs for this drive 156 157 jz NoValidMasterLVM 158 159 mov si,offset LVMSector 160 mov ax,[si+LocLVM_Secs] 161 mov word ptr [bx],ax 162 jmp SkipUseBiosSecs 163 164 165 NoValidMasterLVM: 166 push bx ; push truesecs pointer 167 mov bx, offset BIOS_Secs 168 add bx,cx 169 add bx,cx 170 add bx,cx 171 add bx,cx 172 173 mov ax,[bx] ; get biossecs 174 pop bx 175 mov word ptr [bx],ax ; store bios secs in truesecs 176 177 178 SkipUseBiosSecs: 179 inc cx 180 cmp cl,[TotalHarddiscs] 181 jb PRECRAP_Main_next_disk 182 183 184 185 IFDEF AuxDebug 186 ; Write some debug-info to the com-port 187 call DEBUG_Dump1 188 ENDIF 189 190 ; jz NoValidMasterLVM 191 192 193 ; A valid Master LVM has been found. 194 ; We use the values in here to determine the number of sectors per track, 195 ; since this could be OS/2 extended geometry. 196 197 ; jmp Continue1 198 199 200 ;mov word ptr [LOG_Secs],63 201 202 mov al,[HugeDisk] ;; fout, moet nog index bij 203 call AuxIO_TeletypeHexByte 204 call AuxIO_TeletypeNL 205 206 mov ax,word ptr [TrueSecs] ;; fout, moet nog index bij 207 call AuxIO_TeletypeHexWord 208 call AuxIO_TeletypeNL 209 210 211 212 ; Huge Disk indicator 213 mov si, offset HugeBootDisk 214 call MBR_Teletype 215 mov al,[HugeDisk] 216 mov si, offset No 217 test al,al 218 jz MBR_HugeDriveIndicator 219 mov si, offset Yes 220 221 MBR_HugeDriveIndicator: 222 call MBR_Teletype 223 xor si,si 224 call MBR_TeletypeNL 225 226 227 228 229 230 ; 231 ; Phase 1 Indicator 232 ; 233 mov si, offset Phase1 234 call MBR_Teletype 235 236 mov si, offset eCS_InstallVolume 237 mov al, [si] 238 test al,al ; See if phase 1 is active 239 jnz MBR_Main_BootThrough 240 mov si, offset NotActive 241 242 MBR_Main_BootThrough: 243 call MBR_TeleType 244 xor si,si 245 call MBR_TeletypeNL ; ALP barks undefined symbol; must use prototypes ? 246 247 89 248 ; Calculate Cooper-Bar Tables 90 249 call FX_CalculateTables … … 108 267 109 268 call PRECRAP_CheckFor13extensions 269 110 270 IFNDEF ReleaseCode 111 271 ret 112 272 ENDIF 273 113 274 call PRECRAP_CheckConfiguration 275 114 276 ; ======================================= 115 277 ; Checks for MBR Virii :) I love that job … … 123 285 call VIRUS_CheckForVirus 124 286 PCM_NoVirusDetection: 287 288 125 289 ; ============================================ 126 290 ; Delay for some time and get Strg/Alt State … … 132 296 jz PCM_LongDelay 133 297 PCM_ShortDelay: 298 134 299 mov al, 13 ; shorten delay,if floppy gets accessed 135 300 PCM_LongDelay: 301 136 302 call TIMER_WaitTicCount 303 137 304 ; First check, if any normal key got pressed... 138 305 mov ah, 1 … … 143 310 call MBR_Teletype 144 311 mov al, 54 ; about 3 seconds, delay again 312 145 313 call TIMER_WaitTicCount 314 146 315 PCM_NoNormalKeyPressed: 147 316 ; Now get keyboard Strg/Alt State … … 156 325 ret 157 326 PRECRAP_Main EndP 327 328 158 329 159 330 AFTERCRAP_Main Proc Near Uses … … 209 380 jmp MBR_HaltSystem 210 381 PRECRAP_CheckConfiguration EndP 382 383 384 ; Rousseau: added 385 ; In: SI - Pointer to begin of string (EOS is 0) 386 ; Destroyed: SI 387 ; Fixme: Uses double writes to use attribute with teletype-function. 388 MBR_TeletypeBold Proc Near Uses ax bx cx 389 MBRT_LoopBold: 390 lodsb 391 or al, al 392 jz MBRT_EndBold 393 push ax 394 mov ah,09h 395 mov bx,15 396 mov cx,1 397 int 10h 398 pop ax 399 mov ah,0eh 400 mov bx,7 ; Does not do anything in text-modus 401 mov cx,1 402 int 10h 403 jmp MBRT_LoopBold 404 MBRT_EndBold: 405 ret 406 MBR_TeletypeBold EndP 407 408 ; In: SI - Pointer to begin of string (EOS is 0) 409 ; Destroyed: SI 410 ; Fixme: Uses double writes to use attribute with teletype-function. 411 MBR_TeletypeVolName Proc Near Uses ax bx cx 412 mov cx, 11 413 MBRT_LoopVolName: 414 mov dx,cx ; Backup counter 415 lodsb 416 or al, al 417 jz MBRT_EndVolName 418 push ax 419 mov ah,09h 420 mov bx,15 421 mov cx,1 422 int 10h ; DX is preserved 423 pop ax 424 mov ah,0eh 425 mov bx,7 ; Does not do anything in text-modus 426 mov cx,1 427 int 10h ; DX is preserved 428 mov cx,dx ; Restore counter 429 loop MBRT_LoopVolName 430 MBRT_EndVolName: 431 ret 432 MBR_TeletypeVolName EndP 433 434 ; Rousseau: added 435 ; Move cursor to next line 436 ; Just do a new-line if SI==0 437 MBR_TeletypeNL Proc Near Uses ax bx cx 438 test si,si 439 jz MBR_TeletypeNL_NL 440 call MBR_Teletype 441 MBR_TeletypeNL_NL: 442 push si 443 mov si, offset NL 444 call MBR_Teletype 445 pop si 446 ret 447 MBR_TeletypeNL EndP 448 449 ; Sync teletype position to VideoIO 450 MBR_TeletypeSyncPos Proc Near Uses ax bx cx dx 451 pushf 452 mov bh, 0 453 mov ah, 02h 454 mov dh,[TextPosY] 455 mov dl,[TextPosX] 456 int 10h 457 popf 458 ret 459 MBR_TeletypeSyncPos EndP -
tags/v1.07r/BOOTCODE/REGULAR/PARTMAIN.ASM
r29 r30 20 20 ;--------------------------------------------------------------------------- 21 21 22 IFDEF ModuleNames 23 DB 'PARTMAIN',0 24 ENDIF 25 22 26 PART_FixUpDefaultPartitionValues Proc Near Uses dx si di 23 27 ; Fix-Up Default and Last Partition - If lost, search for Bootable … … 140 144 ; Copies the device-name to the Resume-BIOS IPT entry 141 145 PART_UpdateResumeBIOSName Proc Near Uses ax bx cx si di 142 movzx bx, CFG_ResumeBIOSbootSeq 146 ;movzx bx, CFG_ResumeBIOSbootSeq 147 mov bl,CFG_ResumeBIOSbootSeq 148 mov bh,0 149 143 150 dec bx 144 151 shl bx, 1 … … 213 220 ; PCMPP_NoLinuxKernels: 214 221 215 movzx cx, CFG_Partitions ; LocIPT_MaxPartitions 222 ;movzx cx, CFG_Partitions ; LocIPT_MaxPartitions 223 mov cl,CFG_Partitions ; LocIPT_MaxPartitions 224 mov ch,0 225 216 226 or cx, cx 217 227 jz PCMPP_NoPartitions … … 240 250 je PGPP_IsBIOSbootSeq ; FEh -> Resume BIOS boot Sequence 241 251 ja PGPP_IsFloppy ; FFh -> Floppy 242 movzx bx, dl 252 ;movzx bx, dl 253 mov bl,dl 254 mov bh,0 255 243 256 shl bx, 1 244 257 mov si, wptr [PartitionPointers+bx] … … 278 291 ; Out: DL - Number of partition in straight view 279 292 PART_ConvertToStraight Proc Near Uses 280 movzx bx, dl 281 shl bx, 1 282 mov ax, wptr cs:[PartitionPointers+bx] 293 ;movzx bx, dl 294 mov bl,dl ; partition number to bl 295 mov bh,0 ; zero extend to word 296 297 shl bx, 1 ; convert to word index 298 mov ax, wptr cs:[PartitionPointers+bx] ; get the partition pointer 283 299 cmp ax, offset FloppyIPTentry 284 300 jb PCTS_IsBIOSbootSeq … … 315 331 PCFS_IsPartition: 316 332 ; First we get Partition-Offset in AX 317 movzx ax, dl 333 ;movzx ax, dl 334 mov al,dl 335 mov ah,0 336 318 337 mov bl, LocIPT_LenOfIPT 319 338 mul bl … … 354 373 mov bl, LocIPT_LenOfIPT 355 374 div bl ; Divide with IPTlength 356 movzx bx, al 375 ;movzx bx, al 376 mov bl,al 377 mov bh,0 378 357 379 shl ax, 1 358 380 shl bx, 2 … … 409 431 dec di ; Go to previous char 410 432 jmp PFOSE_DigitLoop 411 433 412 434 PFOSE_EndOfDigitLoop: 413 435 ret 414 436 PART_FillOutSizeElement EndP 437 438 439 440 441 ; ################### 442 ; # START PARTITION # 443 ; ################### 415 444 416 445 ; Starts Partition DL from Internal Partition Table. … … 454 483 mov di, offset TXT_BootingNowPartName 455 484 jz PSP_NoName 456 rep movsb 485 rep movsb ; Copy label-name to boot 457 486 PSP_NoName: 458 487 xor al, al 459 488 stosb ; Ending Zero 460 mov si, offset TXT_BootingNow1 489 mov si, offset TXT_BootingNow1 ; "Booting the system using " 461 490 call MBR_Teletype 462 491 ; [Linux support removed since v1.02] … … 484 513 IFDEF ReleaseCode 485 514 ; Save configuration on HDD boots (save CFG_PartLast) 486 call DriveIO_SaveConfiguration 515 call DriveIO_SaveConfiguration ; Rouaaseu: SAVE CONFIGURATION ! 487 516 ENDIF 488 517 call MBR_Teletype ; Prints out BootingNow2 including PartitionName … … 496 525 mov dh, bptr [si+LocIPT_LocationPartTable+0] 497 526 mov dl, [si+LocIPT_Drive] 498 call DriveIO_LoadPartition ; Load Table... 527 call DriveIO_LoadPartition ; Load Table... ; Rousseau: LOAD PARTITION ! 499 528 ; --------------------------------------------------- MODIFY PARTITION TABLE 500 529 push cs … … 536 565 or byte ptr es:[di+LocBRPT_Flags], 80h ; set ACTIVE partition 537 566 IFDEF ReleaseCode 538 call DriveIO_SavePartition ; Saves the Partition-Table 567 call DriveIO_SavePartition ; Saves the Partition-Table ; Rousseau: SAVE PARTITION ! 539 568 ENDIF 540 569 … … 549 578 ; BX:AX -> Absolute End-Position of Partition 550 579 551 test CFG_ForceLBAUsage, 1 580 test CFG_ForceLBAUsage, 1 ; Rousseau: LBA 552 581 jnz PSP_ForceI13X 553 ; LBA-boundary at 16450560 (FB0400h) 582 ; LBA-boundary at 16450560 (FB0400h) (16320x16x63) 554 583 cmp bx, 00FBh 555 584 jb PSP_NoI13X 556 585 PSP_ForceI13X: 557 push es di 586 push es di si 558 587 mov ax, 3000h 559 588 mov es, ax 560 589 xor di, di 590 ; Blokkeert starten van IBM BM !! 561 591 mov wptr es:[di], '1I' 562 592 mov wptr es:[di+2], 'X3' 563 pop di es 593 594 ;mov si,3000h 595 ;call AuxIO_DumpSector 596 597 pop si di es 564 598 PSP_NoI13X: 565 599 … … 607 641 mov cx, 0001h ; Cylinder 0, Sector 1 608 642 mov dx, 0080h ; First HD, Head 0 609 call DriveIO_LoadPartition ; Load Primary Partition Table 643 call DriveIO_LoadPartition ; Load Primary Partition Table ; Rousseau: LOAD MBR ! 610 644 call PART_MarkFirstGoodPrimary 611 645 IFDEF ReleaseCode 612 call DriveIO_SavePartition ; Saves the Partition-Table 646 call DriveIO_SavePartition ; Saves the Partition-Table ; Rousseau: SAVE MBR ! 613 647 ENDIF 614 648 PSP_NoHideAdjustPrimaryMark: … … 622 656 test byte ptr [si+LocIPT_Flags], Flags_DriveLetter 623 657 jz PSP_NoLVMReassignment 624 movzx bx, BootPartNo ; EntryNumber is straight view 658 ;movzx bx, BootPartNo ; EntryNumber is straight view 659 mov bl,BootPartNo ; EntryNumber is straight view 660 mov bh,0 661 625 662 mov al, bptr [DriveLetters+bx] 626 663 sub al, 3Dh ; Convert e.g. 80h -> 'C' … … 679 716 mov dh, [si+LocIPT_LocationBegin+0] 680 717 mov dl, [si+LocIPT_Drive] 681 call DriveIO_LoadPartition ; Loads boot-sector... 718 call DriveIO_LoadPartition ; Loads boot-sector... ; Rousseau: LOAD PART BOOT-SECTOR !! 682 719 683 720 test CFG_DetectVIBR, 1 … … 734 771 mov si, 10h*4 735 772 xor di, di ; INT 10h Vector to MBR Protection 736 movsd 773 ;movsd 774 movsw 775 movsw 776 737 777 mov si, 13h*4 ; INT 13h Vector to MBR Protection 738 movsd 778 ;movsd 779 movsw 780 movsw 781 739 782 mov al, CFG_IgnoreWriteToMBR ; Option to MBR Protection 740 783 stosb … … 753 796 PSP_NoMBRprotect: 754 797 cmp bptr [si+LocIPT_SystemID], 08 ; I hate Microsuck NTFS check 755 je PSP_NoSpecialSupport 798 799 ;je PSP_NoSpecialSupport 756 800 757 801 mov di, offset PartitionSector ; ES:DI - Actual Boot-Record … … 759 803 mov ax, wptr es:[di+24] 760 804 cmp ax, 003Fh ; Physical Layout-Sectors... Safety check 761 ja PSP_NoSpecialSupport 805 806 807 ; 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. 811 ; Offset van start-of-disk bij PCD7 niet meer dan 2GiB maken. 812 ; Special is needed to boot ECS-CXXVAC (log-part) on Douwskie Box with 40G disk. 813 ; FreeDOS 20G PRI SOD op 400G start niet met special. 814 ; Heeft drive-id op 26h (36d) van 0dh ! 815 ; WinXP werkt met special en not-special op 400G normal geo. 816 ; eCS op PRI op 2G met os2 ext geo werkt ook met beide. 817 ; eCS LOG werkt niet zonder special op 400G. 818 ; (hidden secs op 3F en moet 3F00 zijn; BM staat ervoor, 3F00=255*63+63) 819 ; Laatste 63 is MBR. 820 ; 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) 823 824 ; FreeDOS zet 63 in SPT in BPB op 255/255 geo !!!! 825 826 ; PC-DOS7 wil vaak niet starten als er meerdere pri's actief zijn. 827 ; Logo verschijnt wel maar start niet door. 828 829 830 ; Display volume-name 831 pushf 832 push si 833 add si, LocIPT_Name 834 call MBR_TeletypeVolName 835 xor si,si 836 call MBR_TeletypeNL ; Rousseau: Just before booting the selected partition 837 pop si 838 popf 839 840 841 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 ! 846 847 762 848 mov ax, wptr es:[di+26] 763 849 cmp ax, 00FFh ; Physical Layout-Heads... Safety check 764 850 ja PSP_NoSpecialSupport 765 851 mov al, bptr es:[di+36] 766 cmp al, 80h ; Drive Letter 852 cmp al, 80h ; Drive Letter (ID) 767 853 jne PSP_NoSpecialSupport 854 768 855 ; Special Support needed 856 special: 857 ; Write actual drive-letter to partition boot-record. 858 ; This is according to BPB. 769 859 mov al, bptr [si+LocIPT_Drive] 770 mov bptr es:[di+36], al ; Write Actual Drive-Letter 860 ; Also an influence with FreeDOS ! 861 ; Generates JFS ERROR when not set correctly !!! 862 mov bptr es:[di+36], al ; Write Actual Drive-Letter (80h id first drive) !!!!!!!!!!!!!!!!!!!!!!! 863 864 ; This could be incorrect when a partition is moved, 865 ; 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. 867 ; This fixing is done by OS/2 BM as well, according to Martin. 771 868 mov ax, [si+LocIPT_AbsoluteBegin] 772 mov wptr es:[di+28], ax ; Fixing Hidden Sectors count869 mov wptr es:[di+28], ax ; low word of hidden sectors 773 870 mov ax, [si+LocIPT_AbsoluteBegin+2] 774 mov wptr es:[di+30], ax ; Done by OS/2 BootMan as well...871 mov wptr es:[di+30], ax ; high word of hidden sectors 775 872 776 873 ; ------------------------------------------------ LOGICAL PARTITION SUPPORT 777 874 PSP_NoSpecialSupport: 875 876 ;jmp PSP_NoLogicalSupport 877 778 878 test byte ptr [si+LocIPT_Flags], Flags_DriveLetter 779 879 jz PSP_NoLogicalSupport 780 880 781 movzx bx, BootPartNo ; EntryNumber is straight view 881 ;movzx bx, BootPartNo ; EntryNumber is straight view 882 mov bl,BootPartNo ; EntryNumber is straight view 883 mov bh,0 884 782 885 mov al, bptr [DriveLetters+bx] 783 886 mov bptr es:[di+37], al ; Write Drive Letter (OS/2 only) … … 793 896 rep movsw 794 897 pop si 795 ; ---------------------------------------------------- NOW START BOOT-RECORD 898 ; ---------------------------------------------------- NOW START BOOT-RECORD ; Rousseau: START PARTITION BOOT-RECORD !! 899 900 901 IFDEF AuxDebug 902 ; call DEBUG_Dump2 903 ENDIF 904 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 926 927 ; 928 ; BYE BYE 929 ; 796 930 xor ax, ax 797 931 xor bx, bx … … 801 935 xor dh, dh ; Drive supported by BIOS 802 936 mov dl, cs:[si+LocIPT_Drive] ; Drive Physical No 937 803 938 IFDEF ReleaseCode 804 db 0EAh 939 db 0EAh ; JUMP TO Entry Point...Bye Bye 805 940 dw StartBasePtr 806 941 dw StartBaseSeg 807 942 ENDIF 808 943 PART_StartPartition EndP 944 945 946 947 948 949 950 951 952 953 809 954 810 955 ; This routine is called to hide a partition … … 923 1068 ; Destroyed: *none* 924 1069 PART_SearchFileSysName Proc Near Uses bx dx 925 movzx bx, al 1070 ;movzx bx, al 1071 mov bl,al 1072 mov bh,0 1073 926 1074 mov si, offset FileSysIDs 927 1075 PSFSN_SearchLoop: … … 943 1091 mov ah, dl 944 1092 ; AH is now the FileSystem-Flag 945 movzx bx, bh 1093 ;movzx bx, bh 1094 mov bl,bh 1095 mov bh,0 1096 946 1097 shl bx, 3 ; Offsets * 8 947 1098 mov si, offset FileSysNames 948 1099 add si, bx 949 ret 1100 ret 950 1101 PART_SearchFileSysName EndP 951 1102 … … 954 1105 ; Out: AL - Hidden File-System-ID 955 1106 PART_SearchFileSysHiddenID Proc Near Uses bx 956 movzx bx, al 1107 ;movzx bx, al 1108 mov bl,al 1109 mov bh,0 1110 957 1111 mov si, offset FileSysIDs 958 1112 PSFSHI_SearchLoop: … … 1019 1173 ret 1020 1174 PART_CheckForValidPartName EndP 1175 1176 1177 ; Rousseau: added 1178 ; Compare a volume-label in the IPT to the install-volume 1179 ; SI holds pointer to entry in IPT 1180 ; CY set if this entry is also the install-volume 1181 PART_IsInstallVolume Proc Near Uses ax cx dx si di 1182 cld ; Advance upwards with lodsb 1183 mov di, offset eCS_InstallVolume ; Address of install-volume label (max. 11 chars) 1184 1185 mov cx, 11 ; Maximum length of label 1186 xor dl, dl ; Not found yet 1187 1188 ; Compare next character 1189 PART_IsInstallVolumeNext: 1190 lodsb ; Load byte from SI (IPT-entry) 1191 ;cmp al,' ' ; If space then use zero 1192 ;jne PART_IsInstallVolume_skip1 1193 ;xor al,al 1194 PART_IsInstallVolume_skip1: 1195 xchg ah,al ; Save char to AH 1196 xchg si,di ; Exchange pointers 1197 lodsb ; Load byte from SI (install-volume label) 1198 ;cmp al,' ' ; If space then use zero 1199 ;jne PART_IsInstallVolume_skip2 1200 ;xor al,al 1201 PART_IsInstallVolume_skip2: 1202 xchg si,di ; Reexchange pointers 1203 call AuxIO_Teletype 1204 call CONV_ToUpper 1205 call AuxIO_Teletype 1206 xchg al,ah 1207 call AuxIO_Teletype 1208 call CONV_ToUpper 1209 call AuxIO_Teletype 1210 call AuxIO_TeletypeNL 1211 1212 ; Are both of them zero ? 1213 ; Then the names could be the same, but cx must not equal 11 1214 ; because that would indicate a null-string. 1215 mov dh,al 1216 or dh,ah 1217 jz PART_IsInstallVolumeFound 1218 1219 cmp ah,al ; Are the the same ? 1220 jnz PART_IsInstallVolumeNotFound ; Nope, compare ended 1221 loop PART_IsInstallVolumeNext ; Yep, Compare next character 1222 1223 PART_IsInstallVolumeFound: 1224 ; If CX is still 11 this was a zero string 1225 ; and thus not a valid volume-name. 1226 ; This should not occur as this function is only called when the first 1227 ; byte is non-zero. 1228 cmp cx,11 1229 je PART_IsInstallVolumeNotFound 1230 ; Found ! 1231 mov dl,1 ; Found 1232 jmp PART_IsInstallVolumeEnd 1233 1234 1235 PART_IsInstallVolumeNotFound: 1236 mov dl,0 1237 jmp PART_IsInstallVolumeEnd 1238 1239 1240 PART_IsInstallVolumeEnd: 1241 ; Set the status in CY 1242 mov al,dl 1243 add al,'0' 1244 call AuxIO_TeletypeHexByte 1245 call AuxIO_TeletypeNL 1246 rcr dl,1 ; Put found-flag in CY 1247 ret 1248 PART_IsInstallVolume EndP -
tags/v1.07r/BOOTCODE/REGULAR/PARTSCAN.ASM
r29 r30 20 20 ;--------------------------------------------------------------------------- 21 21 22 23 IFDEF ModuleNames 24 DB 'PARTSCAN',0 25 ENDIF 26 22 27 ; Note: This is complex code. So make sure that you know what you are doing in 23 28 ; here. … … 48 53 mov si, offset NewPartTable 49 54 mov di, offset PartitionTable 50 movzx ax, NewPartitions 55 ;movzx ax, NewPartitions 56 mov al,NewPartitions 57 mov ah,0 58 51 59 mov CFG_Partitions, al 52 60 mov bl, LocIPT_LenOfIPT … … 58 66 mov si, offset NewDriveLetters 59 67 mov di, offset DriveLetters 60 mov cx, LocIPT_MaxPartitions /261 rep movs w68 mov cx, LocIPT_MaxPartitions 69 rep movsb 62 70 63 71 ; [Linux support removed since v1.02] … … 82 90 or dl, dl 83 91 jz PSSFP_NoAutoDriveLetter 84 movzx cx, CFG_Partitions 92 ;movzx cx, CFG_Partitions 93 mov cl,CFG_Partitions 94 mov ch,0 95 85 96 or cx, cx 86 97 jz PSSFP_NoAutoDriveLetter … … 118 129 mov wptr [ExtendedAbsPos+2], ax 119 130 PSSDFP_LoadThisPartition: 120 call DriveIO_LoadPartition 131 132 call DriveIO_LoadPartition ; Rousseau: load a partition record 133 121 134 jc PSSDFP_InvalidPartition 135 122 136 ; LVM Support - Reads LVM Information Sector 123 call DriveIO_LoadLVMSector 137 call DriveIO_LoadLVMSector ; Rousseau: load LVM sector 138 124 139 call PARTSCAN_ScanPartition 125 140 IFDEF ReleaseCode … … 223 238 add ax, wptr [CurPartition_Location+0] ; +Partition-Absolute 224 239 adc bx, wptr [CurPartition_Location+2] ; sectors 225 call DriveIO_LoadTmpSector ; Loads Boot record 240 call DriveIO_LoadTmpSector ; Loads Boot record ; Rousseau: LOAD PARTITION BOOT RECORD !! 226 241 ; Sets up DS:SI - TmpSector 227 242 … … 249 264 cmp PartSystemID, 07h ; We got IFS here? 250 265 jne PCCTP_IFSdone 251 ; Check, if 'JFS ' is at DWORD offset 36h 266 ; Check, if 'JFS ' is at DWORD offset 36h ; Rousseau: JFS check (LVM / IPT?) 252 267 cmp wptr [si+36h], 'FJ' 253 268 jne PCCTP_IFSnoJFS … … 284 299 PCCTP_HasVolumeLetter: 285 300 ; Save VolumeLetter in separate table 286 movzx bx, NewPartitions ; NewPartitions is one behind here, so 301 ;movzx bx, NewPartitions ; NewPartitions is one behind here, so 302 mov bl,NewPartitions ; NewPartitions is one behind here, so 303 mov bh,0 304 287 305 mov [PartitionVolumeLetters+bx], al ; it's already a zero-based offset 288 306 ; Now copy VolumeID and VolumeName to temporary space … … 291 309 stosw 292 310 mov ax, [si+LocLVM_PartitionID+2] 293 stosw ; Set Serial-Field to LVM-VolumeID 311 stosw 312 ; Set Serial-Field to LVM-VolumeID 313 push di 294 314 add si, LocLVM_PartitionName 315 295 316 mov cx, 5 296 317 rep movsw ; Copy LVM-PartitionName to Temp Space 297 movsb ; (11 bytes in total) 318 movsb ; (11 bytes in total) 319 320 pop di 321 cmp PartSystemID, 0ah 322 323 jne PCCTP_NoIbmBm 324 mov si, offset ibm_bm_name 325 mov cx,5 326 rep movsw 327 movsb 328 329 330 331 PCCTP_NoIbmBm: 332 333 298 334 pop di si dx ax 299 335 mov si, offset MBR_NoName_Patched … … 304 340 pop di si dx ax 305 341 test ah, FileSysFlags_NoName ; No-Name-Flag ? -> No Partition Name 306 jnz PCCTP_ThereIsNoName ; available 342 343 jz PCCTP_ThereIsAName 344 jmp PCCTP_ThereIsNoName ; available 345 346 PCCTP_ThereIsAName: 347 307 348 ; We check for NTFS (got detected a little bit earlier in this routine) 308 349 cmp PartSystemID, 08h ; We got IFS/NTFS here? … … 312 353 add si, 2Bh ; DS:SI - Partition-Name 313 354 test ah, FileSysFlags_FAT32 ; FAT32 specific name getting ? 355 314 356 jz PCCTP_ResumeNormal 357 315 358 add si, 1Ch ; Fix for FAT 32, shiat 316 359 PCCTP_ResumeNormal: 317 360 mov cx, 11 ; 11 bytes length 318 361 call PART_CheckForValidPartName 319 jnc PCCTP_ThereIsNoName 362 jc PCCTP_ThereIsAName2 363 364 jmp PCCTP_ThereIsNoName 365 366 PCCTP_ThereIsAName2: 367 320 368 sub si, 4 ; DS:SI -> Serial&Name (15-Bytes) 321 369 xor ah, ah ; no Flags_NoPartName … … 343 391 repz cmpsb 344 392 pop di si 345 je PCCTP_Match 393 394 jne PCCTP_NoMatchYet 395 396 jmp PCCTP_Match 397 398 PCCTP_NoMatchYet: 399 346 400 PCCTP_SerialNameAlreadyFound: 347 401 add di, LocIPT_LenOfIPT … … 477 531 PCCTP_LocCompFailed: 478 532 jmp PCCTP_CompareFailed 479 533 480 534 ; ================================== 481 535 ; =MATCH=, found partition in IPT... … … 557 611 ; Calculate Pointer to IPT 558 612 mov di, offset NewPartTable ; ES:DI - NewPartTable 559 movzx ax, NewPartitions 613 ;movzx ax, NewPartitions 614 mov al,NewPartitions 615 mov ah,0 616 560 617 mov bl, LocIPT_LenOfIPT 561 618 mul bl … … 575 632 stosb 576 633 mov al, cl ; Partition-Flags from register... 577 stosb 634 stosb 578 635 mov ax, PartCRC ; BootRecordCRC... 579 636 stosw … … 620 677 621 678 ; Calculate Size of this partition and put it into separate table... 622 movzx ax, NewPartitions 679 ;movzx ax, NewPartitions 680 mov al,NewPartitions 681 mov ah,0 682 623 683 dec ax 624 684 mov bx, ax … … 658 718 ; Destroyed: None 659 719 PARTSCAN_DefXref Proc Near Uses ax bx cx dx si di 660 movzx bx, dl 720 ;movzx bx, dl 721 mov bl,dl 722 mov bh,0 723 661 724 mov bptr [PartitionXref+bx], dh ; X-Reference 662 725 ; Copy Hide-Config of IPT partition to new location in new table … … 673 736 rep movsb ; Copy Hide-Config to NewHideTable 674 737 ; Process Logical-Drive-Letter table as well... 675 movzx bx, dl 738 ;movzx bx, dl 739 mov bl,dl 740 mov bh,0 741 676 742 mov al, bptr [DriveLetters+bx] ; Get Drv-Letter from org. pos 677 movzx bx, dh 743 ;movzx bx, dh 744 mov bl,dl 745 mov bh,0 746 678 747 mov bptr [NewDriveLetters+bx], al ; Put Drv-Letter to new pos 679 748 ret … … 684 753 ; Destroyed: None 685 754 PARTSCAN_GetXref Proc Near Uses bx 686 movzx bx, dl 755 ;movzx bx, dl 756 mov bl,dl 757 mov bh,0 758 687 759 mov dh, bptr [PartitionXref+bx] ; X-Reference 688 760 ret … … 702 774 cmp al, 0FFh 703 775 je PSSHCWX_SyncEmpty 704 movzx bx, al 776 ;movzx bx, al 777 mov bl,al 778 mov bh,0 779 705 780 mov al, [PartitionXref+bx] ; Translate it 706 781 cmp al, 0FFh … … 729 804 ret 730 805 PARTSCAN_SyncHideConfigWithXref EndP 806 807 ibm_bm_name: db 'IBM BootMan',0 -
tags/v1.07r/BOOTCODE/REGULAR/PASSWORD.ASM
r29 r30 19 19 ; AiR-BOOT / PASSWORD 20 20 ;--------------------------------------------------------------------------- 21 22 IFDEF ModuleNames 23 DB 'PASSWORD',0 24 ENDIF 25 21 26 22 27 ; Don't ask me, what I'm doing in here to encode the passwords. I don't even … … 164 169 PE_ContinueLoop: 165 170 mov al, ds:[si] 166 movzx bx, ds:[si+8] 171 ;movzx bx, ds:[si+8] 172 mov bl,ds:[si+8] 173 mov bh,0 174 167 175 add bl, 16 168 176 mov ah, ds:[si+bx] -
tags/v1.07r/BOOTCODE/REGULAR/STD_TEXT.ASM
r29 r30 20 20 ;--------------------------------------------------------------------------- 21 21 22 IFDEF ModuleNames 23 DB 'STD_TEXT',0 24 ENDIF 25 22 26 ; If you modify this Copyright and release this under your own name, 23 27 ; I'm going to sue your cheap ass, rape your dog and blow up your house. =) 24 28 25 CopyrightVersionLen equ 5 26 Copyright db ' AiR-BOOT v1.06 - (c) 1998-2009 M. Kiewitz, Dedicated to Gerd Kiewitz', 0 27 BootEndMsg db 'Free usage allowed, as long as you dont or have not worked for US government', 0 28 BootEndMsg2 db 'This is GPLv3+ software. Please visit http://AiR-BOOT.sourceforge.net', 0 29 CopyrightVersionLen equ 6 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', 0 32 ;Copyright db ' AiR-BOOT v1.07 - (c) 2011 M. Kiewitz - Rousseau test-version >502G (build: #24)', 0 33 ;Copyright db ' AiR-BOOT v1.07 - (c) 2011 M. Kiewitz - Release Candidate 1 - (build: #25)', 0 34 ;Copyright db ' AiR-BOOT v1.07 - (c) 1998-2011 M. Kiewitz, Dedicated to Gerd Kiewitz (rc2-b27)', 0 35 ;Copyright db ' AiR-BOOT v1.07 - (c) 1998-2011 M. Kiewitz, Dedicated to Gerd Kiewitz (rc3-b31)', 0 36 ;Copyright db ' AiR-BOOT v1.07 - (c) 1998-2011 M. Kiewitz, Dedicated to Gerd Kiewitz (rc4-b33)', 0 37 ;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', 0 40 41 ; Rousseau: switch around 42 BootEndMsg db 'This is GPLv3+ software. Please visit http://AiR-BOOT.sourceforge.net', 0 43 BootEndMsg2 db 'http://www.gnu.org/licenses/gpl.txt', 0 44 45 AuxInitMsg db 'Initializing Serial Communications on COM',0 29 46 30 47 CheckID_MBR db 'AiRBOOT' … … 33 50 ; Colors for special words hard-coded. Keep all 0s. 34 51 TXT_SETUP_LowerMessage db 'This software is released under ', 0, 'GPLv3+.', 0 35 db 'It may not be used by US government', 0 52 ; db 'It may not be used by US government', 0 53 db 'http://www.gnu.org/licenses/gpl.txt', 0 36 54 db 'For more information and source, please visit', 0 37 55 db 'http://AiR-BOOT.sourceforge.net', 0 38 db 'Contact via e-mail: ', 0, 'm_kiewitz [AT] users.sourceforge.net', 0 56 ; db 'Contact via e-mail: ', 0, 'm_kiewitz [AT] users.sourceforge.net', 0 57 db 'Contact via e-mail: ', 0, 'airboot@ecomstation.com', 0 39 58 40 59 ContinueBIOSbootTable dw offset TXT_SETUP_MAGIC_CDROM -
tags/v1.07r/BOOTCODE/REGULAR/TIMER.ASM
r29 r30 20 20 ;--------------------------------------------------------------------------- 21 21 22 IFDEF ModuleNames 23 DB 'TIMER',0 24 ENDIF 25 22 26 ; This here is one of the rare cases that I'm using DIV and MUL opcodes. I 23 27 ; could have coded around them in here as well, but I was too lazy. Most of … … 39 43 ; Out: Nothing 40 44 TIMER_WaitTicCount Proc Near Uses ax bx dx 41 movzx bx, al 45 ;movzx bx, al 46 mov bl,al 47 mov bh,0 48 42 49 call TIMER_GetTicCount 43 50 add bx, ax ; BX - Required lower Tic … … 62 69 mul bl ; Result * 91 63 70 mov dx, ax 64 movzx ax, bh 71 ;movzx ax, bh 72 mov al,bh 73 mov ah,0 74 65 75 mov bl, 18 66 76 mul bl ; Remainder * 18 … … 80 90 div dl ; Tics : 91 81 91 mov dh, al 82 movzx ax, ah 92 ;movzx ax, ah 93 mov al,ah 94 mov ah,0 95 83 96 mov dl, 18 84 97 div dl ; Remainder : 18 … … 87 100 mov bl, 5 88 101 mul bl ; Result * 5 89 movzx dx, dh 102 ;movzx dx, dh 103 mov dl,dh 104 mov dh,0 105 90 106 add ax, dx ; Add both together... 91 107 ret -
tags/v1.07r/BOOTCODE/REGULAR/VIDEOIO.ASM
r29 r30 19 19 ; AiR-BOOT / VIDEO I/O 20 20 ;--------------------------------------------------------------------------- 21 22 IFDEF ModuleNames 23 DB 'VIDEOIO',0 24 ENDIF 21 25 22 26 VideoIO_WaitRetrace Proc Near Uses ax dx … … 32 36 ret 33 37 VideoIO_WaitRetrace EndP 38 39 34 40 35 41 ; Holds the current position. Yeah, I know this is in the code area, but who … … 100 106 mov ax, VideoIO_Segment 101 107 mov es, ax 102 movzx ax, TextPosY 108 ;movzx ax, TextPosY 109 mov al,TextPosY 110 mov ah,0 111 103 112 mov bl, 160 104 113 mul bl … … 169 178 VideoIO_FixedPrint EndP 170 179 180 ; Rousseau: 181 ; Turn off blinking 182 ; http://www.ctyme.com/intr/rb-0088.htm does not mention this 183 VideoIO_NoBlinking Proc Near Uses ax bx 184 mov bx,0 185 mov ax,1003h 186 int 10h 187 ret 188 VideoIO_NoBlinking EndP 189 171 190 ; In: AL - Single Char to Print 172 191 ; Destroyed: None … … 179 198 ret 180 199 VideoIO_PrintSingleChar EndP 200 201 202 203 ; Print hex-byte to screen 204 ; This outputs two characters 205 ; In: AL - byte to send 206 ; Out: AL - byte sent 207 ; Destroyed: None 208 VideoIO_PrintHexByte Proc Near Uses ax 209 call CONV_BinToAsc ; Returns high hex-nibble in AH, low hex-nibble in AL 210 xchg al,ah ; High hex-nibble first 211 call VideoIO_PrintSingleChar ; Output to screen 212 xchg al,ah ; Low hex-nibble next 213 call VideoIO_PrintSingleChar ; Output to screen 214 ret 215 VideoIO_PrintHexByte EndP 216 217 218 ; Print hex-word to screen 219 ; This outputs four characters 220 ; In: AX - word to send 221 ; Out: AX - word sent 222 ; Destroyed: None 223 VideoIO_PrintHexWord Proc Near 224 xchg al,ah ; High byte first 225 call VideoIO_PrintHexByte ; Output to screen 226 xchg al,ah ; low byte next 227 call VideoIO_PrintHexByte ; Output to screen 228 ret 229 VideoIO_PrintHexWord EndP 230 231 232 ; Print hex-dword to screen 233 ; This outputs eight characters 234 ; In: DX:AX - dword to send 235 ; Out: DX:AX - dword sent 236 ; Destroyed: None 237 VideoIO_PrintHexDWord Proc Near 238 xchg ax,dx 239 call VideoIO_PrintHexWord ; High word first 240 xchg ax,dx 241 call VideoIO_PrintHexWord ; Low word next 242 ret 243 VideoIO_PrintHexDWord EndP 244 245 246 ; Print hex-qword to screen 247 ; This outputs sixteen characters 248 ; In: BX:CX:DX:AX - qword to send 249 ; Out: BX:CX:DX:AX - qword sent 250 ; Destroyed: None 251 VideoIO_PrintHexQWord Proc Near 252 xchg dx,bx 253 xchg ax,cx 254 call VideoIO_PrintHexDWord ; High dword first 255 xchg dx,bx 256 xchg ax,cx 257 call VideoIO_PrintHexDWord ; Low dword next 258 ret 259 VideoIO_PrintHexQWord EndP 260 261 262 263 181 264 182 265 ; In: AL - Single Char to Print … … 205 288 cmp al, 99 206 289 ja VIOPBN_DoNotWriteAnything 207 movzx bx, al 290 ;movzx bx, al 291 mov bl,al 292 mov bh,0 293 208 294 call VideoIO_Internal_SetRegs 209 295 cmp bl, 10 210 296 jb VIOPBN_Lower10 211 297 push ax 212 movzx ax, bl 298 ;movzx ax, bl 299 mov al,bl 300 mov ah,0 301 213 302 mov dl, 10 214 303 div dl … … 231 320 ; In: AL - Single Byte to Print 232 321 ; Destroyed: None 233 VideoIO_PrintByteDynamicNumber Proc Near Uses ax bx dx es di322 VideoIO_PrintByteDynamicNumber Proc Near Uses ax bx cx dx es di ; Rousseau: cx was missing from push-list 234 323 xor cl, cl 235 324 mov bh, al … … 240 329 cmp ah, 100 241 330 jb VIOPBDN_Lower100 242 movzx ax, ah 331 ;movzx ax, ah 332 mov al,ah 333 mov ah,0 334 243 335 mov dl, 100 244 336 div dl … … 249 341 add di, 2 250 342 VIOPBDN_Lower100: 251 movzx ax, ah 343 ;movzx ax, ah 344 mov al,ah 345 mov ah,0 346 252 347 mov dl, 10 253 348 div dl … … 270 365 ; Destroyed: None Important 271 366 VideoIO_Internal_MakeWinDown Proc Near Uses dx di 272 movzx dx, cl 367 ;movzx dx, cl 368 mov dl,cl 369 mov dh,0 370 273 371 mov bl, al 274 372 call VideoIO_Internal_SetRegs … … 281 379 dec dx 282 380 jnz VIOIMWD_Loop 283 ret 381 ret 284 382 VideoIO_Internal_MakeWinDown EndP 285 383 … … 287 385 ; Destroyed: None Important 288 386 VideoIO_Internal_MakeWinRight Proc Near Uses dx di 289 movzx dx, cl 387 ;movzx dx, cl 388 mov dl,cl 389 mov dh,0 390 290 391 mov bl, al 291 392 call VideoIO_Internal_SetRegs … … 298 399 dec dx 299 400 jnz VIOIMWR_Loop 300 ret 401 ret 301 402 VideoIO_Internal_MakeWinRight EndP 302 403 … … 366 467 sub bl, WinBeginPosX 367 468 dec bl 368 469 369 470 VIOIMW_Loop: 370 471 mov ch, WinBeginPosY … … 439 540 call VideoIO_CursorSet 440 541 call VideoIO_CursorOn ; Set and turn cursor on 441 542 442 543 ; ES:DI - Screen-Position to Start of String 443 544 ; DL - Position in String (relative to begin, base=0) … … 460 561 cmp dl, StringLen ; String "full" ? 461 562 jae VIOLUES_Loop 462 movzx bx, dl 563 ;movzx bx, dl 564 mov bl,dl 565 mov bh,0 566 463 567 shl bx, 1 464 568 mov es:[di+bx], al … … 476 580 mov al, ' ' 477 581 dec dl 478 movzx bx, dl 582 ;movzx bx, dl 583 mov bl,dl 584 mov bh,0 585 479 586 shl bx, 1 480 587 mov es:[di+bx], al … … 502 609 ret 503 610 VideoIO_LetUserEditString EndP 611 612 613 614 ; 615 ; Rousseau Additions. 616 ; 617 618 619 ; Function Template 620 ;ProcName Proc Near Uses ax bx cx dx si es di 621 ;ProcName EndP 622 623 624 ; 625 ; Clear the current page 626 ; 627 VideoIO_ClearScreen Proc Near Uses ax bx cx dx si es di 628 mov al, 0 ; clear entire window 629 mov bh,07h ; Attribute for new lines 630 xor cx,cx ; Row, Column ULC 631 xor dx,dx 632 dec dx ; Row, Column LRC (does this corrupt other pages ?) 633 mov ah, 06h ; Function Code 634 int 10h ; Do It ! 635 ret 636 VideoIO_ClearScreen EndP 637 638 ; 639 ; Rousseau: added 640 ; Set poosition to teletype cursor 641 ; 642 VideoIO_SyncPos Proc Near Uses ax bx cx dx 643 pushf 644 mov bh, 0 645 mov ah, 03h 646 int 10h 647 mov [TextPosX], dl 648 mov [TextPosY], dh 649 popf 650 ret 651 VideoIO_SyncPos EndP 652 653 654 655 VideoIO_DBG_WriteString Proc Near Uses ax bx cx dx si es di 656 mov ch, [CFG_Partitions] ; y 657 add ch, 7 658 add ch, [CFG_IncludeFloppy] 659 push cx 660 mov cl, 1 ; x 661 call VideoIO_Locate 662 mov ch, 15 ; fgc 663 mov cl, 0 ; bgc 664 call VideoIO_Color 665 mov si, offset ShowBootLog 666 call VideoIO_Print 667 pop cx 668 inc ch 669 670 ;mov ch, 21 ; y 671 mov cl, 1 ; x 672 call VideoIO_Locate 673 mov ch, 15 ; fgc 674 mov cl, 0 ; bgc 675 call VideoIO_Color 676 677 678 ; Rousseau: 679 mov al, [NewPartitions] 680 ;call VideoIO_PrintByteDynamicNumber 681 mov al, [CFG_Partitions] 682 ;call VideoIO_PrintByteDynamicNumber 683 ret 684 VideoIO_DBG_WriteString EndP 685 686 687 ; Dump the disk-info. 688 ; Disk number is in DL. 689 VideoIO_DumpDiskInfo Proc Near 690 691 VideoIO_DumpDiskInfo_next_disk: 692 push dx 693 xor ax,ax 694 mov al,[TextPosY] 695 push ax 696 697 mov ax,21 698 mov dh,dl 699 and dh,01111111b 700 mul dh 701 mov dh,al 702 703 mov [TextPosX],dh 704 705 mov si, offset Disk 706 call VideoIO_Print 707 mov al,dl 708 709 ; NIET GOED, GAAT FOUT > 9, HEX PRINT GEBRUIKEN !! 710 shr al,4 711 add al,'0' 712 call VideoIO_PrintSingleChar 713 mov al,dl 714 and al,01111111b 715 add al,'0' 716 call VideoIO_PrintSingleChar 717 mov al,'h' 718 call VideoIO_PrintSingleChar 719 720 inc [TextPosY] 721 mov [TextPosX],dh 722 723 mov al,'-' 724 mov cl,17 725 call VideoIO_PrintSingleMultiChar 726 727 inc [TextPosY] 728 mov [TextPosX],dh 729 mov si, offset BiosCyls 730 call VideoIO_Print 731 732 push dx 733 mov bx,offset BIOS_Cyls 734 xor dh,dh 735 and dl,01111111b 736 shl dx,1 737 shl dx,1 738 add bx,dx 739 mov ax,[bx] 740 mov dx,[bx+02] 741 call VideoIO_PrintHexDWord 742 pop dx 743 744 inc [TextPosY] 745 mov [TextPosX],dh 746 mov si, offset BiosHeads 747 call VideoIO_Print 748 749 push dx 750 mov bx,offset BIOS_Heads 751 xor dh,dh 752 and dl,01111111b 753 shl dx,1 754 shl dx,1 755 add bx,dx 756 mov ax,[bx] 757 mov dx,[bx+02] 758 call VideoIO_PrintHexDWord 759 pop dx 760 761 inc [TextPosY] 762 mov [TextPosX],dh 763 mov si, offset BiosSecs 764 call VideoIO_Print 765 766 push dx 767 mov bx,offset BIOS_Secs 768 xor dh,dh 769 and dl,01111111b 770 shl dx,1 771 shl dx,1 772 add bx,dx 773 mov ax,[bx] 774 mov dx,[bx+02] 775 call VideoIO_PrintHexDWord 776 pop dx 777 778 inc [TextPosY] 779 mov [TextPosX],dh 780 mov si, offset LvmSecs 781 call VideoIO_Print 782 783 push dx 784 mov bx,offset TrueSecs 785 xor dh,dh 786 and dl,01111111b 787 shl dx,1 788 shl dx,1 789 add bx,dx 790 mov ax,[bx] 791 mov dx,[bx+02] 792 call VideoIO_PrintHexDWord 793 pop dx 794 795 inc [TextPosY] 796 mov [TextPosX],dh 797 mov si, offset BiosLBA 798 call VideoIO_Print 799 800 push dx 801 mov bx,offset BIOS_TotalSecs 802 xor dh,dh 803 and dl,01111111b 804 shl dx,1 805 shl dx,1 806 shl dx,1 807 add bx,dx 808 mov ax,[bx] 809 mov dx,[bx+02] 810 call VideoIO_PrintHexDWord 811 pop dx 812 813 inc [TextPosY] 814 mov [TextPosX],dh 815 816 pop ax 817 mov [TextPosY],al 818 pop dx 819 820 inc dl 821 mov al,dl 822 and al,01111111b 823 cmp al,[TotalHarddiscs] 824 jae VideoIO_DumpDiskInfo_end 825 jmp VideoIO_DumpDiskInfo_next_disk 826 827 VideoIO_DumpDiskInfo_end: 828 mov [TextPosX],0 829 add [TextPosY],6 830 ret 831 VideoIO_DumpDiskInfo EndP 832 833 834 835 ; Disk Info to Dump to AB LogScreen 836 Disk: db "DISK ",0 837 BiosCyls: db "Cyls :",0 838 BiosHeads: db "Heads :",0 839 BiosSecs: db "Secs :",0 840 LvmSecs: db "SecsLVM :",0 841 BiosLBA: db "LBA Secs:",0 842 843 844 HugeBootDisk: db "Boot Disk is Huge : ",0 845 DisksFound: db "Disks Found : ",0 846 PartitionsFound: db "Partitions Found : ",0 847 ;AutoStartPart: db "Auto Start Partition : ",0 848 849 Phase1: db "eCS Install Phase 1 : ",0 850 851 852 ShowMenu: db "Press TAB to return to the AiR-BOOT Menu",0 853 ShowBootLog: db "Press TAB to see the Boot Log...",0 854 855 Yes: db "YES",0 856 No: db "NO",0 857 On: db "ON",0 858 Off: db "OFF",0 859 None: db "NONE",0 860 Active: db "ACTIVE",0 861 NotActive: db "NOT ACTIVE",0 862 863 ; New Line for use by MBR_Teletype 864 NL: db 0dh, 0ah, 0 -
tags/v1.07r/BOOTCODE/SETUP/MAIN.ASM
r29 r30 20 20 ;--------------------------------------------------------------------------- 21 21 22 IFDEF ModuleNames 23 DB 'MAIN',0 24 ENDIF 25 22 26 LocMENU_RoutinePtr equ 0 23 27 LocMENU_VariablePtr equ 2 … … 66 70 67 71 SETUP_CheckEnterSETUP Proc Near Uses 72 73 74 75 ; Rousseau: added 76 ;mov SETUP_ExitEvent, 0 77 ;xor al, al ; -PARTITION SETUP PreDefines- 78 ;mov PartSetup_UpperPart, al ; Upper-Partition == 0 79 ;mov PartSetup_ActivePart, al ; Active-Partition == 0 80 81 ; Setup PartitionPointers-Table...again (needed when re-entering setup) 82 ;call PART_CalculateStraightPartPointers 83 ;call VideoIO_DBG_WriteString 84 ; Rousseau: end added 85 86 87 68 88 test CFG_AutoEnterSetup, 1 69 89 jnz SCES_ForceEnter … … 152 172 je SMT_KeyEsc 153 173 cmp ah, Keys_F1 154 je SMT_KeyHelp 174 jne skip_xx 175 jmp SMT_KeyHelp 176 skip_xx: 155 177 cmp ah, Keys_F10 156 je SMT_SaveAndExitNOW 178 jne skip_yy 179 jmp SMT_SaveAndExitNOW 180 skip_yy: 157 181 ; ASCII values... 158 182 cmp al, Keys_Space … … 264 288 SETUP_MenuTask EndP 265 289 290 291 292 CLR_MENU_WINDOW_CLASSIC = 0e01h 293 CLR_MENU_WINDOW_BM = 0e01h 266 294 ; In: BP - Pointer to Menu 267 295 ; Out: DH - Active Item on Screen 268 296 SETUP_DrawMenuOnScreen Proc Near Uses 269 297 call SETUP_DrawMenuWindow 270 mov cx, 0E01h298 mov cx, CLR_MENU_WINDOW_BM 271 299 call VideoIO_Color 272 300 xor ch, ch … … 294 322 SETUP_FillUpItemPacks EndP 295 323 324 325 326 CLR_SELECTED_ITEM_CLASSIC = 0f04h 327 CLR_SELECTED_ITEM_BM = 0f04h 296 328 ; Displays selected Item on screen 297 329 ; In: DH - Active Item 298 330 ; Destroyed: None 299 331 SETUP_DrawSelectItem Proc Near Uses cx 300 mov cx, 0F04h332 mov cx, CLR_SELECTED_ITEM_BM 301 333 call VideoIO_Color 302 334 mov ch, dh … … 305 337 SETUP_DrawSelectItem EndP 306 338 339 340 CLR_DESELECTED_ITEM_CLASSIC = 0e01h 341 CLR_DESELECTED_ITEM_BM = 0e01h 307 342 ; Display last-selected Item on screen (De-Select) 308 343 ; In: DL - Active Item 309 344 ; Destroyed: None 310 345 SETUP_DrawDeSelectItem Proc Near Uses cx 311 mov cx, 0E01h346 mov cx, CLR_DESELECTED_ITEM_BM 312 347 call VideoIO_Color 313 348 mov ch, dl … … 356 391 mov wptr TextColorFore, dx 357 392 ret 358 393 359 394 ; ------------------------------------------------------ Draw ITEMPACK 360 395 SDIOS_ItemPackDraw: … … 368 403 SDIOS_ItemPack_NoFixUpItemPack: 369 404 call VideoIO_Locate 370 mov cx, 0F01h 405 406 CLR_ITEM_PACK_CLASSIC = 0f01h 407 CLR_ITEM_PACK_BM = 0f01h 408 409 mov cx, CLR_ITEM_PACK_BM 371 410 call VideoIO_Color ; White on blue background 372 411 mov si, ds:[si+LocMENU_ItemNamePtr] ; SI - Name of Item … … 418 457 ret 419 458 SETUP_FillUpItemPack_Now EndP 459 460 420 461 421 462 SETUP_DrawMenuWindow Proc Near Uses es … … 474 515 mov cl, CopyrightVersionLen 475 516 call VideoIO_FixedPrint ; and 'vX.XX'. 476 add si, 3 517 518 ; Rousseau: 519 ; Strange, had to adjust this value. 520 ; Somewhere some offset changed... 521 ; Possibly happened with the movzx change to 286 instructions because some 522 ; offsets are hard coded. 523 ;add si, 3 524 add si, 2 525 477 526 call GetLenOfString ; CX - Len of "Copyright" string 478 527 mov dx, cx … … 871 920 mov si, di ; DS:SI - Current Password 872 921 xor dl, dl 873 ; DL - location of cursor (first=0) 922 ; DL - location of cursor (first=0) 874 923 SLEP_Loop: 875 924 mov cx, EnterPwd_Location … … 910 959 cmp dl, 8 911 960 je SLEP_SkipThiz 912 movzx bx, dl 961 962 ;movzx bx, dl 963 mov bl,dl 964 mov bh,0 965 913 966 mov ds:[si+bx], al 914 967 mov al, 42 ; fixed star :] … … 920 973 je SLEP_SkipThiz 921 974 dec dl 922 movzx bx, dl 975 976 ;movzx bx, dl 977 mov bl,dl 978 mov bh,0 979 923 980 mov al, 32 924 981 mov ds:[si+bx], al … … 1098 1155 jz SMICTN_NoFiller 1099 1156 dec al 1100 movzx cx, al 1157 1158 ;movzx cx, al 1159 mov cl,al 1160 mov ch,0 1161 1101 1162 xor al, al 1102 1163 rep stosb ; and fill up with NULs, if required … … 1523 1584 SMCBBS_Enabled: 1524 1585 dec dl 1525 movzx bx, dl 1586 1587 ;movzx bx, dl 1588 mov bl,dl 1589 mov bh,0 1590 1526 1591 shl bx, 1 1527 1592 mov si, wptr [ContinueBIOSbootTable+bx] -
tags/v1.07r/BOOTCODE/SETUP/MENUS.ASM
r29 r30 55 55 ; 56 56 57 IFDEF ModuleNames 58 DB 'MENUS',0 59 ENDIF 60 57 61 LocMENU_LenOfMenuPtrBlock equ 8 58 62 LocMENU_LenOfItemPack equ 12 … … 63 67 LocMENU_ItemPack equ 8 ; only if VariablePtr>0 64 68 65 SETUP_MainMenu: 69 SETUP_MainMenu: 66 70 db 0 ; Where Current Item will get saved 67 71 dw offset TXT_SETUPHELP_MAIN ; Pointer to help information … … 209 213 dw offset TXT_SETUP_IgnoreLVM, offset TXT_SETUPHELP_IgnoreLVM 210 214 dw 6 dup (0) 211 dw offset SETUPMAGIC_EnableDisable, offset CFG_ForceLBAUsage 215 dw offset SETUPMAGIC_EnableDisable, offset CFG_ForceLBAUsage ; Rousseau: LBA 212 216 dw offset TXT_SETUP_ForceLBAUsage, offset TXT_SETUPHELP_ForceLBAUsage 213 217 dw 6 dup (0) -
tags/v1.07r/BOOTCODE/SETUP/PART_SET.ASM
r29 r30 19 19 ; AiR-BOOT SETUP / PARTITION SETUP 20 20 ;--------------------------------------------------------------------------- 21 22 IFDEF ModuleNames 23 DB 'PART_SET',0 24 ENDIF 21 25 22 26 ; This here is called from Menu in AIR-BSET.asm … … 58 62 je PSM_KeyVIBRdetection 59 63 cmp al, TXT_SETUP_FlagLetterHide 60 je PSM_KeyHiddenSetup 64 65 jne skip_x 66 jmp PSM_KeyHiddenSetup 67 skip_x: 61 68 cmp al, TXT_SETUP_FlagLetterDrvLetter 62 je PSM_KeyDriveLetterForceSetup 69 70 jne skip_y 71 jmp PSM_KeyDriveLetterForceSetup 72 skip_y: 73 63 74 cmp al, TXT_SETUP_FlagLetterExtMShack 64 je PSM_KeyDriveLetterExtMShack 75 jne skip_z 76 jmp PSM_KeyDriveLetterExtMShack 77 skip_z: 65 78 jmp PSM_MainLoop 66 79 … … 331 344 inc al 332 345 call VideoIO_PrintByteNumber 333 346 334 347 ; Display "No Hd" field aka "01/01" 335 348 call VideoIO_Locate … … 426 439 call PARTSETUP_ReColorPart 427 440 428 ; Running Fixing 441 ; Running Fixing 429 442 cmp dh, 0FFh 430 443 jne PSBCB_NoUnderflow … … 558 571 ; This is done for security purposes, because if they match, we will update 559 572 ; the name in both - IPT and BR/LVM. 560 movzx bx, dl 573 574 ;movzx bx, dl 575 mov bl,dl 576 mov bh,0 577 561 578 cmp [PartitionVolumeLetters+bx], 0 ; ==0 means not supported by LVM 562 579 je PSCPN_NotLVMSupported … … 638 655 639 656 ; Check, where to save 2nd destination to... 640 movzx bx, dl 657 658 ;movzx bx, dl 659 mov bl,dl 660 mov bh,0 661 641 662 cmp [PartitionVolumeLetters+bx], 0 ; ==0 means not supported by LVM 642 663 je PSCPN_SaveBootRecord … … 775 796 PARTHIDESETUP_DrawMenuBase Proc Near Uses dx 776 797 ; PartSetup_HiddenX1 777 mov cx, 0D05h ; Lila on lila 798 799 CLR_PART_HIDE_WINDOW_BASE_CLASSIC = 0d05h 800 CLR_PART_HIDE_WINDOW_BASE_BM = 0a02h 801 802 mov cx, CLR_PART_HIDE_WINDOW_BASE_BM ; Lila on lila 778 803 call VideoIO_Color 779 804 mov bh, 05h … … 792 817 mov al, 'µ' 793 818 call VideoIO_PrintSingleChar 794 mov cx, 0E05h ; Yellow on Lila 819 820 CLR_PART_HIDE_WINDOW_LABEL_CLASSIC = 0e05h 821 CLR_PART_HIDE_WINDOW_LABEL_BM = 0e02h 822 823 mov cx, CLR_PART_HIDE_WINDOW_LABEL_BM ; Yellow on Lila 795 824 call VideoIO_Color 796 825 mov si, offset TXT_SETUP_HideFeature 797 826 call VideoIO_Print 798 mov cx, 0D05h ; Lila on lila 827 828 CLR_PART_HIDE_WINDOW_BORDER_CLASSIC = 0d05h 829 CLR_PART_HIDE_WINDOW_BORDER_BM = 0d02h 830 831 832 mov cx, CLR_PART_HIDE_WINDOW_BORDER_BM ; Lila on lila 799 833 call VideoIO_Color 800 834 mov al, 'Æ' … … 851 885 852 886 ; --- Make ':' Line down 853 mov cx, 0F05h ; Yellow on Lila 887 888 CLR_PART_HIDE_MENU_BASE_CLASSIC = 0f05h 889 CLR_PART_HIDE_MENU_BASE_BM = 0f02h 890 891 mov cx, CLR_PART_HIDE_MENU_BASE_BM ; Yellow on Lila 854 892 call VideoIO_Color 855 893 mov ch, 07h … … 873 911 dec dh 874 912 jnz PHSRP_Loop 913 914 CLR_PART_HIDE_MENU_MARKERS_CLASSIC = 0d05h 915 CLR_PART_HIDE_MENU_MARKERS_BM = 0a02h 916 875 917 ; At last calculate Scroll-Markers 876 mov cx, 0D05h ; Lila on lila918 mov cx, CLR_PART_HIDE_MENU_MARKERS_BM ; Lila on lila ; Hide Feature Markers 877 919 call VideoIO_Color 878 920 mov cx, 0603h ; 6, +3 … … 919 961 push cx 920 962 ; Display "Label" field aka "OS2" without ending NULs/Spaces 921 mov cx, 0F05h 963 964 CLR_PART_HIDE_LABEL_CLASSIC = 0f05h 965 CLR_PART_HIDE_LABEL_BM = 0f02h 966 967 mov cx, CLR_PART_HIDE_LABEL_BM 922 968 call VideoIO_Color ; Bright White on Lila 923 969 push si … … 927 973 call VideoIO_FixedPrint 928 974 pop si 929 mov cx, 0D05h 975 976 CLR_PART_HIDE_WINDOW_FS_CLASSIC = 0d05h 977 CLR_PART_HIDE_WINDOW_FS_BM = 0a02h 978 979 mov cx, CLR_PART_HIDE_WINDOW_FS_BM 930 980 call VideoIO_Color ; Bright Lila on Lila 931 981 mov al, ' ' … … 948 998 call VideoIO_Locate 949 999 push cx 950 mov cx, 0E05h 1000 1001 CLR_PART_HIDE_WINDOW_CHOISES_CLASSIC = 0e05h 1002 CLR_PART_HIDE_WINDOW_CHOISES_BM = 0e02h 1003 1004 mov cx, CLR_PART_HIDE_WINDOW_CHOISES_BM 951 1005 call VideoIO_Color ; Yellow on Lila 952 1006 mov al, ' ' … … 980 1034 PHSBCB_SkipRetrace: 981 1035 1036 CLR_PART_HIDE_WINDOW_MENU_BAR_CLASSIC = 5eh 1037 CLR_PART_HIDE_WINDOW_MENU_BAR_BM = 2eh 1038 982 1039 ; Deactivate current active bar 983 mov cl, 5Eh; Yellow on Lila1040 mov cl, CLR_PART_HIDE_WINDOW_MENU_BAR_BM ; Yellow on Lila 984 1041 call PARTHIDESETUP_ReColorPart 985 1042 986 ; Running Fixing 1043 ; Running Fixing 987 1044 cmp dh, 0FFh 988 1045 jne PHSBCB_NoUnderflow … … 1015 1072 1016 1073 ; Activate fresh active bar 1017 mov cl, 1Fh ; Bright White on Blue 1074 1075 CLR_PART_HIDE_WINDOW_MENU_ACTIVE_BAR_CLASSIC = 1fh 1076 CLR_PART_HIDE_WINDOW_MENU_ACTIVE_BAR_BM = 1fh 1077 1078 mov cl, CLR_PART_HIDE_WINDOW_MENU_ACTIVE_BAR_BM ; Bright White on Blue 1018 1079 call PARTHIDESETUP_ReColorPart 1019 1080 ; Now DL==DH … … 1178 1239 1179 1240 ; Now get the Logical-Drive-Letter for that partition... 1180 movzx bx, dl 1241 ;movzx bx, dl 1242 mov bl,dl 1243 mov bh,0 1244 1181 1245 mov dl, bptr [DriveLetters+bx] 1182 1246 … … 1264 1328 1265 1329 ; Draw base-window 1266 mov cx, 0D05h ; Lila on lila 1330 1331 CLR_PART_DL_XX_CLASSIC = 0d05h 1332 CLR_PART_DL_XX_BM = 0a02h 1333 1334 mov cx, CLR_PART_DL_XX_BM ; Lila on lila 1267 1335 call VideoIO_Color 1268 1336 mov bh, 06h … … 1281 1349 mov al, 'µ' 1282 1350 call VideoIO_PrintSingleChar 1283 mov cx, 0E05h ; Yellow on Lila 1351 1352 CLR_PART_DL_WINDOW_TITLE_CLASSIC = 0e05h 1353 CLR_PART_DL_WINDOW_TITLE_BM = 0e02h 1354 1355 mov cx, CLR_PART_DL_WINDOW_TITLE_BM ; Yellow on Lila 1284 1356 call VideoIO_Color 1285 1357 mov si, offset TXT_SETUP_DriveLetter 1286 1358 call VideoIO_Print 1287 mov cx, 0D05h ; Lila on lila 1359 1360 CLR_PART_DL_WINDOW_BORDER2_CLASSIC = 0d05h 1361 CLR_PART_DL_WINDOW_BORDER2_BM = 0a02h 1362 1363 mov cx, CLR_PART_DL_WINDOW_BORDER2_BM ; Lila on lila 1288 1364 call VideoIO_Color 1289 1365 mov al, 'Æ' … … 1292 1368 ; Display help-information 1293 1369 mov si, offset TXT_SETUPHELP_DriveLetter 1294 mov cx, 0D05h ; Lila on lila 1370 1371 CLR_PART_DL_SETUP_HELP_CLASSIC = 0d05h 1372 CLR_PART_DL_SETUP_HELP_BM = 0a02h 1373 1374 1375 mov cx, CLR_PART_DL_SETUP_HELP_BM ; Lila on lila 1295 1376 call VideoIO_Color 1296 1377 … … 1306 1387 mov al, '>' 1307 1388 call VideoIO_PrintSingleChar 1308 ; 1389 ; 1309 1390 mov cx, 0F01h ; Bright White on Blue 1310 1391 call VideoIO_Color -
tags/v1.07r/BOOTCODE/SPECIAL/APM.ASM
r29 r30 20 20 ;--------------------------------------------------------------------------- 21 21 22 IFDEF ModuleNames 23 DB 'APM',0 24 ENDIF 25 22 26 ; Here is APM Code to turn off the computer 23 27 -
tags/v1.07r/BOOTCODE/SPECIAL/F00K/BILLSUXX.ASM
r29 r30 27 27 ; Here is code to change Extended Partition to Type 05h or 0Fh depending 28 28 ; on the partition's P-flag including the overall M$hack-Enable Flag. 29 30 IFDEF ModuleNames 31 DB 'BILLSUXX',0 32 ENDIF 33 29 34 MSHACK_ProcessPartTables Proc Near Uses ax dx di 30 35 ; Check Overall M$-Hack Enable -
tags/v1.07r/BOOTCODE/SPECIAL/FAT16.ASM
r29 r30 20 20 ;--------------------------------------------------------------------------- 21 21 22 IFDEF ModuleNames 23 DB 'FAT16',0 24 ENDIF 25 22 26 ; Here is access code for accessing FAT-16 partitions. It's not a complete 23 27 ; File-API and only for simple readonly-access. … … 27 31 ; I did not want to code silly cylinder stuff here. I have also used 28 32 ; i386 code in here, because Linux requires so as well. Please note that 29 ; I don't use i386 code anywhere (!) else in AiR-BOOT. 30 ; 33 ; I don't use i386 code anywhere (!) else in AiR-BOOT. ; Rousseau: yes you did, movezx is 386-only :-) 34 ; ; Replaced by 286 instructions. 31 35 ; Initialize FAT-16 access on specified partition (required for following xs) 32 36 ; In: DS:SI - IPT-Entry that contains a FAT-16 partition … … 131 135 mov ax, dx 132 136 sub ax, 2 ; Everything starts at Cluster 2 133 movzx bx, FAT16_SecsPerCluster 137 ;movzx bx, FAT16_SecsPerCluster 138 mov bl,FAT16_SecsPerCluster 139 mov bh,0 140 134 141 mul bx 135 142 shl edx, 16 … … 145 152 add di, ax 146 153 ; Finally, look for next Cluster following to this one... 147 movzx bx, dl 154 ;movzx bx, dl 155 mov bl,dl 156 mov bh,0 157 148 158 shl bx, 1 ; BX - Offset within FAT-Table 149 159 shr dx, 8 ; DX - FAT-Sector … … 259 269 pop ax 260 270 mov dx, si 261 movzx cx, ah 271 ;movzx cx, ah 272 mov cl,ah 273 mov ch,0 274 262 275 rep movsb 263 276 mov si, dx ; Restore SI -
tags/v1.07r/BOOTCODE/SPECIAL/FX.ASM
r29 r30 19 19 ; AiR-BOOT / F/X 20 20 ;--------------------------------------------------------------------------- 21 22 IFDEF ModuleNames 23 DB 'FX',0 24 ENDIF 21 25 22 26 ; There you go. Some nice old-school demo coder effects :) … … 268 272 cmp di, FX_MaxScanLine 269 273 jb FX_MCS_VerticalLoop 270 274 271 275 mov ax, FX_CooperBarsTimer 272 276 dec ax … … 386 390 FX_CC_ActiveState: 387 391 ; increment SinusPos by 1 388 movzx bx, bptr ds:[FX_SinusPos+si] 392 ;movzx bx, bptr ds:[FX_SinusPos+si] 393 mov bl,bptr ds:[FX_SinusPos+si] 394 mov bh,0 395 389 396 inc bx 390 397 mov bptr ds:[FX_SinusPos+si], bl … … 409 416 FX_CalculateWideScroller Proc Near Uses 410 417 mov bx, FX_WideScrollerCurPos 411 movzx cx, FX_WideScrollerSpeed 418 ;movzx cx, FX_WideScrollerSpeed 419 mov cl,FX_WideScrollerSpeed 420 mov ch,0 421 412 422 test FX_WideScrollerAbsDirection, 1 413 423 jnz FXCWS_RIGHT -
tags/v1.07r/BOOTCODE/SPECIAL/FXTABLES.ASM
r29 r30 20 20 ;--------------------------------------------------------------------------- 21 21 22 IFDEF ModuleNames 23 DB 'FXTABLES',0 24 ENDIF 25 22 26 ; Sinus-Table - 128xWORD = 256 Bytes 23 27 FX_SinusTab dw 00101h, 00102h, 00103h, 00105h, 00107h, 0010Ah, 0010Dh, 00111h -
tags/v1.07r/BOOTCODE/SPECIAL/LINUX.ASM
r29 r30 40 40 ; some nice menus, setup, text, cyrillic support, demo-coder effects, easy 41 41 ; handling, help, auto-detection and plenty of other stuff INTO AROUND 25k. 42 ; 42 ; 43 43 ; Oh, why is this code here? Because of 2 friends of mine. Otherwise I wouldnt 44 44 ; have done it as well as fat16.asm. 45 46 IFDEF ModuleNames 47 DB 'LINUX',0 48 ENDIF 45 49 46 50 Linux_TranslateBase db '/dev/hd' … … 217 221 mov dx, ds:[si+LocIPT_LocationBegin] 218 222 ; from now on, we don't need si anymore 219 223 220 224 ; Linux has 1 'BR' (which is crap) and some setup sectors 221 225 ; we load them at 9000:0, what a luck, we are at 8000:0 :-)) … … 342 346 jz LLL_LoadNormalKernel 343 347 jmp LLL_LoadBigKernel 344 348 345 349 LLL_LoadNormalKernel: 346 350 ; NORMAL KERNEL … … 458 462 dw 0 459 463 dw 0FFFFh 460 MBR_Linux_GDT_Dst db 0, 0, 10h ; Dest is "10000:0" 464 MBR_Linux_GDT_Dst db 0, 0, 10h ; Dest is "10000:0" 461 465 db 093h 462 466 dw 0 -
tags/v1.07r/BOOTCODE/SPECIAL/LVM.ASM
r29 r30 19 19 ; AiR-BOOT / LVM 20 20 ;--------------------------------------------------------------------------- 21 22 IFDEF ModuleNames 23 DB 'LVM',0 24 ENDIF 21 25 22 26 LVM_InitCRCTable Proc Near Uses … … 25 29 mov di, offset LVM_CRCTable 26 30 LVM_ICRCT_Loop: 27 movzx ax, cl 31 ;movzx ax, cl 32 mov al,cl 33 mov ah,0 34 28 35 xor dx, dx ; DX:AX - CRC-Value 29 36 mov ch, 8 … … 86 93 test [CFG_IgnoreLVM], 1 ; We are supposed to ignore LVM, so 87 94 jnz LVMCSS_InvalidSignature ; any sector is bad! 88 cmp wptr [si+LocLVM_SignatureStart], 5202h 95 cmp wptr [si+LocLVM_SignatureStart], 5202h ; Rousseau: identify LVM sector 89 96 jne LVMCSS_InvalidSignature 90 97 cmp wptr [si+LocLVM_SignatureStart+2], 'BM' -
tags/v1.07r/BOOTCODE/SPECIAL/SOUND.ASM
r29 r30 19 19 ; AiR-BOOT / SOUND SUPPORT 20 20 ;--------------------------------------------------------------------------- 21 22 IFDEF ModuleNames 23 DB 'SOUND',0 24 ENDIF 21 25 22 26 ; Here is some sound code. Requested by Hex1753. … … 108 112 ret 109 113 SOUND_WaitToSilence EndP 114 115 116 117 ; Rousseau: added 118 SOUND_Beep PROC Near 119 pushf 120 pusha 121 122 mov al, 7 123 mov bh, 0 124 mov bl, 7 125 mov ah, 0eh 126 int 10h 127 128 popa 129 popf 130 ret 131 SOUND_Beep ENDP -
tags/v1.07r/BOOTCODE/SPECIAL/VIRUS.ASM
r29 r30 23 23 ; system will get halted. On Non-Real-Mode this will only save Interrupt Vectors. 24 24 ; Segment Registers preserved 25 26 IFDEF ModuleNames 27 DB 'VIRUS',0 28 ENDIF 29 25 30 VIRUS_CheckForStealth Proc Near Uses ds si es di 26 31 xor al, al … … 154 159 mov bx, BootBasePtr 155 160 mov dx, 0080h 156 mov cx, 003Ch ; First Harddrive, Sector 60 161 ;mov cx, 003Ch ; First Harddrive, Sector 60 162 mov cx, image_size / sector_size ; Harddisc 0, Sector 60 (or 62 for extended version) 157 163 mov ax, 0301h ; Write 1 Sector 158 164 int 13h … … 166 172 mov bx, offset TmpSector 167 173 mov dx, 0080h 168 mov cx, 003Ch ; Harddisc 0, Sector 60 174 ;mov cx, 003Ch ; Harddisc 0, Sector 60 175 mov cx, image_size / sector_size ; Harddisc 0, Sector 60 (or 62 for extended version) 169 176 mov ax, 0201h ; Load 1 Sector 170 177 pushf -
tags/v1.07r/BOOTCODE/TEXT/EN/OTHER.ASM
r29 r30 52 52 ;----------------------------------|----------------------------| 53 53 TXT_BootMenuEnterSetup db 'F10 to enter Setup', 0 54 ;TXT_BootMenuEnterBootLog db 'TAB to enter Boot Log', 0 54 55 55 56 ; Dynamic Length (till 80 chars) … … 61 62 db 13, 10, ' Press any key to continue...', 0 62 63 63 TXT_VirusFoundMain: db 13, 10, ' - !ATTENTION! -> A V IRUSWAS FOUND <- !ATTENTION!', 13, 10, 064 TXT_VirusFoundMain: db 13, 10, ' - !ATTENTION! -> A V1RU5 WAS FOUND <- !ATTENTION!', 13, 10, 0 64 65 TXT_VirusFound1ok: db ' It got squashed, but the system may not reboot correctly. If this happens,', 13, 10 65 66 db ' use your AiR-BOOT system disc.', 13, 10, 0 -
tags/v1.07r/ENV/DOS.BAT
r29 r30 1 1 rem This file sets Assembler, Linker and EXE2BIN for DOS environment 2 set assembler=tasm.exe /m9 /dReal /t 2 set assembler=tasm.exe /m9 /dReal /l 3 rem set assembler=tasm.exe /m9 /dReal /t 3 4 set linker=tlink.exe /3 /x 4 5 set exe2bin=exe2bin.exe -
tags/v1.07r/INCLUDE/ASM.INC
r29 r30 36 36 37 37 ; Shortcuts for pointer-types 38 bptr equ byte ptr 39 wptr equ word ptr 40 dptr equ dword ptr 41 qptr equ qword ptr 42 tptr equ tbyte ptr 38 bptr equ byte ptr 39 wptr equ word ptr 40 dptr equ dword ptr 41 qptr equ qword ptr 42 tptr equ tbyte ptr 43 44 45 sector_size equ 512 46 image_size_60secs equ 7800h 47 image_size_62secs equ 7c00h 48 49 ;image_size equ image_size_60secs 50 image_size equ image_size_62secs 51 52 sector_count equ image_size / sector_size ; Image size in sectors 53 54 IF image_size EQ image_size_60secs 55 partition_count equ 30 ; Maximum number of partitions supported 56 ELSE 57 partition_count equ 45 ; Maximum number of partitions supported 58 ENDIF -
tags/v1.07r/INSTALL/C/INST-OS2.TGT
r29 r30 22 22 5 23 23 MCommand 24 67 25 copy inst-os2.exe ..\..\RELEASE\OS2\airboot2.exe 24 131 25 @ren INST-OS2.EXE INST-OS2.XEX 26 @ren INST-OS2.XEX INST-OS2.EXE 27 copy INST-OS2.EXE ..\..\RELEASE\OS2\AIRBOOT2.EXE 26 28 del install.obj 27 29 … … 29 31 MItem 30 32 12 31 inst-os2.exe 33 INST-OS2.EXE 32 34 7 33 35 WString … … 36 38 8 37 39 WVList 38 2 40 4 39 41 9 40 M CState42 MVState 41 43 10 42 44 WString … … 45 47 11 46 48 WString 49 22 50 ?????Other options(,): 51 0 52 12 53 WString 54 19 55 op map=INST-OS2.MAP 56 0 57 13 58 MVState 59 14 60 WString 61 7 62 OS2LINK 63 15 64 WString 65 22 66 ?????Other options(,): 67 1 68 16 69 WString 70 19 71 op map=INST-OS2.MAP 72 0 73 17 74 MCState 75 18 76 WString 77 7 78 OS2LINK 79 19 80 WString 47 81 13 48 82 ?????Map file 49 83 1 50 84 0 51 12 85 20 52 86 MCState 53 13 87 21 54 88 WString 55 89 7 56 90 OS2LINK 57 14 91 22 58 92 WString 59 93 24 … … 61 95 1 62 96 0 63 15 97 23 98 WVList 99 1 100 24 101 ActionStates 102 25 103 WString 104 5 105 &Make 106 26 64 107 WVList 65 108 0 … … 68 111 1 69 112 0 70 16 113 27 71 114 WPickList 72 115 2 73 17 116 28 74 117 MItem 75 118 3 76 119 *.c 77 18 120 29 78 121 WString 79 122 4 80 123 COBJ 81 19 124 30 82 125 WVList 83 126 0 84 20 127 31 85 128 WVList 86 129 0 … … 89 132 1 90 133 0 91 21 134 32 92 135 MItem 93 136 9 94 install.c 95 22 137 INSTALL.C 138 33 96 139 WString 97 140 4 98 141 COBJ 99 23 142 34 100 143 WVList 101 144 0 102 24 145 35 103 146 WVList 104 147 0 105 17 148 28 106 149 1 107 150 1 -
tags/v1.07r/INSTALL/C/INST-WIN.TGT
r29 r30 22 22 5 23 23 MCommand 24 69 25 copy inst-win.exe ..\..\RELEASE\WINNT\airbootw.exe 24 133 25 @ren INST-WIN.EXE INST-WIN.XEX 26 @ren INST-WIN.XEX INST-WIN.EXE 27 copy INST-WIN.EXE ..\..\RELEASE\WINNT\AIRBOOTW.EXE 26 28 del install.obj 27 29 … … 29 31 MItem 30 32 12 31 inst-win.exe 33 INST-WIN.EXE 32 34 7 33 35 WString … … 36 38 8 37 39 WVList 38 2 40 4 39 41 9 40 M CState42 MVState 41 43 10 42 44 WString … … 45 47 11 46 48 WString 49 22 50 ?????Other options(,): 51 0 52 12 53 WString 54 19 55 op map=INST-WIN.MAP 56 0 57 13 58 MVState 59 14 60 WString 61 7 62 WINLINK 63 15 64 WString 65 22 66 ?????Other options(,): 67 1 68 16 69 WString 70 19 71 op map=INST-WIN.MAP 72 0 73 17 74 MCState 75 18 76 WString 77 7 78 WINLINK 79 19 80 WString 47 81 13 48 82 ?????Map file 49 83 1 50 84 0 51 12 85 20 52 86 MCState 53 13 87 21 54 88 WString 55 89 7 56 90 WINLINK 57 14 91 22 58 92 WString 59 93 24 … … 61 95 1 62 96 0 63 15 97 23 64 98 WVList 65 1 66 16 99 2 100 24 67 101 ActionStates 68 17 102 25 69 103 WString 70 104 5 71 105 &Make 72 18 106 26 107 WVList 108 0 109 27 110 ActionStates 111 28 112 WString 113 4 114 &Run 115 29 73 116 WVList 74 117 0 … … 77 120 1 78 121 0 79 19 122 30 80 123 WPickList 81 124 2 82 20 125 31 83 126 MItem 84 127 3 85 128 *.c 86 21 129 32 87 130 WString 88 131 4 89 132 COBJ 90 22 133 33 91 134 WVList 92 135 0 93 23 136 34 94 137 WVList 95 138 0 … … 98 141 1 99 142 0 100 24 143 35 101 144 MItem 102 145 9 103 install.c 104 25 146 INSTALL.C 147 36 105 148 WString 106 149 4 107 150 COBJ 108 26 151 37 109 152 WVList 110 153 0 111 27 154 38 112 155 WVList 113 156 0 114 20 157 31 115 158 1 116 159 1 -
tags/v1.07r/INSTALL/C/INSTALL.C
r29 r30 25 25 #include <os2.h> 26 26 #include <malloc.h> 27 #include <stdlib.h> // Rousseau: added to use getenv() 27 28 #define PLATFORM_OS2 28 29 #elif defined(__NT__) … … 39 40 40 41 41 #define STATUS_NOTINSTALLED 0 // No ID found 42 #define STATUS_CORRUPT 1 // ID found, Checksum failure 43 #define STATUS_INSTALLED 2 // ID found, Checksum valid 44 #define STATUS_INSTALLEDMGU 3 // ID found, Checksum valid, may get updated 45 #define STATUS_IMPOSSIBLE 4 // Unable/Not willing to install 42 #define STATUS_NOTINSTALLED 0 // No ID found 43 #define STATUS_CORRUPT 1 // ID found, Checksum failure 44 #define STATUS_INSTALLED 2 // ID found, Checksum valid 45 #define STATUS_INSTALLEDMGU 3 // ID found, Checksum valid, may get updated 46 #define STATUS_IMPOSSIBLE 4 // Unable/Not willing to install 47 48 /* Rousseau: added */ 49 #define GPT 0xEE // GPT Disk, AiR-BOOT will abort 50 #define BYTES_PER_SECTOR 512 // This could be higher in the future 51 #define IMAGE_SIZE_60SECS 30720 // Normal image-size (max. 30 partitions) 52 #define IMAGE_SIZE_62SECS 31744 // Extended image-size (max. 45 partitions) 53 //#define IMAGE_SIZE IMAGE_SIZE_60SECS // Use the normal image 54 #define IMAGE_SIZE IMAGE_SIZE_62SECS // Use the extended image 55 #define SECTOR_COUNT IMAGE_SIZE / BYTES_PER_SECTOR // Size of the image in sectors 56 #define CONFIG_OFFSET 0x6C00 // Byte offset of config-sector 57 #define SECTORS_BEFORE_CONFIG CONFIG_OFFSET / BYTES_PER_SECTOR // Nr of sectors before config-sector 58 59 46 60 47 61 // ============================================================================ 48 62 // Variables 49 63 // ============================================================================ 50 CHAR Track0[ 60*512];// current track 0 from harddrive51 CHAR Bootcode[ 60*512];// bootcode image from airboot.bin64 CHAR Track0[SECTOR_COUNT * BYTES_PER_SECTOR]; // current track 0 from harddrive 65 CHAR Bootcode[SECTOR_COUNT * BYTES_PER_SECTOR]; // bootcode image from airboot.bin 52 66 53 67 UCHAR Bootcode_LanguageID = ' '; … … 64 78 BOOL Option_ForceConfig = FALSE; 65 79 BOOL Option_Silent = FALSE; 80 81 BOOL Option_CID = FALSE; // Rousseau: added 66 82 67 83 BOOL Install_Code = FALSE; … … 86 102 USHORT OS2_GetIOCTLHandle () { 87 103 USHORT IOCTLHandle = 0; 88 104 89 105 if (DosPhysicalDisk(INFO_GETIOCTLHANDLE, &IOCTLHandle, sizeof(IOCTLHandle),"1:" , 3) != 0) 90 106 return 0; … … 114 130 AutoDriveLetter = BootDrive+0x7D; 115 131 AutoDriveLetterSerial = InfoLevel2.ulVSN; 116 printf("%X\n", InfoLevel2.ulVSN); 132 if (!Option_CID) { 133 printf("%X\n", InfoLevel2.ulVSN); 134 } 117 135 } 118 136 } … … 122 140 USHORT SectorsPerTrack = 0; 123 141 DEVICEPARAMETERBLOCK DeviceParmBlock; 124 ULONG ulDataLength; 142 ULONG ulDataLength; 125 143 126 144 IOCTLHandle = OS2_GetIOCTLHandle(); … … 129 147 SectorsPerTrack = DeviceParmBlock.cSectorsPerTrack; 130 148 OS2_FreeIOCTLHandle (IOCTLHandle); 131 if (SectorsPerTrack>61) return TRUE; 149 //if (SectorsPerTrack > 61) return TRUE; // >60 should also be ok for normal image (60 for image 1 for lvm) 150 if (SectorsPerTrack > SECTOR_COUNT) return TRUE; // Note: This is 1 sector smaller than above !! 132 151 // OS/2 is only able to support 512-byte/sector media, so we dont need to check this 133 152 return FALSE; … … 136 155 BOOL Track0Load (void) { 137 156 USHORT IOCTLHandle; 138 ULONG TrackLayoutLen = sizeof(TRACKLAYOUT)+sizeof(ULONG)*( 60-1);157 ULONG TrackLayoutLen = sizeof(TRACKLAYOUT)+sizeof(ULONG)*(SECTOR_COUNT-1); 139 158 TRACKLAYOUT *TrackLayoutPtr = malloc(TrackLayoutLen); 140 159 ULONG cbParms = sizeof(TrackLayoutPtr); 141 ULONG cbData = 512;160 ULONG cbData = BYTES_PER_SECTOR; 142 161 int i; 143 162 BOOL Success = FALSE; … … 149 168 TrackLayoutPtr->usCylinder = 0; 150 169 TrackLayoutPtr->usFirstSector = 0; 151 TrackLayoutPtr->cSectors = 60;152 153 for (i=0; i< 60; i++) {170 TrackLayoutPtr->cSectors = SECTOR_COUNT; 171 172 for (i=0; i<SECTOR_COUNT; i++) { 154 173 TrackLayoutPtr->TrackTable[i].usSectorNumber = i+1; 155 TrackLayoutPtr->TrackTable[i].usSectorSize = 512;174 TrackLayoutPtr->TrackTable[i].usSectorSize = BYTES_PER_SECTOR; 156 175 } 157 176 … … 166 185 BOOL Track0Write (void) { 167 186 USHORT IOCTLHandle; 168 ULONG TrackLayoutLen = sizeof(TRACKLAYOUT)+sizeof(ULONG)*( 60-1);187 ULONG TrackLayoutLen = sizeof(TRACKLAYOUT)+sizeof(ULONG)*(SECTOR_COUNT-1); 169 188 TRACKLAYOUT *TrackLayoutPtr = malloc(TrackLayoutLen); 170 189 ULONG cbParms = sizeof(TrackLayoutPtr); 171 ULONG cbData = 512;190 ULONG cbData = BYTES_PER_SECTOR; 172 191 INT i; 173 192 BOOL Success = FALSE; … … 180 199 TrackLayoutPtr->usCylinder = 0; 181 200 TrackLayoutPtr->usFirstSector = 0; 182 TrackLayoutPtr->cSectors = 60;183 184 for (i=0; i< 60; i++) {201 TrackLayoutPtr->cSectors = SECTOR_COUNT; 202 203 for (i=0; i<SECTOR_COUNT; i++) { 185 204 TrackLayoutPtr->TrackTable[i].usSectorNumber = i+1; 186 TrackLayoutPtr->TrackTable[i].usSectorSize = 512;205 TrackLayoutPtr->TrackTable[i].usSectorSize = BYTES_PER_SECTOR; 187 206 } 188 207 … … 218 237 GetVersionEx(&Version); 219 238 if (Version.dwPlatformId == VER_PLATFORM_WIN32_NT) return TRUE; 220 printf(" - This installer is for WindowsNT family only.\n"); 221 printf(" Please use DOS installer for Windows9x.\n"); 239 if (!Option_CID) { 240 printf(" - This installer is for WindowsNT family only.\n"); 241 printf(" Please use DOS installer for Windows9x.\n"); 242 } 222 243 return FALSE; 223 244 } … … 231 252 CloseHandle(IOCTLHandle); 232 253 } 233 254 234 255 USHORT CountHarddrives (void) { 235 256 return 1; … … 246 267 SectorsPerTrack = Geometry.SectorsPerTrack; 247 268 WINNT_FreeIOCTLHandle(IOCTLHandle); 248 if (SectorsPerTrack>61) return TRUE; 269 //if (SectorsPerTrack > 61) return TRUE; // >60 should also be ok for normal image (60 for image 1 for lvm) 270 if (SectorsPerTrack > SECTOR_COUNT) return TRUE; // Note: This is 1 sector smaller than above !! 249 271 return FALSE; 250 272 } … … 257 279 IOCTLHandle = WINNT_GetIOCTLHandle(); 258 280 SetFilePointer(IOCTLHandle, 0, 0, FILE_BEGIN); 259 if (ReadFile(IOCTLHandle, &Track0, 60*512, &BytesRead, NULL))281 if (ReadFile(IOCTLHandle, &Track0, SECTOR_COUNT * BYTES_PER_SECTOR, &BytesRead, NULL)) 260 282 Success = TRUE; 261 283 WINNT_FreeIOCTLHandle(IOCTLHandle); … … 270 292 IOCTLHandle = WINNT_GetIOCTLHandle(); 271 293 SetFilePointer(IOCTLHandle, 0, 0, FILE_BEGIN); 272 if (WriteFile(IOCTLHandle, &Track0, 60*512, &BytesWritten, NULL))294 if (WriteFile(IOCTLHandle, &Track0, SECTOR_COUNT * BYTES_PER_SECTOR, &BytesWritten, NULL)) 273 295 Success = TRUE; 274 296 WINNT_FreeIOCTLHandle(IOCTLHandle); … … 307 329 FileHandle = fopen("airboot.bin", "rb"); 308 330 if (!FileHandle) { 309 printf("airboot.bin not found\n"); 331 if (!Option_CID) { 332 printf("airboot.bin not found\n"); 333 } 310 334 return FALSE; 311 335 } … … 313 337 fseek (FileHandle, 0, SEEK_END); 314 338 BootcodeSize = ftell(FileHandle); 315 if (BootcodeSize!= 30720) {339 if (BootcodeSize!=IMAGE_SIZE) { 316 340 fclose (FileHandle); 317 printf("Invalid airboot.bin\n"); 341 if (!Option_CID) { 342 printf("Invalid airboot.bin\n"); 343 } 318 344 return FALSE; 319 345 } 320 346 fseek (FileHandle, 0, SEEK_SET); 321 fread (&Bootcode, 1, 30720, FileHandle);347 fread (&Bootcode, 1, IMAGE_SIZE, FileHandle); 322 348 fclose (FileHandle); 323 349 … … 330 356 } 331 357 358 /** 359 * Check MBR and AB signatures. 360 * Also check code sectors if AB is installed. 361 * Set global status accordingly. 362 */ 332 363 void Status_CheckCode (void) { 333 364 USHORT TotalCodeSectorsUsed = 0; … … 338 369 // EZ-Setup check! 339 370 Status_Code = STATUS_NOTINSTALLED; 340 if ((Track0[0x1FE]!=0x55) || (Track0[0x1FF]!=0xAA)) return; 341 if (strncmp(&Track0[2], "AiRBOOT", 7)!=0) return; 371 if ((Track0[0x1FE]!=0x55) || (Track0[0x1FF]!=0xAA)) return; // No MBR signature found, so not installed 372 if (strncmp(&Track0[2], "AiRBOOT", 7)!=0) return; // No AiR-BOOT signature found, so not installed 342 373 // MBR and AiR-BOOT signature found... 343 TotalCodeSectorsUsed = Track0[0x10]; 344 SectorPtr = &Track0[1*512]; // Start at sector 2 374 TotalCodeSectorsUsed = Track0[0x10]; // 34h/52 in v1.06 375 SectorPtr = &Track0[1 * BYTES_PER_SECTOR]; // Start at sector 2 376 // Calculate checksum of code-sectors 345 377 while (TotalCodeSectorsUsed>0) { 346 378 Checksum = GetChecksumOfSector(Checksum, SectorPtr); 347 SectorPtr += 512;379 SectorPtr += BYTES_PER_SECTOR; 348 380 TotalCodeSectorsUsed--; 349 381 } 350 382 if (Checksum!=*(PUSHORT)&Track0[0x11]) { 351 Status_Code = STATUS_CORRUPT; return; 383 Status_Code = STATUS_CORRUPT; return; // Bad checksum for code 352 384 } 353 385 // Checksum fine... … … 355 387 Installed_CodeVersion = (Track0[0x0D] << 8) | Track0[0x0E]; 356 388 if (Installed_CodeVersion<Bootcode_Version) 357 Status_Code = STATUS_INSTALLEDMGU; 389 Status_Code = STATUS_INSTALLEDMGU; // Do upgrade 358 390 else 359 Status_Code = STATUS_INSTALLED; 360 } 391 Status_Code = STATUS_INSTALLED; // Same version installed 392 } 393 361 394 362 395 void Status_CheckConfig (void) { 363 PCHAR ConfigSectorPtr = &Track0[ 0x6C00];396 PCHAR ConfigSectorPtr = &Track0[CONFIG_OFFSET]; // Config sector offset hard-coded ! 364 397 PCHAR SectorPtr = NULL; 365 398 USHORT Checksum = 0; … … 369 402 if (strncmp(ConfigSectorPtr, "AiRCFG-TABLE", 13)==0) { 370 403 // AiR-BOOT signature found... 371 SectorPtr = &Track0[54 *512];// Start at sector 55372 ConfigChecksum = *(PUSHORT)&Track0[54 *512+20];404 SectorPtr = &Track0[54 * BYTES_PER_SECTOR]; // Start at sector 55 405 ConfigChecksum = *(PUSHORT)&Track0[54 * BYTES_PER_SECTOR + 20]; 373 406 // Remove checksum 374 *(PUSHORT)&Track0[54*512+20] = 0; 407 *(PUSHORT)&Track0[54 * BYTES_PER_SECTOR + 20] = 0; // Config sector secnum hard-coded ! 408 409 /* 410 // Rousseau: 411 // Calculate chechsum over 5 sectors starting at the config-sector at 55. 412 // 55,56,57,58,59 (60 is MBR backup in normal version) 413 // SHOULD ADJUST THIS FOR EXTENDED VERSION ! // !!!!!!!!!!! 414 */ 375 415 SectorCount = 5; 376 416 while (SectorCount>0) { 377 417 Checksum = GetChecksumOfSector(Checksum, SectorPtr); 378 SectorPtr += 512;418 SectorPtr += BYTES_PER_SECTOR; 379 419 SectorCount--; 380 420 } 381 421 // Restore checksum 382 *(PUSHORT)&Track0[54 *512+20] = ConfigChecksum;422 *(PUSHORT)&Track0[54 * BYTES_PER_SECTOR + 20] = ConfigChecksum; // Config sector secnum hard-coded ! 383 423 if (Checksum!=ConfigChecksum) { 384 424 Status_Config = STATUS_CORRUPT; return; … … 386 426 } 387 427 // Checksum fine 388 Installed_ConfigVersion = (Track0[54 *512+0x0D] << 8) | Track0[54*512+0x0E];428 Installed_ConfigVersion = (Track0[54 * BYTES_PER_SECTOR + 0x0D] << 8) | Track0[54 * BYTES_PER_SECTOR + 0x0E]; 389 429 if (Installed_ConfigVersion>=Bootcode_ConfigVersion) { 390 430 Status_Config = STATUS_INSTALLED; return; … … 394 434 // If new configuration data was added, those spaces are not overwritten 395 435 // Sector 60 (MBR-BackUp) *MUST BE* copied, otherwise it would be lost. 436 // Rousseau: Upgrade from v0.27 396 437 if (Installed_ConfigVersion<=0x27) { 397 438 // UPGRADE v0.27 and prior versions … … 407 448 // -> Total-length 101 408 449 // Offset 432 Length 34 - New IPT entry (BIOS continued) 409 memcpy(&Bootcode[54 *512+16], &Track0[54*512+16], 69-16);410 memcpy(&Bootcode[54 *512+466], &Track0[54*512+466], 46);450 memcpy(&Bootcode[54 * BYTES_PER_SECTOR + 16], &Track0[54 * BYTES_PER_SECTOR + 16], 69 - 16); // CHECKEN !! 451 memcpy(&Bootcode[54 * BYTES_PER_SECTOR + 466], &Track0[54 * BYTES_PER_SECTOR + 466], 46); // CHECKEN !! 411 452 // Sector 56-57 no changes 412 memcpy(&Bootcode[55*512], &Track0[55 *512], 1024);453 memcpy(&Bootcode[55*512], &Track0[55 * BYTES_PER_SECTOR], 1024); 413 454 // Sector 58-59 414 455 // Changes: Offset 900 Length 30 - Logical driveletter table 415 memcpy(&Bootcode[57 *512], &Track0[57*512], 900);456 memcpy(&Bootcode[57 * BYTES_PER_SECTOR], &Track0[57 * BYTES_PER_SECTOR], 900); // AANPASSEN 900 !! 416 457 // Sector 60 copy unmodified 417 memcpy(&Bootcode[59 *512], &Track0[59*512], 512);458 memcpy(&Bootcode[59 * BYTES_PER_SECTOR], &Track0[59 * BYTES_PER_SECTOR], BYTES_PER_SECTOR); // CHECKEN !! 418 459 return; 419 460 } 461 // Rousseau: Upgrade from v0.91 420 462 if (Installed_ConfigVersion<=0x91) { 421 463 // UPGRADE v0.91 and prior versions 422 464 // Sector 55-57 no changes 423 memcpy(&Bootcode[54 *512+16], &Track0[54*512+16], 512+1024-16);465 memcpy(&Bootcode[54 * BYTES_PER_SECTOR + 16], &Track0[54 * BYTES_PER_SECTOR + 16], BYTES_PER_SECTOR + 1024 - 16); // CHACKEN !! 424 466 // Sector 58-59 425 467 // Changes: Offset 900 Length 30 - Logical driveletter table 426 memcpy(&Bootcode[57 *512], &Track0[57*512], 900);468 memcpy(&Bootcode[57 * BYTES_PER_SECTOR], &Track0[57 * BYTES_PER_SECTOR], 900); // AANPASSEN 900 !! 427 469 // Sector 60 copy unmodified 428 memcpy(&Bootcode[59 *512], &Track0[59*512], 512);470 memcpy(&Bootcode[59 * BYTES_PER_SECTOR], &Track0[59 * BYTES_PER_SECTOR], BYTES_PER_SECTOR); 429 471 return; 430 472 } … … 432 474 // We don't need to "upgrade" the configuration, we simply copy it over. 433 475 // From Sector 55, 6 sectors in total but never header/version 434 memcpy(&Bootcode[54*512+16], &Track0[54*512+16], 512*6-16); 476 // Rousseau: We copy two more sectors (8 in total) in the extended (45 partition) version. 477 switch (IMAGE_SIZE) { 478 case IMAGE_SIZE_60SECS: { 479 memcpy(&Bootcode[54 * BYTES_PER_SECTOR + 16], &Track0[54 * BYTES_PER_SECTOR + 16], BYTES_PER_SECTOR * 6 - 16); 480 break; 481 } 482 case IMAGE_SIZE_62SECS: { 483 memcpy(&Bootcode[54 * BYTES_PER_SECTOR + 16], &Track0[54 * BYTES_PER_SECTOR + 16], BYTES_PER_SECTOR * 8 - 16); 484 break; 485 } 486 } 487 435 488 return; 436 489 } … … 442 495 443 496 // Checks partition table for valid data 444 BOOL Virus_CheckThisMBR (PCHAR MBRptr) { 497 BOOL Virus_CheckThisMBR (PCHAR MBRptr) { // Rousseau: adjusted this function 445 498 USHORT PartitionNo; 446 499 ULONG CHSStart, CHSEnd; 447 500 448 if (*(PUSHORT)(MBRptr + 510)!=0x0AA55) return FALSE; 501 //printf("DEBUG: Virus_CheckThisMBR\n"); 502 503 if (*(PUSHORT)(MBRptr + BYTES_PER_SECTOR - 2)!=0x0AA55) return FALSE; 504 505 //printf("DEBUG: Virus_CheckThisMBR - Checking Partitions\n"); 506 449 507 MBRptr += 446; 450 508 for (PartitionNo=0; PartitionNo<4; PartitionNo++) { 451 if (*(MBRptr+4)!=0) { 509 if (*(MBRptr+4) != 0) { 510 /* 511 // Rousseau 2011-02-04: ## Check for GPT ## 512 */ 513 if (*(MBRptr+4) == GPT) { 514 if (!Option_CID) { 515 printf("ERROR: This drive is partitioned with the modern GPT layout.\n"); 516 printf(" AiR-BOOT is currently unable to handle GPT partitioned drives.\n"); 517 printf(" Installation aborted, no changes made.\n"); 518 } 519 exit(2); 520 } 521 522 /* 523 // Rousseau: 2011-05-05 524 // Last minute change to have AB install a disk with nopartitions 525 // on the bootdisk. 526 // It still checks for GPT but will skip the check below. 527 */ 528 continue; 529 530 //printf("DEBUG: Virus_CheckThisMBR - Partition: %d\n", PartitionNo); 452 531 // Partition-type defined, analyse partition data 453 CHSStart = (*(MBRptr+3) | ((*(MBRptr+2) >> 6) << 8)) << 16; // Cylinder 454 CHSStart |= (*(MBRptr+2) & 0x3F) | ((*(MBRptr+1) << 8)); // Sector / Head 455 456 CHSEnd = (*(MBRptr+7) | ((*(MBRptr+6) >> 6) << 8)) << 16; // Cylinder 457 CHSEnd |= (*(MBRptr+6) & 0x3F) | ((*(MBRptr+5) << 8)); // Sector / Head 458 459 if (CHSStart<CHSEnd) { 532 CHSStart = (*(MBRptr+3) | ((*(MBRptr+2) >> 6) << 8)) << 16; // Cylinder 533 CHSStart |= (*(MBRptr+2) & 0x3F) | ((*(MBRptr+1) << 8)); // Sector / Head 534 //printf("DEBUG: Virus_CheckThisMBR - CHSStart: %d\n", CHSStart); // 3F MASK CHECKEN !! 535 536 CHSEnd = (*(MBRptr+7) | ((*(MBRptr+6) >> 6) << 8)) << 16; // Cylinder 537 CHSEnd |= (*(MBRptr+6) & 0x3F) | ((*(MBRptr+5) << 8)); // Sector / Head 538 //printf("DEBUG: Virus_CheckThisMBR - CHSEnd: %d\n", CHSEnd); 539 540 541 /* 542 // Rousseau 2011-02-03: ## Changed below from < to <= ## 543 // When a partition is above 1024x255x63 (8GiB) the start and end of the partition 544 // in the MBR is the same (1024/255/63) to indicate extended CHS-values. 545 // This made the installer see this as a non-valid entry. 546 // Fixme: This could use some further optimazation like checking if CHS is really 1024/255/63 547 // to exclude truly faulty partition-entries. 548 */ 549 /*if (CHSStart<CHSEnd) {*/ 550 if (CHSStart<=CHSEnd) { 460 551 if (*(PULONG)(MBRptr+12)!=0) // Absolute length > 0? 461 552 return TRUE; … … 466 557 } 467 558 // No partitions defined/no valid partitions found 468 return FALSE; 559 // Rousseau: Still return TRUE (OK) 560 //return FALSE; 561 return TRUE; 469 562 } 470 563 … … 474 567 475 568 BOOL Virus_CheckForBackUpMBR (void) { 476 return Virus_CheckThisMBR(&Track0[59 *512]);569 return Virus_CheckThisMBR(&Track0[59 * BYTES_PER_SECTOR]); 477 570 } 478 571 … … 481 574 USHORT i; 482 575 483 for (i=0; i<511; i++) { 576 for (i=0; i<511; i++) { // BYTES_PER_SECTOR RELATED ?? 484 577 if (*(PUSHORT)CurPtr==0x13CD) return FALSE; 485 578 CurPtr++; … … 490 583 491 584 // Copies backup MBR into current MBR on current memory copy of track 0 585 // Rousseau: Two sectors higher in the extended version. 492 586 void Virus_CopyBackUpMBR (void) { 493 memcpy(&Track0, &Track0[59*512], 512); 587 switch (IMAGE_SIZE) { 588 case IMAGE_SIZE_60SECS: { 589 memcpy(&Track0, &Track0[59 * BYTES_PER_SECTOR], BYTES_PER_SECTOR); // sector 60 590 break; 591 } 592 case IMAGE_SIZE_62SECS: { 593 memcpy(&Track0, &Track0[61 * BYTES_PER_SECTOR], BYTES_PER_SECTOR); // sector 62 594 break; 595 } 596 } 494 597 } 495 598 … … 497 600 switch (Status) { 498 601 case STATUS_NOTINSTALLED: { 499 printf("not installed\n"); 602 if (!Option_CID) { 603 printf("not installed\n"); 604 } 500 605 break; 501 606 } 502 607 case STATUS_CORRUPT: { 503 printf("not intact\n"); 608 if (!Option_CID) { 609 printf("not intact\n"); 610 } 504 611 break; 505 612 } 506 613 case STATUS_INSTALLED: 507 614 case STATUS_INSTALLEDMGU: 508 printf("intact (v%x.%02x)", Version>>8, Version & 0x0FF); 509 if (Status==STATUS_INSTALLEDMGU) printf(", but may be updated"); 510 printf("\n"); 615 if (!Option_CID) { 616 printf("intact (v%x.%02x)", Version>>8, Version & 0x0FF); 617 } 618 if (Status==STATUS_INSTALLEDMGU) 619 if (!Option_CID) { 620 printf(", but may be updated"); 621 printf("\n"); 622 } 511 623 break; 512 624 case STATUS_IMPOSSIBLE: 513 printf(ImpossibleCause); 625 if (!Option_CID) { 626 printf(ImpossibleCause); 627 } 514 628 break; 515 629 } … … 517 631 518 632 void Language_PrintF(UCHAR LanguageID) { 633 if (Option_CID) 634 return; 519 635 switch (LanguageID) { 520 636 case 'E': printf("english"); break; … … 537 653 538 654 // Calculate checksum for code... 539 TotalCodeSectorsUsed = Bootcode[0x10]; 540 SectorPtr = &Bootcode[1 *512]; // Start at sector 2655 TotalCodeSectorsUsed = Bootcode[0x10]; // SECTORS USED CHECKEN !! (34h / 52d in v1.06) 656 SectorPtr = &Bootcode[1 * BYTES_PER_SECTOR]; // Start at sector 2 541 657 SectorCount = TotalCodeSectorsUsed; 542 658 while (SectorCount>0) { 543 659 Checksum = GetChecksumOfSector(Checksum, SectorPtr); 544 SectorPtr += 512;660 SectorPtr += BYTES_PER_SECTOR; 545 661 SectorCount--; 546 662 } … … 551 667 552 668 // Copy over code sectors... 553 memcpy(&Track0[ 512], &Bootcode[512], TotalCodeSectorsUsed*512);669 memcpy(&Track0[BYTES_PER_SECTOR], &Bootcode[BYTES_PER_SECTOR], TotalCodeSectorsUsed * BYTES_PER_SECTOR); 554 670 } 555 671 … … 562 678 if (AutoDriveLetter!=0) { 563 679 // Add DriveLetter Automatic veriables, if set 564 Bootcode[54 *512+0x1AB] = AutoDriveLetter;565 *(PULONG)&Bootcode[54 *512+0x1AC] = AutoDriveLetterSerial;680 Bootcode[54 * BYTES_PER_SECTOR + 0x1AB] = AutoDriveLetter; // CHECKEN ! 681 *(PULONG)&Bootcode[54 * BYTES_PER_SECTOR + 0x1AC] = AutoDriveLetterSerial; 566 682 } 567 683 #endif 568 684 569 685 // Delete current checksum 570 *(PUSHORT)&Bootcode[54 *512+20] = 0;571 572 SectorPtr = &Bootcode[54 *512];// Start at sector 55686 *(PUSHORT)&Bootcode[54 * BYTES_PER_SECTOR + 20] = 0; 687 688 SectorPtr = &Bootcode[54 * BYTES_PER_SECTOR]; // Start at sector 55 573 689 SectorCount = 5; 574 690 while (SectorCount>0) { 575 691 Checksum = GetChecksumOfSector(Checksum, SectorPtr); 576 SectorPtr += 512;692 SectorPtr += BYTES_PER_SECTOR; 577 693 SectorCount--; 578 694 } 579 *(PUSHORT)&Bootcode[54 *512+20] = Checksum;695 *(PUSHORT)&Bootcode[54 * BYTES_PER_SECTOR + 20] = Checksum; 580 696 581 697 // Copy configuration sectors 582 memcpy(&Track0[54*512], &Bootcode[54*512], 6*512); 698 // Rousseau: Two more sectors for extended version. 699 switch (IMAGE_SIZE) { 700 case IMAGE_SIZE_60SECS: { 701 memcpy(&Track0[54 * BYTES_PER_SECTOR], &Bootcode[54 * BYTES_PER_SECTOR], 6 * BYTES_PER_SECTOR); 702 break; 703 } 704 case IMAGE_SIZE_62SECS: { 705 memcpy(&Track0[54 * BYTES_PER_SECTOR], &Bootcode[54 * BYTES_PER_SECTOR], 8 * BYTES_PER_SECTOR); 706 break; 707 } 708 } 583 709 } 584 710 … … 593 719 BOOL ExitOnly = FALSE; 594 720 595 printf("AiR-BOOT Installer v1.00\n");596 printf(" - (c) Copyright 1998-2009by Martin Kiewitz.\n");597 printf("\n-> ...Please wait... <-\n");721 // printf("AiR-BOOT Installer v1.07\n"); 722 // printf(" - (c) Copyright 1998-2011 by Martin Kiewitz.\n"); 723 // printf("\n-> ...Please wait... <-\n"); 598 724 599 725 // Check commandline parameters … … 615 741 if (strcmp(&TempSpace, "forceconfig")==0) Option_ForceConfig = TRUE; 616 742 if (strcmp(&TempSpace, "silent")==0) Option_Silent = TRUE; 743 if (strcmp(&TempSpace, "cid")==0) Option_CID = TRUE; 617 744 } 618 745 CurArgument++; 619 746 } 747 748 if (Option_CID) { 749 Option_Silent = TRUE; 750 } 620 751 621 752 #ifdef PLATFORM_WINNT … … 624 755 625 756 if (CountHarddrives()==0) { 626 printf(" - No physical drives found on this system. Install impossible.\n"); 627 return 1; 628 } 629 630 printf(" - Loading bootcode from file..."); 757 if (!Option_CID) { 758 printf(" - No physical drives found on this system. Install impossible.\n"); 759 } 760 return 3; // Rouseau: changed from 1 to 3 761 } 762 763 if (!Option_CID) { 764 printf(" - Loading bootcode from file..."); 765 } 631 766 if (LoadBootcodeFromFile()==FALSE) return 1; 632 printf("ok\n"); 633 634 printf(" - Loading MBR from harddisc..."); 767 if (!Option_CID) { 768 printf("ok\n"); 769 } 770 771 if (!Option_CID) { 772 printf(" - Loading MBR from harddisc..."); 773 } 635 774 if (HarddriveCheckGeometry()) { 636 775 // No EZ-SETUP check here, because we are under 32-bit OS and this 637 776 // wouldn't make any sense 638 777 if (!Track0Load()) { 639 printf("LOAD ERROR!\n"); 778 if (!Option_CID) { 779 printf("LOAD ERROR!\n"); 780 } 640 781 return 1; 641 782 } 642 783 } else { 643 784 StatusCode = STATUS_IMPOSSIBLE; 644 ImpossibleCause = "unable to install\n Your harddisc does not have at least 62 sectors per track."; 645 } 646 printf("ok\n"); 647 648 649 printf("\n-> ...Current Status... <-\n"); 785 if (!Option_CID) { 786 ImpossibleCause = "unable to install\n Your harddisc does not have at least 62 sectors per track."; 787 } 788 } 789 if (!Option_CID) { 790 printf("ok\n"); 791 } 792 793 794 if (!Option_CID) { 795 printf("\n-> ...Current Status... <-\n"); 796 } 650 797 Status_CheckCode(); 651 printf(" - AiR-BOOT is "); 798 if (!Option_CID) { 799 printf(" - AiR-BOOT is "); 800 } 652 801 Status_PrintF(Status_Code, Installed_CodeVersion); 653 802 if (StatusCode==STATUS_IMPOSSIBLE) return 1; 654 803 Status_CheckConfig(); 655 printf(" - Configuration is "); 804 if (!Option_CID) { 805 printf(" - Configuration is "); 806 } 656 807 Status_PrintF(Status_Config, Installed_ConfigVersion); 657 808 // Display language as well, if code installed 658 809 if ((Status_Code==STATUS_INSTALLED) || (Status_Code==STATUS_INSTALLEDMGU)) { 659 printf(" - Language is "); 810 if (!Option_CID) { 811 printf(" - Language is "); 812 } 660 813 Language_PrintF(Installed_LanguageID); 661 printf("\n"); 814 if (!Option_CID) { 815 printf("\n"); 816 } 662 817 } 663 818 … … 682 837 // Code==not installed, config==installed -> (-> Virus?) 683 838 // Code==installed, config==not installed -> Check MBR (-> Virus?) 839 840 //printf("DEBUG: Status_Code: %d, Status_Config: %d\n", Status_Code, Status_Config); // Rousseau: DEBUG 841 684 842 if ((Status_Code==STATUS_NOTINSTALLED) & (Status_Config==STATUS_NOTINSTALLED)) { 685 843 // Nothing installed, so check MBR, if squashed... 686 844 if (!Virus_CheckCurrentMBR()) { 687 printf("\n\n"); 688 printf("AiR-BOOT detected that the data on your harddisc got damaged.\n"); 689 printf("If you had AiR-BOOT installed before: the corruption killed AiR-BOOT completly!\n"); 690 printf("Installation halted.\n"); 691 return 1; 692 } 845 if (!Option_CID) { 846 printf("\n\n"); 847 printf("AiR-BOOT detected that the data on your harddisc got damaged.\n"); 848 printf("If you had AiR-BOOT installed before: the corruption killed AiR-BOOT completly!\n"); 849 printf("Installation halted.\n"); 850 } 851 return 255; // Rousseau: changed from 1 to 255 852 } 853 //printf("DEBUG: Installing...\n"); // Rousseau: DEBUG 693 854 } else { 694 855 if ((Status_Code==STATUS_NOTINSTALLED) | (!Virus_CheckCurrentMBR())) { 695 856 // Code not installed, but Config or MBR squashed... 696 857 // -> Virus proposed, check for backup (if available) 697 printf("\n\n"); 698 printf("-> ...!ATTENTION!... <-\n"); 858 if (!Option_CID) { 859 printf("\n\n"); 860 printf("-> ...!ATTENTION!... <-\n"); 861 } 699 862 if (Virus_CheckForStealth()) 700 printf("Your system GOT infected by a stealth-virus (or your MBR got trashed).\n"); 863 if (!Option_CID) { 864 printf("Your system GOT infected by a stealth-virus (or your MBR got trashed).\n"); 865 } 701 866 else 702 printf("Probably your system was infected by a virus.\n"); 703 printf("Repairing AiR-BOOT will normally squash the virus.\n"); 704 printf("But to be sure it's gone, you should check your harddisc using a virus-scanner.\n"); 867 if (!Option_CID) { 868 printf("Probably your system was infected by a virus.\n"); 869 printf("Repairing AiR-BOOT will normally squash the virus.\n"); 870 printf("But to be sure it's gone, you should check your harddisc using a virus-scanner.\n"); 871 } 705 872 if (!Virus_CheckCurrentMBR()) { 706 873 // MBR squashed, so check backup and display message 707 printf("\n"); 708 printf("AiR-BOOT detected that the virus has broken your partition-table.\n"); 874 if (!Option_CID) { 875 printf("\n"); 876 printf("AiR-BOOT detected that the virus has broken your partition-table.\n"); 877 } 709 878 if (Virus_CheckForBackUpMBR()) { 710 printf("Good news: AiR-BOOT has found a (hopefully) functional backup.\n"); 711 printf("Shall I use this backup, instead of the current active one? (Y/N)\n"); 879 if (!Option_CID) { 880 printf("Good news: AiR-BOOT has found a (hopefully) functional backup.\n"); 881 printf("Shall I use this backup, instead of the current active one? (Y/N)\n"); 882 } 712 883 // User selection, Y/N, if he wants to restore MBR 713 884 // *NOT* CID (silent) able … … 718 889 Virus_CopyBackUpMBR(); 719 890 } else { 720 printf("Sadly the virus also broke AiR-BOOT's backup. You will have to help yourself.\n"); 891 if (!Option_CID) { 892 printf("Sadly the virus also broke AiR-BOOT's backup. You will have to help yourself.\n"); 893 } 721 894 } 722 895 } … … 727 900 // MAIN-MENU 728 901 // ============================================================= 729 printf("\n-> ...Please press... <-\n"); 730 731 if (Install_IsCorrupt) printf(" <R> - Repair AiR-BOOT "); 732 else if (Status_Code==STATUS_NOTINSTALLED) printf(" <A> - Add AiR-BOOT "); 733 else printf(" <U> - Update/Change AiR-BOOT to "); 734 printf("'v%x.%02x/", Bootcode_Version>>8, Bootcode_Version & 0x0FF); 735 Language_PrintF(Bootcode_LanguageID); 736 printf("' on current system\n"); 737 738 printf(" <D> - Delete AiR-BOOT from current system\n"); 739 printf(" <Q> - Quit without any change\n"); 740 741 if (Option_Silent) { 902 if (!Option_CID) { 903 printf("\n-> ...Please press... <-\n"); 904 } 905 906 if (!Option_CID) { 907 if (Install_IsCorrupt) printf(" <R> - Repair AiR-BOOT "); 908 else if (Status_Code==STATUS_NOTINSTALLED) printf(" <A> - Add AiR-BOOT "); 909 else printf(" <U> - Update/Change AiR-BOOT to "); 910 printf("'v%x.%02x/", Bootcode_Version>>8, Bootcode_Version & 0x0FF); 911 Language_PrintF(Bootcode_LanguageID); 912 printf("' on current system\n"); 913 914 printf(" <D> - Delete AiR-BOOT from current system\n"); 915 printf(" <Q> - Quit without any change\n"); 916 } 917 918 if (Option_Silent || Option_CID) { 742 919 // Silent operation? Always add AiR-BOOT then 743 920 UserKey = 'a'; … … 748 925 } 749 926 750 printf("\n\n\n-------------------------------------------------------------------------------\n"); 927 if (!Option_CID) { 928 printf("\n\n\n-------------------------------------------------------------------------------\n"); 929 } 751 930 switch (UserKey) { 752 931 case 'a': … … 754 933 case 'u': { 755 934 if (Install_Code || Install_Config) { 756 printf("Add/Repair/Update AiR-BOOT in progress...\n"); 935 if (!Option_CID) { 936 printf("Add/Repair/Update AiR-BOOT in progress...\n"); 937 } 757 938 #ifdef PLATFORM_OS2 758 939 OS2_GetBootAutoDriveLetter(); 759 940 #endif 760 941 if (Install_Code) { 761 printf(" þ Writing AiR-BOOT code..."); 942 if (!Option_CID) { 943 printf(" þ Writing AiR-BOOT code..."); 944 } 762 945 Install_WriteCode(); 763 printf("ok\n"); 946 if (!Option_CID) { 947 printf("ok\n"); 948 } 764 949 } 765 950 if (Install_Config) { 766 printf(" þ Writing AiR-BOOT configuration..."); 951 if (!Option_CID) { 952 printf(" þ Writing AiR-BOOT configuration..."); 953 } 767 954 Install_WriteConfig(); 768 printf("ok\n"); 955 if (!Option_CID) { 956 printf("ok\n"); 957 } 769 958 } 770 959 771 960 if (!Track0Write()) { 772 printf("SAVE ERROR!\n"); 961 if (!Option_CID) { 962 printf("SAVE ERROR!\n"); 963 } 773 964 return 1; 774 965 } 775 printf("\n"); 776 printf("Your copy of AiR-BOOT is now fully functional.\n"); 777 printf("Please hit ESC to exit AiR-BOOT installer or ENTER to reboot your system...\n"); 778 if (Option_Silent) { 966 if (!Option_CID) { 967 printf("\n"); 968 printf("Your copy of AiR-BOOT is now fully functional.\n"); 969 printf("Please hit ESC to exit AiR-BOOT installer or ENTER to reboot your system...\n"); 970 } 971 if (Option_Silent || Option_CID) { 779 972 // Silent operation? Always reboot system (shall we do this really?) 780 973 UserKey = 0x0D; … … 784 977 } while (!((UserKey==0x0D) || (UserKey==0x1B))); 785 978 } 786 if (UserKey==0x0D) { // ENTER reboots system... 787 printf("Now rebooting system...\n"); 788 RebootSystem(); 979 if (UserKey==0x0D) { // ENTER reboots system... (if not in eCS install mode) 980 981 /* 982 // Rousseau: ## Disable Reboot when installing eComStation ## 983 // In the install-environment, the MEMDRIVE env-var is defined. 984 // So, only reboot if this env-var is not defined. 985 */ 986 if (!getenv("MEMDRIVE")) { 987 if (!Option_CID) { 988 printf("Now rebooting system...\n"); 989 } 990 //RebootSystem(); 991 } 992 ExitOnly = TRUE; 789 993 } 790 994 } else { 791 printf(" þ All components of AiR-BOOT are intact and up-to-date. Nothing to do.\n"); 995 if (!Option_CID) { 996 printf(" þ All components of AiR-BOOT are intact and up-to-date. Nothing to do.\n"); 997 } 792 998 ExitOnly = TRUE; 793 999 } … … 795 1001 } 796 1002 case 'd': { 797 printf(" þ Removing AiR-BOOT automatically is not possible at this time.\n"); 1003 if (!Option_CID) { 1004 printf(" þ Removing AiR-BOOT automatically is not possible at this time.\n"); 1005 } 798 1006 #ifdef PLATFORM_OS2 799 printf(" You may remove AiR-BOOT manually by entering \"FDISK /MBR\" or \"LVM /NEWMBR:1\"\n"); 800 printf(" in commandline.\n"); 1007 if (!Option_CID) { 1008 printf(" You may remove AiR-BOOT manually by entering \"FDISK /MBR\" or \"LVM /NEWMBR:1\"\n"); 1009 printf(" in commandline.\n"); 1010 } 801 1011 #endif 802 1012 #ifdef PLATFORM_WINNT 803 printf(" You may remove AiR-BOOT manually by entering \"FDISK /MBR\" in commandline.\n"); 1013 if (!Option_CID) { 1014 printf(" You may remove AiR-BOOT manually by entering \"FDISK /MBR\" in commandline.\n"); 1015 } 804 1016 #endif 805 1017 ExitOnly = TRUE; … … 811 1023 812 1024 if (ExitOnly) { 813 printf("\n"); 814 printf("Please hit ENTER to exit AiR-BOOT installer...\n"); 815 if (!Option_Silent) { 1025 if (!Option_CID) { 1026 printf("\n"); 1027 printf("Please hit ENTER to exit AiR-BOOT installer...\n"); 1028 } 1029 if (!Option_Silent || !Option_CID) { 816 1030 while (getch()!=0x0D); 817 1031 } -
tags/v1.07r/INSTALL/C/OS2.WPJ
r29 r30 5 5 1 6 6 WRect 7 08 07 840 8 620 9 9 7680 10 921 610 9210 11 11 2 12 12 MProject … … 21 21 WFileName 22 22 12 23 inst-os2.tgt 23 INST-OS2.TGT 24 24 6 25 25 WVList … … 38 38 WFileName 39 39 12 40 inst-os2.tgt 40 INST-OS2.TGT 41 41 0 42 42 1 -
tags/v1.07r/INSTALL/C/WIN32.WPJ
r29 r30 5 5 1 6 6 WRect 7 08 07 840 8 620 9 9 7680 10 921 610 9210 11 11 2 12 12 MProject … … 21 21 WFileName 22 22 12 23 inst-win.tgt 23 INST-WIN.TGT 24 24 6 25 25 WVList … … 30 30 WRect 31 31 576 32 52 932 520 33 33 5632 34 414 734 4140 35 35 0 36 36 0 … … 38 38 WFileName 39 39 12 40 inst-win.tgt 40 INST-WIN.TGT 41 41 0 42 42 1 -
tags/v1.07r/INSTALL/DOS/AIRBOOT.ASM
r29 r30 29 29 COM_StartUp: jmp COM_Init 30 30 31 COM_Copyright db 'AiR-BOOT Installer for DOS v1.0 0', 13, 1031 COM_Copyright db 'AiR-BOOT Installer for DOS v1.07', 13, 10 32 32 db ' - (c) Copyright 2008-2009 by M. Kiewitz.', 13, 10 33 33 db 13, 10 … … 134 134 135 135 mov ah, 3Fh 136 mov cx, 30720; Image size136 mov cx, image_size ; Image size 137 137 mov dx, offset BootImage 138 138 int 21h ; DOS: READ FILE … … 141 141 call APIShowError 142 142 143 COM_DoneRead: cmp ax, 30720143 COM_DoneRead: cmp ax, image_size 144 144 je COM_DoneRead2 145 145 COM_InvalidFile:mov si, offset COM_FailedRead2 -
tags/v1.07r/INSTALL/DOS/MAKE.BAT
r29 r30 19 19 echo Errorlevel not 0, make failed 20 20 :ExitMe 21 pause21 rem pause -
tags/v1.07r/INSTALL/INST_X86/INSTALL.INC
r29 r30 158 158 je VirusRestoreNo 159 159 jmp VirusKeyLoop 160 160 161 161 VirusRestoreYes:call Init_CopyBackupMBR 162 162 VirusRestoreNo: jmp VirusSkip … … 191 191 mov si, offset TXT_MENU_OnCurSystem 192 192 call APIShowMessage 193 193 194 194 mov si, offset TXT_MENU_Delete 195 195 call APIShowMessage … … 347 347 call SaveImageSector ; Hide-Partition Table 2 348 348 call SaveImageSector ; MBR BackUp (just to be sure, no valid is there) 349 350 ;call SaveImageSector 351 ;call SaveImageSector 349 352 ret 350 353 InstallConfig EndP 351 354 352 355 353 356 354 357 ; Out: Carry Flag SET if Harddisc failed 62-sectors test 355 358 Init_CheckHarddisc Proc Near Uses -
tags/v1.07r/TOOLS/DOS/INITHDD/INITHDD.ASM
r29 r30 20 20 21 21 Include ..\..\..\include\asm.inc 22 include ..\..\..\include\dos\airboot.inc22 ;include ..\..\..\include\dos\airboot.inc 23 23 24 24 .386p … … 36 36 TXT_ERROR_NotNeeded db 'INITHDD: Initialization not needed.', 13, 10, 0 37 37 TXT_Done db 'INITHDD: HDD was successfully initialized.', 13, 10, 0 38 TXT_Cleared db 'INITHDD: Reserved Sectors successfully cleared.', 13, 10, 0 ; Rousseau: added 38 39 39 40 StandardMBR: … … 68 69 dw 00000h, 00000h, 00000h, 0AA55h 69 70 70 Include ..\..\..\include\DOS\Const.asm71 ; Include ..\..\..\include\DOS\Const.asm 71 72 72 73 INITHDD_Start: mov ax, cs … … 84 85 mov ax, 0201h ; Read 1 sector 85 86 int 13h 87 jnc Clear ; Rousseau: added (only clear) 86 88 jnc LoadMBR_NoError 87 89 mov si, offset TXT_ERROR_IO … … 91 93 ; Check Master-Boot-Record Signature 92 94 cmp wptr ds:[CurMBR+01FEh], 0AA55h 93 je AlreadyInitialized95 ;;je AlreadyInitialized ; Rousseau: always initialize 94 96 95 97 mov ax, cs … … 107 109 mov si, offset TXT_Done 108 110 call MBR_Teletype 111 112 ; Rousseau: added 113 Clear: 114 call MBR_ClearReservedSectors 115 mov si, offset TXT_Cleared 116 call MBR_Teletype 117 ; Rousseau: end added 118 109 119 jmp GoByeBye 110 120 … … 132 142 MBR_Teletype EndP 133 143 144 145 ; Rousseau: added 146 MBR_ClearReservedSectors Proc Near 147 mov ax, cs 148 mov es, ax ; Make sure that ES is right 149 mov cx, 2 ; Index of first reserved sector to clear 150 MBR_ClearReservedSectors_loop: 151 push cx ; Put on stack for later use 152 mov bx, offset ZeroSEC ; Block of 0's 153 mov dx, 0080h ; First harddrive, Sector in cx 154 ;mov cx, 0001h 155 mov ax, 0301h ; Function 03, 1 sector to write 156 int 13h 157 pop cx ; Pop sector-index 158 inc cx ; Next sector 159 cmp cx, 62 ; If below 63 (Possible LVM) then... 160 jbe MBR_ClearReservedSectors_loop ; Repeat 161 ret 162 MBR_ClearReservedSectors EndP 163 164 165 134 166 CurMBR db 512 dup (?) 167 ZeroSEC db 512 dup (0) ; Rousseau: added 135 168 136 169 code_seg ends -
tags/v1.07r/TOOLS/DOS/INITHDD/MAKE.BAT
r29 r30 19 19 echo Errorlevel not 0, make failed 20 20 :ExitMe 21 pause21 rem pause -
tags/v1.07r/TOOLS/INTERNAL/FIXCODE.ASM
r29 r30 91 91 92 92 mov ah, 3Fh 93 mov cx, 30720; Image size93 mov cx, image_size ; Image size 94 94 mov dx, offset BootCode 95 95 int 21h ; DOS: READ FILE … … 98 98 call ShowError 99 99 100 DoneReadCode: cmp ax, 30720100 DoneReadCode: cmp ax, image_size 101 101 je DoneReadCode2 102 102 InvalidCode: mov dx, offset COM_FailedInvalidCode … … 232 232 233 233 mov ah, 40h 234 mov cx, 30720; Image size234 mov cx, image_size ; Image size 235 235 mov dx, offset BootCode 236 236 int 21h ; DOS: WRITE FILE … … 239 239 call ShowError 240 240 241 DoneWriteCode: cmp ax, 30720241 DoneWriteCode: cmp ax, image_size 242 242 jne FailedWriteCode 243 243 … … 250 250 251 251 ; Buffers for files 252 BootCode db 30720dup (?)252 BootCode db image_size dup (?) 253 253 MBRProtection db 1024 dup (?) 254 254 -
tags/v1.07r/TOOLS/INTERNAL/MAKE.BAT
r29 r30 6 6 %linker% fixcode.obj >nul 7 7 if errorlevel 1 goto Failed 8 %exe2bin% fixcode.exe fixcode.com>nul8 %exe2bin% FIXCODE.EXE FIXCODE.COM >nul 9 9 if errorlevel 1 goto Failed 10 10 … … 17 17 echo Errorlevel not 0, make failed 18 18 :ExitMe 19 pause19 rem pause -
tags/v1.07r/TOOLS/OS2/SETABOOT/SETABOOT.C
r29 r30 17 17 // 18 18 19 /* 20 // Rousseau: 2011-02-05 21 // - Made volumes compare case insensitive so fs-label matches volume-name on command-line. (around line 510) 22 // This means bootable volumes cannot not have the same and only differ in case. 23 */ 24 25 19 26 #define INCL_BASE 20 27 #define INCL_WINSHELLDATA … … 62 69 63 70 typedef struct _AiRBOOTCONFIG { 64 CHAR Identifier[13]; 71 CHAR Identifier[13]; // Rousseau: INVISIBLE CHAR AT END ! 65 72 UCHAR MajorVersion; 66 73 UCHAR MinorVersion; … … 110 117 UCHAR AutomaticPartition; 111 118 UCHAR ForceLBAUsage; 119 UCHAR IgnoreLVM; 120 UCHAR Reserved[82]; 121 CHAR InstallVolume[12]; 112 122 } AiRBOOTCONFIG; 113 123 typedef AiRBOOTCONFIG *PAiRBOOTCONFIG; 124 125 114 126 115 127 typedef struct _AiRBOOTIPENTRY { … … 139 151 140 152 153 /* Executables to search for */ 154 PCHAR classic_setboots[] = { 155 "SETBM.EXE", 156 NULL 157 }; 158 159 160 /* 161 // ProtoTypes. 162 */ 163 BOOL Track0DetectAirBoot (BOOL* ab_bad); 164 BOOL Track0WriteAiRBOOTConfig (void); 165 166 167 141 168 USHORT CountHarddrives (void) { 142 169 USHORT NumDrives = 0; … … 149 176 USHORT OS2_GetIOCTLHandle () { 150 177 USHORT IOCTLHandle = 0; 151 178 152 179 if (DosPhysicalDisk(INFO_GETIOCTLHANDLE, &IOCTLHandle, sizeof(IOCTLHandle),"1:" , 3) != 0) 153 180 return 0; … … 236 263 } 237 264 265 266 APIRET QueryBootDrive(char *bootdrv) 267 { 268 ULONG aulSysInfo[QSV_MAX] = {0}; // System Information Data Buffer 269 APIRET rc = NO_ERROR; // Return code 270 271 if(bootdrv==0) return 1; 272 273 rc = DosQuerySysInfo(1L, // Request all available system 274 QSV_MAX , // information 275 (PVOID)aulSysInfo, // Pointer to buffer 276 sizeof(ULONG)*QSV_MAX); // Size of the buffer 277 278 if (rc != NO_ERROR) { 279 return 1; 280 } 281 else { 282 //printf("Bootable drive: %c:\n", 283 // aulSysInfo[QSV_BOOT_DRIVE-1]+'A'-1); /* Max length of path name */ 284 bootdrv[0]=aulSysInfo[QSV_BOOT_DRIVE-1]+'A'-1; 285 286 /* 287 printf("Total physical memory is %u bytes.\n", 288 aulSysInfo[QSV_TOTPHYSMEM-1]); 289 */ 290 291 return 0; 292 } 293 294 295 } 296 238 297 USHORT GetChecksumOfSector (USHORT BaseCheck, USHORT SectorNo) { 239 298 PUSHORT CurPos = (PUSHORT)((ULONG)&Track0+(SectorNo-1)*512); … … 246 305 } 247 306 248 BOOL Track0DetectAirBoot (void) { 249 USHORT ResultCheck; 250 USHORT CurSectorNo = 0; 251 252 AiRBOOT_CodeSig = (PAiRBOOTCODESIG)&Track0[2]; 253 AiRBOOT_Config = (PAiRBOOTCONFIG)&Track0[(55-1)*512]; 254 AiRBOOT_IPT = (PAiRBOOTIPENTRY)&Track0[(56-1)*512]; 255 256 if (strncmp(AiRBOOT_CodeSig->Identifier, "AiRBOOT", 7)!=0) { 257 return FALSE; 258 } 259 260 if ((AiRBOOT_CodeSig->TotalCodeSectors)>53) { 261 puts ("SETABOOT: AiR-BOOT Code damaged!"); 262 return FALSE; 263 } 264 265 ResultCheck = 0; CurSectorNo = 0; 266 while (CurSectorNo<AiRBOOT_CodeSig->TotalCodeSectors) { 267 ResultCheck = GetChecksumOfSector(ResultCheck, CurSectorNo+2); 268 CurSectorNo++; 269 } 270 if (ResultCheck!=AiRBOOT_CodeSig->CheckSumOfCode) { 271 puts ("SETABOOT: AiR-BOOT Code damaged!"); 272 return FALSE; 273 } 274 275 if (strncmp(AiRBOOT_Config->Identifier, "AiRCFG-TABLE", 13)!=0) { 276 puts ("SETABOOT: AiR-BOOT Config damaged!"); 277 return FALSE; 278 } 279 280 // Set Config-CheckSum to 0 281 AiRBOOT_ConfigCheckSum = AiRBOOT_Config->CheckSumOfConfig; 282 AiRBOOT_Config->CheckSumOfConfig = 0; 283 284 // Calculate CheckSum... 285 ResultCheck = 0; CurSectorNo = 55; 286 while (CurSectorNo<60) { 287 ResultCheck = GetChecksumOfSector(ResultCheck, CurSectorNo); 288 CurSectorNo++; 289 } 290 if (ResultCheck!=AiRBOOT_ConfigCheckSum) { 291 puts ("SETABOOT: AiR-BOOT Config damaged!"); 292 return FALSE; 293 } 294 return TRUE; 295 } 296 297 BOOL Track0WriteAiRBOOTConfig (void) { 298 USHORT ResultCheck; 299 USHORT CurSectorNo = 0; 300 301 // Update Edit-Counter... 302 AiRBOOT_Config->EditCounter++; 303 AiRBOOT_Config->CheckSumOfConfig = 0; 304 305 // Calculate CheckSum... 306 ResultCheck = 0; CurSectorNo = 55; 307 while (CurSectorNo<60) { 308 ResultCheck = GetChecksumOfSector(ResultCheck, CurSectorNo); 309 CurSectorNo++; 310 } 311 AiRBOOT_Config->CheckSumOfConfig = ResultCheck; 312 313 if (!Track0Write()) 314 return FALSE; 315 return TRUE; 316 } 317 318 int main (int argc, char **argv) { 307 308 309 310 /* 311 // If AiR-BOOT is not installed, the user probably meant to control OS/2 BM with this utility. 312 // Since the functionality of this utility is for AiR-BOOT only, we will pass the request to 313 // the OS/2 BM SETBOOT utility which is called SETBM.EXE as of eCS 2.01. 314 // Since the objective here is to supply OS/2 BM SETBOOT compatibility, if SETBM.EXE is not found, 315 // some other system locations are searched for the OS/2 version of SETBOOT.EXE. 316 // Any SETBOOT.EXE that is found and that does not have a module-name of "setaboot" is invoked, 317 // and passed along the command-line the user issued. 318 // In this case also the return-value of the OS/2 version of SETBOOT.EXE is returned. 319 */ 320 int DoClassicActions(int argc, char **argv) { 321 APIRET rc = -1; 322 RESULTCODES crc = {-1,-1}; 323 PTIB ptib = NULL; 324 PPIB ppib = NULL; 325 char buffer[256] = "\0"; 326 char cmdline[256] = "\0"; 327 PSZ path = NULL; 328 char sresult[256] = "\0"; 329 char bootdrive = '?'; 330 char* p = NULL; 331 int i = 0; 332 333 //printf("\nCLASSIC ACTIONS !! (%d)\n", argc); 334 335 rc = QueryBootDrive(&bootdrive); 336 337 rc = DosScanEnv("PATH", &path); 338 rc = DosSearchPath(SEARCH_CUR_DIRECTORY | SEARCH_IGNORENETERRS, 339 path, 340 classic_setboots[0], 341 sresult, 342 sizeof(sresult)); 343 344 //printf("SRESULT: rc=%d, %s\n", rc, sresult); 345 346 if (rc) { 347 printf("\n"); 348 printf("ERROR: SETBOOT (AiR-BOOT version)\n"); 349 printf("Since the AiR-BOOT Boot Manager is not installed, this program (SETBOOT.EXE), funcions as a wrapper\n"); 350 printf("to %s that should be used to control IBM Boot Manager.\n", classic_setboots[0]); 351 printf("However, %s could not be found in the PATH, the error-code is: %d\n", classic_setboots[0], rc); 352 printf("You can resolve this situation by renaming a valid SETBOOT.EXE to %s\n", classic_setboots[0]); 353 printf("and put it in your %c:\\OS2 directory.", bootdrive); 354 printf("\n"); 355 exit(rc); 356 } 357 358 359 360 361 memset(cmdline, 0, sizeof(cmdline)); // Clear the command-line buffer. 362 p = cmdline; // Temporary pointer to insert arguments. 363 strcpy(p, sresult); // Copy the program-name. 364 p += strlen(sresult)+1; // Advance to point for space separated parameters. 365 366 /* 367 // Process all the arguments, 368 // inserting the separated by a space. 369 */ 370 for (i=1; i<argc; i++) { 371 strcpy(p, argv[i]); // Copy the argument. 372 p += strlen(argv[i]); // Advance pointer past argument. 373 *p++ = ' '; // Space separation. 374 } 375 376 /* 377 for (i=0; i<100; i++) { 378 printf("%c", cmdline[i] ? cmdline[i] : '#'); 379 } 380 printf("\n"); 381 */ 382 383 //printf("CMDLINE: %s\n", cmdline); 384 //printf("CMDLINE+: %s\n", cmdline+strlen(sresult)+1); 385 386 rc = DosExecPgm(buffer, 387 sizeof(buffer), 388 EXEC_SYNC, 389 cmdline, 390 NULL, 391 &crc, 392 sresult); 393 394 //rc = 3; 395 if (rc) { 396 printf("\n"); 397 printf("ERROR: SETBOOT (AiR-BOOT version)\n"); 398 printf("Since the AiR-BOOT Boot Manager is not installed, this program (SETBOOT.EXE), funcions as a wrapper\n"); 399 printf("to %s that should be used to control IBM Boot Manager.\n", classic_setboots[0]); 400 printf("However, something went wrong when executing %s.\n", classic_setboots[0]); 401 printf("The error-code is: %d and the termination-code is: %d\n", rc, crc.codeTerminate); 402 printf("\n"); 403 exit(rc); 404 } 405 406 407 //printf("DosExecPgm: rc=%08X, codeterminate=%08X, coderesult=%08X\n", rc, crc.codeTerminate, crc.codeResult); 408 409 /* 410 rc = DosGetInfoBlocks(&ptib, &ppib); 411 412 rc = DosQueryModuleName(ppib->pib_hmte, sizeof(buffer), buffer); 413 printf("MODULE: %s\n", buffer); 414 printf("CMDLINE: %s\n", ppib->pib_pchcmd); 415 */ 416 417 return crc.codeResult; 418 } 419 420 421 int DoAirBootActions(int argc, char **argv, BOOL ab_detected, BOOL ab_bad) { 319 422 ULONG CurArgument = 0; 320 423 ULONG ArgumentLen = 0; … … 347 450 ULONG XWPBootCount = 0; 348 451 CHAR XWPBootName[30][12]; 349 CHAR XWPBootCommand[30][28]; // 'setaboot /IBA:""' (16 chars)452 CHAR XWPBootCommand[30][28]; // 'setaboot /IBA:""' (16 chars) 350 453 BOOL XWPEntryFound = FALSE; 454 BOOL CDBoot = FALSE; // TRUE if booted from CD; New System will be added when using /4:"LABEL" 455 BOOL Track0Loaded = FALSE; // Assume track0 did not load correctly. 456 BOOL AiRBOOTBad = FALSE; 457 458 //printf("\nAiR-BOOT ACTIONS !!\n"); 459 460 AiRBOOTDetected = ab_detected; 461 AiRBOOTBad = ab_bad; 462 463 if (AiRBOOTBad) 464 return 1; 351 465 352 466 // Use OSO001.MSG, so we safe us the trouble of translating :) … … 354 468 return 1; 355 469 356 puts ("SETABOOT - AiR-BOOT Configuration Utility (OS/2) - (c) 2004-2009 by M. Kiewitz"); 470 /* 471 // Rousseau: changed version to be the same as the AiR-BOOT is accompanies. 472 */ 473 //puts ("SETABOOT - AiR-BOOT Configuration Utility (OS/2) - (c) 2004-2009 by M. Kiewitz"); 474 puts ("SETABOOT v1.07 - AiR-BOOT Configuration Utility - (c) 2004-2011 by M. Kiewitz"); 475 476 477 //return 0; 478 479 /* 480 // Rousseau: 481 // Log some debug stuff to (virtual) flop. 482 */ 483 /* 484 { 485 char buf[512]="\0"; 486 FILE* fp = NULL; 487 int i = 0; 488 489 fp = fopen("A:\\SETBOOT.TXT", "a"); 490 sprintf(buf, "Bliep"); 491 fprintf(fp,"Program: %s\n", argv[0]); 492 fprintf(fp,"Arguments: %d\n", argc); 493 for (i=0; i<argc-1; i++) { 494 fprintf(fp, "Arg %d: %s\n", i+1, argv[i+1]); 495 } 496 fprintf(fp, "\n"); 497 fclose(fp); 498 } 499 */ 500 501 502 503 /* 504 // Rousseau: ## Enable boot-through when installing new system ## 505 // In the install-environment, the MEMDRIVE env-var is defined. 506 // This modifies the behavior after phase 1. 507 */ 508 if (getenv("MEMDRIVE")) { 509 printf("CDBoot Environment.\n"); 510 CDBoot = TRUE; 511 } 512 357 513 358 514 if (argc==1) { … … 361 517 } 362 518 519 520 521 363 522 // Now we check for AiR-BOOT existance... 523 /* 364 524 if (CountHarddrives()>0) { 365 525 if (Track0Load()) { 366 if (Track0DetectAirBoot()) AiRBOOTDetected = TRUE; 367 } else { 526 // Rousseau: Track0DetectAirBoot() will init globals. 527 if (Track0DetectAirBoot()) // REPLACE WITH BOOL 528 AiRBOOTDetected = TRUE; 529 } 530 else { 368 531 MSG_Print (TXT_ERROR_DuringAccessHDD); 369 532 } 370 } else { 533 } 534 else { 371 535 MSG_Print (TXT_ERROR_DuringAccessHDD); 372 } 536 } 537 */ 373 538 374 539 CurArgument = 1; … … 460 625 461 626 *StartPos = 0; StartPos++; 627 462 628 // Search that partition in IPT of AiR-BOOT... 463 629 if ((CurChar=='4') && (ArgumentLen==0)) { … … 475 641 } 476 642 643 644 /* 645 // Rousseau: 646 // Insert label of newly installed system in AiR-BOOT configuration. 647 // Note that it is changed to uppercase because AiR-BOOT uses the FS-label when 648 // scanning partitions and LVM-info is not found. (Otherwise PART-label) 649 // The auto-boot flag is not set in this case as this is handled by the AiR-BOOT loader. 650 */ 651 if (CDBoot) { 652 strncpy(AiRBOOT_Config->InstallVolume, _strupr(StartPos), ArgumentLen); 653 AiRBOOT_Config->InstallVolume[ArgumentLen] = '\0'; 654 printf("Writing Install Volume: %s to AiR-BOOT configuration.\n", AiRBOOT_Config->InstallVolume); 655 Track0WriteAiRBOOTConfig(); 656 return 0; 657 } 658 659 660 661 477 662 BadValue = TRUE; 478 663 CurPartitionNo = 0; CurIPTEntry = AiRBOOT_IPT; 479 664 while (CurPartitionNo<AiRBOOT_Config->Partitions) { 480 if (strncmp(CurIPTEntry->PartitionName, StartPos, ArgumentLen)==0) { 665 /* 666 // Rousseau: Changed below to case-insensitive compare. 667 // This solves the part/vol-label (mixed-case) v.s. fs-label (upper-case) issue. 668 */ 669 /*if (strncmp(CurIPTEntry->PartitionName, StartPos, ArgumentLen)==0) {*/ 670 if (strnicmp(CurIPTEntry->PartitionName, StartPos, ArgumentLen)==0) { 481 671 if (ArgumentLen==11) { 482 672 BadValue = FALSE; … … 495 685 CurPartitionNo++; CurIPTEntry++; 496 686 } 687 497 688 498 689 if (BadValue) { … … 602 793 PrfWriteProfileData (HINI_USERPROFILE, "XWorkplace", "RebootTo", XWPOrgStringPtr, XWPStringSize); 603 794 free(XWPOrgStringPtr); 604 795 605 796 puts ("SETABOOT: XWorkPlace updated."); 606 797 return 0; … … 611 802 return 1; 612 803 } 613 printf ("SETABOOT: AiR-BOOT %X.%02X detected.\n\n", AiRBOOT_CodeSig->MajorVersion, AiRBOOT_CodeSig->MinorVersion); 804 printf("SETABOOT: AiR-BOOT %X.%02X detected.\n\n", AiRBOOT_CodeSig->MajorVersion, AiRBOOT_CodeSig->MinorVersion); 805 //printf("DEBUG: InstallVolume: %s\n", AiRBOOT_Config->InstallVolume); 614 806 if (AiRBOOT_Config->BootMenuActive) { 615 807 if (AiRBOOT_Config->TimedBoot) { … … 697 889 } 698 890 return 0; 891 892 893 894 } 895 896 897 /* 898 // Rousseau: 899 // Global pointers will be initialized here ! 900 */ 901 BOOL Track0DetectAirBoot (BOOL* ab_bad) { 902 USHORT ResultCheck; 903 USHORT CurSectorNo = 0; 904 905 /* Globals that get initialized */ 906 AiRBOOT_CodeSig = (PAiRBOOTCODESIG)&Track0[2]; 907 AiRBOOT_Config = (PAiRBOOTCONFIG)&Track0[(55-1)*512]; 908 AiRBOOT_IPT = (PAiRBOOTIPENTRY)&Track0[(56-1)*512]; 909 910 if (strncmp(AiRBOOT_CodeSig->Identifier, "AiRBOOT", 7)!=0) { 911 *ab_bad = FALSE; 912 return FALSE; 913 } 914 915 if ((AiRBOOT_CodeSig->TotalCodeSectors)>53) { 916 puts ("SETABOOT: AiR-BOOT Code damaged!"); 917 *ab_bad = TRUE; 918 return TRUE; 919 } 920 921 ResultCheck = 0; CurSectorNo = 0; 922 while (CurSectorNo<AiRBOOT_CodeSig->TotalCodeSectors) { 923 ResultCheck = GetChecksumOfSector(ResultCheck, CurSectorNo+2); 924 CurSectorNo++; 925 } 926 if (ResultCheck!=AiRBOOT_CodeSig->CheckSumOfCode) { 927 puts ("SETABOOT: AiR-BOOT Code damaged!"); 928 *ab_bad = TRUE; 929 return TRUE; 930 } 931 932 if (strncmp(AiRBOOT_Config->Identifier, "AiRCFG-TABLE", 13)!=0) { // Rousseau: INVISIBLE CHAR HERE ! 933 puts ("SETABOOT: AiR-BOOT Config damaged!"); 934 *ab_bad = TRUE; 935 return TRUE; 936 } 937 938 // Set Config-CheckSum to 0 939 AiRBOOT_ConfigCheckSum = AiRBOOT_Config->CheckSumOfConfig; 940 AiRBOOT_Config->CheckSumOfConfig = 0; 941 942 // Calculate CheckSum... 943 ResultCheck = 0; CurSectorNo = 55; 944 while (CurSectorNo<60) { 945 ResultCheck = GetChecksumOfSector(ResultCheck, CurSectorNo); 946 CurSectorNo++; 947 } 948 if (ResultCheck!=AiRBOOT_ConfigCheckSum) { 949 puts ("SETABOOT: AiR-BOOT Config damaged!"); 950 *ab_bad = TRUE; 951 return TRUE; 952 } 953 *ab_bad = FALSE; 954 return TRUE; 699 955 } 956 957 BOOL Track0WriteAiRBOOTConfig (void) { 958 USHORT ResultCheck; 959 USHORT CurSectorNo = 0; 960 961 // Update Edit-Counter... 962 AiRBOOT_Config->EditCounter++; 963 AiRBOOT_Config->CheckSumOfConfig = 0; 964 965 // Calculate CheckSum... 966 ResultCheck = 0; CurSectorNo = 55; 967 while (CurSectorNo<60) { 968 ResultCheck = GetChecksumOfSector(ResultCheck, CurSectorNo); 969 CurSectorNo++; 970 } 971 AiRBOOT_Config->CheckSumOfConfig = ResultCheck; 972 973 if (!Track0Write()) 974 return FALSE; 975 return TRUE; 976 } 977 978 979 /* 980 // Rousseau: # This is the main entry-point # 981 // Special behavior if eCS is booted from CDROM and phase 1 called this program. 982 // In that case, the name of the newly installed system is put in the AiR-BOOT configuration. 983 // This will cause AiR-BOOT to boot through after phase 1. 984 */ 985 int main (int argc, char **argv) { 986 BOOL AiRBOOTDetected = FALSE; 987 BOOL Track0Loaded = FALSE; // Assume track0 did not load correctly. 988 BOOL AiRBOOTBad = FALSE; 989 int rc = -1; 990 991 992 /* 993 // Rousseau: ## Changed order to first check for AiR-BOOT existance ## 994 // If AiR-BOOT is not installed, all action is passed-thru to IBM SETBOOT (SETBM.EXE). 995 */ 996 997 998 /* 999 // Try to load track zero. 1000 // We don't care if no harddisk is present, since we first want to know if AiR-BOOT is 1001 // installed to adjust our behaviour. 1002 // If it's not installed, or a loading error occurs, all actions will be deferred to 1003 // IBM SETBOOT (SETBM.EXE). 1004 // This means we also let IBM SETBOOT handle the situation in which no HD's are present. 1005 */ 1006 Track0Loaded = Track0Load(); 1007 1008 /* 1009 // Now see if AiR-BOOT is present. 1010 // If there was a loading error, no AiR-BOOT signature will be present, so 1011 // we pass-thru to IBM SETBOOT. 1012 */ 1013 AiRBOOTDetected = Track0DetectAirBoot(&AiRBOOTBad); 1014 1015 if (AiRBOOTDetected) { 1016 rc = DoAirBootActions(argc, argv, AiRBOOTDetected, AiRBOOTBad); 1017 } 1018 else { 1019 rc = DoClassicActions(argc, argv); 1020 } 1021 1022 1023 return rc; 1024 } -
tags/v1.07r/TOOLS/OS2/SETABOOT/SETABOOT.TGT
r29 r30 22 22 5 23 23 MCommand 24 0 24 117 25 @ren SETABOOT.EXE SETABOOT.XEX 26 @ren SETABOOT.XEX SETABOOT.EXE 27 copy SETABOOT.EXE ..\..\..\RELEASE\OS2\SETABOOT.EXE 28 25 29 6 26 30 MItem 27 31 12 28 setaboot.exe 32 SETABOOT.EXE 29 33 7 30 34 WString … … 33 37 8 34 38 WVList 35 2 39 4 36 40 9 37 M CState41 MVState 38 42 10 39 43 WString … … 42 46 11 43 47 WString 48 22 49 ?????Other options(,): 50 1 51 12 52 WString 53 19 54 op map=SETABOOT.MAP 55 0 56 13 57 MCState 58 14 59 WString 60 7 61 OS2LINK 62 15 63 WString 44 64 13 45 65 ?????Map file 46 66 1 47 67 0 48 1 268 16 49 69 MCState 50 1 370 17 51 71 WString 52 72 7 53 73 OS2LINK 54 1 474 18 55 75 WString 56 76 24 … … 58 78 1 59 79 0 60 15 80 19 81 MVState 82 20 83 WString 84 7 85 OS2LINK 86 21 87 WString 88 22 89 ?????Other options(,): 90 0 91 22 92 WString 93 19 94 op map=SETABOOT.MAP 95 0 96 23 97 WVList 98 1 99 24 100 ActionStates 101 25 102 WString 103 5 104 &Make 105 26 61 106 WVList 62 107 0 … … 65 110 1 66 111 0 67 16 112 27 68 113 WPickList 69 114 2 70 17 115 28 71 116 MItem 72 117 3 73 118 *.C 74 18 119 29 75 120 WString 76 121 4 77 122 COBJ 78 19 123 30 79 124 WVList 80 125 0 81 20 126 31 82 127 WVList 83 128 0 … … 86 131 1 87 132 0 88 21 133 32 89 134 MItem 90 135 10 91 136 SETABOOT.C 92 22 137 33 93 138 WString 94 139 4 95 140 COBJ 96 23 141 34 97 142 WVList 98 143 0 99 24 144 35 100 145 WVList 101 146 0 102 17 147 28 103 148 1 104 149 1 -
tags/v1.07r/TOOLS/OS2/SETABOOT/SETABOOT.WPJ
r29 r30 5 5 1 6 6 WRect 7 08 07 840 8 620 9 9 7680 10 921 610 9210 11 11 2 12 12 MProject … … 21 21 WFileName 22 22 12 23 setaboot.tgt 23 SETABOOT.TGT 24 24 6 25 25 WVList … … 31 31 0 32 32 0 33 56 7034 421 533 5664 34 4210 35 35 0 36 36 0 … … 38 38 WFileName 39 39 12 40 setaboot.tgt 40 SETABOOT.TGT 41 41 0 42 42 0 -
trunk/BOOTCODE/AIR-BOOT.ASM
r29 r30 17 17 ; 18 18 19 ; ------------------- 20 ; Rousseau: # Fixes # 21 ; ------------------- 22 ; # Huge Drives and LVM # 23 ; When using disks >512GB under eComStation, the drive geometry changes to 24 ; 127 or 255 sectors per track. Since LVM-info is written at the last sector 25 ; of a track, and AiR-BOOT uses the geometry of the MBR, it cannot find the 26 ; LVM-info and the eCS partition / volume bootsector. 27 ; This has been fixed. 28 ; Now, when an eCS-partition is discovered and the drive is >512GB, AiR-BOOT 29 ; will use the eCS geometry to locate the LVM-info and the bootsector. 30 ; 31 ; # Special loader handling # 32 ; The special handling of partition boot-loaders has been enhanced to 33 ; enable booting of legacy sysems on huge drives with or without OS/2 34 ; extended geometry. 35 ; 36 ; # eComStation boot-through after phase 1 # 37 ; A special functionality is implemented to directly boot the newly 38 ; installed system ; when installing eCS without showing the Boot Menu, 39 ; independant of user settings. 40 ; This works in conjuntion with the OS/2 specific SETABOOT.EXE program, 41 ; also part of this AiR-BOOT package. 42 ; 43 ; # Math, Debug, Conv and Aux modules # 44 ; These are used for 32-bit arithmatic on 16-bit code, 45 ; debug the booting process, converting between data-types 46 ; and outputting log-data to the com-port. 47 48 49 19 50 ;--------------------------------------------------------------------------- 20 51 ; AiR-BOOT / MAIN-CODE 21 52 ;--------------------------------------------------------------------------- 22 ; 23 53 ; 54 55 56 ; ---------------------------- 57 ; Rousseau: # JUMPS disabled # 58 ; ---------------------------- 59 ; We actually don't want to use this directive because it generates extra 60 ; NOP instructions that we can do without. 61 ; Relative conditional jumps that are out-of-range are manually reworked by 62 ; skipping an unconditional jump to the target on base of complementary 63 ; 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. 66 ; NOJUMPS seems to have no effect in this situation. 67 ; In this case 4 NOP instructions are generated after forward referencing jump 68 ; instructions, to allow for automatic recoding by TASM. 69 ; This seems to be a TASM bug. (v2,v3,v4, dunno v5) 70 ; 71 ;JUMPS 72 ; 73 74 ; 75 ; If defined then each module is prefixed with it's name. 76 ; This is used for debugging purposes. 77 ; It should be off in release code. 78 ; 79 ;ModuleNames equ 1 80 81 82 83 ; 84 ; The first harddisk is BIOS coded 80h. 85 ; This makes a total of 128 disk could be supported using this coding. 86 ; This value is used to store disk-information and this info is allocated 87 ; in the BSS. 88 ; 89 MaxDisks equ 16 90 91 ; 92 ; If defined then include DEBUG.ASM and output debug-info to serial-port. 93 ; 94 AuxDebug equ 1 95 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) 106 ; 24 107 ; If ReleaseCode is not defined, it will produce debug-able code... 25 ReleaseCode equ -1 26 27 JUMPS 28 108 ; 109 ReleaseCode equ -1 ; Rousseau: this should be replaced 110 ; 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. 114 115 ; 29 116 ; All Special Equs for this project 30 117 ; 118 119 ; Use different addresses depending on whether in pre-boot or debug environment. 31 120 IFDEF ReleaseCode 32 StartBaseSeg equ 00000h 33 StartBasePtr equ 07C00h ; BIOS starts our MBR at 0:7C00121 StartBaseSeg equ 00000h ; Pre-boot, so we are in low memory 122 StartBasePtr equ 07C00h ; BIOS starts our MBR at 0:7C00 34 123 ELSE 35 StartBaseSeg equ 03A98h ; Adjust to DOS segment36 StartBasePtr equ 00100h 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 37 126 ENDIF 38 BootBaseSeg equ 8000h 39 BootBasePtr equ 0h ; We put our MBR to this location 40 BootBaseExec equ BootBasePtr+offset MBR_RealStart 41 StackSeg equ 7000h 42 127 128 ; Address labels after code-move 129 BootBaseSeg equ 8000h ; Pre-boot, somewhere in the low 640K 130 BootBasePtr equ 0h ; We put our MBR to this location 131 BootBaseExec equ BootBasePtr+offset MBR_RealStart 132 StackSeg equ 7000h ; Put the stack below the code 133 134 ; Video pages, no INT 10h is used for menu-drawing etc. 43 135 VideoIO_Page0 equ 0B800h 44 136 VideoIO_Page1 equ 0B900h … … 47 139 VideoIO_FXSegment equ 0A000h 48 140 141 ; Include 49 142 Include ..\INCLUDE\asm.inc 50 ;Include ..\INCLUDE\DOS\airboot.inc 51 143 ;Include ..\INCLUDE\DOS\airboot.inc ; does not exist anymore 144 145 ; Special line-drawing characters 52 146 TextChar_WinLineRight equ 0C4h ; 'Ä' 53 147 TextChar_WinLineDown equ 0B3h ; '³' … … 60 154 61 155 ; Offsets for Partition-Entries in MBR/EPRs 62 LocBRPT_LenOfEntry equ 16 63 LocBRPT_Flags equ 0 64 LocBRPT_BeginCHS equ 1 65 LocBRPT_BeginHead equ 1 66 LocBRPT_BeginSector equ 2 67 LocBRPT_BeginCylinder equ 3 68 LocBRPT_SystemID equ 4 69 LocBRPT_EndCHS equ 5 156 LocBRPT_LenOfEntry equ 16 ; Length of a standard MBR or EPR entry 157 LocBRPT_Flags equ 0 ; Bootable, Hidden, etc. 158 LocBRPT_BeginCHS equ 1 ; Combined 10-bits cyl with 6 bits 159 LocBRPT_BeginHead equ 1 ; Start head (0<=H<255) 255 is invalid ! 160 LocBRPT_BeginSector equ 2 ; Start sector (1<=S<=255) 161 LocBRPT_BeginCylinder equ 3 ; Start cylinder (0<=C<[1024,16384,65536,n]) 162 LocBRPT_SystemID equ 4 ; Type of system using the partition 163 LocBRPT_EndCHS equ 5 ; Same for end of partition 70 164 LocBRPT_EndHead equ 5 71 165 LocBRPT_EndSector equ 6 72 166 LocBRPT_EndCylinder equ 7 73 LocBRPT_RelativeBegin equ 8 74 LocBRPT_AbsoluteLength equ 12 75 76 LocBR_Magic equ 510 167 LocBRPT_RelativeBegin equ 8 ; Where the ... 168 LocBRPT_AbsoluteLength equ 12 ; ? 169 170 LocBR_Magic equ 510 ; ? 77 171 78 172 ; 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 173 LocLVM_SignatureStart equ 0 ; 174 LocLVM_SignatureByte0 equ 2 ; 175 LocLVM_CRC equ 8 ; CRC is a DWORD 176 LocLVM_MaxEntries equ 4 ; Max entries in the track0 LVM-sector 177 LocLVM_StartOfEntries equ 60 ; (contains maximum of 4 entries) 178 LocLVM_LenOfEntry equ 60 ; ? 179 LocLVM_VolumeID equ 0 ; is DWORD 180 LocLVM_PartitionID equ 4 ; is DWORD 181 LocLVM_PartitionSize equ 8 ; is DWORD 182 LocLVM_PartitionStart equ 12 ; is DWORD 183 LocLVM_VolumeLetter equ 18 ; is BYTE (Letter C-Z or 0) (relative to entry) 184 185 ; Rousseau: added (index in LVM-sector) 186 LocLVM_Secs equ 20h ; Sectors per Track ; Rousseau: this one is used for the OS/2 extended geometry 187 LocLVM_Heads equ 1ch ; Number of heads 188 LocLVM_VolumeLetter2 equ 78 ; is BYTE (Letter C-Z or 0) ; FOUT !! niet entry relative ! 189 LocLVM_Startable equ 77 ; is startable (newly installed system) ; FOUT !! niet entry relative ! 190 LocLVM_OnBootMenu equ 76 ; is on bootmenu ; FOUT !! niet entry relative ! 191 192 LocLVM_VolumeName equ 20 ; 20 bytes 193 LocLVM_PartitionName equ 40 ; 20 bytes 194 195 196 92 197 93 198 ; Offsets for IPT (Internal Partition Table) 94 LocIPT_MaxPartitions equ 30 ; Maximum LocIPT_MaxPartitions 95 LocIPT_LenOfSizeElement equ 6 ; Size of one Size-Element 96 LocIPT_LenOfIPT equ 34 97 LocIPT_Serial equ 0 98 LocIPT_Name equ 4 99 LocIPT_Drive equ 15 ; Drive-ID 100 LocIPT_SystemID equ 16 ; Partition-Type 101 LocIPT_Flags equ 17 ; AiR-BOOT Flags for partition 102 LocIPT_BootRecordCRC equ 18 ; CRC of Boot-Record 103 LocIPT_LocationBegin equ 20 ; Begin of Partition 104 LocIPT_LocationPartTable equ 23 ; PartitionTable of Partition 105 LocIPT_AbsoluteBegin equ 26 ; Absolute Sector of Begin 106 LocIPT_AbsolutePartTable equ 30 ; Absolute Sector of PartTable 107 108 LocIPT_DefaultFlags equ 00000011b ; Don't know if boot-able :) 109 LocIPT_DefaultNonBootFlags equ 00000010b ; ...VIBR Detection is always on 199 LocIPT_MaxPartitions equ partition_count ; Maximum LocIPT_MaxPartitions 200 LocIPT_LenOfSizeElement equ 6 ; Size of one Size-Element 201 LocIPT_LenOfIPT equ 34 ; Length of an IPT-entry 202 LocIPT_Serial equ 0 ; Serial from MBR ? 203 LocIPT_Name equ 4 ; Name from FS or LVM (part/vol) 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 (06,07,etc) 206 LocIPT_Flags equ 17 ; AiR-BOOT Flags for partition (see below) 207 LocIPT_BootRecordCRC equ 18 ; CRC of Boot-Record 208 LocIPT_LocationBegin equ 20 ; Begin of Partition 209 LocIPT_LocationPartTable equ 23 ; PartitionTable of Partition 210 LocIPT_AbsoluteBegin equ 26 ; Absolute Sector of Begin 211 LocIPT_AbsolutePartTable equ 30 ; Absolute Sector of PartTable 212 213 ; AiR-BOOT IPT-Flags 214 LocIPT_DefaultFlags equ 00000011b ; Don't know if boot-able :) 215 LocIPT_DefaultNonBootFlags equ 00000010b ; ...VIBR Detection is always on 110 216 111 217 Flags_BootAble equ 00000001b 112 218 Flags_VIBR_Detection equ 00000010b 113 219 Flags_HideFeature equ 00000100b 114 Flags_DriveLetter equ 00001000b ; OS/2 FAT16/HPFS only115 Flags_ExtPartMShack equ 00010000b ; Extended Partition M$-Hack req ?220 Flags_DriveLetter equ 00001000b ; OS/2 FAT16/HPFS only 221 Flags_ExtPartMShack equ 00010000b ; Extended Partition M$-Hack req ? 116 222 Flags_NoPartName equ 01000000b 117 Flags_NowFound equ 10000000b ; temp only in OldPartTable 118 Flags_SpecialMarker equ 10000000b ; temp only for HiddenSetup 119 120 FileSysFlags_BootAble equ 00000001b ; Is this Partition boot-able ? 121 FileSysFlags_FAT32 equ 00010000b ; FAT 32 specific name getting 122 FileSysFlags_NoName equ 00100000b ; No Name - use PartitionName 123 FileSysFlags_DriveLetter equ 01000000b ; DriveLetter Feature possible 124 223 Flags_NowFound equ 10000000b ; temp only in OldPartTable 224 Flags_SpecialMarker equ 10000000b ; temp only for HiddenSetup 225 226 FileSysFlags_BootAble equ 00000001b ; Is this Partition boot-able ? 227 FileSysFlags_FAT32 equ 00010000b ; FAT 32 specific name getting 228 FileSysFlags_NoName equ 00100000b ; No Name - use PartitionName 229 FileSysFlags_DriveLetter equ 01000000b ; DriveLetter Feature possible 230 231 ; Navigation keys 125 232 Keys_Up equ 48h 126 233 Keys_Down equ 50h … … 148 255 Keys_Flags_EnterSetup equ 1100b ; Strg+Alt (AL) 149 256 150 .386p 151 model large, basic 152 257 258 ; ------------------------------------------ 259 ; Rousseau: # Changed this from .386 to .286 260 ; ------------------------------------------ 261 ; Because of the TASM-bug the processor had to be changed to turn JUMPS 262 ; off. Existing movzx instructions were replaced with 286 equivalent code. 263 ; Out of range relative jumps have been recoded. 264 ; AiR-BOOT can now run on a 286 processor :-) 265 .286 266 267 ; This influences the uses directive and other stuff, 268 ; like calling-style. 269 ; The model itself,large, has no effect because we generate 270 ; a binairy image and not a segmented executable. 271 .model large, basic 272 273 ; Our code-segment starts here. 274 ; We are running in 16-bit and we like it 153 275 code_seg segment public use16 154 276 assume cs:code_seg, ds:code_seg, es:nothing, ss:nothing 155 277 156 org 00000h ; Sector 1 278 279 280 ;=============================================================================== 281 ; Sector 1 282 283 284 ; We are not a .com file at 100h but a binary image 285 ; of which only the 1st sector gets loaded at 07c00h. 286 org 00000h ; Sector 1 287 288 ; Start of sector 1 289 ; This is the MBR, note the AiRBOOT signature, it's date (2006), version and 290 ; language. 291 ; Version 1.07 was intruduced in 2011. 292 ; It fixes issues with huge drives and lvm and more. 293 294 sos1: 295 296 ; --------------------------------------------- 297 ; Rousseau: # Combined letter and jump offset # 298 ; --------------------------------------------- 299 ; My guess is Martin had a short jump followed by the AiRBOOT signature at first. 300 ; Then he encountered strange behaviour by some M$ operating-systems if the 301 ; the first insruction was not a CLI. 302 ; But there was no room to insert the CLI and of course he did not want to 303 ; change the location of the AiRBOOT signature. 304 ; He solved this by inserting the M$ needed CLI at offset 0 followed by a short 305 ; jump that uses the 'A' of the AiRBOOT signature as the jump displacement. 306 307 157 308 ;--------------------------------------------------------------------------- 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! 162 db 0EBh ; JMP-Short -> MBR_Start 163 db 'AiRBOOT', 13h, 03h, 20h, 06h, 01h, 06h, TXT_LanguageID 309 AiR_BOOT: cli ; Some M$ operating systems need a CLI 310 ; here otherwise they will go beserk ; Rousseau: M$ osses are beserk by definition. 311 ; and will do funny things during 312 ; 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 315 164 316 ; ID String, Date and Version Number, U for US version 165 db 1 ; Total Sectors Count, 166 ; Will get overwritten by FIXBSET.exe 167 MBR_CheckCode dw 0 ; Check-Sum for Code 168 169 MBR_Start: sti ; This opcode is dedicated to: 170 cld ; =MICROSOFT JUMP DEPARTMENT= 171 mov ax, StartBaseSeg 172 mov ds, ax 173 mov si, StartBasePtr 174 mov ax, BootBaseSeg 317 db 1 ; Total Sectors Count, 318 ; Will get overwritten by FIXBSET.exe 319 MBR_CheckCode dw 0 ; Check-Sum for Code 320 321 ; 322 ; This label is jumped to from the jump after 'eCSRocks'. 323 ; No single instruction below should be changed, added or removed in the code 324 ; below as this will cause the jump-link to go haywire. 325 MBR_Start: sti ; This opcode is dedicated to: 326 cld ; =MICROSOFT JUMP DEPARTMENT= 327 328 ; Setup some base stuff 329 ; AX got loaded wrongly for debug, changed the instructions 330 ; 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. 333 mov ax, StartBaseSeg ; The segment we are moving ourself from (NOT USED) 334 ;mov ds, ax 335 push cs 336 pop ds 337 mov si, StartBasePtr ; The offset we are moving ourself from 338 mov ax, BootBaseSeg ; The target segment we are moving ourself to 175 339 mov es, ax 176 mov di, BootBasePtr 340 mov di, BootBasePtr ; The target offset we are moving ourself to 341 342 ; Depending on pre-boot or debug, 343 ; only move first 512 bytes or the whole she-bang++ (65400 bytes) 177 344 IFDEF ReleaseCode 178 mov cx, 256 345 mov cx, 256 ; Pre-boot environment 179 346 ELSE 180 mov cx, 32700 347 mov cx, 32700 ; Debug environment ; Rousseau: where does 32700 come from ? (30720) 181 348 ENDIF 349 350 ; 351 ; LET's MOVE OURSELVES ! 352 ; 182 353 rep movsw 354 355 ; Code a jump to the 183 356 db 0EAh 184 dw BootBaseExec 185 dw BootBaseSeg 357 dw BootBaseExec ; This is MBR_RealStart + BootBasePtr 358 dw BootBaseSeg ; This is 08000h 186 359 ; jmp far ptr BootBaseSeg:BootBaseExec 187 360 361 362 ; 363 ; Some MBR-functions to provide absolute minimum functionality. 364 ; 365 366 ; 367 ; Entry-point for halting the system. 368 ; 188 369 MBR_HaltSystem: 189 370 mov ax, 8600h … … 194 375 jmp MBR_HaltSys 195 376 196 db 'FUCKMS:>' 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 :-) 197 384 jmp MBR_Start ; We jump here, because I needed to 198 385 ; insert a CLI on start and did not 199 386 ; want to change AiR-BOOT detection 200 387 ; because of Microsoft inventions... 201 388 ; 389 ; Entry-point when loading fails. 390 ; 202 391 db 'LOAD ERROR!', 0 203 MBR_LoadError Proc Near Uses 204 mov si, offset $-12 205 push cs 206 pop ds 207 call MBR_Teletype 208 MBRLE_Halt: 209 jmp MBRLE_Halt 210 MBR_LoadError EndP 211 392 MBR_LoadError Proc Near 393 mov si, offset $-12 394 push cs 395 pop ds 396 call MBR_Teletype 397 MBRLE_Halt: 398 jmp MBRLE_Halt 399 MBR_LoadError EndP 400 401 402 ; 403 ; Entry-point when saving fails. 404 ; 212 405 db 'SAVE ERROR!', 0 213 MBR_SaveError Proc Near Uses 214 mov si, offset $-12 215 push cs 216 pop ds 217 call MBR_Teletype 218 MBRSE_Halt: 219 jmp MBRSE_Halt 220 MBR_SaveError EndP 221 406 MBR_SaveError Proc Near 407 mov si, offset $-12 408 push cs 409 pop ds 410 call MBR_Teletype 411 MBRSE_Halt: 412 jmp MBRSE_Halt 413 MBR_SaveError EndP 414 415 416 ; Put text on the screen using the BIOS tele-type function. 417 ; No attributes like color are supported. 222 418 ; In: SI - Pointer to begin of string (EOS is 0) 223 419 ; Destroyed: SI 224 420 MBR_Teletype Proc Near Uses ax bx cx 225 movah, 0Eh226 movbx, 7227 MBRT_Loop:228 lodsb229 oral, al230 jzMBRT_End231 int10h232 jmpMBRT_Loop233 MBRT_End:234 ret421 mov ah, 0Eh 422 mov bx, 7 423 MBRT_Loop: 424 lodsb 425 or al, al 426 jz MBRT_End 427 int 10h 428 jmp MBRT_Loop 429 MBRT_End: 430 ret 235 431 MBR_Teletype EndP 432 433 ; 434 ; Rousseau: DO NOT ADD CODE TO THIS SECTION ! 435 ; 236 436 237 437 ; In: BX - Base Check, DS:SI - Pointer to 512-byte-area to be included … … 252 452 MBR_GetCheckOfSector EndP 253 453 454 455 456 457 458 459 ; 460 ; This is where the rest of AiR-BOOT gets loaded. 461 ; 462 254 463 ;--------------------------------------------------------------------------- 255 464 MBR_RealStart: 256 mov ax, StackSeg 465 mov ax, StackSeg ; 07000h, below the moved code 257 466 mov ss, ax 258 mov sp, 7FFFh 259 mov ax, es 260 mov ds, ax ; Set DS==ES to Code Segment 467 ;mov sp, 7FFFh ; Odd stack-pointer ?? 468 mov sp, 7FFEh ; Safe value, could also be 8000h because SP is decremented by 2 before push 469 mov ax, es ; ES holds segment where we moved ourself to. 470 mov ds, ax ; Set DS==ES to Code Segment 471 472 ; If we are in debug-mode, all code is moved already, 473 ; 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. 261 479 IFNDEF ReleaseCode 262 480 jmp AiR_BOOT_Start 263 481 ENDIF 482 483 264 484 ; Load missing parts from harddrive... 265 mov ax, cs 266 mov es, ax 485 mov ax, cs ; actually obsolete 486 mov es, ax ; actually obsolete 487 488 ; Load the configuration-sectors from disk. 267 489 mov bx, offset Configuration 268 mov dx, 0080h ; First harddrive, Sector 55 269 mov cx, 0037h 270 mov ax, 0205h ; Read 5 sectors 490 mov dx, 0080h ; First harddrive, Sector 55 491 mov cx, 0037h ; Is 55d is config-sector 492 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 271 501 int 13h 272 502 jnc MBR_ConfigCopy_NoError 503 504 ; Some error occured 273 505 MBR_ConfigCopy_LoadError: 274 call MBR_LoadError ; Will Abort BootUp 506 call MBR_LoadError ; Will Abort BootUp 507 508 ; Load the code sectors 275 509 MBR_ConfigCopy_NoError: 276 510 mov bx, offset FurtherMoreLoad 277 mov dx, 0080h ; First harddrive, Sector 2278 mov cx, 0002h 511 mov dx, 0080h ; First harddrive 512 mov cx, 0002h ; Second sector 279 513 mov ah, 02h 280 mov al, ds:[10h] 514 515 mov al, ds:[10h] ; 34h = 52d sectors (35h in extended version) 281 516 int 13h 282 517 jnc MBR_RealStart_NoError … … 288 523 ; Now Check Code with CheckSum 289 524 mov si, offset FurtherMoreLoad 290 movzx cx, bptr ds:[10h] 525 526 ;movzx cx, bptr ds:[10h] 527 mov cl, ds:[10h] 528 mov ch,0 529 291 530 xor bx, bx 292 531 MBR_RealStart_CheckCodeLoop: … … 305 544 jmp AiR_BOOT_Start 306 545 546 547 548 307 549 ;--------------------------------------------------------------------------- 308 550 Include TEXT\TXTMBR.asm ; All translateable Text in MBR 309 551 ;--------------------------------------------------------------------------- 310 org 00200h ; Sector 2 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 561 562 org 00200h 563 ; End of sector 1 564 eos1: 565 566 ; Check for overlap 567 slack01 = sos2 - eos1 568 IF slack01 LT 0 569 .ERR2 "Location Overlap slack01 !" 570 ENDIF 571 572 573 ;=============================================================================== 574 ; Sector 2 575 576 ; 577 ; Here starts the second sector, sector 2 578 ; 579 org 00200h 580 ; Start of sector 2. 581 sos2: 582 583 311 584 ; Everything beyond this point is loaded on startup and is NOT existant at first 312 585 FurtherMoreLoad: 586 587 ; 588 ; Filesystem table correlating id with name. 589 ; 590 313 591 ; first Normal-Partition-ID, Hidden-Partition-ID 314 592 ; and Default-Partition-Flags. … … 344 622 ; -> 44 Partition-Types 345 623 346 ;--------------------------------------------------------------------------- 347 org 00400h ; Sector 3 348 AiR_BOOT_Start: mov ax, VideoIO_Page1 349 call VideoIO_BackUpTo ; Copy BIOS POST to Second Page 350 mov si, offset Copyright 351 call MBR_Teletype 624 ; End of sector 2. 625 eos2: 626 627 628 629 ; Check for overlap 630 slack02 = sos3 - eos2 631 IF slack02 LT 0 632 .ERR2 "Location Overlap slack02 !" 633 ENDIF 634 635 636 637 638 639 ;=============================================================================== 640 ; Sector 3 641 org 00400h 642 ; Start of sector 3. 643 sos3: 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 ; ############################################## 660 ; ## ENTRY-POINT AFTER ALL THE INITIAL HASSLE ## 661 ; ############################################## 662 663 664 665 AiR_BOOT_Start: nop 666 667 ;jmp skip 668 669 ; Rousseau: 670 ; I should cleanup my garbage here... 671 352 672 ; Initialize Variable-Tables, Detections, etc. 353 673 call PRECRAP_Main 674 675 ; Number of harddisks is now known 676 354 677 call PARTSCAN_ScanForPartitions 355 MBR_Main_ReEnterSetup: 678 679 680 ; Number of disks found 681 mov si, offset DisksFound 682 call MBR_Teletype 683 684 mov al, [TotalHarddiscs] 685 call VideoIO_SyncPos 686 call VideoIO_PrintByteDynamicNumber 687 xor si,si 688 call MBR_TeletypeNL 689 690 ; Number of bootable systems indicator 691 mov si, offset PartitionsFound 692 call MBR_Teletype 693 694 mov al, [CFG_Partitions] 695 call VideoIO_SyncPos 696 call VideoIO_PrintByteDynamicNumber 697 698 xor si,si 699 call MBR_TeletypeNL 700 call MBR_TeletypeNL 701 702 call VideoIO_SyncPos 703 704 mov dl,80h 705 call VideoIO_DumpDiskInfo 706 707 ; 708 ; Enumberate Bootable Systemen by name 709 ; And prepare Phase 1 if active 710 ; 711 mov si, offset PartitionTable 712 xor cx,cx 713 mov cl,[CFG_Partitions] 714 MBR_Parts: 715 add si, 4 716 push si 717 push si 718 ;call MBR_TeletypeVolName 719 pop si 720 call PART_IsInstallVolume 721 jnc MBR_Parts_NI 722 723 ; install volume 724 mov al,' ' 725 mov bl,7 726 mov ah, 0eh 727 int 10h 728 729 mov al,'(' 730 mov bl,7 731 mov ah, 0eh 732 int 10h 733 734 mov al,[CFG_Partitions] 735 sub al,cl 736 ;inc al 737 ;mov [Menu_EntryAutomatic],al 738 mov [CFG_PartAutomatic],al ; Rousseau: setup entry for install-volume 739 mov [CFG_PartLast],al 740 mov ah, [eCS_InstallVolume] ; 1st byte is 0 if no phase 1 active 741 test ah,ah ; test the byte, ZF is 0 if phase 1 active 742 lahf ; flags in ah 743 xor ah, 40h ; complement ZF 744 and ah, 40h ; mask ZF 745 shr ah, 6 ; move ZF to LSB 746 mov [CFG_AutomaticBoot], ah ; automatic boot if phase 1 is active 747 mov [eCS_InstallVolume], 0 ; disable phase 1 for next boot 748 749 add al,'1' 750 mov bl,7 751 mov ah, 0eh 752 int 10h 753 754 mov al,')' 755 mov bl,7 756 mov ah, 0eh 757 int 10h 758 759 mov bx,cx 760 761 MBR_Parts_NI: 762 xor si,si 763 ;call MBR_TeletypeNL 764 pop si 765 add si, 30 766 loop MBR_Parts 767 768 769 770 771 ; Index of automatic start partition 772 ; mov si, offset AutoStartPart 773 ;call MBR_Teletype 774 775 mov al, [CFG_PartAutomatic] 776 add al, 31h 777 mov ah, 09h 778 mov bx, 15 779 mov cx, 1 780 ;int 10h 781 782 mov al, [CFG_PartAutomatic] 783 add al, 31h 784 mov ah, 0eh 785 mov bx, 15 786 mov cx, 1 787 ;int 10h 788 789 xor si,si 790 call MBR_TeletypeNL 791 xor si,si 792 call MBR_TeletypeNL 793 794 mov ax,[BIOS_AuxParms] 795 ;call VideoIO_SyncPos 796 push ax 797 add al,'0' 798 mov bl,7 799 mov ah, 0eh 800 ;int 10h 801 pop ax 802 xchg al,ah 803 sub al,0a2h 804 mov bl,7 805 mov ah, 0eh 806 ;int 10h 807 808 809 call MBR_TeletypeSyncPos 810 811 xor si,si 812 call MBR_TeletypeNL 813 call MBR_TeletypeNL 814 815 816 817 mov si, offset ShowMenu 818 call MBR_TeletypeBold 819 820 821 skip: 822 823 824 825 ; 826 ; ########################### WAIT FOR KEY ################################ 827 ; 828 829 830 ; Rousseau: 831 ; Wait for key so we can see debug log if ab-menu hangs. 832 ;;xor ax, ax 833 ;;int 16h 834 835 ;call SOUND_Beep 836 837 ; Rousseau: delayed save of video-page 838 839 mov ax, VideoIO_Page1 840 call VideoIO_BackUpTo ; Copy BIOS POST to Second Page 841 842 ;call SOUND_Beep 843 844 845 ; 846 ; COM-PORT DEBUG 847 ; 848 call AuxIO_TeletypeNL 849 mov si, offset PartitionTable 850 call AuxIO_DumpSector 851 call AuxIO_TeletypeNL 852 853 ; 854 ; RE-ENTER SETUP 855 ; 856 MBR_Main_ReEnterSetup: ; Rousseau: SETUP re-enters here ! 356 857 call SETUP_CheckEnterSETUP 357 call AFTERCRAP_Main 858 859 ;call SOUND_Beep 860 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 :-) 358 869 359 870 ; [Linux support removed since v1.02] … … 364 875 ; MBR_Main_NoLinuxKrnlPartition: 365 876 877 878 MBR_Main_ReEnterBootMenuPre: 879 366 880 ; SetUp PartitionPointers for BootMenu (filter non-bootable) 367 881 call PART_CalculateMenuPartPointers … … 373 887 call MBR_Teletype 374 888 jmp MBR_HaltSystem 375 889 376 890 MBR_Main_SomethingBootAble: 377 891 ; FixUp Values, define Timed Setup booting, etc. 378 892 call PART_FixUpDefaultPartitionValues 893 894 379 895 380 896 ; -------------------------------------------------- BOOT-MENU … … 389 905 call PASSWORD_AskSystemPwd 390 906 mov al, Menu_EntryAutomatic 907 908 ;mov al, 2 ; Rousseau: 0-based 909 391 910 mov Menu_EntrySelected, al 392 jmp MBR_Main_NoBootMenu 911 jmp MBR_Main_NoBootMenu ; Rousseau: NO-BOOT-MENU 393 912 394 913 MBR_Main_NoAutomaticBooting: 914 915 ;call SOUND_Beep 916 395 917 test CFG_BootMenuActive, 0FFh 396 918 jnz MBR_Main_GotBootMenu … … 398 920 ; Select default partition and boot system... 399 921 call PASSWORD_AskSystemPwd 922 923 ;call VideoIO_DBG_WriteString2 ; Rousseau 924 400 925 mov al, Menu_EntryDefault 926 ;mov al,0 ; Rousseau: 0-based 401 927 mov Menu_EntrySelected, al 402 928 jmp MBR_Main_NoBootMenu … … 405 931 ; ------------------------------------------ BOOT-MENU VISUALS 406 932 call FX_StartScreen 933 934 ;call SOUND_Beep 935 407 936 call BOOTMENU_BuildBackground 408 937 call BOOTMENU_BuildMain … … 410 939 call PASSWORD_AskSystemPwd 411 940 call BOOTMENU_ResetTimedBoot 941 942 ;call SOUND_Beep 943 412 944 call BOOTMENU_Execute 945 946 ;call SOUND_Beep 947 413 948 jc MBR_Main_ReEnterSetup 414 949 call BOOTMENU_SetVarsAfterMenu 950 951 ;call SOUND_Beep 952 415 953 ; ------------------------------------------------- BOOTING... 416 954 MBR_Main_NoBootMenu: … … 432 970 call ANTIVIR_SaveBackUpMBR 433 971 mov dl, Menu_EntrySelected 434 call PART_StartPartition 435 972 call PART_StartPartition ; Rousseau: START PARTITION 973 974 975 976 ; 977 ; Include other code-modules here. 978 ; Because TASM is a multiple pass assembler, forward references 979 ; are possible. 980 ; 981 b_std_txt: 436 982 Include REGULAR\STD_TEXT.asm ; Standard (non-translateable text) 983 size_std_txt = $-b_std_txt 984 985 b_driveio: 437 986 Include REGULAR\DRIVEIO.asm ; Drive I/O, Config Load/Save 987 size_driveio = $-b_driveio 988 989 b_videoio: 438 990 Include REGULAR\ViDEOIO.asm ; Video I/O 991 size_videoio = $-b_videoio 992 993 b_timer: 439 994 Include REGULAR\TIMER.asm ; Timer 995 size_timer = $-b_timer 996 997 b_partmain: 440 998 Include REGULAR\PARTMAIN.asm ; Regular Partition Routines 999 size_partmain = $-b_partmain 1000 1001 b_partscan: 441 1002 Include REGULAR\PARTSCAN.asm ; Partition Scanning 1003 size_partscan = $-b_partscan 1004 1005 b_bootmenu: 442 1006 Include REGULAR\BOOTMENU.asm ; Boot-Menu 1007 size_bootmenu = $-b_bootmenu 1008 1009 b_password: 443 1010 Include REGULAR\PASSWORD.asm ; Password related 1011 size_password = $-b_password 1012 1013 b_other: 444 1014 Include REGULAR\OTHER.asm ; Other Routines 445 1015 size_other = $-b_other 1016 1017 ; Rousseau: Special modules moved upwards. 1018 b_main: 446 1019 Include SETUP\MAiN.ASM ; The whole AiR-BOOT SETUP 1020 size_main = $-b_main 1021 1022 1023 IFDEF TXT_IncludeCyrillic 1024 b_ccharset: 1025 Include SPECiAL\CHARSET.asm ; Charset Support (e.g. Cyrillic) 1026 size_ccharset = $-b_ccharset 1027 ENDIF 1028 1029 b_math: 1030 Include REGULAR\MATH.ASM ; Math functions (like 32-bit multiply) 1031 size_math = $-b_math 1032 1033 b_conv: 1034 Include REGULAR\CONV.ASM ; Various conversion routines 1035 size_conv = $-b_conv 1036 1037 IFDEF AuxDebug 1038 b_debug: 1039 Include REGULAR\DEBUG.ASM ; Various debugging routines, uses AUXIO and CONV 1040 size_debug = $-b_debug 1041 ENDIF 1042 1043 b_auxio: 1044 Include REGULAR\AUXIO.ASM ; Com-port support for debugging 1045 size_auxio = $-b_auxio 1046 1047 ; Rousseau: moved upwards 1048 ;IFDEF TXT_IncludeCyrillic 1049 ; Include SPECiAL\CHARSET.asm ; Charset Support (e.g. Cyrillic) 1050 ;ENDIF 1051 1052 ; End of sector 3. 1053 eos3: 1054 1055 1056 ; Check for overlap 1057 slack03 = sos36 - eos3 1058 IF slack03 LT 0 1059 .ERR2 "Location Overlap slack03 !" 1060 ENDIF 1061 1062 1063 ;=============================================================================== 1064 1065 ; 1066 ; This is the AiR-BOOT MBR-Protection Image. 1067 ; 04600 / 200h = 23h = 35d sectors are before this point. 1068 ; The stuff generated here gets overwritten when the MBR_PROT.ASM 1069 ; module, which is assembled separately, gets merged. 1070 ; So you won't find the string below in the generated binary. 1071 ; 1072 org 04600h ; Sector 36-37 1073 1074 ; Start of sector 36. 1075 sos36: 1076 1077 MBR_Protection: db 'AiR-BOOT MBR-Protection Image' 1078 ; Hardcoded to 1k (1024 bytes) 1079 db 1024-($-MBR_Protection) dup('X') 1080 1081 ; End of sector 37, yes this section is 2 sectors long. 1082 eos37: 1083 1084 1085 1086 ; Check for overlap 1087 slack04 = sos38 - eos37 1088 IF slack04 LT 0 1089 .ERR2 "Location Overlap slack04 !" 1090 ENDIF 1091 1092 1093 1094 1095 ;=============================================================================== 1096 ; Sector 38-x 1097 ; 1098 ; This section contains translatable texts. 1099 ; 1100 org 04A00h 1101 1102 ; Start of sector 28. 1103 sos38: 1104 1105 b_txtother: 1106 Include TEXT\TXTOTHER.asm ; All translateable Text-Strings 1107 size_txtother = $-b_txtother 1108 1109 b_txtmenus: 1110 Include TEXT\TXTMENUS.asm ; All translateable Menu-text 1111 size_txtmenus = $-b_txtmenus 1112 1113 b_charset: 1114 Include TEXT\CHARSET.asm ; Special Video Charsets (if needed) 1115 size_charset = $-b_charset 1116 1117 1118 ; 1119 ; Here is room for more code. 1120 ; Let's move the special modules here... 1121 ; The come from the previous section. 1122 ; 1123 b_virus: 447 1124 Include SPECiAL\ViRUS.asm ; Virus Detection / Anti-Virus 1125 size_virus = $-b_virus 448 1126 ; [Linux support removed since v1.02] 449 1127 ;Include SPECiAL\FAT16.asm ; FAT-16 Support 450 1128 ;Include SPECiAL\LINUX.asm ; Linux Kernel Support 1129 b_billsuxx: 451 1130 Include SPECiAL\F00K\BILLSUXX.asm ; Extended Partition - Microsoft-Hack 1131 size_billsuxx = $-b_billsuxx 1132 1133 b_sound: 452 1134 Include SPECiAL\SOUND.asm ; Sound 1135 size_sound = $-b_sound 1136 1137 b_apm: 453 1138 Include SPECiAL\APM.asm ; Power Managment Support 1139 size_apm = $-b_apm 1140 1141 b_fx: 454 1142 Include SPECiAL\FX.asm ; l33t Cooper-Bars/Scrolling <bg> 1143 size_fx = $-b_fx 1144 1145 b_lvm: 455 1146 Include SPECiAL\LVM.asm ; LVM-specific code 456 IFDEF TXT_IncludeCyrillic 457 Include SPECiAL\CHARSET.asm ; Charset Support (e.g. Cyrillic) 1147 size_lvm = $-b_lvm 1148 1149 1150 1151 1152 1153 ; 1154 ; Let's make this always the last module in this section. 1155 ; 1156 Include BLDDATE.asm ; Build Date generated by _build.cmd 1157 1158 ; End of sector x depending on size of translatable texts. 1159 eosx: 1160 1161 org 06A00h - 4 1162 ;db 'BABE' 1163 1164 org 06A00h 1165 ; db 'FACE' 1166 1167 ; Check for overlap 1168 slack05 = sos55 - eosx 1169 IF slack05 LT 0 1170 .ERR2 "Location Overlap slack05 !" 458 1171 ENDIF 459 1172 460 ;--------------------------------------------------------------------------- 461 org 04600h ; Sector 36-37 462 MBR_Protection: db 'AiR-BOOT MBR-Protection Image' 463 ; Hardcoded to 1k (1024 bytes) 464 465 ;--------------------------------------------------------------------------- 466 org 04A00h ; Sector 38-x 467 Include TEXT\TXTOTHER.asm ; All translateable Text-Strings 468 Include TEXT\TXTMENUS.asm ; All translateable Menu-text 469 Include TEXT\CHARSET.asm ; Special Video Charsets (if needed) 470 471 ;--------------------------------------------------------------------------- 472 org 06C00h ; Sector 55 1173 1174 1175 ;=============================================================================== 1176 ; Sector 55 1177 1178 ; 1179 ; This section contains the AiR-BOOT configuration. 1180 ; Note that it has a version that should be updated 1181 ; when stuff is added. 1182 ; Also add stuff to the end so that offsets of other 1183 ; variables remain vaild. 1184 ; 1185 org 06C00h 1186 sos55: 1187 1188 473 1189 Configuration: 474 db 'AiRCFG-TABLE' 475 db 01h, 02h, 'U' ; "Compressed" ID String 476 ; This is still version 1.02, because nothing got 477 ; changed... 1190 db 'AiRCFG-TABLE' ; Rousseau: THERE IS AN INVISIBLE CHAR HERE !! 1191 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. 478 1196 479 1197 CFG_LastTimeEditLow dw 0 ; Last Time Edited Stamp (will incr every setup) … … 490 1208 CFG_TimedSecs db 15 ; Timed Boot - How Many Seconds Till Boot 491 1209 CFG_TimedDelay dw 123 ; Timed Boot - Delay 492 CFG_TimedBootLast db 0; Timed Boot - Boot From Last Drive Booted From1210 CFG_TimedBootLast db 1 ; Timed Boot - Boot From Last Drive Booted From 493 1211 CFG_RememberBoot db 1 ; Remember Manual Boot Choice 494 1212 CFG_RememberTimed db 0 ; Remember if Timed Boot (if both disabled: Boot Default) 495 CFG_IncludeFloppy db 1; Include Floppy Drives in Boot-Menu1213 CFG_IncludeFloppy db 0 ; Include Floppy Drives in Boot-Menu 496 1214 CFG_BootMenuActive db 1 ; Display Boot-Menu (if Disabled: Boot Default) 497 1215 ; v0.29+ -> 2 - Detailed Bootmenu … … 503 1221 CFG_IgnoreWriteToMBR db 0 ; Just ignore writes to MBR, otherwise crash 504 1222 CFG_FloppyBootGetName db 0 ; Gets floppy name for display purposes 505 CFG_DetectVirus db 1 ; Detect Virus ?506 CFG_DetectStealth db 1 ; Detect Stealth-Virus ?507 CFG_DetectVIBR db 1 ; Detect BootRecord-Virus ?508 CFG_AutoEnterSetup db 1 ; Automatic Enter Setup (first install!)1223 CFG_DetectVirus db 0 ; Detect Virus ? // Rousseau: disabled 1224 CFG_DetectStealth db 0 ; Detect Stealth-Virus ? // Rousseau: disabled 1225 CFG_DetectVIBR db 0 ; Detect BootRecord-Virus ? // Rousseau: disabled 1226 CFG_AutoEnterSetup db 0 ; Automatic Enter Setup (first install!) // Rousseau: disabled 509 1227 CFG_MasterPassword dw 0101Fh ; Encoded Password (this is just CR) 510 1228 dw 07A53h … … 537 1255 CFG_AutomaticBoot db 0 ; Automatic Booting (only one bootup) 538 1256 CFG_PartAutomatic db 0 ; Partition-No for automatic booting 539 CFG_ForceLBAUsage db 0 ; LBA-BIOS-API forced on any HDD I/O1257 CFG_ForceLBAUsage db 1 ; LBA-BIOS-API forced on any HDD I/O // Rousseau: enabled config (LBA) 540 1258 CFG_IgnoreLVM db 0 ; Ignores any LVM-Information 1259 1260 1261 ; 1262 ; THERE IS ROOM RESERVED HERE FOR MORE VARIABLES 1263 ; 1264 1265 1266 eoc: 1267 1268 ; Check for overlap 1269 slack05a = soiv - eoc 1270 IF slack05a LT 0 1271 .ERR2 "Location Overlap slack05a !" 1272 ENDIF 1273 1274 ; Allways have the name of the installation volume 1275 ; at this offset. 1276 ; So future config changes will not break auto-install. 1277 org 06D00h 1278 1279 soiv: 1280 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 1288 1289 1290 1291 ; End of sector 55. 1292 eos55: 1293 1294 1295 1296 ; Check for overlap 1297 slack06 = sosvs - eos55 1298 IF slack06 LT 0 1299 .ERR2 "Location Overlap slack06 !" 1300 ENDIF 1301 1302 541 1303 542 1304 ; VIR variables are for the AiR-BOOT Anti Virus Code … … 544 1306 ; stealth virus is on-line, we can intercept its call. 545 1307 ; Normal (non stealth) virus are trapped simply by rereading the MBR sector. 546 ; If a virus is found, we will restore MBR from Sektor 60 and stop the system1308 ; If a virus is found, we will restore MBR from Sektor 60/62 and stop the system 547 1309 ; from working, so the user has to press reset. That's saver than a Reboot. 548 1310 ; … … 554 1316 ; off or just reset it by switching 'VIBR Detection'. 555 1317 1318 1319 ; 1320 ; 06DABh - 06C00h = 01ABh = 427 bytes. 1321 ; 556 1322 org 06DABh ; 427 Boundry 1323 1324 sosvs: 1325 557 1326 AutoDrvLetter db 0 558 1327 AutoDrvLetterSerial dd 0 559 1328 1329 ; This entry is also 34 bytes long 560 1330 BIOScontIPTentry: 561 1331 db 0, 0, 0, 0, ' ' … … 571 1341 CFG_VIR_INT1C dd 0 ; pointer to saved 1Ch entry point 572 1342 573 ; 478 Boundry 1343 ; 478 Boundry 1344 ; This entry is also 34 bytes long 574 1345 FloppyIPTentry: db 0, 0, 0, 0, 'FloppyDrive' 575 1346 db 0, 0FFh, Flags_BootAble … … 579 1350 dd 0, 0 580 1351 ;--------------------------------------------------------------------------- 581 org 06E00h ; Sector 56-57 1352 1353 eosvs: 1354 1355 ; Check for overlap 1356 slack07 = sos56 - eosvs 1357 IF slack07 LT 0 1358 .ERR2 "Location Overlap slack07 !" 1359 ENDIF 1360 1361 1362 ;org 06E00h ; Sector 56-57 1363 org image_size - 0a00h - (image_size - image_size_60secs) 1364 sos56: 1365 1366 1367 1368 ; Rousseau: This is the start of the AiR-BOOT IPT 1369 582 1370 PartitionTable: ; no-partitions detected... :] 583 1371 ; db 1, 0, 0, 0, 'Harddisc 1' … … 600 1388 ; AbsoluteBegin * 4 (where the partition begins, in absolute sectors) 601 1389 ; AbsolutePartTab * 4 (where the partition table is, in absolute sectors) 602 ; --------------------> 34 Bytes (total maximum = 30) 603 604 org 071F6h 1390 ; --------------------> 34 Bytes (total maximum partition-entries = 30) 1391 1392 db (partition_count * 34) dup ('P') 1393 1394 eos56: 1395 1396 ; Check for overlap 1397 slack08 = eoiptsig - eos56 1398 IF slack08 LT 0 1399 .ERR2 "Location Overlap slack08 !" 1400 ENDIF 1401 1402 1403 ;org 071F6h 1404 org image_size - 600h - (image_size - image_size_60secs) / 2 - 0ah 1405 soiptsig: 605 1406 db 'AiRBOOTPAR' ; 1K internal partition table 1407 1408 1409 1410 eoiptsig: 1411 1412 ; Check for overlap 1413 slack09 = soipt - eoiptsig 1414 IF slack09 LT 0 1415 .ERR2 "Location Overlap slack09 !" 1416 ENDIF 1417 606 1418 ;--------------------------------------------------------------------------- 607 org 07200h ; Sector 58 608 HidePartitionTable: db 900 dup (0FFh) 1419 ;org 07200h ; Sector 58 1420 org image_size - 600h - (image_size - image_size_60secs) / 2 ; Sector 58 1421 soipt: 1422 sos58: 1423 1424 HidePartitionTable: db (partition_count * 30) dup (0FFh) 609 1425 ; Format is: 610 1426 ;============ … … 612 1428 ; --------------------> 30 Bytes * 30 613 1429 614 DriveLetters: db 30dup (0)1430 DriveLetters: db partition_count dup (0) 615 1431 ; Format is: 616 1432 ;============ 617 1433 ; Drive-Letter : BYTE (80h-C:, 81h-D:) 618 1434 ; --------------------> 1 Byte * 30 619 620 org 075F6h 1435 eos58: 1436 eoipt: 1437 1438 ; Check foroverlap 1439 slack10 = sohidsig - eoipt 1440 IF slack10 LT 0 1441 .ERR2 "Location Overlap slack10 !" 1442 ENDIF 1443 1444 1445 1446 ;org 075F6h 1447 org image_size - 200h -0ah 1448 1449 sohidsig: 621 1450 db 'AiRBOOTHID' ; 1K internal Hide-partition table 1451 1452 eohidsig: 1453 1454 ; Check for overlap 1455 slack11 = sohid - eohidsig 1456 IF slack11 LT 0 1457 .ERR2 "Location Overlap slack11 !" 1458 ENDIF 1459 1460 1461 1462 622 1463 ;--------------------------------------------------------------------------- 623 org 07600h ; Sector 60 624 MBR_BackUpMBR db 'AiR-BOOT MBR-BackUp - Just to fill this sector with something' 625 626 org 077FFh 627 db 0 1464 ;org 07600h ; Sector 60 1465 org image_size - 200h ; Sector 60 1466 sohid: 1467 sos60: 1468 MBR_BackUpMBR db 'AiR-BOOT MBR-BackUp - Just to fill this sector with something',0 1469 AirBootRocks db 'AiR-BOOT Rocks!',0 1470 1471 eos60: 1472 eohid: 1473 1474 ; Check for overlap 1475 slack12 = eoab - eohid 1476 IF slack12 LT 0 1477 .ERR2 "Location Overlap slack12 !" 1478 ENDIF 1479 1480 1481 ;org 077FEh 1482 org image_size - 2 1483 dw 0BABEh 1484 ;dw 0 1485 ;BIOS_AuxParms dw BIOS_AuxParmsDefault ; Initialized at start when developing 1486 1487 eoab: 1488 1489 ; 1490 ; Rousseau: 1491 ; End of AiR-BOOT code and data. 1492 ; 1493 1494 1495 ; 1496 ; Rousseau: 1497 ; Below functions like a BSS segment, thus uninitialized data. 1498 ; 1499 sobss: 628 1500 ;--------------------------------------------------------------------------- 629 1501 org 0A000h ; Uninitialized … … 633 1505 LVMSector: db 512 dup (?) ; Temporary Sector for LVM 634 1506 TmpSector: db 512 dup (?) ; Temporary Sector 635 TmpSector2: 1507 636 1508 ; Everything used to build a new IPT and reference it to the old one 637 NewPartTable: db 1 024dup (?) ; New Partition Table638 NewHidePartTable: db 900 dup (?) ; New Hide-Partition Table639 NewDriveLetters: db 30dup (?) ; Logical Drive-Letters640 641 PartitionSizeTable: db 180dup (?) ; Size-Table (6 bytes per partition)1509 NewPartTable: db 1536 dup (?) ; New Partition Table 1510 NewHidePartTable: db partition_count * 30 dup (?) ; New Hide-Partition Table 1511 NewDriveLetters: db partition_count dup (?) ; Logical Drive-Letters 1512 1513 PartitionSizeTable: db partition_count * 6 dup (?) ; Size-Table (6 bytes per partition) 642 1514 PartitionPointers dw 52 dup (?) ; Maximum is 52 entries till now 643 1515 PartitionPointerCount db ? ; Count of total Partition Pointers 644 PartitionXref db 30dup (?) ; X-Reference Table645 PartitionVolumeLetters db 30dup (?) ; Volume-Letters1516 PartitionXref db partition_count dup (?) ; X-Reference Table 1517 PartitionVolumeLetters db partition_count dup (?) ; Volume-Letters 646 1518 ; 0 - no LVM support 647 1519 ; 1 - LVM support, but no letter … … 650 1522 TotalHarddiscs db ? ; Total harddrives (by POST) 651 1523 LBASwitchTable db 128 dup (?) ; Bit 25-18 for CHS/LBA Switching 652 NewPartitions db ? ; Freshly found partitions 1524 NewPartitions db ? ; Freshly found partitions ; Independent of SaveConfiguration 653 1525 654 1526 VideoIO_Segment dw ? ; Segment for Video I/O … … 723 1595 ;LINUX_KernelNo db ? ; Total of Kernels in KernelEntries 724 1596 ;LINUX_KernelSizeTable db 120 dup (?) ; Size-Table (6 bytes per kernel) 725 EndOfVariables:1597 ;EndOfVariables: 726 1598 727 1599 ; Dynamically Generated Tables - do not need to get initialized with NUL … … 733 1605 LVM_CRCTable: dd 256 dup (?) ; LVM-CRC (->SPECiAL\LVM.asm) 734 1606 1607 1608 1609 ; 1610 ; Rousseau: added some stuff. 1611 ; 1612 1613 1614 ;EVEN 1615 HugeDisk db MaxDisks dup(?) 1616 TrueSecs dd MaxDisks dup(?) 1617 1618 ; BIOS geometry of the boot-drive 1619 ; Note that heads cannot be 256 due to legacy DOS/BIOS bug 1620 ; If Int13X is supported those values are used, otherwise the legacy values. 1621 BIOS_Cyls dd MaxDisks dup(?) 1622 BIOS_Heads dd MaxDisks dup(?) 1623 BIOS_Secs dd MaxDisks dup(?) 1624 BIOS_Bytes dw MaxDisks dup(?) 1625 BIOS_TotalSecs dq MaxDisks dup(?) 1626 1627 ; LBA geometry of the boot-drive 1628 ; Note that these values are taken from the BPB of a partition boot-record 1629 LVM_Cyls dd MaxDisks dup(?) 1630 LVM_Heads dd MaxDisks dup(?) 1631 LVM_Secs dd MaxDisks dup(?) 1632 LVM_Bytes dw MaxDisks dup(?) 1633 LVM_TotalSecs dq MaxDisks dup(?) 1634 1635 ; OS/2 geometry of the boot-drive 1636 ; Note that these values are taken from the BPB of a partition boot-record 1637 LOG_Cyls dd MaxDisks dup(?) 1638 LOG_Heads dd MaxDisks dup(?) 1639 LOG_Secs dd MaxDisks dup(?) 1640 LOG_Bytes dw MaxDisks dup(?) 1641 LOG_TotalSecs dq MaxDisks dup(?) 1642 1643 ; Rousseau: moved here 1644 EndOfVariables: 1645 1646 ; Temporary buffer for 48h INT13X bios call 1647 ; Word aligned 1648 ;even 1649 ;align 2 1650 1651 ;db 1 dup(?) 1652 1653 i13xbuf dw 1 dup (?) ; Size of the buffer; this param *must* be present. Code inserts it. 1654 db 126 dup(?) ; The buffer itself. 1655 i13xbuf_size = $-offset i13xbuf-2 ; Size of buffer (excluding the size word at the start). 1656 1657 eobss: 1658 1659 735 1660 code_seg ends 736 1661 end air_boot -
trunk/BOOTCODE/MAKE.BAT
r29 r30 3 3 if "%1"=="EN" goto Valid 4 4 if "%1"=="DE" goto Valid 5 if "%1"==" DT" goto Valid5 if "%1"=="NL" goto Valid 6 6 if "%1"=="FR" goto Valid 7 7 if "%1"=="IT" goto Valid … … 13 13 14 14 :BuildAll 15 call make.bat EN16 15 call make.bat DE 17 call make.bat DT16 call make.bat NL 18 17 call make.bat FR 19 18 call make.bat IT 20 19 call make.bat RU 21 20 call make.bat SW 21 call make.bat EN 22 22 goto ExitMe 23 23 24 24 :Valid 25 echo. 26 echo. 25 27 echo Making %1 language version of AiR-BOOT bootcode... 26 28 echo Include TEXT\%1\MBR.asm >TEXT\TXTMBR.asm … … 37 39 if errorlevel 1 goto Failed 38 40 ..\tools\internal\fixcode.com 39 copy AIR-BOOT.com ..\RELEASE\BOOTCODE\%1.bin 41 copy AIR-BOOT.com ..\RELEASE\BOOTCODE\AIRBT-%1.bin 42 43 copy AIR-BOOT.COM AIRBOOT.BIN 40 44 41 45 rem Cleanup 42 remdel AiR-BOOT.com46 del AiR-BOOT.com 43 47 del AiR-BOOT.exe 44 48 del AiR-BOOT.obj … … 48 52 echo Errorlevel not 0, make failed 49 53 :ExitMe 54 rem @pause -
trunk/BOOTCODE/MBR-PROT/MAKE.BAT
r29 r30 6 6 %linker% mbr_prot.obj >nul 7 7 if errorlevel 1 goto Failed 8 %exe2bin% mbr_prot.exe fixcode.com >nul 8 %exe2bin% mbr_prot.exe mbr_prot.com 9 if errorlevel 1 goto Failed 10 copy mbr_prot.com fixcode.com 9 11 if errorlevel 1 goto Failed 10 12 11 13 rem Cleanup 12 del mbr_prot.exe13 del mbr_prot.obj14 ::del mbr_prot.exe 15 ::del mbr_prot.obj 14 16 goto ExitMe 15 17 … … 17 19 echo Errorlevel not 0, make failed 18 20 :ExitMe 19 pause21 rem pause -
trunk/BOOTCODE/MBR-PROT/MBR_PROT.ASM
r29 r30 27 27 org 0000h 28 28 29 OldInterrupt10 dd 'kcuf' ; we are nice aren't we ;-) 30 OldInterrupt13 dd 'kcuf' 29 ; Yes you are :-) 30 ;OldInterrupt10 dd 'kcuf' ; we are nice aren't we ;-) 31 ;OldInterrupt13 dd 'kcuf' 32 33 OldInterrupt10 dd 0 34 OldInterrupt13 dd 0 35 31 36 MBR_IgnoreWrite db 0 32 37 … … 143 148 MBRProt_WriteBorderLine EndP 144 149 145 MBRP_Line1: db 'ÕÍÍŽ!ATTENTION! -> A V IRUSWAS FOUND <- !ATTENTION!ÃÍÍž'150 MBRP_Line1: db 'ÕÍÍŽ!ATTENTION! -> A V1RU5 WAS FOUND <- !ATTENTION!ÃÍÍž' 146 151 MBRP_EmptyLine: db '³ ³' 147 152 db '³ A program tried to write to your Master Boot Record ³' … … 151 156 db '³ you have to deactivate MBR PROTECTION in AiR-BOOT ³' 152 157 db '³ or contact your supervisor. ³' 153 MBRP_Line3: db 'ÔÍÍÍŽAiR-BOOT (c) Copyright by M. Kiewitz 1999-2009ÃÍÍŸ' 158 ;MBRP_Line3: db 'ÔÍÍÍŽAiR-BOOT (c) Copyright by M. Kiewitz 1999-2009ÃÍÍŸ' 159 MBRP_Line3: db 'ÔÍÍÍŽAiR-BOOT (c) Copyright by M. Kiewitz 1999-2011ÃÍÍŸ' 154 160 155 161 org 1023 -
trunk/BOOTCODE/REGULAR/BOOTMENU.ASM
r29 r30 20 20 ;--------------------------------------------------------------------------- 21 21 22 IFDEF ModuleNames 23 DB 'BOOTMENU',0 24 ENDIF 25 22 26 BOOTMENU_BuildBackground Proc Near Uses es di 23 27 call VideoIO_CursorOff … … 32 36 BOOTMENU_BuildBackground EndP 33 37 38 CLR_COPYRIGHT_CLASSIC = 0f00h 39 CLR_COPYRIGHT_BM = 0700h 40 34 41 BOOTMENU_BuildMain Proc Near Uses es di 35 42 ; 1st line with Copyright information... 36 43 mov cx, 0101h 37 44 call VideoIO_Locate 38 mov cx, 0F00h45 mov cx, CLR_COPYRIGHT_BM 39 46 call VideoIO_Color 40 47 mov si, offset Copyright … … 42 49 43 50 ; Boot-Window... 44 mov cx, 0901h 51 CLR_BOOT_WINDOW_CLASSIC = 0901h 52 CLR_BOOT_WINDOW_BM = 0701h 53 54 mov cx, CLR_BOOT_WINDOW_BM 45 55 call VideoIO_Color 46 56 mov bx, 0201h … … 53 63 mov al, TextChar_WinLineRight 54 64 mov cl, 78 55 call VideoIO_Internal_MakeWinRight 65 call VideoIO_Internal_MakeWinRight 56 66 57 67 mov dl, 18h … … 63 73 64 74 ; Display Top-Infos in Boot-Window 65 mov cx, 0B01h 75 76 CLR_TOP_INFOS_CLASSIC = 0b01h 77 CLR_TOP_INFOS_BM = 0301h 78 79 mov cx, CLR_TOP_INFOS_BM 66 80 call VideoIO_Color 67 81 mov ch, 03h … … 91 105 92 106 ; Now make the separating vertical lines... 93 mov cx, 0901h 107 CLR_SEP_VERT_LINES_CLASSIC = 0901h 108 CLR_SEP_VERT_LINES_BM = 0701h 109 110 mov cx, CLR_SEP_VERT_LINES_BM 94 111 call VideoIO_Color 95 112 mov ch, 03h … … 157 174 ; Boot-Window is DONE 158 175 159 mov cx, 0C04h 160 call VideoIO_Color 176 ; Rousseau: = Colors = 177 ; FG 178 ; BG 179 ; 7 = grey 180 ; 6 = brown 181 ; 5 = magenta 182 ; 4 = red 183 ; 3 = cyan 184 ; 2 = green 185 ; 1 = blue 186 187 CLR_INFO_WINDOW_CLASSIC = 0c04h 188 CLR_INFO_WINDOW_BM = 0701h 189 190 mov cx, CLR_INFO_WINDOW_BM 191 ;mov cx, 0C06h ; brown, main background 192 call VideoIO_Color ; Rousseau: color info window 193 161 194 mov bx, 1401h 162 195 mov dx, 1950h … … 173 206 mov cx, 1703h 174 207 call VideoIO_Locate 175 mov cx, 0F04h 176 call VideoIO_Color 208 209 CLR_INFO_TEXT_CLASSIC = 0f04h 210 CLR_INFO_TEXT_BM = 0701h 211 212 mov cx, CLR_INFO_TEXT_BM ; Info text 213 call VideoIO_Color ; Rousseau: color info text 214 177 215 mov si, offset TXT_BootMenuHelpText1 178 216 call VideoIO_Print … … 182 220 call VideoIO_Print 183 221 184 mov cx, 0C04h 222 223 CLR_F10_SETUP_CLASSIC = 0c04h 224 CLR_F10_SETUP_BM = 0901h 225 226 mov cx, CLR_F10_SETUP_BM ; background F10 enter Setup 185 227 call VideoIO_Color 186 228 … … 198 240 call VideoIO_PrintSingleChar 199 241 ; HelpWindow done... 242 243 244 ; Rousseau: Debug Stuff, put here after building Main Menu 245 ;call VideoIO_DBG_WriteString 246 ;call VideoIO_DBG_WriteString2 247 200 248 ret 201 249 BOOTMENU_BuildMain EndP 250 251 202 252 203 253 BOOTMENU_BuildGoodBye Proc Near Uses es di … … 209 259 rep stosw 210 260 ; ------------------------------------------- 211 mov cx, 0D05h 261 262 CLR_GOODBYE_WINDOW_CLASSIC = 0d05h 263 CLR_GOODBYE_WINDOW_BM = 0f01h 264 265 mov cx, CLR_GOODBYE_WINDOW_BM 212 266 call VideoIO_Color 213 267 mov bx, 0101h … … 221 275 mov cx, 9 222 276 mov al, WinCharRight 223 mov ah, 05Dh 277 278 ; Little part before version in goodbye-window 279 ; Does not use color-function 280 ;mov ah, 05Dh 281 mov ah, 01fh 224 282 rep stosw 283 225 284 mov cx, 010Bh 226 285 call VideoIO_Locate … … 240 299 mov al, TextChar_WinRep4 241 300 call VideoIO_PrintSingleChar 242 mov cx, 0E01h 301 302 CLR_GOODBYE_AB_VERSION_CLASSIC = 0e01h 303 CLR_GOODBYE_AB_VERSION_BM = 0e03h 304 305 mov cx, CLR_GOODBYE_AB_VERSION_BM 243 306 call VideoIO_Color 244 307 mov si, offset Copyright 245 308 mov cl, 11+CopyrightVersionLen 246 309 call VideoIO_FixedPrint 247 mov cx, 0D05h 310 311 mov cx, CLR_GOODBYE_WINDOW_BM 312 248 313 call VideoIO_Color 249 314 mov al, TextChar_WinRep5 … … 251 316 mov cx, 020Dh 252 317 call VideoIO_Locate 253 mov cx, 0F05h 318 319 CLR_GOODBYE_WINDOW_CLASSIC_2 = 0f05h 320 CLR_GOODBYE_WINDOW_BM_2 = 0701h 321 322 mov cx, CLR_GOODBYE_WINDOW_BM_2 254 323 call VideoIO_Color 255 324 inc si … … 272 341 BOOTMENU_BuildGoodBye EndP 273 342 343 344 274 345 ; Must preserve AX! 275 346 BOOTMENU_BuildTimedBootText Proc Near Uses ax cx si es di 276 mov cx, 1503h 277 call VideoIO_Locate 278 mov cx, 0E04h 347 mov cx, 1503h ; 348 call VideoIO_Locate 349 350 CLR_NON_TIMED_BAR_CLASSIC = 0e04h 351 CLR_NON_TIMED_BAR_BM = 0701h 352 353 mov cx, CLR_NON_TIMED_BAR_BM ; non-timed time bar 279 354 call VideoIO_Color 280 355 call VideoIO_Internal_SetRegs … … 294 369 mov cx, 1503h 295 370 call VideoIO_Locate 296 mov cx, 0E04h 371 372 CLR_TIMED_BAR_CLASSIC = 0e04h 373 CLR_TIMED_BAR_BM = 0e04h 374 375 mov cx, CLR_TIMED_BAR_BM ; timed time bar, yellow on red 297 376 call VideoIO_Color 298 377 mov si, offset TXT_TimedBootLine ; will print TimedBootEntryName too … … 325 404 BOOTMENU_RefreshPartitionText EndP 326 405 406 407 CLR_VOLUME_INDEX_CLASSIC = 0f01h 408 CLR_VOLUME_INDEX_BM = 0f01h 409 327 410 ; Writes Partition-Information to Screen (Boot-Menu) 328 411 ; In: CH - Line to print info … … 339 422 mov dh, cl 340 423 call VideoIO_Locate 341 mov cx, 0F01h; Bwhite, blue424 mov cx, CLR_VOLUME_INDEX_BM ; Bwhite, blue 342 425 call VideoIO_Color 343 426 mov al, dl … … 347 430 ; === Display Drive-Number and Size (Size only in detailed view) === 348 431 add dh, 5 349 movzx cx, dh 350 call VideoIO_Locate 351 mov cx, 0D01h 432 ;movzx cx, dh 433 mov cl,dh 434 mov ch,0 435 436 call VideoIO_Locate 437 438 CLR_HD_INDEX_CLASSIC = 0d01h 439 CLR_HD_INDEX_BM = 0701h 440 441 mov cx, CLR_HD_INDEX_BM 352 442 call VideoIO_Color ; Violet, blue 353 443 mov si, PartPointer … … 367 457 BMBPT_IsHarddrive: 368 458 ; Now display Size-Element... 369 mov cx, 0501h 459 460 CLR_HD_SIZE_CLASSIC = 0501h 461 CLR_HD_SIZE_BM = 0701h 462 463 mov cx, CLR_HD_SIZE_BM 370 464 call VideoIO_Color ; Dark-Violet, Blue 371 465 mov al, '/' 372 466 call VideoIO_PrintSingleChar 373 mov cx, 0D01h467 mov cx, CLR_HD_SIZE_BM 374 468 call VideoIO_Color ; Violet, Blue 375 469 mov ax, PartPointer ; Get Size-Element from PartPtr (AX) … … 383 477 384 478 ; === Display Label === 385 movzx cx, dh 386 call VideoIO_Locate 387 mov cx, 0E01h 479 ;movzx cx, dh 480 mov cl,dh 481 mov ch,0 482 483 call VideoIO_Locate 484 485 CLR_LABEL_CLASSIC = 0e01h 486 CLR_LABEL_BM = 0f01h 487 488 mov cx, CLR_LABEL_BM 388 489 call VideoIO_Color ; Yellow, blue 389 490 mov si, PartPointer … … 394 495 ; === Display Type === 395 496 add dh, 14 396 movzx cx, dh 497 ;movzx cx, dh 498 mov cl,dh 499 mov ch,0 500 397 501 call VideoIO_Locate 398 502 mov si, PartPointer 399 503 mov al, [si+LocIPT_SystemID] 400 504 call PART_SearchFileSysName 401 mov cx, 0C01h 505 506 CLR_FS_NAME_CLASSIC = 0c01h 507 CLR_FS_NAME_BM = 0701h 508 509 mov cx, CLR_FS_NAME_BM 402 510 call VideoIO_Color ; Hrot, Blau 403 511 mov cl, 8 … … 410 518 ; Out: DX - will get returned (fixed, if needed) 411 519 BOOTMENU_BuildChoiceBar Proc near Uses ax es di 520 521 ;call SOUND_Beep 522 412 523 call VideoIO_WaitRetrace 524 525 526 ;call SOUND_Beep 527 413 528 mov cl, 10h ; Color BLUE, Partition DL 414 529 call BOOTMENU_ReColorPart 530 531 ;call SOUND_Beep 415 532 416 533 ; Check, if clipping needed... … … 448 565 call BOOTMENU_RefreshPartitionText 449 566 567 568 ; Keuze bar 569 ; 00h black 570 ; 10h blue 571 ; 20h green (also nice) 572 ; 30h cyan (also nice) 573 ; 40h red 574 ; 50h magenta 575 ; 60h brown (nice) 576 ; 70h white 577 ; 80h grey 578 ; 90h light blue (nice) 579 ; 0a0h bright green 580 ; 0b0h bright cyan 581 ; 0c0h bright red 582 ; 0d0h bright magenta 583 ; 0e0h bright yellow 584 ; 0f0h bright white 585 586 587 CLR_SELECTION_BAR_CLASSIC = 50h 588 CLR_SELECTION_BAR_BM = 090h 589 590 591 450 592 BMBCB_AfterScrolling: 451 mov cl, 50h; Color PINK, Partition DL593 mov cl, CLR_SELECTION_BAR_BM ; Color PINK, Partition DL 452 594 call BOOTMENU_ReColorPart 453 595 ret … … 457 599 ; Destroyed: None, but Locate-Pointer gets set 458 600 BOOTMENU_ReColorPart Proc Near Uses bx cx es di 601 602 ; call SOUND_Beep 603 459 604 mov bh, cl ; Color to BH 460 605 ; First calculate location of bar … … 475 620 and al, 0Fh 476 621 or al, bh ; Adds background color (from BH) 622 623 ;mov al,97h 624 477 625 mov es:[di], al 478 626 add di, 2 … … 615 763 ; Got it, so display bar... 616 764 mov dh, dl 765 766 ;call SOUND_Beep 767 617 768 call BOOTMENU_BuildChoiceBar ; DH - Active, DL - Last Active 769 770 ;call SOUND_Beep 771 618 772 call SOUND_PreBootMenu 619 773 774 620 775 BME_MainLoop: 776 777 ;call VideoIO_DBG_WriteString2 ; Rousseau 778 621 779 test TimedBootEnable, 1 622 780 jz BME_NoTimedBoot -
trunk/BOOTCODE/REGULAR/DRIVEIO.ASM
r29 r30 19 19 ; AiR-BOOT / DRIVE I/O 20 20 ;--------------------------------------------------------------------------- 21 22 23 24 IFDEF ModuleNames 25 DB 'DRIVEIO',0 26 ENDIF 21 27 22 28 ; Note: Some routines set DS/ES to CS or even address via CS, even if its not … … 141 147 ; This is calculated by Sector*Heads. Comparing will get done with Bit 25-10 142 148 ; on LBA sectors, so we actually divide sector number by 1024. 143 DriveIO_InitLBASwitchTable Proc Near Uses es di 149 DriveIO_InitLBASwitchTable Proc Near Uses es di ; Rousseau: LBA ! 144 150 mov di, offset LBASwitchTable 145 151 mov dh, TotalHarddiscs … … 152 158 jc DIOILUT_Error 153 159 and cl, 111111b ; Isolate lower 6 bits of CL -> sector count 154 movzx ax, cl 155 mov bl, dh ; DH -> head count 160 161 ; huge disk 127 sec/track on <1TB using DANI 162 ; mov cl, 07Fh 163 164 ;movzx ax, cl 165 mov al,cl 166 mov ah,0 167 168 mov bl, dh ; DH -> head count ; Rousseau: nope, it's max head number ! 156 169 mul bl ; AX = Sectors*Heads 157 170 shl ah, 1 … … 168 181 DriveIO_InitLBASwitchTable EndP 169 182 183 184 185 170 186 ; Adjusts BX:AX / CX:DX to meet LVM sector location 171 187 ; Destroys SI 172 DriveIO_LVMAdjustToInfoSector Proc Near Uses 173 push cx 174 xor ch, ch 175 and cl, 63 ; Isolate lower bits, because upper 176 mov si, 63 ; ones may be used for cylinder 177 sub si, cx 178 pop cx 179 add ax, si 180 adc bx, 0 ; Adjust LBA Sector (BX:AX) 181 or cl, 63 ; Set Sector to 63 182 ret 188 ; Rousseau: Enhanced to handle sector-numbers 127 and 255 besides 63 for LVM-info sectors. 189 ; Ugly, need to cleanup. 190 DriveIO_LVMAdjustToInfoSector Proc Near Uses ; Rousseau: LVM stuff ! 191 192 193 194 ; pusha 195 ; call AuxIO_TeletypeNL 196 197 ; LBA 198 ; xchg dx,bx 199 ; call AuxIO_TeletypeHexDWord 200 ; call AuxIO_TeletypeNL 201 ; xchg bx,dx 202 203 ; CYL 204 ; mov al,ch 205 ; call AuxIO_TeletypeHexByte 206 ; call AuxIO_TeletypeNL 207 208 ; HEAD 209 ; mov al,dh 210 ; call AuxIO_TeletypeHexByte 211 ; call AuxIO_TeletypeNL 212 213 ; SEC 214 ; mov al,cl 215 ; call AuxIO_TeletypeHexByte 216 ; call AuxIO_TeletypeNL 217 218 ; DRIVE 219 ; mov al,dl 220 ; call AuxIO_TeletypeHexByte 221 ; call AuxIO_TeletypeNL 222 223 ; popa 224 225 226 ;local ts:word 227 ;local ts2:word 228 229 pusha 230 231 ; Dump drive 232 mov si,offset drive 233 call AuxIO_Print 234 xchg al,dl 235 call AuxIO_TeletypeHexByte 236 call AuxIO_TeletypeNL 237 xchg dl,al 238 239 ; Dump SPT 240 mov si,offset spt_used 241 call AuxIO_Print 242 push dx 243 push bx 244 xor dh,dh 245 and dl,01111111b 246 shl dx,1 247 shl dx,1 248 mov bx, offset TrueSecs 249 add bx,dx 250 mov ax,word ptr [bx] 251 252 ;mov [ts],ax 253 254 call AuxIO_TeletypeHexWord 255 call AuxIO_TeletypeNL 256 pop bx 257 pop dx 258 259 pusha 260 push dx 261 ; Location of extended position 262 mov dx,word ptr [ExtendedAbsPos+02] 263 mov ax,word ptr [ExtendedAbsPos+00] 264 call AuxIO_TeletypeHexDWord 265 call AuxIO_TeletypeNL 266 pop dx 267 268 xor dh,dh 269 and dl,01111111b 270 shl dx,1 271 shl dx,1 272 mov bx, offset TrueSecs 273 add bx,dx 274 275 mov ax, word ptr[bx] 276 call AuxIO_TeletypeHexWord 277 call AuxIO_TeletypeNL 278 mov al,[ExtendedAbsPosSet] ; if true -> 1st sector of extpart (EBR), not logpart(BPB) 279 call AuxIO_TeletypeHexByte 280 call AuxIO_TeletypeNL 281 ; mov si,offset PartitionSector 282 ; call AuxIO_DumpSector 283 popa 284 285 ; LBA 286 mov si,offset before_lvm_adjust 287 call AuxIO_Print 288 289 xchg dx,bx 290 call AuxIO_TeletypeHexDWord 291 call AuxIO_TeletypeNL 292 xchg bx,dx 293 popa 294 295 296 ;or bx,ax 297 test [ExtendedAbsPosSet],1 298 jz pri 299 300 301 302 303 pusha 304 mov si,offset before_lvm_adjust_log 305 call AuxIO_Print 306 ; LBA 307 xchg dx,bx 308 call AuxIO_TeletypeHexDWord 309 call AuxIO_TeletypeNL 310 xchg bx,dx 311 popa 312 313 314 push dx 315 push bx 316 xor dh,dh 317 and dl,01111111b 318 shl dx,1 319 shl dx,1 320 mov bx,offset TrueSecs 321 add bx,dx 322 mov dx,[bx] 323 dec dx 324 add ax,dx 325 pop bx 326 pop dx 327 adc bx,0 328 329 330 pusha 331 mov si,offset after_lvm_adjust_log 332 call AuxIO_Print 333 ; LBA 334 xchg dx,bx 335 call AuxIO_TeletypeHexDWord 336 call AuxIO_TeletypeNL 337 xchg bx,dx 338 popa 339 340 jmp done 341 342 343 344 345 pri: 346 347 348 push ax 349 push cx 350 xor ch, ch ; Zero out upper-byte 351 352 push dx 353 xor dh,dh 354 and dl,01111111b 355 shl dx,1 356 shl dx,1 357 push bx 358 mov bx,offset TrueSecs 359 add bx,dx 360 mov ax,[bx] 361 ;mov [ts2],ax 362 pop bx 363 pop dx 364 365 366 367 ;mov al, 63 368 ;call VideoIO_PrintByteDynamicNumber 369 ;self: jmp self 370 371 372 373 ; DEZE WERKT SOMS NIET GOED 374 ; ROMMELT MET CYLINDERS 375 ; ALLEEN TOEPASSEN ALS INT13X NIET ACTIEF ! 376 377 and cl, al ; Isolate lower bits, because upper 378 mov ah, 0 379 mov si, ax ; ones may be used for cylinder 380 sub si, cx 381 382 pop cx 383 pop ax 384 385 or cl, al ; Set sector to last sector 386 387 add ax, si ; Adjust lower LBA 388 adc bx, 0 ; Adjust LBA Sector (BX:AX) 389 390 391 392 ;push ax 393 ;call AuxIO_TeletypeHexWord 394 ;call AuxIO_TeletypeNL 395 ;mov ax,[ts] 396 ;call AuxIO_TeletypeHexWord 397 ;call AuxIO_TeletypeNL 398 ;mov ax,[ts2] 399 ;call AuxIO_TeletypeHexWord 400 ;call AuxIO_TeletypeNL 401 ;pop ax 402 403 ;and ax,[ts] 404 405 jmp done 406 407 408 409 done: 410 411 412 413 pusha 414 mov si,offset after_lvm_adjust 415 call AuxIO_Print 416 ; LBA 417 xchg dx,bx 418 call AuxIO_TeletypeHexDWord 419 call AuxIO_TeletypeNL 420 xchg bx,dx 421 popa 422 423 424 425 ; pusha 426 ; call AuxIO_TeletypeNL 427 428 ; CYL 429 ; mov al,ch 430 ; call AuxIO_TeletypeHexByte 431 ; call AuxIO_TeletypeNL 432 433 ; HEAD 434 ; mov al,dh 435 ; call AuxIO_TeletypeHexByte 436 ; call AuxIO_TeletypeNL 437 438 ; SEC 439 ; mov al,cl 440 ; call AuxIO_TeletypeHexByte 441 ; call AuxIO_TeletypeNL 442 443 ; DRIVE 444 ; mov al,dl 445 ; call AuxIO_TeletypeHexByte 446 ; call AuxIO_TeletypeNL 447 448 ; popa 449 450 451 452 ret 183 453 DriveIO_LVMAdjustToInfoSector EndP 184 454 185 Comment *ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 186 Routine: Loads partition to ExecBase and checks for validity 187 ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ 188 Calling : bx:ax - Absolute sector 189 cx:dx - Cylinder/Sector, Side/Drive (hi/lo-byte) 190 Returns : Carry Set if invalid partition encountered 191 Preserve: all registers 192 ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ* 455 drive: db 'drive : ',0 456 before_lvm_adjust: db 'before lvm adjust : ',0 457 after_lvm_adjust: db 'after lvm adjust : ',0 458 before_lvm_adjust_log: db 'before lvm logical adjust: ',0 459 after_lvm_adjust_log: db 'after lvm logical adjust : ',0 460 spt_used: db 'spt used : ',0 461 462 463 464 ; ######################################################################### 465 ; Routine: Loads partition to ExecBase and checks for validity 466 ; ######################################################################### 467 ; Calling : bx:ax - Absolute sector 468 ; cx:dx - Cylinder/Sector, Side/Drive (hi/lo-byte) 469 ; Returns : Carry Set if invalid partition encountered 470 ; Preserve: all registers 471 ; ######################################################################### 193 472 DriveIO_LoadPartition Proc Near Uses si 194 473 mov wptr cs:[CurPartition_Location+0], ax … … 209 488 stc ; Set carry, so no partition table 210 489 DIOLP_Success: 490 491 IFDEF AuxDebug 492 ; show current partition location 493 pushf 494 pusha 495 call AuxIO_TeletypeNL 496 mov si,offset db_curpartloc 497 call AuxIO_Print 498 mov dx,word ptr [CurPartition_Location+02] 499 mov ax,word ptr [CurPartition_Location+00] 500 call AuxIO_TeletypeHexDWord 501 call AuxIO_TeletypeNL 502 mov si,offset PartitionSector 503 call AuxIO_DumpSector 504 call AuxIO_TeletypeNL 505 popa 506 popf 507 ENDIF 508 211 509 ret 212 510 DIOLP_Failed: … … 214 512 DriveIO_LoadPartition EndP 215 513 216 Comment *ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 217 Routine: Writes a partition from ExecBase to its original sector218 ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ 219 Calling : none220 Returns : none221 Preserve: all registers222 ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ* 514 ; ######################################################################### 515 ; Routine: Writes a partition from ExecBase to its original sector 516 ; ######################################################################### 517 ; Calling : none 518 ; Returns : none 519 ; Preserve: all registers 520 ; ######################################################################### 223 521 DriveIO_SavePartition Proc Near Uses ax bx cx dx si 224 522 mov ax, wptr cs:[CurPartition_Location+0] … … 237 535 DriveIO_LoadTmpSector Proc Near Uses 238 536 mov si, offset TmpSector 239 call DriveIO_LoadSector 537 call DriveIO_LoadSector ; Uses INT13X if needed 240 538 ret 241 539 DriveIO_LoadTmpSector EndP … … 256 554 mov dx, wptr cs:[CurPartition_Location+4] 257 555 mov cx, wptr cs:[CurPartition_Location+6] ; Gets cur. partition location 258 call DriveIO_LVMAdjustToInfoSector 556 557 call DriveIO_LVMAdjustToInfoSector ; Rousseau: LVM stuff ! 558 259 559 mov si, offset LVMSector 260 560 call DriveIO_LoadSector 261 call LVM_CheckSectorSignature 561 562 IFDEF AuxDebug 563 ; show current partition location 564 pushf 565 pusha 566 call AuxIO_TeletypeNL 567 mov si,offset db_curlvmsec 568 call AuxIO_Print 569 mov dx,bx 570 call AuxIO_TeletypeHexDWord 571 call AuxIO_TeletypeNL 572 mov si,offset LVMSector 573 call AuxIO_DumpSector 574 call AuxIO_TeletypeNL 575 popa 576 popf 577 ENDIF 578 579 ; Rousseau 580 ;pushf 581 ;pusha 582 ;mov si, offset MyText4 583 ;call VideoIO_Print 584 ;mov si, offset LVMSector 585 ;mov al, [si+LocLVM_VolumeLetter2] 586 ;call VideoIO_PrintByteDynamicNumber 587 ;mov al, [si+LocLVM_Startable] 588 ;call VideoIO_PrintByteDynamicNumber 589 ;mov al, [si+LocLVM_OnBootMenu] 590 ;call VideoIO_PrintByteDynamicNumber 591 ;;self: jmp self 592 ;popa 593 ;popf 594 595 call LVM_CheckSectorSignature ; Rousseau: LVM stuff ! 262 596 jnc DIOLLVMS_NoLVMSector 263 call LVM_CheckSectorCRC 597 call LVM_CheckSectorCRC ; Rousseau: LVM stuff ! 264 598 jnc DIOLLVMS_NoLVMSector 265 599 ret … … 303 637 jnz InScanMode 304 638 jmp MBR_LoadError 305 InScanMode: 639 InScanMode: 306 640 mov si, offset TXT_BrokenPartitionTable 307 641 push cs … … 319 653 DriveIO_GotLoadError EndP 320 654 321 Comment *ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 322 Routine: Loads a specified sector to DS:DI323 ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ 324 Calling : bx:ax - Absolute sector325 cx:dx - Cylinder/Sector, Side/Drive (hi/lo-byte)326 ds:si - Destination-Adress327 Returns : none328 Preserve: all registers329 ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ* 330 DriveIO_LoadSector Proc Near Uses ax bx ds si es di 655 ; ######################################################################### 656 ; Routine: Loads a specified sector to DS:DI 657 ; ######################################################################### 658 ; Calling : bx:ax - Absolute sector 659 ; cx:dx - Cylinder/Sector, Side/Drive (hi/lo-byte) 660 ; ds:si - Destination-Adress 661 ; Returns : none 662 ; Preserve: all registers 663 ; ######################################################################### 664 DriveIO_LoadSector Proc Near Uses ax bx ds si es di ; Rousseau: Disk IO 331 665 test cs:[CurIO_UseExtension], 1 332 666 jz DIOLS_UseNormal 333 667 ; Are we forced do use LBA via Setting? 334 test cs:[CFG_ForceLBAUsage], 1 668 test cs:[CFG_ForceLBAUsage], 1 ; Rousseau: LBA 335 669 jnz DIOLS_UseExtension 336 670 ; Is the drive not a harddrive? … … 351 685 pop es 352 686 mov bx, si ; ES:BX - Destination 353 mov ax, 0201h ; Function 2 - Load Sector 687 mov ax, 0201h ; Function 2 - Load Sector ; Rousseau: Disk IO -- legacy BIOS call 354 688 int 13h 355 689 jnc DIOLS_Success … … 370 704 pop ds 371 705 mov si, offset DriveIO_DAP 372 mov ah, 42h ; Extended Read 706 mov ah, 42h ; Extended Read ; Rousseau: Disk IO -- extended BIOS call 373 707 int 13h 374 708 pop cx … … 381 715 DriveIO_LoadSector EndP 382 716 383 Comment *ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 384 Routine: Writes DS:SI to a specified sector385 ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ 386 Calling : bx:ax - Absolute sector387 cx:dx - Cylinder/Sector, Side/Drive (hi/lo-byte)388 ds:si - Source-Adress389 Returns : none390 Preserve: all registers391 ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ* 717 ; ######################################################################### 718 ; Routine: Writes DS:SI to a specified sector 719 ; ######################################################################### 720 ; Calling : bx:ax - Absolute sector 721 ; cx:dx - Cylinder/Sector, Side/Drive (hi/lo-byte) 722 ; ds:si - Source-Adress 723 ; Returns : none 724 ; Preserve: all registers 725 ; ######################################################################### 392 726 DriveIO_SaveSector Proc Near Uses ax bx cx ds si es di 393 727 test cs:[CurIO_UseExtension], 1 394 728 jz DIOSS_UseNormal 395 729 ; Are we forced do use LBA via Setting? 396 test cs:[CFG_ForceLBAUsage], 1 730 test cs:[CFG_ForceLBAUsage], 1 ; Rousseau: LBA 397 731 jnz DIOSS_UseExtension 398 732 ; Is the drive not a harddrive? … … 440 774 ret 441 775 DriveIO_SaveSector EndP 776 777 778 ; See if a LVM-sector is valid. 779 ; In : si, pointer to sector 780 ; Out : ZF=true, not valid; ZF=false, valid 781 DriveIO_LVMSectorValid Proc Near 782 pusha 783 784 call LVM_CheckSectorSignature 785 mov al,0 786 rcl al,1 ; Move CY to AL.0 787 call AuxIO_TeletypeHexByte 788 call AuxIO_TeletypeNL 789 or al,al ; Zero if not a valid sector 790 jz DriveIO_LVMSectorValid_End ; Not a valid sector 791 792 call LVM_CheckSectorCRC 793 stc 794 mov al,0 795 rcl al,1 ; Move CY to AL.0 796 call AuxIO_TeletypeHexByte 797 call AuxIO_TeletypeNL 798 or al,al ; Zero if not a valid sector 799 800 DriveIO_LVMSectorValid_End: 801 802 popa 803 ret 804 DriveIO_LVMSectorValid EndP 805 806 ; ------------------------------------------------------ 807 ; Rousseau: # Load the master LVM-sector is one exists # 808 ; ------------------------------------------------------ 809 ; Load the master LVM-sector to get the number of sectors per track as eCS views the drive. 810 ; If no master LVM-sector is found it is assumed eCS is not installed. 811 ; The master LVM-sector can be located at three different places according to drive size 812 ; and partitioning scheme and driver used. 813 ; When DANIS506.ADD is used, the eCS extended geometry will be 255/127 for drives >502GiB but <1TiB. 814 ; Then the location will be sector 127 which is LBA 126 (7Eh). 815 ; IBM1S506.ADD will always use 255/255 for the extended eCS geometry. 816 ; DANIS506.ADD will use 255/255 for drives >1TiB. 817 ; Then the location of the master LVM-sector will be 255 which is LBA 254 (FEh). 818 ; When eCS is installed on a huge drive that alread had a system on it, eCS will be confined to the 819 ; lower 502GiB of the drive. In this case the normal geometry from Int13X will be used. 820 ; This is also the case when no valid master LVM-sector can be found. 821 ; 822 ; Return ZF=true if not found, ZF=false when valid master LVM-sector found. 823 DriveIO_LoadMasterLVMSector Proc Near 824 pusha 825 826 mov si,offset db_lmlvm 827 ;call AuxIO_Print 828 829 mov al,dl 830 ;call AuxIO_TeletypeHexByte 831 ;call AuxIO_TeletypeNL 832 833 834 ; Loop over the sector-translation table, 835 ; process the first three values from high (255) to low (bios spt, most likely 63) 836 mov cx,3 837 DriveIO_LoadMasterLVMSector_NextTry: 838 mov bx,offset secs_per_track_table ; sector translation table that corresponds with IsHugeDrive 839 mov si, offset LVMSector ; space to load the master LVM-sector 840 mov [DriveIO_DAP_NumBlocks],1 ; number of sectors to read 841 mov wptr [DriveIO_DAP_Transfer+0],si ; low part of transfer address 842 mov ax, ds 843 mov wptr [DriveIO_DAP_Transfer+2],ax ; high part of transfer address 844 mov ax,cx ; use the counter... 845 dec ax ; as an index into the table 846 xlatb ; translate to number of sectors 847 dec al ; LBA is zero-based, so adjust 848 849 IFDEF AuxDebug 850 ; Dump the value 851 ;call AuxIO_TeletypeHexByte 852 ;call AuxIO_TeletypeNL 853 ENDIF 854 855 mov wptr [DriveIO_DAP_Absolute+0],ax ; LBA low ; 856 mov wptr [DriveIO_DAP_Absolute+2],00h ; LBA high 857 mov si, offset DriveIO_DAP ; address request packet 858 mov ah, 42h 859 int 13h ; do the i/o 860 jc DriveIO_LoadMasterLVMSector_NotFound ; oops, there was an error 861 862 IFDEF AuxDebug 863 ; Dump title 864 mov si,offset db_masterlvm 865 ;call AuxIO_Print 866 867 ; Dum sector 868 mov si, offset LVMSector 869 ;call AuxIO_DumpSector 870 ;call AuxIO_TeletypeNL 871 ENDIF 872 ; See is this is a valid LVM-sector 873 call DriveIO_LVMSectorValid 874 875 IFDEF AuxDebug 876 pushf 877 ;call AuxIO_TeletypeNL 878 popf 879 ENDIF 880 ; Yep, we found the master LVM-sector 881 jnz DriveIO_LoadMasterLVMSector_Found 882 ; Try next location 883 loop DriveIO_LoadMasterLVMSector_NextTry 884 885 ; No master LVM-sector found, set ZF=true 886 DriveIO_LoadMasterLVMSector_NotFound: 887 xor ax,ax 888 889 ; Jump here with ZF=false if found 890 DriveIO_LoadMasterLVMSector_Found: 891 892 popa 893 ret 894 DriveIO_LoadMasterLVMSector Endp 895 896 897 898 899 ; --------------------------------------------------- 900 ; Rousseau ## Large drives, (eCS) geometry and LBA ## 901 ; --------------------------------------------------- 902 ; A sector size of 512 bytes is assumed in the below calculations. 903 ; Note that this scheme changes when the sector size will be 4096 or larger, 904 ; like with modern drives that do not translate to 512 bytes per sector anymore. 905 ; These drives will have a capacity above the 2TiB LBA32 boundary. 906 ; For now, we assume drives <=2TiB with a sector size of 512 bytes. 907 908 ; There are a few boundaries that are of importance. 909 ; Note that these are disk-boundaries and not partition boundaries. 910 ; Even with a small partition, like <502GiB, OS/2 will use extended geometry on an 911 ; empty huge disk. 912 ; These boundaries are (from high to low): 913 914 ; (code 5) 915 ; 2^32 = 4294967296 = 100000000 sectors = 2048 GiB 916 ; This is the LBA32 2TiB boundary. 917 ; Everything above it must be addressed using LBA48. 918 ; OS/2 can currently not address this space above. 919 920 ; (code4) 921 ; 65536*255*255 = 4261478400 = FE010000 sectors ~ 2032 GiB 922 ; This is the max OS/2 boundary using 255/255 extended geometry. 923 ; OS/2 can currently not address this space above. 924 925 ; (code 3) 926 ; 2^31 = 2147483648 = 80000000 sectors = 1024 GiB 927 ; This is the LBA32 1TiB boundary. 928 ; OS/2 can address this space and will use 255/255 extended geometry. 929 930 ; (code 2) 931 ; 65536*255*127 = 2122383360 = 7E810000 sectors ~ 1012 GiB 932 ; This is the DANI 1TiB boundary. 933 ; OS/2 can address this space and will use 255/255 extended geometry. 934 ; Below this DANI will use 255/127 extended geometry. 935 ; This matters on where the LVM-sectors are located ! 936 937 ; (code 1) 938 ; 65536*255*63 = 1052835840 = 3EC10000 sectors ~ 502 GiB 939 ; This is the current OS/2 limit using this geometry because OS/2 can currently 940 ; not address more than 65536 cylinders. 941 ; DANI will address space above with 255/127 extended geometry up until the DANI 1TiB boundary (code 2) 942 943 ; (code 0) 944 ; Everything below 65536*255*63 will be addressed using standard geometry. 945 946 947 ; 948 ; This function will return the following values: 949 ; 950 951 ; 5 = This drive is above the 2^32 LBA32 (2TB) boundary and has more than 4294967296 sectors. 952 ; LBA48 addressing is needed to access the complete capacity of the drive. 953 ; OS/2 is currently unable to do so. 954 955 ; 4 = This drive is above the 65536*255*255 (4261478400) boundary but below 2^32. 956 ; This is an OS/2 boundary and OS/2 is not able to access the drive above this boundary. 957 958 ; 3 = This drive is above the 2^31 (1TB) boundary and has more than 2147483648 sectors. 959 ; OS/2 is able to access the drive using it's extended geometry. 960 ; Both DANIS506 and IBM1S506 will use the 255/255 scheme. 961 962 ; 2 = This drive is above the 65536*255*127 (2122383360) boundary but below 2^31. 963 ; OS/2 is able to access the drive using it's extended geometry. 964 ; Both DANIS506 and IBM1S506 will use the 255/255 scheme. 965 966 ; 1 = This drive is above the 65536*255*63 (1052835840) boundary but below 65536*255*127. 967 ; OS/2 is able to access the drive using it's extended geometry. 968 ; Note that DANIS506 will use 255/127 and IBM1S506 will use 255/255 geometry ! 969 ; Using DANI or IBM influences the location of the LVM info-sectors ! 970 971 ; 0 = This drive is below the 65536*255*63 (1052835840) boundary. 972 ; OS/2 is able to access this drive using the standard 255/63 geometry. 973 974 ; So, any return value >0 means OS/2 extended geometry will be used. 975 ; Value 1 will use 255/127 with DANIS506 but 255/255 with IBM1S506. 976 ; Values 2 and 3 will use 255/255 on both drivers. 977 ; You can or with 0x01 and check for 3 in this case. 978 ; Any value above 3 will be a drive who's capacity cannot be fully used by OS/2 979 ; The upper limit of 65536*255*255 will be in effect here. 980 981 ; Note this function currently handles the boot-drive only ! 982 ; It should be extended and use dl for the drive-number as a parameter. 983 ; Because we use this function to get this info in a number of places, 984 ; all regs and flags except AX are saved and restored. 985 986 ; DL contains BIOS disk-number; 80h for first, 81h for second, etc. 987 DriveIO_GatherDiskInfo Proc Near 988 pushf 989 push bx 990 push cx 991 push dx 992 push si 993 push di 994 push es 995 996 ; Set ES to CS for buffer clearing 997 push cs 998 pop es 999 1000 ; Clear the buffer 1001 ; Don't overwrite the word of the buffersize at index 0 ! 1002 ; Old Phoenix BIOSses require word (flags) at 02 to be zero, 1003 ; so we clear the whole buffer to be sure. 1004 mov cx, i13xbuf_size 1005 mov di, offset i13xbuf 1006 mov [di],cx 1007 inc di 1008 inc di 1009 xor ah,ah 1010 cld 1011 rep stosb 1012 1013 ; Get the drive parameters 1014 mov ah, 48h ; Get Drive Parameters (extended version) 1015 ;mov dl, 80h ; Drive number 1016 mov si, offset i13xbuf ; Buffer for result-info 1017 push dx 1018 int 13h ; Call the BIOS-function 1019 pop dx 1020 1021 ; Do some error-checking 1022 or ah,ah ; AH is zero if no error (ZF=1 if no error) 1023 mov ax,0 ; Setup code for non-huge drive (does not influence ZF) 1024 jz DriveIO_GatherDiskInfo_ok ; Return if error (AL<>0 thus ZF=0) but CY not set, assuming non-huge drive 1025 jnc DriveIO_GatherDiskInfo_ok ; Return if error (CY=1), assuming non-huge drive 1026 jmp DriveIO_GatherDiskInfo_ret 1027 1028 1029 DriveIO_GatherDiskInfo_ok: 1030 1031 ; 1032 ; Store the drive geometry 1033 ; 1034 1035 mov si, offset i13xbuf 1036 1037 xor dh,dh 1038 and dl,01111111b 1039 shl dx,1 1040 shl dx,1 1041 1042 ; Store number of cylinders on disk 1043 mov bx, offset BIOS_Cyls 1044 add bx,dx 1045 mov ax,[si+04h] 1046 1047 mov word ptr [bx+00],ax 1048 mov ax,[si+06] 1049 mov word ptr [bx+02],ax 1050 1051 ; Store number of heads per cylinder 1052 mov bx, offset BIOS_Heads 1053 add bx,dx 1054 mov ax,[si+08h] 1055 mov word ptr [bx+00],ax 1056 mov ax,[si+0ah] 1057 mov word ptr [bx+02],ax 1058 1059 ; Store number of sectors per track 1060 mov bx, offset BIOS_Secs 1061 add bx,dx 1062 mov ax,[si+0ch] 1063 mov word ptr [bx+00],ax 1064 1065 ; Update first byte of translation-table to conform to BIOS SPT 1066 mov byte ptr [secs_per_track_table], al 1067 1068 mov ax,[si+0eh] 1069 mov word ptr [bx+02],ax 1070 1071 ; Store total secs 1072 mov bx, offset BIOS_TotalSecs 1073 add bx,dx 1074 add bx,dx 1075 mov ax,[si+10h] 1076 1077 mov word ptr [bx+00],ax 1078 mov ax,[si+12h] 1079 mov word ptr [bx+02],ax 1080 mov ax,[si+14h] 1081 mov word ptr [bx+04],ax 1082 mov ax,[si+18h] 1083 mov word ptr [bx+06],ax 1084 1085 ; Store number of bytes per sector 1086 mov bx, offset BIOS_Bytes 1087 add bx,dx 1088 mov ax,[si+18h] 1089 mov [bx],ax 1090 1091 1092 ; 1093 ; See of it's a huge drive of not 1094 ; 1095 1096 ; Drive is larger than 2TiB 1097 mov ax,5 ; Drive code (5) 1098 mov bx, [si+14h] ; Low word of high dword of sector-count 1099 or bx, [si+16h] ; High word of high dword of sector-count 1100 jnz DriveIO_GatherDiskInfo_ret ; If non-zero we have a drive with >2^32 sectors and thus LBA48 addressing 1101 1102 ; Drive is larger than max OS/2 capacity 1103 dec ax ; Drive code (4) 1104 mov bx, [si+12h] ; High word of low dword of sector-count 1105 cmp bx, 0fe01h ; Boundary 1106 jae DriveIO_GatherDiskInfo_ret ; If above or equal to boundary, 1107 ; we have a drive larger than to 65536*255*255 = FE010000 sectors 1108 1109 ; Drive can be completely utilized by OS/2 1110 dec ax ; Drive code (3) 1111 cmp bx, 8000h ; Boundary 1112 jae DriveIO_GatherDiskInfo_ret ; If above or equal to boundary, 1113 ; we have a drive larger than 2^31 sectors but smaller than 65536*255*255 1114 1115 ; This is the small area between DANI 1TiB and LBA 1TiB 1116 dec ax ; Drive code (2) 1117 cmp bx, 7e81h ; Boundary 1118 jae DriveIO_GatherDiskInfo_ret ; If above or equal to boundary, 1119 ; we have a drive larger than 65536*255*127 but <65536*255*255 1120 ; DANIS506.ADD will use 255/255 extended geometry 1121 1122 ; DANI will use 255/127 in this area, this could impact the location of LVM-sectors ! (last sec on track) 1123 dec ax ; Drive code (1) 1124 cmp bx, 3ec1h ; Boundary 1125 jae DriveIO_GatherDiskInfo_ret ; If above or equal to boundary, 1126 ; we have a drive larger than 65536*255*63 sectors (OS/2 502GiB Limit!) 1127 ; DANIS506.ADD will use 255/127 extended geometry ! 1128 ; IBM1S506.ADD will use 255/255 extended geometry ! 1129 1130 ; We have a drive that can be addressed using standard 255/63 geometry 1131 dec ax ; Drive code (0) 1132 ; We have a drive smaller than 65536*255*63 = 3EC10000 sectors 1133 1134 DriveIO_GatherDiskInfo_ret: 1135 pop es 1136 pop di 1137 pop si 1138 pop dx 1139 pop cx 1140 pop bx 1141 1142 mov [CurIO_UseExtension],1 1143 1144 popf 1145 ret 1146 DriveIO_GatherDiskInfo EndP 1147 1148 1149 1150 ; Values for sectors per track table corresponding to DriveIO_IsHugeDrive return value. 1151 secs_per_track_table: db 63,127,255,255,255,255 1152 1153 db_lmlvm: db 'Load Master LVM -- disk: ',0 -
trunk/BOOTCODE/REGULAR/OTHER.ASM
r29 r30 20 20 ;--------------------------------------------------------------------------- 21 21 22 IFDEF ModuleNames 23 DB 'OTHER',0 24 ENDIF 25 22 26 ; In: DS:SI - Pointer to begin of string 23 27 ; CX - Len of string … … 72 76 dec dh 73 77 jnz GLOSS_StringsLoop 74 movzx cx, dl 78 ;movzx cx, dl 79 mov cl,dl 80 mov ch,0 81 75 82 ret 76 83 GetLenOfStrings EndP … … 87 94 mov VideoIO_Segment, VideoIO_Page0 88 95 96 ; Don't use blinking attribute 97 call VideoIO_NoBlinking 98 99 ; Get HardDriveCount 100 call DriveIO_GetHardDriveCount 101 102 103 ; Rousseau: added 104 call VideoIO_ClearScreen 105 106 ; Cursor to upper-left 107 mov TextPosX, 0 108 mov TextPosY, 0 109 call VideoIO_CursorSet 110 111 ;mov ax, VideoIO_Page1 112 ;call VideoIO_BackUpTo ; Copy BIOS POST to Second Page 113 114 ; Copyright 115 mov si, offset Copyright 116 call MBR_Teletype 117 xor si,si 118 call MBR_TeletypeNL 119 120 121 ;call SOUND_Beep 122 123 ; Build Date 124 mov si, offset BUILD_DATE 125 call MBR_TeletypeNL 126 127 ; Initialize the com-port for debugging 128 call AuxIO_Init 129 130 xor si,si 131 call MBR_TeletypeNL 132 133 xor cx,cx 134 PRECRAP_Main_next_disk: 135 136 mov dl,cl 137 or dl,80h 138 139 call DriveIO_GatherDiskInfo ; Also used to fill the geo, should be separate function 140 141 mov bx,offset HugeDisk 142 add bx,cx 143 mov [bx], al 144 145 call DriveIO_LoadMasterLVMSector ; returns ZF=1 if no valid LVM record found 146 147 pushf 148 mov bx, offset TrueSecs 149 add bx,cx 150 add bx,cx 151 add bx,cx 152 add bx,cx 153 popf 154 155 ; bx now contains pointer to truesecs for this drive 156 157 jz NoValidMasterLVM 158 159 mov si,offset LVMSector 160 mov ax,[si+LocLVM_Secs] 161 mov word ptr [bx],ax 162 jmp SkipUseBiosSecs 163 164 165 NoValidMasterLVM: 166 push bx ; push truesecs pointer 167 mov bx, offset BIOS_Secs 168 add bx,cx 169 add bx,cx 170 add bx,cx 171 add bx,cx 172 173 mov ax,[bx] ; get biossecs 174 pop bx 175 mov word ptr [bx],ax ; store bios secs in truesecs 176 177 178 SkipUseBiosSecs: 179 inc cx 180 cmp cl,[TotalHarddiscs] 181 jb PRECRAP_Main_next_disk 182 183 184 185 IFDEF AuxDebug 186 ; Write some debug-info to the com-port 187 call DEBUG_Dump1 188 ENDIF 189 190 ; jz NoValidMasterLVM 191 192 193 ; A valid Master LVM has been found. 194 ; We use the values in here to determine the number of sectors per track, 195 ; since this could be OS/2 extended geometry. 196 197 ; jmp Continue1 198 199 200 ;mov word ptr [LOG_Secs],63 201 202 mov al,[HugeDisk] ;; fout, moet nog index bij 203 call AuxIO_TeletypeHexByte 204 call AuxIO_TeletypeNL 205 206 mov ax,word ptr [TrueSecs] ;; fout, moet nog index bij 207 call AuxIO_TeletypeHexWord 208 call AuxIO_TeletypeNL 209 210 211 212 ; Huge Disk indicator 213 mov si, offset HugeBootDisk 214 call MBR_Teletype 215 mov al,[HugeDisk] 216 mov si, offset No 217 test al,al 218 jz MBR_HugeDriveIndicator 219 mov si, offset Yes 220 221 MBR_HugeDriveIndicator: 222 call MBR_Teletype 223 xor si,si 224 call MBR_TeletypeNL 225 226 227 228 229 230 ; 231 ; Phase 1 Indicator 232 ; 233 mov si, offset Phase1 234 call MBR_Teletype 235 236 mov si, offset eCS_InstallVolume 237 mov al, [si] 238 test al,al ; See if phase 1 is active 239 jnz MBR_Main_BootThrough 240 mov si, offset NotActive 241 242 MBR_Main_BootThrough: 243 call MBR_TeleType 244 xor si,si 245 call MBR_TeletypeNL ; ALP barks undefined symbol; must use prototypes ? 246 247 89 248 ; Calculate Cooper-Bar Tables 90 249 call FX_CalculateTables … … 108 267 109 268 call PRECRAP_CheckFor13extensions 269 110 270 IFNDEF ReleaseCode 111 271 ret 112 272 ENDIF 273 113 274 call PRECRAP_CheckConfiguration 275 114 276 ; ======================================= 115 277 ; Checks for MBR Virii :) I love that job … … 123 285 call VIRUS_CheckForVirus 124 286 PCM_NoVirusDetection: 287 288 125 289 ; ============================================ 126 290 ; Delay for some time and get Strg/Alt State … … 132 296 jz PCM_LongDelay 133 297 PCM_ShortDelay: 298 134 299 mov al, 13 ; shorten delay,if floppy gets accessed 135 300 PCM_LongDelay: 301 136 302 call TIMER_WaitTicCount 303 137 304 ; First check, if any normal key got pressed... 138 305 mov ah, 1 … … 143 310 call MBR_Teletype 144 311 mov al, 54 ; about 3 seconds, delay again 312 145 313 call TIMER_WaitTicCount 314 146 315 PCM_NoNormalKeyPressed: 147 316 ; Now get keyboard Strg/Alt State … … 156 325 ret 157 326 PRECRAP_Main EndP 327 328 158 329 159 330 AFTERCRAP_Main Proc Near Uses … … 209 380 jmp MBR_HaltSystem 210 381 PRECRAP_CheckConfiguration EndP 382 383 384 ; Rousseau: added 385 ; In: SI - Pointer to begin of string (EOS is 0) 386 ; Destroyed: SI 387 ; Fixme: Uses double writes to use attribute with teletype-function. 388 MBR_TeletypeBold Proc Near Uses ax bx cx 389 MBRT_LoopBold: 390 lodsb 391 or al, al 392 jz MBRT_EndBold 393 push ax 394 mov ah,09h 395 mov bx,15 396 mov cx,1 397 int 10h 398 pop ax 399 mov ah,0eh 400 mov bx,7 ; Does not do anything in text-modus 401 mov cx,1 402 int 10h 403 jmp MBRT_LoopBold 404 MBRT_EndBold: 405 ret 406 MBR_TeletypeBold EndP 407 408 ; In: SI - Pointer to begin of string (EOS is 0) 409 ; Destroyed: SI 410 ; Fixme: Uses double writes to use attribute with teletype-function. 411 MBR_TeletypeVolName Proc Near Uses ax bx cx 412 mov cx, 11 413 MBRT_LoopVolName: 414 mov dx,cx ; Backup counter 415 lodsb 416 or al, al 417 jz MBRT_EndVolName 418 push ax 419 mov ah,09h 420 mov bx,15 421 mov cx,1 422 int 10h ; DX is preserved 423 pop ax 424 mov ah,0eh 425 mov bx,7 ; Does not do anything in text-modus 426 mov cx,1 427 int 10h ; DX is preserved 428 mov cx,dx ; Restore counter 429 loop MBRT_LoopVolName 430 MBRT_EndVolName: 431 ret 432 MBR_TeletypeVolName EndP 433 434 ; Rousseau: added 435 ; Move cursor to next line 436 ; Just do a new-line if SI==0 437 MBR_TeletypeNL Proc Near Uses ax bx cx 438 test si,si 439 jz MBR_TeletypeNL_NL 440 call MBR_Teletype 441 MBR_TeletypeNL_NL: 442 push si 443 mov si, offset NL 444 call MBR_Teletype 445 pop si 446 ret 447 MBR_TeletypeNL EndP 448 449 ; Sync teletype position to VideoIO 450 MBR_TeletypeSyncPos Proc Near Uses ax bx cx dx 451 pushf 452 mov bh, 0 453 mov ah, 02h 454 mov dh,[TextPosY] 455 mov dl,[TextPosX] 456 int 10h 457 popf 458 ret 459 MBR_TeletypeSyncPos EndP -
trunk/BOOTCODE/REGULAR/PARTMAIN.ASM
r29 r30 20 20 ;--------------------------------------------------------------------------- 21 21 22 IFDEF ModuleNames 23 DB 'PARTMAIN',0 24 ENDIF 25 22 26 PART_FixUpDefaultPartitionValues Proc Near Uses dx si di 23 27 ; Fix-Up Default and Last Partition - If lost, search for Bootable … … 140 144 ; Copies the device-name to the Resume-BIOS IPT entry 141 145 PART_UpdateResumeBIOSName Proc Near Uses ax bx cx si di 142 movzx bx, CFG_ResumeBIOSbootSeq 146 ;movzx bx, CFG_ResumeBIOSbootSeq 147 mov bl,CFG_ResumeBIOSbootSeq 148 mov bh,0 149 143 150 dec bx 144 151 shl bx, 1 … … 213 220 ; PCMPP_NoLinuxKernels: 214 221 215 movzx cx, CFG_Partitions ; LocIPT_MaxPartitions 222 ;movzx cx, CFG_Partitions ; LocIPT_MaxPartitions 223 mov cl,CFG_Partitions ; LocIPT_MaxPartitions 224 mov ch,0 225 216 226 or cx, cx 217 227 jz PCMPP_NoPartitions … … 240 250 je PGPP_IsBIOSbootSeq ; FEh -> Resume BIOS boot Sequence 241 251 ja PGPP_IsFloppy ; FFh -> Floppy 242 movzx bx, dl 252 ;movzx bx, dl 253 mov bl,dl 254 mov bh,0 255 243 256 shl bx, 1 244 257 mov si, wptr [PartitionPointers+bx] … … 278 291 ; Out: DL - Number of partition in straight view 279 292 PART_ConvertToStraight Proc Near Uses 280 movzx bx, dl 281 shl bx, 1 282 mov ax, wptr cs:[PartitionPointers+bx] 293 ;movzx bx, dl 294 mov bl,dl ; partition number to bl 295 mov bh,0 ; zero extend to word 296 297 shl bx, 1 ; convert to word index 298 mov ax, wptr cs:[PartitionPointers+bx] ; get the partition pointer 283 299 cmp ax, offset FloppyIPTentry 284 300 jb PCTS_IsBIOSbootSeq … … 315 331 PCFS_IsPartition: 316 332 ; First we get Partition-Offset in AX 317 movzx ax, dl 333 ;movzx ax, dl 334 mov al,dl 335 mov ah,0 336 318 337 mov bl, LocIPT_LenOfIPT 319 338 mul bl … … 354 373 mov bl, LocIPT_LenOfIPT 355 374 div bl ; Divide with IPTlength 356 movzx bx, al 375 ;movzx bx, al 376 mov bl,al 377 mov bh,0 378 357 379 shl ax, 1 358 380 shl bx, 2 … … 409 431 dec di ; Go to previous char 410 432 jmp PFOSE_DigitLoop 411 433 412 434 PFOSE_EndOfDigitLoop: 413 435 ret 414 436 PART_FillOutSizeElement EndP 437 438 439 440 441 ; ################### 442 ; # START PARTITION # 443 ; ################### 415 444 416 445 ; Starts Partition DL from Internal Partition Table. … … 454 483 mov di, offset TXT_BootingNowPartName 455 484 jz PSP_NoName 456 rep movsb 485 rep movsb ; Copy label-name to boot 457 486 PSP_NoName: 458 487 xor al, al 459 488 stosb ; Ending Zero 460 mov si, offset TXT_BootingNow1 489 mov si, offset TXT_BootingNow1 ; "Booting the system using " 461 490 call MBR_Teletype 462 491 ; [Linux support removed since v1.02] … … 484 513 IFDEF ReleaseCode 485 514 ; Save configuration on HDD boots (save CFG_PartLast) 486 call DriveIO_SaveConfiguration 515 call DriveIO_SaveConfiguration ; Rouaaseu: SAVE CONFIGURATION ! 487 516 ENDIF 488 517 call MBR_Teletype ; Prints out BootingNow2 including PartitionName … … 496 525 mov dh, bptr [si+LocIPT_LocationPartTable+0] 497 526 mov dl, [si+LocIPT_Drive] 498 call DriveIO_LoadPartition ; Load Table... 527 call DriveIO_LoadPartition ; Load Table... ; Rousseau: LOAD PARTITION ! 499 528 ; --------------------------------------------------- MODIFY PARTITION TABLE 500 529 push cs … … 536 565 or byte ptr es:[di+LocBRPT_Flags], 80h ; set ACTIVE partition 537 566 IFDEF ReleaseCode 538 call DriveIO_SavePartition ; Saves the Partition-Table 567 call DriveIO_SavePartition ; Saves the Partition-Table ; Rousseau: SAVE PARTITION ! 539 568 ENDIF 540 569 … … 549 578 ; BX:AX -> Absolute End-Position of Partition 550 579 551 test CFG_ForceLBAUsage, 1 580 test CFG_ForceLBAUsage, 1 ; Rousseau: LBA 552 581 jnz PSP_ForceI13X 553 ; LBA-boundary at 16450560 (FB0400h) 582 ; LBA-boundary at 16450560 (FB0400h) (16320x16x63) 554 583 cmp bx, 00FBh 555 584 jb PSP_NoI13X 556 585 PSP_ForceI13X: 557 push es di 586 push es di si 558 587 mov ax, 3000h 559 588 mov es, ax 560 589 xor di, di 590 ; Blokkeert starten van IBM BM !! 561 591 mov wptr es:[di], '1I' 562 592 mov wptr es:[di+2], 'X3' 563 pop di es 593 594 ;mov si,3000h 595 ;call AuxIO_DumpSector 596 597 pop si di es 564 598 PSP_NoI13X: 565 599 … … 607 641 mov cx, 0001h ; Cylinder 0, Sector 1 608 642 mov dx, 0080h ; First HD, Head 0 609 call DriveIO_LoadPartition ; Load Primary Partition Table 643 call DriveIO_LoadPartition ; Load Primary Partition Table ; Rousseau: LOAD MBR ! 610 644 call PART_MarkFirstGoodPrimary 611 645 IFDEF ReleaseCode 612 call DriveIO_SavePartition ; Saves the Partition-Table 646 call DriveIO_SavePartition ; Saves the Partition-Table ; Rousseau: SAVE MBR ! 613 647 ENDIF 614 648 PSP_NoHideAdjustPrimaryMark: … … 622 656 test byte ptr [si+LocIPT_Flags], Flags_DriveLetter 623 657 jz PSP_NoLVMReassignment 624 movzx bx, BootPartNo ; EntryNumber is straight view 658 ;movzx bx, BootPartNo ; EntryNumber is straight view 659 mov bl,BootPartNo ; EntryNumber is straight view 660 mov bh,0 661 625 662 mov al, bptr [DriveLetters+bx] 626 663 sub al, 3Dh ; Convert e.g. 80h -> 'C' … … 679 716 mov dh, [si+LocIPT_LocationBegin+0] 680 717 mov dl, [si+LocIPT_Drive] 681 call DriveIO_LoadPartition ; Loads boot-sector... 718 call DriveIO_LoadPartition ; Loads boot-sector... ; Rousseau: LOAD PART BOOT-SECTOR !! 682 719 683 720 test CFG_DetectVIBR, 1 … … 734 771 mov si, 10h*4 735 772 xor di, di ; INT 10h Vector to MBR Protection 736 movsd 773 ;movsd 774 movsw 775 movsw 776 737 777 mov si, 13h*4 ; INT 13h Vector to MBR Protection 738 movsd 778 ;movsd 779 movsw 780 movsw 781 739 782 mov al, CFG_IgnoreWriteToMBR ; Option to MBR Protection 740 783 stosb … … 753 796 PSP_NoMBRprotect: 754 797 cmp bptr [si+LocIPT_SystemID], 08 ; I hate Microsuck NTFS check 755 je PSP_NoSpecialSupport 798 799 ;je PSP_NoSpecialSupport 756 800 757 801 mov di, offset PartitionSector ; ES:DI - Actual Boot-Record … … 759 803 mov ax, wptr es:[di+24] 760 804 cmp ax, 003Fh ; Physical Layout-Sectors... Safety check 761 ja PSP_NoSpecialSupport 805 806 807 ; 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. 811 ; Offset van start-of-disk bij PCD7 niet meer dan 2GiB maken. 812 ; Special is needed to boot ECS-CXXVAC (log-part) on Douwskie Box with 40G disk. 813 ; FreeDOS 20G PRI SOD op 400G start niet met special. 814 ; Heeft drive-id op 26h (36d) van 0dh ! 815 ; WinXP werkt met special en not-special op 400G normal geo. 816 ; eCS op PRI op 2G met os2 ext geo werkt ook met beide. 817 ; eCS LOG werkt niet zonder special op 400G. 818 ; (hidden secs op 3F en moet 3F00 zijn; BM staat ervoor, 3F00=255*63+63) 819 ; Laatste 63 is MBR. 820 ; 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) 823 824 ; FreeDOS zet 63 in SPT in BPB op 255/255 geo !!!! 825 826 ; PC-DOS7 wil vaak niet starten als er meerdere pri's actief zijn. 827 ; Logo verschijnt wel maar start niet door. 828 829 830 ; Display volume-name 831 pushf 832 push si 833 add si, LocIPT_Name 834 call MBR_TeletypeVolName 835 xor si,si 836 call MBR_TeletypeNL ; Rousseau: Just before booting the selected partition 837 pop si 838 popf 839 840 841 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 ! 846 847 762 848 mov ax, wptr es:[di+26] 763 849 cmp ax, 00FFh ; Physical Layout-Heads... Safety check 764 850 ja PSP_NoSpecialSupport 765 851 mov al, bptr es:[di+36] 766 cmp al, 80h ; Drive Letter 852 cmp al, 80h ; Drive Letter (ID) 767 853 jne PSP_NoSpecialSupport 854 768 855 ; Special Support needed 856 special: 857 ; Write actual drive-letter to partition boot-record. 858 ; This is according to BPB. 769 859 mov al, bptr [si+LocIPT_Drive] 770 mov bptr es:[di+36], al ; Write Actual Drive-Letter 860 ; Also an influence with FreeDOS ! 861 ; Generates JFS ERROR when not set correctly !!! 862 mov bptr es:[di+36], al ; Write Actual Drive-Letter (80h id first drive) !!!!!!!!!!!!!!!!!!!!!!! 863 864 ; This could be incorrect when a partition is moved, 865 ; 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. 867 ; This fixing is done by OS/2 BM as well, according to Martin. 771 868 mov ax, [si+LocIPT_AbsoluteBegin] 772 mov wptr es:[di+28], ax ; Fixing Hidden Sectors count869 mov wptr es:[di+28], ax ; low word of hidden sectors 773 870 mov ax, [si+LocIPT_AbsoluteBegin+2] 774 mov wptr es:[di+30], ax ; Done by OS/2 BootMan as well...871 mov wptr es:[di+30], ax ; high word of hidden sectors 775 872 776 873 ; ------------------------------------------------ LOGICAL PARTITION SUPPORT 777 874 PSP_NoSpecialSupport: 875 876 ;jmp PSP_NoLogicalSupport 877 778 878 test byte ptr [si+LocIPT_Flags], Flags_DriveLetter 779 879 jz PSP_NoLogicalSupport 780 880 781 movzx bx, BootPartNo ; EntryNumber is straight view 881 ;movzx bx, BootPartNo ; EntryNumber is straight view 882 mov bl,BootPartNo ; EntryNumber is straight view 883 mov bh,0 884 782 885 mov al, bptr [DriveLetters+bx] 783 886 mov bptr es:[di+37], al ; Write Drive Letter (OS/2 only) … … 793 896 rep movsw 794 897 pop si 795 ; ---------------------------------------------------- NOW START BOOT-RECORD 898 ; ---------------------------------------------------- NOW START BOOT-RECORD ; Rousseau: START PARTITION BOOT-RECORD !! 899 900 901 IFDEF AuxDebug 902 ; call DEBUG_Dump2 903 ENDIF 904 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 926 927 ; 928 ; BYE BYE 929 ; 796 930 xor ax, ax 797 931 xor bx, bx … … 801 935 xor dh, dh ; Drive supported by BIOS 802 936 mov dl, cs:[si+LocIPT_Drive] ; Drive Physical No 937 803 938 IFDEF ReleaseCode 804 db 0EAh 939 db 0EAh ; JUMP TO Entry Point...Bye Bye 805 940 dw StartBasePtr 806 941 dw StartBaseSeg 807 942 ENDIF 808 943 PART_StartPartition EndP 944 945 946 947 948 949 950 951 952 953 809 954 810 955 ; This routine is called to hide a partition … … 923 1068 ; Destroyed: *none* 924 1069 PART_SearchFileSysName Proc Near Uses bx dx 925 movzx bx, al 1070 ;movzx bx, al 1071 mov bl,al 1072 mov bh,0 1073 926 1074 mov si, offset FileSysIDs 927 1075 PSFSN_SearchLoop: … … 943 1091 mov ah, dl 944 1092 ; AH is now the FileSystem-Flag 945 movzx bx, bh 1093 ;movzx bx, bh 1094 mov bl,bh 1095 mov bh,0 1096 946 1097 shl bx, 3 ; Offsets * 8 947 1098 mov si, offset FileSysNames 948 1099 add si, bx 949 ret 1100 ret 950 1101 PART_SearchFileSysName EndP 951 1102 … … 954 1105 ; Out: AL - Hidden File-System-ID 955 1106 PART_SearchFileSysHiddenID Proc Near Uses bx 956 movzx bx, al 1107 ;movzx bx, al 1108 mov bl,al 1109 mov bh,0 1110 957 1111 mov si, offset FileSysIDs 958 1112 PSFSHI_SearchLoop: … … 1019 1173 ret 1020 1174 PART_CheckForValidPartName EndP 1175 1176 1177 ; Rousseau: added 1178 ; Compare a volume-label in the IPT to the install-volume 1179 ; SI holds pointer to entry in IPT 1180 ; CY set if this entry is also the install-volume 1181 PART_IsInstallVolume Proc Near Uses ax cx dx si di 1182 cld ; Advance upwards with lodsb 1183 mov di, offset eCS_InstallVolume ; Address of install-volume label (max. 11 chars) 1184 1185 mov cx, 11 ; Maximum length of label 1186 xor dl, dl ; Not found yet 1187 1188 ; Compare next character 1189 PART_IsInstallVolumeNext: 1190 lodsb ; Load byte from SI (IPT-entry) 1191 ;cmp al,' ' ; If space then use zero 1192 ;jne PART_IsInstallVolume_skip1 1193 ;xor al,al 1194 PART_IsInstallVolume_skip1: 1195 xchg ah,al ; Save char to AH 1196 xchg si,di ; Exchange pointers 1197 lodsb ; Load byte from SI (install-volume label) 1198 ;cmp al,' ' ; If space then use zero 1199 ;jne PART_IsInstallVolume_skip2 1200 ;xor al,al 1201 PART_IsInstallVolume_skip2: 1202 xchg si,di ; Reexchange pointers 1203 call AuxIO_Teletype 1204 call CONV_ToUpper 1205 call AuxIO_Teletype 1206 xchg al,ah 1207 call AuxIO_Teletype 1208 call CONV_ToUpper 1209 call AuxIO_Teletype 1210 call AuxIO_TeletypeNL 1211 1212 ; Are both of them zero ? 1213 ; Then the names could be the same, but cx must not equal 11 1214 ; because that would indicate a null-string. 1215 mov dh,al 1216 or dh,ah 1217 jz PART_IsInstallVolumeFound 1218 1219 cmp ah,al ; Are the the same ? 1220 jnz PART_IsInstallVolumeNotFound ; Nope, compare ended 1221 loop PART_IsInstallVolumeNext ; Yep, Compare next character 1222 1223 PART_IsInstallVolumeFound: 1224 ; If CX is still 11 this was a zero string 1225 ; and thus not a valid volume-name. 1226 ; This should not occur as this function is only called when the first 1227 ; byte is non-zero. 1228 cmp cx,11 1229 je PART_IsInstallVolumeNotFound 1230 ; Found ! 1231 mov dl,1 ; Found 1232 jmp PART_IsInstallVolumeEnd 1233 1234 1235 PART_IsInstallVolumeNotFound: 1236 mov dl,0 1237 jmp PART_IsInstallVolumeEnd 1238 1239 1240 PART_IsInstallVolumeEnd: 1241 ; Set the status in CY 1242 mov al,dl 1243 add al,'0' 1244 call AuxIO_TeletypeHexByte 1245 call AuxIO_TeletypeNL 1246 rcr dl,1 ; Put found-flag in CY 1247 ret 1248 PART_IsInstallVolume EndP -
trunk/BOOTCODE/REGULAR/PARTSCAN.ASM
r29 r30 20 20 ;--------------------------------------------------------------------------- 21 21 22 23 IFDEF ModuleNames 24 DB 'PARTSCAN',0 25 ENDIF 26 22 27 ; Note: This is complex code. So make sure that you know what you are doing in 23 28 ; here. … … 48 53 mov si, offset NewPartTable 49 54 mov di, offset PartitionTable 50 movzx ax, NewPartitions 55 ;movzx ax, NewPartitions 56 mov al,NewPartitions 57 mov ah,0 58 51 59 mov CFG_Partitions, al 52 60 mov bl, LocIPT_LenOfIPT … … 58 66 mov si, offset NewDriveLetters 59 67 mov di, offset DriveLetters 60 mov cx, LocIPT_MaxPartitions /261 rep movs w68 mov cx, LocIPT_MaxPartitions 69 rep movsb 62 70 63 71 ; [Linux support removed since v1.02] … … 82 90 or dl, dl 83 91 jz PSSFP_NoAutoDriveLetter 84 movzx cx, CFG_Partitions 92 ;movzx cx, CFG_Partitions 93 mov cl,CFG_Partitions 94 mov ch,0 95 85 96 or cx, cx 86 97 jz PSSFP_NoAutoDriveLetter … … 118 129 mov wptr [ExtendedAbsPos+2], ax 119 130 PSSDFP_LoadThisPartition: 120 call DriveIO_LoadPartition 131 132 call DriveIO_LoadPartition ; Rousseau: load a partition record 133 121 134 jc PSSDFP_InvalidPartition 135 122 136 ; LVM Support - Reads LVM Information Sector 123 call DriveIO_LoadLVMSector 137 call DriveIO_LoadLVMSector ; Rousseau: load LVM sector 138 124 139 call PARTSCAN_ScanPartition 125 140 IFDEF ReleaseCode … … 223 238 add ax, wptr [CurPartition_Location+0] ; +Partition-Absolute 224 239 adc bx, wptr [CurPartition_Location+2] ; sectors 225 call DriveIO_LoadTmpSector ; Loads Boot record 240 call DriveIO_LoadTmpSector ; Loads Boot record ; Rousseau: LOAD PARTITION BOOT RECORD !! 226 241 ; Sets up DS:SI - TmpSector 227 242 … … 249 264 cmp PartSystemID, 07h ; We got IFS here? 250 265 jne PCCTP_IFSdone 251 ; Check, if 'JFS ' is at DWORD offset 36h 266 ; Check, if 'JFS ' is at DWORD offset 36h ; Rousseau: JFS check (LVM / IPT?) 252 267 cmp wptr [si+36h], 'FJ' 253 268 jne PCCTP_IFSnoJFS … … 284 299 PCCTP_HasVolumeLetter: 285 300 ; Save VolumeLetter in separate table 286 movzx bx, NewPartitions ; NewPartitions is one behind here, so 301 ;movzx bx, NewPartitions ; NewPartitions is one behind here, so 302 mov bl,NewPartitions ; NewPartitions is one behind here, so 303 mov bh,0 304 287 305 mov [PartitionVolumeLetters+bx], al ; it's already a zero-based offset 288 306 ; Now copy VolumeID and VolumeName to temporary space … … 291 309 stosw 292 310 mov ax, [si+LocLVM_PartitionID+2] 293 stosw ; Set Serial-Field to LVM-VolumeID 311 stosw 312 ; Set Serial-Field to LVM-VolumeID 313 push di 294 314 add si, LocLVM_PartitionName 315 295 316 mov cx, 5 296 317 rep movsw ; Copy LVM-PartitionName to Temp Space 297 movsb ; (11 bytes in total) 318 movsb ; (11 bytes in total) 319 320 pop di 321 cmp PartSystemID, 0ah 322 323 jne PCCTP_NoIbmBm 324 mov si, offset ibm_bm_name 325 mov cx,5 326 rep movsw 327 movsb 328 329 330 331 PCCTP_NoIbmBm: 332 333 298 334 pop di si dx ax 299 335 mov si, offset MBR_NoName_Patched … … 304 340 pop di si dx ax 305 341 test ah, FileSysFlags_NoName ; No-Name-Flag ? -> No Partition Name 306 jnz PCCTP_ThereIsNoName ; available 342 343 jz PCCTP_ThereIsAName 344 jmp PCCTP_ThereIsNoName ; available 345 346 PCCTP_ThereIsAName: 347 307 348 ; We check for NTFS (got detected a little bit earlier in this routine) 308 349 cmp PartSystemID, 08h ; We got IFS/NTFS here? … … 312 353 add si, 2Bh ; DS:SI - Partition-Name 313 354 test ah, FileSysFlags_FAT32 ; FAT32 specific name getting ? 355 314 356 jz PCCTP_ResumeNormal 357 315 358 add si, 1Ch ; Fix for FAT 32, shiat 316 359 PCCTP_ResumeNormal: 317 360 mov cx, 11 ; 11 bytes length 318 361 call PART_CheckForValidPartName 319 jnc PCCTP_ThereIsNoName 362 jc PCCTP_ThereIsAName2 363 364 jmp PCCTP_ThereIsNoName 365 366 PCCTP_ThereIsAName2: 367 320 368 sub si, 4 ; DS:SI -> Serial&Name (15-Bytes) 321 369 xor ah, ah ; no Flags_NoPartName … … 343 391 repz cmpsb 344 392 pop di si 345 je PCCTP_Match 393 394 jne PCCTP_NoMatchYet 395 396 jmp PCCTP_Match 397 398 PCCTP_NoMatchYet: 399 346 400 PCCTP_SerialNameAlreadyFound: 347 401 add di, LocIPT_LenOfIPT … … 477 531 PCCTP_LocCompFailed: 478 532 jmp PCCTP_CompareFailed 479 533 480 534 ; ================================== 481 535 ; =MATCH=, found partition in IPT... … … 557 611 ; Calculate Pointer to IPT 558 612 mov di, offset NewPartTable ; ES:DI - NewPartTable 559 movzx ax, NewPartitions 613 ;movzx ax, NewPartitions 614 mov al,NewPartitions 615 mov ah,0 616 560 617 mov bl, LocIPT_LenOfIPT 561 618 mul bl … … 575 632 stosb 576 633 mov al, cl ; Partition-Flags from register... 577 stosb 634 stosb 578 635 mov ax, PartCRC ; BootRecordCRC... 579 636 stosw … … 620 677 621 678 ; Calculate Size of this partition and put it into separate table... 622 movzx ax, NewPartitions 679 ;movzx ax, NewPartitions 680 mov al,NewPartitions 681 mov ah,0 682 623 683 dec ax 624 684 mov bx, ax … … 658 718 ; Destroyed: None 659 719 PARTSCAN_DefXref Proc Near Uses ax bx cx dx si di 660 movzx bx, dl 720 ;movzx bx, dl 721 mov bl,dl 722 mov bh,0 723 661 724 mov bptr [PartitionXref+bx], dh ; X-Reference 662 725 ; Copy Hide-Config of IPT partition to new location in new table … … 673 736 rep movsb ; Copy Hide-Config to NewHideTable 674 737 ; Process Logical-Drive-Letter table as well... 675 movzx bx, dl 738 ;movzx bx, dl 739 mov bl,dl 740 mov bh,0 741 676 742 mov al, bptr [DriveLetters+bx] ; Get Drv-Letter from org. pos 677 movzx bx, dh 743 ;movzx bx, dh 744 mov bl,dl 745 mov bh,0 746 678 747 mov bptr [NewDriveLetters+bx], al ; Put Drv-Letter to new pos 679 748 ret … … 684 753 ; Destroyed: None 685 754 PARTSCAN_GetXref Proc Near Uses bx 686 movzx bx, dl 755 ;movzx bx, dl 756 mov bl,dl 757 mov bh,0 758 687 759 mov dh, bptr [PartitionXref+bx] ; X-Reference 688 760 ret … … 702 774 cmp al, 0FFh 703 775 je PSSHCWX_SyncEmpty 704 movzx bx, al 776 ;movzx bx, al 777 mov bl,al 778 mov bh,0 779 705 780 mov al, [PartitionXref+bx] ; Translate it 706 781 cmp al, 0FFh … … 729 804 ret 730 805 PARTSCAN_SyncHideConfigWithXref EndP 806 807 ibm_bm_name: db 'IBM BootMan',0 -
trunk/BOOTCODE/REGULAR/PASSWORD.ASM
r29 r30 19 19 ; AiR-BOOT / PASSWORD 20 20 ;--------------------------------------------------------------------------- 21 22 IFDEF ModuleNames 23 DB 'PASSWORD',0 24 ENDIF 25 21 26 22 27 ; Don't ask me, what I'm doing in here to encode the passwords. I don't even … … 164 169 PE_ContinueLoop: 165 170 mov al, ds:[si] 166 movzx bx, ds:[si+8] 171 ;movzx bx, ds:[si+8] 172 mov bl,ds:[si+8] 173 mov bh,0 174 167 175 add bl, 16 168 176 mov ah, ds:[si+bx] -
trunk/BOOTCODE/REGULAR/STD_TEXT.ASM
r29 r30 20 20 ;--------------------------------------------------------------------------- 21 21 22 IFDEF ModuleNames 23 DB 'STD_TEXT',0 24 ENDIF 25 22 26 ; If you modify this Copyright and release this under your own name, 23 27 ; I'm going to sue your cheap ass, rape your dog and blow up your house. =) 24 28 25 CopyrightVersionLen equ 5 26 Copyright db ' AiR-BOOT v1.06 - (c) 1998-2009 M. Kiewitz, Dedicated to Gerd Kiewitz', 0 27 BootEndMsg db 'Free usage allowed, as long as you dont or have not worked for US government', 0 28 BootEndMsg2 db 'This is GPLv3+ software. Please visit http://AiR-BOOT.sourceforge.net', 0 29 CopyrightVersionLen equ 6 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', 0 32 ;Copyright db ' AiR-BOOT v1.07 - (c) 2011 M. Kiewitz - Rousseau test-version >502G (build: #24)', 0 33 ;Copyright db ' AiR-BOOT v1.07 - (c) 2011 M. Kiewitz - Release Candidate 1 - (build: #25)', 0 34 ;Copyright db ' AiR-BOOT v1.07 - (c) 1998-2011 M. Kiewitz, Dedicated to Gerd Kiewitz (rc2-b27)', 0 35 ;Copyright db ' AiR-BOOT v1.07 - (c) 1998-2011 M. Kiewitz, Dedicated to Gerd Kiewitz (rc3-b31)', 0 36 ;Copyright db ' AiR-BOOT v1.07 - (c) 1998-2011 M. Kiewitz, Dedicated to Gerd Kiewitz (rc4-b33)', 0 37 ;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', 0 40 41 ; Rousseau: switch around 42 BootEndMsg db 'This is GPLv3+ software. Please visit http://AiR-BOOT.sourceforge.net', 0 43 BootEndMsg2 db 'http://www.gnu.org/licenses/gpl.txt', 0 44 45 AuxInitMsg db 'Initializing Serial Communications on COM',0 29 46 30 47 CheckID_MBR db 'AiRBOOT' … … 33 50 ; Colors for special words hard-coded. Keep all 0s. 34 51 TXT_SETUP_LowerMessage db 'This software is released under ', 0, 'GPLv3+.', 0 35 db 'It may not be used by US government', 0 52 ; db 'It may not be used by US government', 0 53 db 'http://www.gnu.org/licenses/gpl.txt', 0 36 54 db 'For more information and source, please visit', 0 37 55 db 'http://AiR-BOOT.sourceforge.net', 0 38 db 'Contact via e-mail: ', 0, 'm_kiewitz [AT] users.sourceforge.net', 0 56 ; db 'Contact via e-mail: ', 0, 'm_kiewitz [AT] users.sourceforge.net', 0 57 db 'Contact via e-mail: ', 0, 'airboot@ecomstation.com', 0 39 58 40 59 ContinueBIOSbootTable dw offset TXT_SETUP_MAGIC_CDROM -
trunk/BOOTCODE/REGULAR/TIMER.ASM
r29 r30 20 20 ;--------------------------------------------------------------------------- 21 21 22 IFDEF ModuleNames 23 DB 'TIMER',0 24 ENDIF 25 22 26 ; This here is one of the rare cases that I'm using DIV and MUL opcodes. I 23 27 ; could have coded around them in here as well, but I was too lazy. Most of … … 39 43 ; Out: Nothing 40 44 TIMER_WaitTicCount Proc Near Uses ax bx dx 41 movzx bx, al 45 ;movzx bx, al 46 mov bl,al 47 mov bh,0 48 42 49 call TIMER_GetTicCount 43 50 add bx, ax ; BX - Required lower Tic … … 62 69 mul bl ; Result * 91 63 70 mov dx, ax 64 movzx ax, bh 71 ;movzx ax, bh 72 mov al,bh 73 mov ah,0 74 65 75 mov bl, 18 66 76 mul bl ; Remainder * 18 … … 80 90 div dl ; Tics : 91 81 91 mov dh, al 82 movzx ax, ah 92 ;movzx ax, ah 93 mov al,ah 94 mov ah,0 95 83 96 mov dl, 18 84 97 div dl ; Remainder : 18 … … 87 100 mov bl, 5 88 101 mul bl ; Result * 5 89 movzx dx, dh 102 ;movzx dx, dh 103 mov dl,dh 104 mov dh,0 105 90 106 add ax, dx ; Add both together... 91 107 ret -
trunk/BOOTCODE/REGULAR/VIDEOIO.ASM
r29 r30 19 19 ; AiR-BOOT / VIDEO I/O 20 20 ;--------------------------------------------------------------------------- 21 22 IFDEF ModuleNames 23 DB 'VIDEOIO',0 24 ENDIF 21 25 22 26 VideoIO_WaitRetrace Proc Near Uses ax dx … … 32 36 ret 33 37 VideoIO_WaitRetrace EndP 38 39 34 40 35 41 ; Holds the current position. Yeah, I know this is in the code area, but who … … 100 106 mov ax, VideoIO_Segment 101 107 mov es, ax 102 movzx ax, TextPosY 108 ;movzx ax, TextPosY 109 mov al,TextPosY 110 mov ah,0 111 103 112 mov bl, 160 104 113 mul bl … … 169 178 VideoIO_FixedPrint EndP 170 179 180 ; Rousseau: 181 ; Turn off blinking 182 ; http://www.ctyme.com/intr/rb-0088.htm does not mention this 183 VideoIO_NoBlinking Proc Near Uses ax bx 184 mov bx,0 185 mov ax,1003h 186 int 10h 187 ret 188 VideoIO_NoBlinking EndP 189 171 190 ; In: AL - Single Char to Print 172 191 ; Destroyed: None … … 179 198 ret 180 199 VideoIO_PrintSingleChar EndP 200 201 202 203 ; Print hex-byte to screen 204 ; This outputs two characters 205 ; In: AL - byte to send 206 ; Out: AL - byte sent 207 ; Destroyed: None 208 VideoIO_PrintHexByte Proc Near Uses ax 209 call CONV_BinToAsc ; Returns high hex-nibble in AH, low hex-nibble in AL 210 xchg al,ah ; High hex-nibble first 211 call VideoIO_PrintSingleChar ; Output to screen 212 xchg al,ah ; Low hex-nibble next 213 call VideoIO_PrintSingleChar ; Output to screen 214 ret 215 VideoIO_PrintHexByte EndP 216 217 218 ; Print hex-word to screen 219 ; This outputs four characters 220 ; In: AX - word to send 221 ; Out: AX - word sent 222 ; Destroyed: None 223 VideoIO_PrintHexWord Proc Near 224 xchg al,ah ; High byte first 225 call VideoIO_PrintHexByte ; Output to screen 226 xchg al,ah ; low byte next 227 call VideoIO_PrintHexByte ; Output to screen 228 ret 229 VideoIO_PrintHexWord EndP 230 231 232 ; Print hex-dword to screen 233 ; This outputs eight characters 234 ; In: DX:AX - dword to send 235 ; Out: DX:AX - dword sent 236 ; Destroyed: None 237 VideoIO_PrintHexDWord Proc Near 238 xchg ax,dx 239 call VideoIO_PrintHexWord ; High word first 240 xchg ax,dx 241 call VideoIO_PrintHexWord ; Low word next 242 ret 243 VideoIO_PrintHexDWord EndP 244 245 246 ; Print hex-qword to screen 247 ; This outputs sixteen characters 248 ; In: BX:CX:DX:AX - qword to send 249 ; Out: BX:CX:DX:AX - qword sent 250 ; Destroyed: None 251 VideoIO_PrintHexQWord Proc Near 252 xchg dx,bx 253 xchg ax,cx 254 call VideoIO_PrintHexDWord ; High dword first 255 xchg dx,bx 256 xchg ax,cx 257 call VideoIO_PrintHexDWord ; Low dword next 258 ret 259 VideoIO_PrintHexQWord EndP 260 261 262 263 181 264 182 265 ; In: AL - Single Char to Print … … 205 288 cmp al, 99 206 289 ja VIOPBN_DoNotWriteAnything 207 movzx bx, al 290 ;movzx bx, al 291 mov bl,al 292 mov bh,0 293 208 294 call VideoIO_Internal_SetRegs 209 295 cmp bl, 10 210 296 jb VIOPBN_Lower10 211 297 push ax 212 movzx ax, bl 298 ;movzx ax, bl 299 mov al,bl 300 mov ah,0 301 213 302 mov dl, 10 214 303 div dl … … 231 320 ; In: AL - Single Byte to Print 232 321 ; Destroyed: None 233 VideoIO_PrintByteDynamicNumber Proc Near Uses ax bx dx es di322 VideoIO_PrintByteDynamicNumber Proc Near Uses ax bx cx dx es di ; Rousseau: cx was missing from push-list 234 323 xor cl, cl 235 324 mov bh, al … … 240 329 cmp ah, 100 241 330 jb VIOPBDN_Lower100 242 movzx ax, ah 331 ;movzx ax, ah 332 mov al,ah 333 mov ah,0 334 243 335 mov dl, 100 244 336 div dl … … 249 341 add di, 2 250 342 VIOPBDN_Lower100: 251 movzx ax, ah 343 ;movzx ax, ah 344 mov al,ah 345 mov ah,0 346 252 347 mov dl, 10 253 348 div dl … … 270 365 ; Destroyed: None Important 271 366 VideoIO_Internal_MakeWinDown Proc Near Uses dx di 272 movzx dx, cl 367 ;movzx dx, cl 368 mov dl,cl 369 mov dh,0 370 273 371 mov bl, al 274 372 call VideoIO_Internal_SetRegs … … 281 379 dec dx 282 380 jnz VIOIMWD_Loop 283 ret 381 ret 284 382 VideoIO_Internal_MakeWinDown EndP 285 383 … … 287 385 ; Destroyed: None Important 288 386 VideoIO_Internal_MakeWinRight Proc Near Uses dx di 289 movzx dx, cl 387 ;movzx dx, cl 388 mov dl,cl 389 mov dh,0 390 290 391 mov bl, al 291 392 call VideoIO_Internal_SetRegs … … 298 399 dec dx 299 400 jnz VIOIMWR_Loop 300 ret 401 ret 301 402 VideoIO_Internal_MakeWinRight EndP 302 403 … … 366 467 sub bl, WinBeginPosX 367 468 dec bl 368 469 369 470 VIOIMW_Loop: 370 471 mov ch, WinBeginPosY … … 439 540 call VideoIO_CursorSet 440 541 call VideoIO_CursorOn ; Set and turn cursor on 441 542 442 543 ; ES:DI - Screen-Position to Start of String 443 544 ; DL - Position in String (relative to begin, base=0) … … 460 561 cmp dl, StringLen ; String "full" ? 461 562 jae VIOLUES_Loop 462 movzx bx, dl 563 ;movzx bx, dl 564 mov bl,dl 565 mov bh,0 566 463 567 shl bx, 1 464 568 mov es:[di+bx], al … … 476 580 mov al, ' ' 477 581 dec dl 478 movzx bx, dl 582 ;movzx bx, dl 583 mov bl,dl 584 mov bh,0 585 479 586 shl bx, 1 480 587 mov es:[di+bx], al … … 502 609 ret 503 610 VideoIO_LetUserEditString EndP 611 612 613 614 ; 615 ; Rousseau Additions. 616 ; 617 618 619 ; Function Template 620 ;ProcName Proc Near Uses ax bx cx dx si es di 621 ;ProcName EndP 622 623 624 ; 625 ; Clear the current page 626 ; 627 VideoIO_ClearScreen Proc Near Uses ax bx cx dx si es di 628 mov al, 0 ; clear entire window 629 mov bh,07h ; Attribute for new lines 630 xor cx,cx ; Row, Column ULC 631 xor dx,dx 632 dec dx ; Row, Column LRC (does this corrupt other pages ?) 633 mov ah, 06h ; Function Code 634 int 10h ; Do It ! 635 ret 636 VideoIO_ClearScreen EndP 637 638 ; 639 ; Rousseau: added 640 ; Set poosition to teletype cursor 641 ; 642 VideoIO_SyncPos Proc Near Uses ax bx cx dx 643 pushf 644 mov bh, 0 645 mov ah, 03h 646 int 10h 647 mov [TextPosX], dl 648 mov [TextPosY], dh 649 popf 650 ret 651 VideoIO_SyncPos EndP 652 653 654 655 VideoIO_DBG_WriteString Proc Near Uses ax bx cx dx si es di 656 mov ch, [CFG_Partitions] ; y 657 add ch, 7 658 add ch, [CFG_IncludeFloppy] 659 push cx 660 mov cl, 1 ; x 661 call VideoIO_Locate 662 mov ch, 15 ; fgc 663 mov cl, 0 ; bgc 664 call VideoIO_Color 665 mov si, offset ShowBootLog 666 call VideoIO_Print 667 pop cx 668 inc ch 669 670 ;mov ch, 21 ; y 671 mov cl, 1 ; x 672 call VideoIO_Locate 673 mov ch, 15 ; fgc 674 mov cl, 0 ; bgc 675 call VideoIO_Color 676 677 678 ; Rousseau: 679 mov al, [NewPartitions] 680 ;call VideoIO_PrintByteDynamicNumber 681 mov al, [CFG_Partitions] 682 ;call VideoIO_PrintByteDynamicNumber 683 ret 684 VideoIO_DBG_WriteString EndP 685 686 687 ; Dump the disk-info. 688 ; Disk number is in DL. 689 VideoIO_DumpDiskInfo Proc Near 690 691 VideoIO_DumpDiskInfo_next_disk: 692 push dx 693 xor ax,ax 694 mov al,[TextPosY] 695 push ax 696 697 mov ax,21 698 mov dh,dl 699 and dh,01111111b 700 mul dh 701 mov dh,al 702 703 mov [TextPosX],dh 704 705 mov si, offset Disk 706 call VideoIO_Print 707 mov al,dl 708 709 ; NIET GOED, GAAT FOUT > 9, HEX PRINT GEBRUIKEN !! 710 shr al,4 711 add al,'0' 712 call VideoIO_PrintSingleChar 713 mov al,dl 714 and al,01111111b 715 add al,'0' 716 call VideoIO_PrintSingleChar 717 mov al,'h' 718 call VideoIO_PrintSingleChar 719 720 inc [TextPosY] 721 mov [TextPosX],dh 722 723 mov al,'-' 724 mov cl,17 725 call VideoIO_PrintSingleMultiChar 726 727 inc [TextPosY] 728 mov [TextPosX],dh 729 mov si, offset BiosCyls 730 call VideoIO_Print 731 732 push dx 733 mov bx,offset BIOS_Cyls 734 xor dh,dh 735 and dl,01111111b 736 shl dx,1 737 shl dx,1 738 add bx,dx 739 mov ax,[bx] 740 mov dx,[bx+02] 741 call VideoIO_PrintHexDWord 742 pop dx 743 744 inc [TextPosY] 745 mov [TextPosX],dh 746 mov si, offset BiosHeads 747 call VideoIO_Print 748 749 push dx 750 mov bx,offset BIOS_Heads 751 xor dh,dh 752 and dl,01111111b 753 shl dx,1 754 shl dx,1 755 add bx,dx 756 mov ax,[bx] 757 mov dx,[bx+02] 758 call VideoIO_PrintHexDWord 759 pop dx 760 761 inc [TextPosY] 762 mov [TextPosX],dh 763 mov si, offset BiosSecs 764 call VideoIO_Print 765 766 push dx 767 mov bx,offset BIOS_Secs 768 xor dh,dh 769 and dl,01111111b 770 shl dx,1 771 shl dx,1 772 add bx,dx 773 mov ax,[bx] 774 mov dx,[bx+02] 775 call VideoIO_PrintHexDWord 776 pop dx 777 778 inc [TextPosY] 779 mov [TextPosX],dh 780 mov si, offset LvmSecs 781 call VideoIO_Print 782 783 push dx 784 mov bx,offset TrueSecs 785 xor dh,dh 786 and dl,01111111b 787 shl dx,1 788 shl dx,1 789 add bx,dx 790 mov ax,[bx] 791 mov dx,[bx+02] 792 call VideoIO_PrintHexDWord 793 pop dx 794 795 inc [TextPosY] 796 mov [TextPosX],dh 797 mov si, offset BiosLBA 798 call VideoIO_Print 799 800 push dx 801 mov bx,offset BIOS_TotalSecs 802 xor dh,dh 803 and dl,01111111b 804 shl dx,1 805 shl dx,1 806 shl dx,1 807 add bx,dx 808 mov ax,[bx] 809 mov dx,[bx+02] 810 call VideoIO_PrintHexDWord 811 pop dx 812 813 inc [TextPosY] 814 mov [TextPosX],dh 815 816 pop ax 817 mov [TextPosY],al 818 pop dx 819 820 inc dl 821 mov al,dl 822 and al,01111111b 823 cmp al,[TotalHarddiscs] 824 jae VideoIO_DumpDiskInfo_end 825 jmp VideoIO_DumpDiskInfo_next_disk 826 827 VideoIO_DumpDiskInfo_end: 828 mov [TextPosX],0 829 add [TextPosY],6 830 ret 831 VideoIO_DumpDiskInfo EndP 832 833 834 835 ; Disk Info to Dump to AB LogScreen 836 Disk: db "DISK ",0 837 BiosCyls: db "Cyls :",0 838 BiosHeads: db "Heads :",0 839 BiosSecs: db "Secs :",0 840 LvmSecs: db "SecsLVM :",0 841 BiosLBA: db "LBA Secs:",0 842 843 844 HugeBootDisk: db "Boot Disk is Huge : ",0 845 DisksFound: db "Disks Found : ",0 846 PartitionsFound: db "Partitions Found : ",0 847 ;AutoStartPart: db "Auto Start Partition : ",0 848 849 Phase1: db "eCS Install Phase 1 : ",0 850 851 852 ShowMenu: db "Press TAB to return to the AiR-BOOT Menu",0 853 ShowBootLog: db "Press TAB to see the Boot Log...",0 854 855 Yes: db "YES",0 856 No: db "NO",0 857 On: db "ON",0 858 Off: db "OFF",0 859 None: db "NONE",0 860 Active: db "ACTIVE",0 861 NotActive: db "NOT ACTIVE",0 862 863 ; New Line for use by MBR_Teletype 864 NL: db 0dh, 0ah, 0 -
trunk/BOOTCODE/SETUP/MAIN.ASM
r29 r30 20 20 ;--------------------------------------------------------------------------- 21 21 22 IFDEF ModuleNames 23 DB 'MAIN',0 24 ENDIF 25 22 26 LocMENU_RoutinePtr equ 0 23 27 LocMENU_VariablePtr equ 2 … … 66 70 67 71 SETUP_CheckEnterSETUP Proc Near Uses 72 73 74 75 ; Rousseau: added 76 ;mov SETUP_ExitEvent, 0 77 ;xor al, al ; -PARTITION SETUP PreDefines- 78 ;mov PartSetup_UpperPart, al ; Upper-Partition == 0 79 ;mov PartSetup_ActivePart, al ; Active-Partition == 0 80 81 ; Setup PartitionPointers-Table...again (needed when re-entering setup) 82 ;call PART_CalculateStraightPartPointers 83 ;call VideoIO_DBG_WriteString 84 ; Rousseau: end added 85 86 87 68 88 test CFG_AutoEnterSetup, 1 69 89 jnz SCES_ForceEnter … … 152 172 je SMT_KeyEsc 153 173 cmp ah, Keys_F1 154 je SMT_KeyHelp 174 jne skip_xx 175 jmp SMT_KeyHelp 176 skip_xx: 155 177 cmp ah, Keys_F10 156 je SMT_SaveAndExitNOW 178 jne skip_yy 179 jmp SMT_SaveAndExitNOW 180 skip_yy: 157 181 ; ASCII values... 158 182 cmp al, Keys_Space … … 264 288 SETUP_MenuTask EndP 265 289 290 291 292 CLR_MENU_WINDOW_CLASSIC = 0e01h 293 CLR_MENU_WINDOW_BM = 0e01h 266 294 ; In: BP - Pointer to Menu 267 295 ; Out: DH - Active Item on Screen 268 296 SETUP_DrawMenuOnScreen Proc Near Uses 269 297 call SETUP_DrawMenuWindow 270 mov cx, 0E01h298 mov cx, CLR_MENU_WINDOW_BM 271 299 call VideoIO_Color 272 300 xor ch, ch … … 294 322 SETUP_FillUpItemPacks EndP 295 323 324 325 326 CLR_SELECTED_ITEM_CLASSIC = 0f04h 327 CLR_SELECTED_ITEM_BM = 0f04h 296 328 ; Displays selected Item on screen 297 329 ; In: DH - Active Item 298 330 ; Destroyed: None 299 331 SETUP_DrawSelectItem Proc Near Uses cx 300 mov cx, 0F04h332 mov cx, CLR_SELECTED_ITEM_BM 301 333 call VideoIO_Color 302 334 mov ch, dh … … 305 337 SETUP_DrawSelectItem EndP 306 338 339 340 CLR_DESELECTED_ITEM_CLASSIC = 0e01h 341 CLR_DESELECTED_ITEM_BM = 0e01h 307 342 ; Display last-selected Item on screen (De-Select) 308 343 ; In: DL - Active Item 309 344 ; Destroyed: None 310 345 SETUP_DrawDeSelectItem Proc Near Uses cx 311 mov cx, 0E01h346 mov cx, CLR_DESELECTED_ITEM_BM 312 347 call VideoIO_Color 313 348 mov ch, dl … … 356 391 mov wptr TextColorFore, dx 357 392 ret 358 393 359 394 ; ------------------------------------------------------ Draw ITEMPACK 360 395 SDIOS_ItemPackDraw: … … 368 403 SDIOS_ItemPack_NoFixUpItemPack: 369 404 call VideoIO_Locate 370 mov cx, 0F01h 405 406 CLR_ITEM_PACK_CLASSIC = 0f01h 407 CLR_ITEM_PACK_BM = 0f01h 408 409 mov cx, CLR_ITEM_PACK_BM 371 410 call VideoIO_Color ; White on blue background 372 411 mov si, ds:[si+LocMENU_ItemNamePtr] ; SI - Name of Item … … 418 457 ret 419 458 SETUP_FillUpItemPack_Now EndP 459 460 420 461 421 462 SETUP_DrawMenuWindow Proc Near Uses es … … 474 515 mov cl, CopyrightVersionLen 475 516 call VideoIO_FixedPrint ; and 'vX.XX'. 476 add si, 3 517 518 ; Rousseau: 519 ; Strange, had to adjust this value. 520 ; Somewhere some offset changed... 521 ; Possibly happened with the movzx change to 286 instructions because some 522 ; offsets are hard coded. 523 ;add si, 3 524 add si, 2 525 477 526 call GetLenOfString ; CX - Len of "Copyright" string 478 527 mov dx, cx … … 871 920 mov si, di ; DS:SI - Current Password 872 921 xor dl, dl 873 ; DL - location of cursor (first=0) 922 ; DL - location of cursor (first=0) 874 923 SLEP_Loop: 875 924 mov cx, EnterPwd_Location … … 910 959 cmp dl, 8 911 960 je SLEP_SkipThiz 912 movzx bx, dl 961 962 ;movzx bx, dl 963 mov bl,dl 964 mov bh,0 965 913 966 mov ds:[si+bx], al 914 967 mov al, 42 ; fixed star :] … … 920 973 je SLEP_SkipThiz 921 974 dec dl 922 movzx bx, dl 975 976 ;movzx bx, dl 977 mov bl,dl 978 mov bh,0 979 923 980 mov al, 32 924 981 mov ds:[si+bx], al … … 1098 1155 jz SMICTN_NoFiller 1099 1156 dec al 1100 movzx cx, al 1157 1158 ;movzx cx, al 1159 mov cl,al 1160 mov ch,0 1161 1101 1162 xor al, al 1102 1163 rep stosb ; and fill up with NULs, if required … … 1523 1584 SMCBBS_Enabled: 1524 1585 dec dl 1525 movzx bx, dl 1586 1587 ;movzx bx, dl 1588 mov bl,dl 1589 mov bh,0 1590 1526 1591 shl bx, 1 1527 1592 mov si, wptr [ContinueBIOSbootTable+bx] -
trunk/BOOTCODE/SETUP/MENUS.ASM
r29 r30 55 55 ; 56 56 57 IFDEF ModuleNames 58 DB 'MENUS',0 59 ENDIF 60 57 61 LocMENU_LenOfMenuPtrBlock equ 8 58 62 LocMENU_LenOfItemPack equ 12 … … 63 67 LocMENU_ItemPack equ 8 ; only if VariablePtr>0 64 68 65 SETUP_MainMenu: 69 SETUP_MainMenu: 66 70 db 0 ; Where Current Item will get saved 67 71 dw offset TXT_SETUPHELP_MAIN ; Pointer to help information … … 209 213 dw offset TXT_SETUP_IgnoreLVM, offset TXT_SETUPHELP_IgnoreLVM 210 214 dw 6 dup (0) 211 dw offset SETUPMAGIC_EnableDisable, offset CFG_ForceLBAUsage 215 dw offset SETUPMAGIC_EnableDisable, offset CFG_ForceLBAUsage ; Rousseau: LBA 212 216 dw offset TXT_SETUP_ForceLBAUsage, offset TXT_SETUPHELP_ForceLBAUsage 213 217 dw 6 dup (0) -
trunk/BOOTCODE/SETUP/PART_SET.ASM
r29 r30 19 19 ; AiR-BOOT SETUP / PARTITION SETUP 20 20 ;--------------------------------------------------------------------------- 21 22 IFDEF ModuleNames 23 DB 'PART_SET',0 24 ENDIF 21 25 22 26 ; This here is called from Menu in AIR-BSET.asm … … 58 62 je PSM_KeyVIBRdetection 59 63 cmp al, TXT_SETUP_FlagLetterHide 60 je PSM_KeyHiddenSetup 64 65 jne skip_x 66 jmp PSM_KeyHiddenSetup 67 skip_x: 61 68 cmp al, TXT_SETUP_FlagLetterDrvLetter 62 je PSM_KeyDriveLetterForceSetup 69 70 jne skip_y 71 jmp PSM_KeyDriveLetterForceSetup 72 skip_y: 73 63 74 cmp al, TXT_SETUP_FlagLetterExtMShack 64 je PSM_KeyDriveLetterExtMShack 75 jne skip_z 76 jmp PSM_KeyDriveLetterExtMShack 77 skip_z: 65 78 jmp PSM_MainLoop 66 79 … … 331 344 inc al 332 345 call VideoIO_PrintByteNumber 333 346 334 347 ; Display "No Hd" field aka "01/01" 335 348 call VideoIO_Locate … … 426 439 call PARTSETUP_ReColorPart 427 440 428 ; Running Fixing 441 ; Running Fixing 429 442 cmp dh, 0FFh 430 443 jne PSBCB_NoUnderflow … … 558 571 ; This is done for security purposes, because if they match, we will update 559 572 ; the name in both - IPT and BR/LVM. 560 movzx bx, dl 573 574 ;movzx bx, dl 575 mov bl,dl 576 mov bh,0 577 561 578 cmp [PartitionVolumeLetters+bx], 0 ; ==0 means not supported by LVM 562 579 je PSCPN_NotLVMSupported … … 638 655 639 656 ; Check, where to save 2nd destination to... 640 movzx bx, dl 657 658 ;movzx bx, dl 659 mov bl,dl 660 mov bh,0 661 641 662 cmp [PartitionVolumeLetters+bx], 0 ; ==0 means not supported by LVM 642 663 je PSCPN_SaveBootRecord … … 775 796 PARTHIDESETUP_DrawMenuBase Proc Near Uses dx 776 797 ; PartSetup_HiddenX1 777 mov cx, 0D05h ; Lila on lila 798 799 CLR_PART_HIDE_WINDOW_BASE_CLASSIC = 0d05h 800 CLR_PART_HIDE_WINDOW_BASE_BM = 0a02h 801 802 mov cx, CLR_PART_HIDE_WINDOW_BASE_BM ; Lila on lila 778 803 call VideoIO_Color 779 804 mov bh, 05h … … 792 817 mov al, 'µ' 793 818 call VideoIO_PrintSingleChar 794 mov cx, 0E05h ; Yellow on Lila 819 820 CLR_PART_HIDE_WINDOW_LABEL_CLASSIC = 0e05h 821 CLR_PART_HIDE_WINDOW_LABEL_BM = 0e02h 822 823 mov cx, CLR_PART_HIDE_WINDOW_LABEL_BM ; Yellow on Lila 795 824 call VideoIO_Color 796 825 mov si, offset TXT_SETUP_HideFeature 797 826 call VideoIO_Print 798 mov cx, 0D05h ; Lila on lila 827 828 CLR_PART_HIDE_WINDOW_BORDER_CLASSIC = 0d05h 829 CLR_PART_HIDE_WINDOW_BORDER_BM = 0d02h 830 831 832 mov cx, CLR_PART_HIDE_WINDOW_BORDER_BM ; Lila on lila 799 833 call VideoIO_Color 800 834 mov al, 'Æ' … … 851 885 852 886 ; --- Make ':' Line down 853 mov cx, 0F05h ; Yellow on Lila 887 888 CLR_PART_HIDE_MENU_BASE_CLASSIC = 0f05h 889 CLR_PART_HIDE_MENU_BASE_BM = 0f02h 890 891 mov cx, CLR_PART_HIDE_MENU_BASE_BM ; Yellow on Lila 854 892 call VideoIO_Color 855 893 mov ch, 07h … … 873 911 dec dh 874 912 jnz PHSRP_Loop 913 914 CLR_PART_HIDE_MENU_MARKERS_CLASSIC = 0d05h 915 CLR_PART_HIDE_MENU_MARKERS_BM = 0a02h 916 875 917 ; At last calculate Scroll-Markers 876 mov cx, 0D05h ; Lila on lila918 mov cx, CLR_PART_HIDE_MENU_MARKERS_BM ; Lila on lila ; Hide Feature Markers 877 919 call VideoIO_Color 878 920 mov cx, 0603h ; 6, +3 … … 919 961 push cx 920 962 ; Display "Label" field aka "OS2" without ending NULs/Spaces 921 mov cx, 0F05h 963 964 CLR_PART_HIDE_LABEL_CLASSIC = 0f05h 965 CLR_PART_HIDE_LABEL_BM = 0f02h 966 967 mov cx, CLR_PART_HIDE_LABEL_BM 922 968 call VideoIO_Color ; Bright White on Lila 923 969 push si … … 927 973 call VideoIO_FixedPrint 928 974 pop si 929 mov cx, 0D05h 975 976 CLR_PART_HIDE_WINDOW_FS_CLASSIC = 0d05h 977 CLR_PART_HIDE_WINDOW_FS_BM = 0a02h 978 979 mov cx, CLR_PART_HIDE_WINDOW_FS_BM 930 980 call VideoIO_Color ; Bright Lila on Lila 931 981 mov al, ' ' … … 948 998 call VideoIO_Locate 949 999 push cx 950 mov cx, 0E05h 1000 1001 CLR_PART_HIDE_WINDOW_CHOISES_CLASSIC = 0e05h 1002 CLR_PART_HIDE_WINDOW_CHOISES_BM = 0e02h 1003 1004 mov cx, CLR_PART_HIDE_WINDOW_CHOISES_BM 951 1005 call VideoIO_Color ; Yellow on Lila 952 1006 mov al, ' ' … … 980 1034 PHSBCB_SkipRetrace: 981 1035 1036 CLR_PART_HIDE_WINDOW_MENU_BAR_CLASSIC = 5eh 1037 CLR_PART_HIDE_WINDOW_MENU_BAR_BM = 2eh 1038 982 1039 ; Deactivate current active bar 983 mov cl, 5Eh; Yellow on Lila1040 mov cl, CLR_PART_HIDE_WINDOW_MENU_BAR_BM ; Yellow on Lila 984 1041 call PARTHIDESETUP_ReColorPart 985 1042 986 ; Running Fixing 1043 ; Running Fixing 987 1044 cmp dh, 0FFh 988 1045 jne PHSBCB_NoUnderflow … … 1015 1072 1016 1073 ; Activate fresh active bar 1017 mov cl, 1Fh ; Bright White on Blue 1074 1075 CLR_PART_HIDE_WINDOW_MENU_ACTIVE_BAR_CLASSIC = 1fh 1076 CLR_PART_HIDE_WINDOW_MENU_ACTIVE_BAR_BM = 1fh 1077 1078 mov cl, CLR_PART_HIDE_WINDOW_MENU_ACTIVE_BAR_BM ; Bright White on Blue 1018 1079 call PARTHIDESETUP_ReColorPart 1019 1080 ; Now DL==DH … … 1178 1239 1179 1240 ; Now get the Logical-Drive-Letter for that partition... 1180 movzx bx, dl 1241 ;movzx bx, dl 1242 mov bl,dl 1243 mov bh,0 1244 1181 1245 mov dl, bptr [DriveLetters+bx] 1182 1246 … … 1264 1328 1265 1329 ; Draw base-window 1266 mov cx, 0D05h ; Lila on lila 1330 1331 CLR_PART_DL_XX_CLASSIC = 0d05h 1332 CLR_PART_DL_XX_BM = 0a02h 1333 1334 mov cx, CLR_PART_DL_XX_BM ; Lila on lila 1267 1335 call VideoIO_Color 1268 1336 mov bh, 06h … … 1281 1349 mov al, 'µ' 1282 1350 call VideoIO_PrintSingleChar 1283 mov cx, 0E05h ; Yellow on Lila 1351 1352 CLR_PART_DL_WINDOW_TITLE_CLASSIC = 0e05h 1353 CLR_PART_DL_WINDOW_TITLE_BM = 0e02h 1354 1355 mov cx, CLR_PART_DL_WINDOW_TITLE_BM ; Yellow on Lila 1284 1356 call VideoIO_Color 1285 1357 mov si, offset TXT_SETUP_DriveLetter 1286 1358 call VideoIO_Print 1287 mov cx, 0D05h ; Lila on lila 1359 1360 CLR_PART_DL_WINDOW_BORDER2_CLASSIC = 0d05h 1361 CLR_PART_DL_WINDOW_BORDER2_BM = 0a02h 1362 1363 mov cx, CLR_PART_DL_WINDOW_BORDER2_BM ; Lila on lila 1288 1364 call VideoIO_Color 1289 1365 mov al, 'Æ' … … 1292 1368 ; Display help-information 1293 1369 mov si, offset TXT_SETUPHELP_DriveLetter 1294 mov cx, 0D05h ; Lila on lila 1370 1371 CLR_PART_DL_SETUP_HELP_CLASSIC = 0d05h 1372 CLR_PART_DL_SETUP_HELP_BM = 0a02h 1373 1374 1375 mov cx, CLR_PART_DL_SETUP_HELP_BM ; Lila on lila 1295 1376 call VideoIO_Color 1296 1377 … … 1306 1387 mov al, '>' 1307 1388 call VideoIO_PrintSingleChar 1308 ; 1389 ; 1309 1390 mov cx, 0F01h ; Bright White on Blue 1310 1391 call VideoIO_Color -
trunk/BOOTCODE/SPECIAL/APM.ASM
r29 r30 20 20 ;--------------------------------------------------------------------------- 21 21 22 IFDEF ModuleNames 23 DB 'APM',0 24 ENDIF 25 22 26 ; Here is APM Code to turn off the computer 23 27 -
trunk/BOOTCODE/SPECIAL/F00K/BILLSUXX.ASM
r29 r30 27 27 ; Here is code to change Extended Partition to Type 05h or 0Fh depending 28 28 ; on the partition's P-flag including the overall M$hack-Enable Flag. 29 30 IFDEF ModuleNames 31 DB 'BILLSUXX',0 32 ENDIF 33 29 34 MSHACK_ProcessPartTables Proc Near Uses ax dx di 30 35 ; Check Overall M$-Hack Enable -
trunk/BOOTCODE/SPECIAL/FAT16.ASM
r29 r30 20 20 ;--------------------------------------------------------------------------- 21 21 22 IFDEF ModuleNames 23 DB 'FAT16',0 24 ENDIF 25 22 26 ; Here is access code for accessing FAT-16 partitions. It's not a complete 23 27 ; File-API and only for simple readonly-access. … … 27 31 ; I did not want to code silly cylinder stuff here. I have also used 28 32 ; i386 code in here, because Linux requires so as well. Please note that 29 ; I don't use i386 code anywhere (!) else in AiR-BOOT. 30 ; 33 ; I don't use i386 code anywhere (!) else in AiR-BOOT. ; Rousseau: yes you did, movezx is 386-only :-) 34 ; ; Replaced by 286 instructions. 31 35 ; Initialize FAT-16 access on specified partition (required for following xs) 32 36 ; In: DS:SI - IPT-Entry that contains a FAT-16 partition … … 131 135 mov ax, dx 132 136 sub ax, 2 ; Everything starts at Cluster 2 133 movzx bx, FAT16_SecsPerCluster 137 ;movzx bx, FAT16_SecsPerCluster 138 mov bl,FAT16_SecsPerCluster 139 mov bh,0 140 134 141 mul bx 135 142 shl edx, 16 … … 145 152 add di, ax 146 153 ; Finally, look for next Cluster following to this one... 147 movzx bx, dl 154 ;movzx bx, dl 155 mov bl,dl 156 mov bh,0 157 148 158 shl bx, 1 ; BX - Offset within FAT-Table 149 159 shr dx, 8 ; DX - FAT-Sector … … 259 269 pop ax 260 270 mov dx, si 261 movzx cx, ah 271 ;movzx cx, ah 272 mov cl,ah 273 mov ch,0 274 262 275 rep movsb 263 276 mov si, dx ; Restore SI -
trunk/BOOTCODE/SPECIAL/FX.ASM
r29 r30 19 19 ; AiR-BOOT / F/X 20 20 ;--------------------------------------------------------------------------- 21 22 IFDEF ModuleNames 23 DB 'FX',0 24 ENDIF 21 25 22 26 ; There you go. Some nice old-school demo coder effects :) … … 268 272 cmp di, FX_MaxScanLine 269 273 jb FX_MCS_VerticalLoop 270 274 271 275 mov ax, FX_CooperBarsTimer 272 276 dec ax … … 386 390 FX_CC_ActiveState: 387 391 ; increment SinusPos by 1 388 movzx bx, bptr ds:[FX_SinusPos+si] 392 ;movzx bx, bptr ds:[FX_SinusPos+si] 393 mov bl,bptr ds:[FX_SinusPos+si] 394 mov bh,0 395 389 396 inc bx 390 397 mov bptr ds:[FX_SinusPos+si], bl … … 409 416 FX_CalculateWideScroller Proc Near Uses 410 417 mov bx, FX_WideScrollerCurPos 411 movzx cx, FX_WideScrollerSpeed 418 ;movzx cx, FX_WideScrollerSpeed 419 mov cl,FX_WideScrollerSpeed 420 mov ch,0 421 412 422 test FX_WideScrollerAbsDirection, 1 413 423 jnz FXCWS_RIGHT -
trunk/BOOTCODE/SPECIAL/FXTABLES.ASM
r29 r30 20 20 ;--------------------------------------------------------------------------- 21 21 22 IFDEF ModuleNames 23 DB 'FXTABLES',0 24 ENDIF 25 22 26 ; Sinus-Table - 128xWORD = 256 Bytes 23 27 FX_SinusTab dw 00101h, 00102h, 00103h, 00105h, 00107h, 0010Ah, 0010Dh, 00111h -
trunk/BOOTCODE/SPECIAL/LINUX.ASM
r29 r30 40 40 ; some nice menus, setup, text, cyrillic support, demo-coder effects, easy 41 41 ; handling, help, auto-detection and plenty of other stuff INTO AROUND 25k. 42 ; 42 ; 43 43 ; Oh, why is this code here? Because of 2 friends of mine. Otherwise I wouldnt 44 44 ; have done it as well as fat16.asm. 45 46 IFDEF ModuleNames 47 DB 'LINUX',0 48 ENDIF 45 49 46 50 Linux_TranslateBase db '/dev/hd' … … 217 221 mov dx, ds:[si+LocIPT_LocationBegin] 218 222 ; from now on, we don't need si anymore 219 223 220 224 ; Linux has 1 'BR' (which is crap) and some setup sectors 221 225 ; we load them at 9000:0, what a luck, we are at 8000:0 :-)) … … 342 346 jz LLL_LoadNormalKernel 343 347 jmp LLL_LoadBigKernel 344 348 345 349 LLL_LoadNormalKernel: 346 350 ; NORMAL KERNEL … … 458 462 dw 0 459 463 dw 0FFFFh 460 MBR_Linux_GDT_Dst db 0, 0, 10h ; Dest is "10000:0" 464 MBR_Linux_GDT_Dst db 0, 0, 10h ; Dest is "10000:0" 461 465 db 093h 462 466 dw 0 -
trunk/BOOTCODE/SPECIAL/LVM.ASM
r29 r30 19 19 ; AiR-BOOT / LVM 20 20 ;--------------------------------------------------------------------------- 21 22 IFDEF ModuleNames 23 DB 'LVM',0 24 ENDIF 21 25 22 26 LVM_InitCRCTable Proc Near Uses … … 25 29 mov di, offset LVM_CRCTable 26 30 LVM_ICRCT_Loop: 27 movzx ax, cl 31 ;movzx ax, cl 32 mov al,cl 33 mov ah,0 34 28 35 xor dx, dx ; DX:AX - CRC-Value 29 36 mov ch, 8 … … 86 93 test [CFG_IgnoreLVM], 1 ; We are supposed to ignore LVM, so 87 94 jnz LVMCSS_InvalidSignature ; any sector is bad! 88 cmp wptr [si+LocLVM_SignatureStart], 5202h 95 cmp wptr [si+LocLVM_SignatureStart], 5202h ; Rousseau: identify LVM sector 89 96 jne LVMCSS_InvalidSignature 90 97 cmp wptr [si+LocLVM_SignatureStart+2], 'BM' -
trunk/BOOTCODE/SPECIAL/SOUND.ASM
r29 r30 19 19 ; AiR-BOOT / SOUND SUPPORT 20 20 ;--------------------------------------------------------------------------- 21 22 IFDEF ModuleNames 23 DB 'SOUND',0 24 ENDIF 21 25 22 26 ; Here is some sound code. Requested by Hex1753. … … 108 112 ret 109 113 SOUND_WaitToSilence EndP 114 115 116 117 ; Rousseau: added 118 SOUND_Beep PROC Near 119 pushf 120 pusha 121 122 mov al, 7 123 mov bh, 0 124 mov bl, 7 125 mov ah, 0eh 126 int 10h 127 128 popa 129 popf 130 ret 131 SOUND_Beep ENDP -
trunk/BOOTCODE/SPECIAL/VIRUS.ASM
r29 r30 23 23 ; system will get halted. On Non-Real-Mode this will only save Interrupt Vectors. 24 24 ; Segment Registers preserved 25 26 IFDEF ModuleNames 27 DB 'VIRUS',0 28 ENDIF 29 25 30 VIRUS_CheckForStealth Proc Near Uses ds si es di 26 31 xor al, al … … 154 159 mov bx, BootBasePtr 155 160 mov dx, 0080h 156 mov cx, 003Ch ; First Harddrive, Sector 60 161 ;mov cx, 003Ch ; First Harddrive, Sector 60 162 mov cx, image_size / sector_size ; Harddisc 0, Sector 60 (or 62 for extended version) 157 163 mov ax, 0301h ; Write 1 Sector 158 164 int 13h … … 166 172 mov bx, offset TmpSector 167 173 mov dx, 0080h 168 mov cx, 003Ch ; Harddisc 0, Sector 60 174 ;mov cx, 003Ch ; Harddisc 0, Sector 60 175 mov cx, image_size / sector_size ; Harddisc 0, Sector 60 (or 62 for extended version) 169 176 mov ax, 0201h ; Load 1 Sector 170 177 pushf -
trunk/BOOTCODE/TEXT/EN/OTHER.ASM
r29 r30 52 52 ;----------------------------------|----------------------------| 53 53 TXT_BootMenuEnterSetup db 'F10 to enter Setup', 0 54 ;TXT_BootMenuEnterBootLog db 'TAB to enter Boot Log', 0 54 55 55 56 ; Dynamic Length (till 80 chars) … … 61 62 db 13, 10, ' Press any key to continue...', 0 62 63 63 TXT_VirusFoundMain: db 13, 10, ' - !ATTENTION! -> A V IRUSWAS FOUND <- !ATTENTION!', 13, 10, 064 TXT_VirusFoundMain: db 13, 10, ' - !ATTENTION! -> A V1RU5 WAS FOUND <- !ATTENTION!', 13, 10, 0 64 65 TXT_VirusFound1ok: db ' It got squashed, but the system may not reboot correctly. If this happens,', 13, 10 65 66 db ' use your AiR-BOOT system disc.', 13, 10, 0 -
trunk/ENV/DOS.BAT
r29 r30 1 1 rem This file sets Assembler, Linker and EXE2BIN for DOS environment 2 set assembler=tasm.exe /m9 /dReal /t 2 set assembler=tasm.exe /m9 /dReal /l 3 rem set assembler=tasm.exe /m9 /dReal /t 3 4 set linker=tlink.exe /3 /x 4 5 set exe2bin=exe2bin.exe -
trunk/INCLUDE/ASM.INC
r29 r30 36 36 37 37 ; Shortcuts for pointer-types 38 bptr equ byte ptr 39 wptr equ word ptr 40 dptr equ dword ptr 41 qptr equ qword ptr 42 tptr equ tbyte ptr 38 bptr equ byte ptr 39 wptr equ word ptr 40 dptr equ dword ptr 41 qptr equ qword ptr 42 tptr equ tbyte ptr 43 44 45 sector_size equ 512 46 image_size_60secs equ 7800h 47 image_size_62secs equ 7c00h 48 49 ;image_size equ image_size_60secs 50 image_size equ image_size_62secs 51 52 sector_count equ image_size / sector_size ; Image size in sectors 53 54 IF image_size EQ image_size_60secs 55 partition_count equ 30 ; Maximum number of partitions supported 56 ELSE 57 partition_count equ 45 ; Maximum number of partitions supported 58 ENDIF -
trunk/INSTALL/C/INST-OS2.TGT
r29 r30 22 22 5 23 23 MCommand 24 67 25 copy inst-os2.exe ..\..\RELEASE\OS2\airboot2.exe 24 131 25 @ren INST-OS2.EXE INST-OS2.XEX 26 @ren INST-OS2.XEX INST-OS2.EXE 27 copy INST-OS2.EXE ..\..\RELEASE\OS2\AIRBOOT2.EXE 26 28 del install.obj 27 29 … … 29 31 MItem 30 32 12 31 inst-os2.exe 33 INST-OS2.EXE 32 34 7 33 35 WString … … 36 38 8 37 39 WVList 38 2 40 4 39 41 9 40 M CState42 MVState 41 43 10 42 44 WString … … 45 47 11 46 48 WString 49 22 50 ?????Other options(,): 51 0 52 12 53 WString 54 19 55 op map=INST-OS2.MAP 56 0 57 13 58 MVState 59 14 60 WString 61 7 62 OS2LINK 63 15 64 WString 65 22 66 ?????Other options(,): 67 1 68 16 69 WString 70 19 71 op map=INST-OS2.MAP 72 0 73 17 74 MCState 75 18 76 WString 77 7 78 OS2LINK 79 19 80 WString 47 81 13 48 82 ?????Map file 49 83 1 50 84 0 51 12 85 20 52 86 MCState 53 13 87 21 54 88 WString 55 89 7 56 90 OS2LINK 57 14 91 22 58 92 WString 59 93 24 … … 61 95 1 62 96 0 63 15 97 23 98 WVList 99 1 100 24 101 ActionStates 102 25 103 WString 104 5 105 &Make 106 26 64 107 WVList 65 108 0 … … 68 111 1 69 112 0 70 16 113 27 71 114 WPickList 72 115 2 73 17 116 28 74 117 MItem 75 118 3 76 119 *.c 77 18 120 29 78 121 WString 79 122 4 80 123 COBJ 81 19 124 30 82 125 WVList 83 126 0 84 20 127 31 85 128 WVList 86 129 0 … … 89 132 1 90 133 0 91 21 134 32 92 135 MItem 93 136 9 94 install.c 95 22 137 INSTALL.C 138 33 96 139 WString 97 140 4 98 141 COBJ 99 23 142 34 100 143 WVList 101 144 0 102 24 145 35 103 146 WVList 104 147 0 105 17 148 28 106 149 1 107 150 1 -
trunk/INSTALL/C/INST-WIN.TGT
r29 r30 22 22 5 23 23 MCommand 24 69 25 copy inst-win.exe ..\..\RELEASE\WINNT\airbootw.exe 24 133 25 @ren INST-WIN.EXE INST-WIN.XEX 26 @ren INST-WIN.XEX INST-WIN.EXE 27 copy INST-WIN.EXE ..\..\RELEASE\WINNT\AIRBOOTW.EXE 26 28 del install.obj 27 29 … … 29 31 MItem 30 32 12 31 inst-win.exe 33 INST-WIN.EXE 32 34 7 33 35 WString … … 36 38 8 37 39 WVList 38 2 40 4 39 41 9 40 M CState42 MVState 41 43 10 42 44 WString … … 45 47 11 46 48 WString 49 22 50 ?????Other options(,): 51 0 52 12 53 WString 54 19 55 op map=INST-WIN.MAP 56 0 57 13 58 MVState 59 14 60 WString 61 7 62 WINLINK 63 15 64 WString 65 22 66 ?????Other options(,): 67 1 68 16 69 WString 70 19 71 op map=INST-WIN.MAP 72 0 73 17 74 MCState 75 18 76 WString 77 7 78 WINLINK 79 19 80 WString 47 81 13 48 82 ?????Map file 49 83 1 50 84 0 51 12 85 20 52 86 MCState 53 13 87 21 54 88 WString 55 89 7 56 90 WINLINK 57 14 91 22 58 92 WString 59 93 24 … … 61 95 1 62 96 0 63 15 97 23 64 98 WVList 65 1 66 16 99 2 100 24 67 101 ActionStates 68 17 102 25 69 103 WString 70 104 5 71 105 &Make 72 18 106 26 107 WVList 108 0 109 27 110 ActionStates 111 28 112 WString 113 4 114 &Run 115 29 73 116 WVList 74 117 0 … … 77 120 1 78 121 0 79 19 122 30 80 123 WPickList 81 124 2 82 20 125 31 83 126 MItem 84 127 3 85 128 *.c 86 21 129 32 87 130 WString 88 131 4 89 132 COBJ 90 22 133 33 91 134 WVList 92 135 0 93 23 136 34 94 137 WVList 95 138 0 … … 98 141 1 99 142 0 100 24 143 35 101 144 MItem 102 145 9 103 install.c 104 25 146 INSTALL.C 147 36 105 148 WString 106 149 4 107 150 COBJ 108 26 151 37 109 152 WVList 110 153 0 111 27 154 38 112 155 WVList 113 156 0 114 20 157 31 115 158 1 116 159 1 -
trunk/INSTALL/C/INSTALL.C
r29 r30 25 25 #include <os2.h> 26 26 #include <malloc.h> 27 #include <stdlib.h> // Rousseau: added to use getenv() 27 28 #define PLATFORM_OS2 28 29 #elif defined(__NT__) … … 39 40 40 41 41 #define STATUS_NOTINSTALLED 0 // No ID found 42 #define STATUS_CORRUPT 1 // ID found, Checksum failure 43 #define STATUS_INSTALLED 2 // ID found, Checksum valid 44 #define STATUS_INSTALLEDMGU 3 // ID found, Checksum valid, may get updated 45 #define STATUS_IMPOSSIBLE 4 // Unable/Not willing to install 42 #define STATUS_NOTINSTALLED 0 // No ID found 43 #define STATUS_CORRUPT 1 // ID found, Checksum failure 44 #define STATUS_INSTALLED 2 // ID found, Checksum valid 45 #define STATUS_INSTALLEDMGU 3 // ID found, Checksum valid, may get updated 46 #define STATUS_IMPOSSIBLE 4 // Unable/Not willing to install 47 48 /* Rousseau: added */ 49 #define GPT 0xEE // GPT Disk, AiR-BOOT will abort 50 #define BYTES_PER_SECTOR 512 // This could be higher in the future 51 #define IMAGE_SIZE_60SECS 30720 // Normal image-size (max. 30 partitions) 52 #define IMAGE_SIZE_62SECS 31744 // Extended image-size (max. 45 partitions) 53 //#define IMAGE_SIZE IMAGE_SIZE_60SECS // Use the normal image 54 #define IMAGE_SIZE IMAGE_SIZE_62SECS // Use the extended image 55 #define SECTOR_COUNT IMAGE_SIZE / BYTES_PER_SECTOR // Size of the image in sectors 56 #define CONFIG_OFFSET 0x6C00 // Byte offset of config-sector 57 #define SECTORS_BEFORE_CONFIG CONFIG_OFFSET / BYTES_PER_SECTOR // Nr of sectors before config-sector 58 59 46 60 47 61 // ============================================================================ 48 62 // Variables 49 63 // ============================================================================ 50 CHAR Track0[ 60*512];// current track 0 from harddrive51 CHAR Bootcode[ 60*512];// bootcode image from airboot.bin64 CHAR Track0[SECTOR_COUNT * BYTES_PER_SECTOR]; // current track 0 from harddrive 65 CHAR Bootcode[SECTOR_COUNT * BYTES_PER_SECTOR]; // bootcode image from airboot.bin 52 66 53 67 UCHAR Bootcode_LanguageID = ' '; … … 64 78 BOOL Option_ForceConfig = FALSE; 65 79 BOOL Option_Silent = FALSE; 80 81 BOOL Option_CID = FALSE; // Rousseau: added 66 82 67 83 BOOL Install_Code = FALSE; … … 86 102 USHORT OS2_GetIOCTLHandle () { 87 103 USHORT IOCTLHandle = 0; 88 104 89 105 if (DosPhysicalDisk(INFO_GETIOCTLHANDLE, &IOCTLHandle, sizeof(IOCTLHandle),"1:" , 3) != 0) 90 106 return 0; … … 114 130 AutoDriveLetter = BootDrive+0x7D; 115 131 AutoDriveLetterSerial = InfoLevel2.ulVSN; 116 printf("%X\n", InfoLevel2.ulVSN); 132 if (!Option_CID) { 133 printf("%X\n", InfoLevel2.ulVSN); 134 } 117 135 } 118 136 } … … 122 140 USHORT SectorsPerTrack = 0; 123 141 DEVICEPARAMETERBLOCK DeviceParmBlock; 124 ULONG ulDataLength; 142 ULONG ulDataLength; 125 143 126 144 IOCTLHandle = OS2_GetIOCTLHandle(); … … 129 147 SectorsPerTrack = DeviceParmBlock.cSectorsPerTrack; 130 148 OS2_FreeIOCTLHandle (IOCTLHandle); 131 if (SectorsPerTrack>61) return TRUE; 149 //if (SectorsPerTrack > 61) return TRUE; // >60 should also be ok for normal image (60 for image 1 for lvm) 150 if (SectorsPerTrack > SECTOR_COUNT) return TRUE; // Note: This is 1 sector smaller than above !! 132 151 // OS/2 is only able to support 512-byte/sector media, so we dont need to check this 133 152 return FALSE; … … 136 155 BOOL Track0Load (void) { 137 156 USHORT IOCTLHandle; 138 ULONG TrackLayoutLen = sizeof(TRACKLAYOUT)+sizeof(ULONG)*( 60-1);157 ULONG TrackLayoutLen = sizeof(TRACKLAYOUT)+sizeof(ULONG)*(SECTOR_COUNT-1); 139 158 TRACKLAYOUT *TrackLayoutPtr = malloc(TrackLayoutLen); 140 159 ULONG cbParms = sizeof(TrackLayoutPtr); 141 ULONG cbData = 512;160 ULONG cbData = BYTES_PER_SECTOR; 142 161 int i; 143 162 BOOL Success = FALSE; … … 149 168 TrackLayoutPtr->usCylinder = 0; 150 169 TrackLayoutPtr->usFirstSector = 0; 151 TrackLayoutPtr->cSectors = 60;152 153 for (i=0; i< 60; i++) {170 TrackLayoutPtr->cSectors = SECTOR_COUNT; 171 172 for (i=0; i<SECTOR_COUNT; i++) { 154 173 TrackLayoutPtr->TrackTable[i].usSectorNumber = i+1; 155 TrackLayoutPtr->TrackTable[i].usSectorSize = 512;174 TrackLayoutPtr->TrackTable[i].usSectorSize = BYTES_PER_SECTOR; 156 175 } 157 176 … … 166 185 BOOL Track0Write (void) { 167 186 USHORT IOCTLHandle; 168 ULONG TrackLayoutLen = sizeof(TRACKLAYOUT)+sizeof(ULONG)*( 60-1);187 ULONG TrackLayoutLen = sizeof(TRACKLAYOUT)+sizeof(ULONG)*(SECTOR_COUNT-1); 169 188 TRACKLAYOUT *TrackLayoutPtr = malloc(TrackLayoutLen); 170 189 ULONG cbParms = sizeof(TrackLayoutPtr); 171 ULONG cbData = 512;190 ULONG cbData = BYTES_PER_SECTOR; 172 191 INT i; 173 192 BOOL Success = FALSE; … … 180 199 TrackLayoutPtr->usCylinder = 0; 181 200 TrackLayoutPtr->usFirstSector = 0; 182 TrackLayoutPtr->cSectors = 60;183 184 for (i=0; i< 60; i++) {201 TrackLayoutPtr->cSectors = SECTOR_COUNT; 202 203 for (i=0; i<SECTOR_COUNT; i++) { 185 204 TrackLayoutPtr->TrackTable[i].usSectorNumber = i+1; 186 TrackLayoutPtr->TrackTable[i].usSectorSize = 512;205 TrackLayoutPtr->TrackTable[i].usSectorSize = BYTES_PER_SECTOR; 187 206 } 188 207 … … 218 237 GetVersionEx(&Version); 219 238 if (Version.dwPlatformId == VER_PLATFORM_WIN32_NT) return TRUE; 220 printf(" - This installer is for WindowsNT family only.\n"); 221 printf(" Please use DOS installer for Windows9x.\n"); 239 if (!Option_CID) { 240 printf(" - This installer is for WindowsNT family only.\n"); 241 printf(" Please use DOS installer for Windows9x.\n"); 242 } 222 243 return FALSE; 223 244 } … … 231 252 CloseHandle(IOCTLHandle); 232 253 } 233 254 234 255 USHORT CountHarddrives (void) { 235 256 return 1; … … 246 267 SectorsPerTrack = Geometry.SectorsPerTrack; 247 268 WINNT_FreeIOCTLHandle(IOCTLHandle); 248 if (SectorsPerTrack>61) return TRUE; 269 //if (SectorsPerTrack > 61) return TRUE; // >60 should also be ok for normal image (60 for image 1 for lvm) 270 if (SectorsPerTrack > SECTOR_COUNT) return TRUE; // Note: This is 1 sector smaller than above !! 249 271 return FALSE; 250 272 } … … 257 279 IOCTLHandle = WINNT_GetIOCTLHandle(); 258 280 SetFilePointer(IOCTLHandle, 0, 0, FILE_BEGIN); 259 if (ReadFile(IOCTLHandle, &Track0, 60*512, &BytesRead, NULL))281 if (ReadFile(IOCTLHandle, &Track0, SECTOR_COUNT * BYTES_PER_SECTOR, &BytesRead, NULL)) 260 282 Success = TRUE; 261 283 WINNT_FreeIOCTLHandle(IOCTLHandle); … … 270 292 IOCTLHandle = WINNT_GetIOCTLHandle(); 271 293 SetFilePointer(IOCTLHandle, 0, 0, FILE_BEGIN); 272 if (WriteFile(IOCTLHandle, &Track0, 60*512, &BytesWritten, NULL))294 if (WriteFile(IOCTLHandle, &Track0, SECTOR_COUNT * BYTES_PER_SECTOR, &BytesWritten, NULL)) 273 295 Success = TRUE; 274 296 WINNT_FreeIOCTLHandle(IOCTLHandle); … … 307 329 FileHandle = fopen("airboot.bin", "rb"); 308 330 if (!FileHandle) { 309 printf("airboot.bin not found\n"); 331 if (!Option_CID) { 332 printf("airboot.bin not found\n"); 333 } 310 334 return FALSE; 311 335 } … … 313 337 fseek (FileHandle, 0, SEEK_END); 314 338 BootcodeSize = ftell(FileHandle); 315 if (BootcodeSize!= 30720) {339 if (BootcodeSize!=IMAGE_SIZE) { 316 340 fclose (FileHandle); 317 printf("Invalid airboot.bin\n"); 341 if (!Option_CID) { 342 printf("Invalid airboot.bin\n"); 343 } 318 344 return FALSE; 319 345 } 320 346 fseek (FileHandle, 0, SEEK_SET); 321 fread (&Bootcode, 1, 30720, FileHandle);347 fread (&Bootcode, 1, IMAGE_SIZE, FileHandle); 322 348 fclose (FileHandle); 323 349 … … 330 356 } 331 357 358 /** 359 * Check MBR and AB signatures. 360 * Also check code sectors if AB is installed. 361 * Set global status accordingly. 362 */ 332 363 void Status_CheckCode (void) { 333 364 USHORT TotalCodeSectorsUsed = 0; … … 338 369 // EZ-Setup check! 339 370 Status_Code = STATUS_NOTINSTALLED; 340 if ((Track0[0x1FE]!=0x55) || (Track0[0x1FF]!=0xAA)) return; 341 if (strncmp(&Track0[2], "AiRBOOT", 7)!=0) return; 371 if ((Track0[0x1FE]!=0x55) || (Track0[0x1FF]!=0xAA)) return; // No MBR signature found, so not installed 372 if (strncmp(&Track0[2], "AiRBOOT", 7)!=0) return; // No AiR-BOOT signature found, so not installed 342 373 // MBR and AiR-BOOT signature found... 343 TotalCodeSectorsUsed = Track0[0x10]; 344 SectorPtr = &Track0[1*512]; // Start at sector 2 374 TotalCodeSectorsUsed = Track0[0x10]; // 34h/52 in v1.06 375 SectorPtr = &Track0[1 * BYTES_PER_SECTOR]; // Start at sector 2 376 // Calculate checksum of code-sectors 345 377 while (TotalCodeSectorsUsed>0) { 346 378 Checksum = GetChecksumOfSector(Checksum, SectorPtr); 347 SectorPtr += 512;379 SectorPtr += BYTES_PER_SECTOR; 348 380 TotalCodeSectorsUsed--; 349 381 } 350 382 if (Checksum!=*(PUSHORT)&Track0[0x11]) { 351 Status_Code = STATUS_CORRUPT; return; 383 Status_Code = STATUS_CORRUPT; return; // Bad checksum for code 352 384 } 353 385 // Checksum fine... … … 355 387 Installed_CodeVersion = (Track0[0x0D] << 8) | Track0[0x0E]; 356 388 if (Installed_CodeVersion<Bootcode_Version) 357 Status_Code = STATUS_INSTALLEDMGU; 389 Status_Code = STATUS_INSTALLEDMGU; // Do upgrade 358 390 else 359 Status_Code = STATUS_INSTALLED; 360 } 391 Status_Code = STATUS_INSTALLED; // Same version installed 392 } 393 361 394 362 395 void Status_CheckConfig (void) { 363 PCHAR ConfigSectorPtr = &Track0[ 0x6C00];396 PCHAR ConfigSectorPtr = &Track0[CONFIG_OFFSET]; // Config sector offset hard-coded ! 364 397 PCHAR SectorPtr = NULL; 365 398 USHORT Checksum = 0; … … 369 402 if (strncmp(ConfigSectorPtr, "AiRCFG-TABLE", 13)==0) { 370 403 // AiR-BOOT signature found... 371 SectorPtr = &Track0[54 *512];// Start at sector 55372 ConfigChecksum = *(PUSHORT)&Track0[54 *512+20];404 SectorPtr = &Track0[54 * BYTES_PER_SECTOR]; // Start at sector 55 405 ConfigChecksum = *(PUSHORT)&Track0[54 * BYTES_PER_SECTOR + 20]; 373 406 // Remove checksum 374 *(PUSHORT)&Track0[54*512+20] = 0; 407 *(PUSHORT)&Track0[54 * BYTES_PER_SECTOR + 20] = 0; // Config sector secnum hard-coded ! 408 409 /* 410 // Rousseau: 411 // Calculate chechsum over 5 sectors starting at the config-sector at 55. 412 // 55,56,57,58,59 (60 is MBR backup in normal version) 413 // SHOULD ADJUST THIS FOR EXTENDED VERSION ! // !!!!!!!!!!! 414 */ 375 415 SectorCount = 5; 376 416 while (SectorCount>0) { 377 417 Checksum = GetChecksumOfSector(Checksum, SectorPtr); 378 SectorPtr += 512;418 SectorPtr += BYTES_PER_SECTOR; 379 419 SectorCount--; 380 420 } 381 421 // Restore checksum 382 *(PUSHORT)&Track0[54 *512+20] = ConfigChecksum;422 *(PUSHORT)&Track0[54 * BYTES_PER_SECTOR + 20] = ConfigChecksum; // Config sector secnum hard-coded ! 383 423 if (Checksum!=ConfigChecksum) { 384 424 Status_Config = STATUS_CORRUPT; return; … … 386 426 } 387 427 // Checksum fine 388 Installed_ConfigVersion = (Track0[54 *512+0x0D] << 8) | Track0[54*512+0x0E];428 Installed_ConfigVersion = (Track0[54 * BYTES_PER_SECTOR + 0x0D] << 8) | Track0[54 * BYTES_PER_SECTOR + 0x0E]; 389 429 if (Installed_ConfigVersion>=Bootcode_ConfigVersion) { 390 430 Status_Config = STATUS_INSTALLED; return; … … 394 434 // If new configuration data was added, those spaces are not overwritten 395 435 // Sector 60 (MBR-BackUp) *MUST BE* copied, otherwise it would be lost. 436 // Rousseau: Upgrade from v0.27 396 437 if (Installed_ConfigVersion<=0x27) { 397 438 // UPGRADE v0.27 and prior versions … … 407 448 // -> Total-length 101 408 449 // Offset 432 Length 34 - New IPT entry (BIOS continued) 409 memcpy(&Bootcode[54 *512+16], &Track0[54*512+16], 69-16);410 memcpy(&Bootcode[54 *512+466], &Track0[54*512+466], 46);450 memcpy(&Bootcode[54 * BYTES_PER_SECTOR + 16], &Track0[54 * BYTES_PER_SECTOR + 16], 69 - 16); // CHECKEN !! 451 memcpy(&Bootcode[54 * BYTES_PER_SECTOR + 466], &Track0[54 * BYTES_PER_SECTOR + 466], 46); // CHECKEN !! 411 452 // Sector 56-57 no changes 412 memcpy(&Bootcode[55*512], &Track0[55 *512], 1024);453 memcpy(&Bootcode[55*512], &Track0[55 * BYTES_PER_SECTOR], 1024); 413 454 // Sector 58-59 414 455 // Changes: Offset 900 Length 30 - Logical driveletter table 415 memcpy(&Bootcode[57 *512], &Track0[57*512], 900);456 memcpy(&Bootcode[57 * BYTES_PER_SECTOR], &Track0[57 * BYTES_PER_SECTOR], 900); // AANPASSEN 900 !! 416 457 // Sector 60 copy unmodified 417 memcpy(&Bootcode[59 *512], &Track0[59*512], 512);458 memcpy(&Bootcode[59 * BYTES_PER_SECTOR], &Track0[59 * BYTES_PER_SECTOR], BYTES_PER_SECTOR); // CHECKEN !! 418 459 return; 419 460 } 461 // Rousseau: Upgrade from v0.91 420 462 if (Installed_ConfigVersion<=0x91) { 421 463 // UPGRADE v0.91 and prior versions 422 464 // Sector 55-57 no changes 423 memcpy(&Bootcode[54 *512+16], &Track0[54*512+16], 512+1024-16);465 memcpy(&Bootcode[54 * BYTES_PER_SECTOR + 16], &Track0[54 * BYTES_PER_SECTOR + 16], BYTES_PER_SECTOR + 1024 - 16); // CHACKEN !! 424 466 // Sector 58-59 425 467 // Changes: Offset 900 Length 30 - Logical driveletter table 426 memcpy(&Bootcode[57 *512], &Track0[57*512], 900);468 memcpy(&Bootcode[57 * BYTES_PER_SECTOR], &Track0[57 * BYTES_PER_SECTOR], 900); // AANPASSEN 900 !! 427 469 // Sector 60 copy unmodified 428 memcpy(&Bootcode[59 *512], &Track0[59*512], 512);470 memcpy(&Bootcode[59 * BYTES_PER_SECTOR], &Track0[59 * BYTES_PER_SECTOR], BYTES_PER_SECTOR); 429 471 return; 430 472 } … … 432 474 // We don't need to "upgrade" the configuration, we simply copy it over. 433 475 // From Sector 55, 6 sectors in total but never header/version 434 memcpy(&Bootcode[54*512+16], &Track0[54*512+16], 512*6-16); 476 // Rousseau: We copy two more sectors (8 in total) in the extended (45 partition) version. 477 switch (IMAGE_SIZE) { 478 case IMAGE_SIZE_60SECS: { 479 memcpy(&Bootcode[54 * BYTES_PER_SECTOR + 16], &Track0[54 * BYTES_PER_SECTOR + 16], BYTES_PER_SECTOR * 6 - 16); 480 break; 481 } 482 case IMAGE_SIZE_62SECS: { 483 memcpy(&Bootcode[54 * BYTES_PER_SECTOR + 16], &Track0[54 * BYTES_PER_SECTOR + 16], BYTES_PER_SECTOR * 8 - 16); 484 break; 485 } 486 } 487 435 488 return; 436 489 } … … 442 495 443 496 // Checks partition table for valid data 444 BOOL Virus_CheckThisMBR (PCHAR MBRptr) { 497 BOOL Virus_CheckThisMBR (PCHAR MBRptr) { // Rousseau: adjusted this function 445 498 USHORT PartitionNo; 446 499 ULONG CHSStart, CHSEnd; 447 500 448 if (*(PUSHORT)(MBRptr + 510)!=0x0AA55) return FALSE; 501 //printf("DEBUG: Virus_CheckThisMBR\n"); 502 503 if (*(PUSHORT)(MBRptr + BYTES_PER_SECTOR - 2)!=0x0AA55) return FALSE; 504 505 //printf("DEBUG: Virus_CheckThisMBR - Checking Partitions\n"); 506 449 507 MBRptr += 446; 450 508 for (PartitionNo=0; PartitionNo<4; PartitionNo++) { 451 if (*(MBRptr+4)!=0) { 509 if (*(MBRptr+4) != 0) { 510 /* 511 // Rousseau 2011-02-04: ## Check for GPT ## 512 */ 513 if (*(MBRptr+4) == GPT) { 514 if (!Option_CID) { 515 printf("ERROR: This drive is partitioned with the modern GPT layout.\n"); 516 printf(" AiR-BOOT is currently unable to handle GPT partitioned drives.\n"); 517 printf(" Installation aborted, no changes made.\n"); 518 } 519 exit(2); 520 } 521 522 /* 523 // Rousseau: 2011-05-05 524 // Last minute change to have AB install a disk with nopartitions 525 // on the bootdisk. 526 // It still checks for GPT but will skip the check below. 527 */ 528 continue; 529 530 //printf("DEBUG: Virus_CheckThisMBR - Partition: %d\n", PartitionNo); 452 531 // Partition-type defined, analyse partition data 453 CHSStart = (*(MBRptr+3) | ((*(MBRptr+2) >> 6) << 8)) << 16; // Cylinder 454 CHSStart |= (*(MBRptr+2) & 0x3F) | ((*(MBRptr+1) << 8)); // Sector / Head 455 456 CHSEnd = (*(MBRptr+7) | ((*(MBRptr+6) >> 6) << 8)) << 16; // Cylinder 457 CHSEnd |= (*(MBRptr+6) & 0x3F) | ((*(MBRptr+5) << 8)); // Sector / Head 458 459 if (CHSStart<CHSEnd) { 532 CHSStart = (*(MBRptr+3) | ((*(MBRptr+2) >> 6) << 8)) << 16; // Cylinder 533 CHSStart |= (*(MBRptr+2) & 0x3F) | ((*(MBRptr+1) << 8)); // Sector / Head 534 //printf("DEBUG: Virus_CheckThisMBR - CHSStart: %d\n", CHSStart); // 3F MASK CHECKEN !! 535 536 CHSEnd = (*(MBRptr+7) | ((*(MBRptr+6) >> 6) << 8)) << 16; // Cylinder 537 CHSEnd |= (*(MBRptr+6) & 0x3F) | ((*(MBRptr+5) << 8)); // Sector / Head 538 //printf("DEBUG: Virus_CheckThisMBR - CHSEnd: %d\n", CHSEnd); 539 540 541 /* 542 // Rousseau 2011-02-03: ## Changed below from < to <= ## 543 // When a partition is above 1024x255x63 (8GiB) the start and end of the partition 544 // in the MBR is the same (1024/255/63) to indicate extended CHS-values. 545 // This made the installer see this as a non-valid entry. 546 // Fixme: This could use some further optimazation like checking if CHS is really 1024/255/63 547 // to exclude truly faulty partition-entries. 548 */ 549 /*if (CHSStart<CHSEnd) {*/ 550 if (CHSStart<=CHSEnd) { 460 551 if (*(PULONG)(MBRptr+12)!=0) // Absolute length > 0? 461 552 return TRUE; … … 466 557 } 467 558 // No partitions defined/no valid partitions found 468 return FALSE; 559 // Rousseau: Still return TRUE (OK) 560 //return FALSE; 561 return TRUE; 469 562 } 470 563 … … 474 567 475 568 BOOL Virus_CheckForBackUpMBR (void) { 476 return Virus_CheckThisMBR(&Track0[59 *512]);569 return Virus_CheckThisMBR(&Track0[59 * BYTES_PER_SECTOR]); 477 570 } 478 571 … … 481 574 USHORT i; 482 575 483 for (i=0; i<511; i++) { 576 for (i=0; i<511; i++) { // BYTES_PER_SECTOR RELATED ?? 484 577 if (*(PUSHORT)CurPtr==0x13CD) return FALSE; 485 578 CurPtr++; … … 490 583 491 584 // Copies backup MBR into current MBR on current memory copy of track 0 585 // Rousseau: Two sectors higher in the extended version. 492 586 void Virus_CopyBackUpMBR (void) { 493 memcpy(&Track0, &Track0[59*512], 512); 587 switch (IMAGE_SIZE) { 588 case IMAGE_SIZE_60SECS: { 589 memcpy(&Track0, &Track0[59 * BYTES_PER_SECTOR], BYTES_PER_SECTOR); // sector 60 590 break; 591 } 592 case IMAGE_SIZE_62SECS: { 593 memcpy(&Track0, &Track0[61 * BYTES_PER_SECTOR], BYTES_PER_SECTOR); // sector 62 594 break; 595 } 596 } 494 597 } 495 598 … … 497 600 switch (Status) { 498 601 case STATUS_NOTINSTALLED: { 499 printf("not installed\n"); 602 if (!Option_CID) { 603 printf("not installed\n"); 604 } 500 605 break; 501 606 } 502 607 case STATUS_CORRUPT: { 503 printf("not intact\n"); 608 if (!Option_CID) { 609 printf("not intact\n"); 610 } 504 611 break; 505 612 } 506 613 case STATUS_INSTALLED: 507 614 case STATUS_INSTALLEDMGU: 508 printf("intact (v%x.%02x)", Version>>8, Version & 0x0FF); 509 if (Status==STATUS_INSTALLEDMGU) printf(", but may be updated"); 510 printf("\n"); 615 if (!Option_CID) { 616 printf("intact (v%x.%02x)", Version>>8, Version & 0x0FF); 617 } 618 if (Status==STATUS_INSTALLEDMGU) 619 if (!Option_CID) { 620 printf(", but may be updated"); 621 printf("\n"); 622 } 511 623 break; 512 624 case STATUS_IMPOSSIBLE: 513 printf(ImpossibleCause); 625 if (!Option_CID) { 626 printf(ImpossibleCause); 627 } 514 628 break; 515 629 } … … 517 631 518 632 void Language_PrintF(UCHAR LanguageID) { 633 if (Option_CID) 634 return; 519 635 switch (LanguageID) { 520 636 case 'E': printf("english"); break; … … 537 653 538 654 // Calculate checksum for code... 539 TotalCodeSectorsUsed = Bootcode[0x10]; 540 SectorPtr = &Bootcode[1 *512]; // Start at sector 2655 TotalCodeSectorsUsed = Bootcode[0x10]; // SECTORS USED CHECKEN !! (34h / 52d in v1.06) 656 SectorPtr = &Bootcode[1 * BYTES_PER_SECTOR]; // Start at sector 2 541 657 SectorCount = TotalCodeSectorsUsed; 542 658 while (SectorCount>0) { 543 659 Checksum = GetChecksumOfSector(Checksum, SectorPtr); 544 SectorPtr += 512;660 SectorPtr += BYTES_PER_SECTOR; 545 661 SectorCount--; 546 662 } … … 551 667 552 668 // Copy over code sectors... 553 memcpy(&Track0[ 512], &Bootcode[512], TotalCodeSectorsUsed*512);669 memcpy(&Track0[BYTES_PER_SECTOR], &Bootcode[BYTES_PER_SECTOR], TotalCodeSectorsUsed * BYTES_PER_SECTOR); 554 670 } 555 671 … … 562 678 if (AutoDriveLetter!=0) { 563 679 // Add DriveLetter Automatic veriables, if set 564 Bootcode[54 *512+0x1AB] = AutoDriveLetter;565 *(PULONG)&Bootcode[54 *512+0x1AC] = AutoDriveLetterSerial;680 Bootcode[54 * BYTES_PER_SECTOR + 0x1AB] = AutoDriveLetter; // CHECKEN ! 681 *(PULONG)&Bootcode[54 * BYTES_PER_SECTOR + 0x1AC] = AutoDriveLetterSerial; 566 682 } 567 683 #endif 568 684 569 685 // Delete current checksum 570 *(PUSHORT)&Bootcode[54 *512+20] = 0;571 572 SectorPtr = &Bootcode[54 *512];// Start at sector 55686 *(PUSHORT)&Bootcode[54 * BYTES_PER_SECTOR + 20] = 0; 687 688 SectorPtr = &Bootcode[54 * BYTES_PER_SECTOR]; // Start at sector 55 573 689 SectorCount = 5; 574 690 while (SectorCount>0) { 575 691 Checksum = GetChecksumOfSector(Checksum, SectorPtr); 576 SectorPtr += 512;692 SectorPtr += BYTES_PER_SECTOR; 577 693 SectorCount--; 578 694 } 579 *(PUSHORT)&Bootcode[54 *512+20] = Checksum;695 *(PUSHORT)&Bootcode[54 * BYTES_PER_SECTOR + 20] = Checksum; 580 696 581 697 // Copy configuration sectors 582 memcpy(&Track0[54*512], &Bootcode[54*512], 6*512); 698 // Rousseau: Two more sectors for extended version. 699 switch (IMAGE_SIZE) { 700 case IMAGE_SIZE_60SECS: { 701 memcpy(&Track0[54 * BYTES_PER_SECTOR], &Bootcode[54 * BYTES_PER_SECTOR], 6 * BYTES_PER_SECTOR); 702 break; 703 } 704 case IMAGE_SIZE_62SECS: { 705 memcpy(&Track0[54 * BYTES_PER_SECTOR], &Bootcode[54 * BYTES_PER_SECTOR], 8 * BYTES_PER_SECTOR); 706 break; 707 } 708 } 583 709 } 584 710 … … 593 719 BOOL ExitOnly = FALSE; 594 720 595 printf("AiR-BOOT Installer v1.00\n");596 printf(" - (c) Copyright 1998-2009by Martin Kiewitz.\n");597 printf("\n-> ...Please wait... <-\n");721 // printf("AiR-BOOT Installer v1.07\n"); 722 // printf(" - (c) Copyright 1998-2011 by Martin Kiewitz.\n"); 723 // printf("\n-> ...Please wait... <-\n"); 598 724 599 725 // Check commandline parameters … … 615 741 if (strcmp(&TempSpace, "forceconfig")==0) Option_ForceConfig = TRUE; 616 742 if (strcmp(&TempSpace, "silent")==0) Option_Silent = TRUE; 743 if (strcmp(&TempSpace, "cid")==0) Option_CID = TRUE; 617 744 } 618 745 CurArgument++; 619 746 } 747 748 if (Option_CID) { 749 Option_Silent = TRUE; 750 } 620 751 621 752 #ifdef PLATFORM_WINNT … … 624 755 625 756 if (CountHarddrives()==0) { 626 printf(" - No physical drives found on this system. Install impossible.\n"); 627 return 1; 628 } 629 630 printf(" - Loading bootcode from file..."); 757 if (!Option_CID) { 758 printf(" - No physical drives found on this system. Install impossible.\n"); 759 } 760 return 3; // Rouseau: changed from 1 to 3 761 } 762 763 if (!Option_CID) { 764 printf(" - Loading bootcode from file..."); 765 } 631 766 if (LoadBootcodeFromFile()==FALSE) return 1; 632 printf("ok\n"); 633 634 printf(" - Loading MBR from harddisc..."); 767 if (!Option_CID) { 768 printf("ok\n"); 769 } 770 771 if (!Option_CID) { 772 printf(" - Loading MBR from harddisc..."); 773 } 635 774 if (HarddriveCheckGeometry()) { 636 775 // No EZ-SETUP check here, because we are under 32-bit OS and this 637 776 // wouldn't make any sense 638 777 if (!Track0Load()) { 639 printf("LOAD ERROR!\n"); 778 if (!Option_CID) { 779 printf("LOAD ERROR!\n"); 780 } 640 781 return 1; 641 782 } 642 783 } else { 643 784 StatusCode = STATUS_IMPOSSIBLE; 644 ImpossibleCause = "unable to install\n Your harddisc does not have at least 62 sectors per track."; 645 } 646 printf("ok\n"); 647 648 649 printf("\n-> ...Current Status... <-\n"); 785 if (!Option_CID) { 786 ImpossibleCause = "unable to install\n Your harddisc does not have at least 62 sectors per track."; 787 } 788 } 789 if (!Option_CID) { 790 printf("ok\n"); 791 } 792 793 794 if (!Option_CID) { 795 printf("\n-> ...Current Status... <-\n"); 796 } 650 797 Status_CheckCode(); 651 printf(" - AiR-BOOT is "); 798 if (!Option_CID) { 799 printf(" - AiR-BOOT is "); 800 } 652 801 Status_PrintF(Status_Code, Installed_CodeVersion); 653 802 if (StatusCode==STATUS_IMPOSSIBLE) return 1; 654 803 Status_CheckConfig(); 655 printf(" - Configuration is "); 804 if (!Option_CID) { 805 printf(" - Configuration is "); 806 } 656 807 Status_PrintF(Status_Config, Installed_ConfigVersion); 657 808 // Display language as well, if code installed 658 809 if ((Status_Code==STATUS_INSTALLED) || (Status_Code==STATUS_INSTALLEDMGU)) { 659 printf(" - Language is "); 810 if (!Option_CID) { 811 printf(" - Language is "); 812 } 660 813 Language_PrintF(Installed_LanguageID); 661 printf("\n"); 814 if (!Option_CID) { 815 printf("\n"); 816 } 662 817 } 663 818 … … 682 837 // Code==not installed, config==installed -> (-> Virus?) 683 838 // Code==installed, config==not installed -> Check MBR (-> Virus?) 839 840 //printf("DEBUG: Status_Code: %d, Status_Config: %d\n", Status_Code, Status_Config); // Rousseau: DEBUG 841 684 842 if ((Status_Code==STATUS_NOTINSTALLED) & (Status_Config==STATUS_NOTINSTALLED)) { 685 843 // Nothing installed, so check MBR, if squashed... 686 844 if (!Virus_CheckCurrentMBR()) { 687 printf("\n\n"); 688 printf("AiR-BOOT detected that the data on your harddisc got damaged.\n"); 689 printf("If you had AiR-BOOT installed before: the corruption killed AiR-BOOT completly!\n"); 690 printf("Installation halted.\n"); 691 return 1; 692 } 845 if (!Option_CID) { 846 printf("\n\n"); 847 printf("AiR-BOOT detected that the data on your harddisc got damaged.\n"); 848 printf("If you had AiR-BOOT installed before: the corruption killed AiR-BOOT completly!\n"); 849 printf("Installation halted.\n"); 850 } 851 return 255; // Rousseau: changed from 1 to 255 852 } 853 //printf("DEBUG: Installing...\n"); // Rousseau: DEBUG 693 854 } else { 694 855 if ((Status_Code==STATUS_NOTINSTALLED) | (!Virus_CheckCurrentMBR())) { 695 856 // Code not installed, but Config or MBR squashed... 696 857 // -> Virus proposed, check for backup (if available) 697 printf("\n\n"); 698 printf("-> ...!ATTENTION!... <-\n"); 858 if (!Option_CID) { 859 printf("\n\n"); 860 printf("-> ...!ATTENTION!... <-\n"); 861 } 699 862 if (Virus_CheckForStealth()) 700 printf("Your system GOT infected by a stealth-virus (or your MBR got trashed).\n"); 863 if (!Option_CID) { 864 printf("Your system GOT infected by a stealth-virus (or your MBR got trashed).\n"); 865 } 701 866 else 702 printf("Probably your system was infected by a virus.\n"); 703 printf("Repairing AiR-BOOT will normally squash the virus.\n"); 704 printf("But to be sure it's gone, you should check your harddisc using a virus-scanner.\n"); 867 if (!Option_CID) { 868 printf("Probably your system was infected by a virus.\n"); 869 printf("Repairing AiR-BOOT will normally squash the virus.\n"); 870 printf("But to be sure it's gone, you should check your harddisc using a virus-scanner.\n"); 871 } 705 872 if (!Virus_CheckCurrentMBR()) { 706 873 // MBR squashed, so check backup and display message 707 printf("\n"); 708 printf("AiR-BOOT detected that the virus has broken your partition-table.\n"); 874 if (!Option_CID) { 875 printf("\n"); 876 printf("AiR-BOOT detected that the virus has broken your partition-table.\n"); 877 } 709 878 if (Virus_CheckForBackUpMBR()) { 710 printf("Good news: AiR-BOOT has found a (hopefully) functional backup.\n"); 711 printf("Shall I use this backup, instead of the current active one? (Y/N)\n"); 879 if (!Option_CID) { 880 printf("Good news: AiR-BOOT has found a (hopefully) functional backup.\n"); 881 printf("Shall I use this backup, instead of the current active one? (Y/N)\n"); 882 } 712 883 // User selection, Y/N, if he wants to restore MBR 713 884 // *NOT* CID (silent) able … … 718 889 Virus_CopyBackUpMBR(); 719 890 } else { 720 printf("Sadly the virus also broke AiR-BOOT's backup. You will have to help yourself.\n"); 891 if (!Option_CID) { 892 printf("Sadly the virus also broke AiR-BOOT's backup. You will have to help yourself.\n"); 893 } 721 894 } 722 895 } … … 727 900 // MAIN-MENU 728 901 // ============================================================= 729 printf("\n-> ...Please press... <-\n"); 730 731 if (Install_IsCorrupt) printf(" <R> - Repair AiR-BOOT "); 732 else if (Status_Code==STATUS_NOTINSTALLED) printf(" <A> - Add AiR-BOOT "); 733 else printf(" <U> - Update/Change AiR-BOOT to "); 734 printf("'v%x.%02x/", Bootcode_Version>>8, Bootcode_Version & 0x0FF); 735 Language_PrintF(Bootcode_LanguageID); 736 printf("' on current system\n"); 737 738 printf(" <D> - Delete AiR-BOOT from current system\n"); 739 printf(" <Q> - Quit without any change\n"); 740 741 if (Option_Silent) { 902 if (!Option_CID) { 903 printf("\n-> ...Please press... <-\n"); 904 } 905 906 if (!Option_CID) { 907 if (Install_IsCorrupt) printf(" <R> - Repair AiR-BOOT "); 908 else if (Status_Code==STATUS_NOTINSTALLED) printf(" <A> - Add AiR-BOOT "); 909 else printf(" <U> - Update/Change AiR-BOOT to "); 910 printf("'v%x.%02x/", Bootcode_Version>>8, Bootcode_Version & 0x0FF); 911 Language_PrintF(Bootcode_LanguageID); 912 printf("' on current system\n"); 913 914 printf(" <D> - Delete AiR-BOOT from current system\n"); 915 printf(" <Q> - Quit without any change\n"); 916 } 917 918 if (Option_Silent || Option_CID) { 742 919 // Silent operation? Always add AiR-BOOT then 743 920 UserKey = 'a'; … … 748 925 } 749 926 750 printf("\n\n\n-------------------------------------------------------------------------------\n"); 927 if (!Option_CID) { 928 printf("\n\n\n-------------------------------------------------------------------------------\n"); 929 } 751 930 switch (UserKey) { 752 931 case 'a': … … 754 933 case 'u': { 755 934 if (Install_Code || Install_Config) { 756 printf("Add/Repair/Update AiR-BOOT in progress...\n"); 935 if (!Option_CID) { 936 printf("Add/Repair/Update AiR-BOOT in progress...\n"); 937 } 757 938 #ifdef PLATFORM_OS2 758 939 OS2_GetBootAutoDriveLetter(); 759 940 #endif 760 941 if (Install_Code) { 761 printf(" þ Writing AiR-BOOT code..."); 942 if (!Option_CID) { 943 printf(" þ Writing AiR-BOOT code..."); 944 } 762 945 Install_WriteCode(); 763 printf("ok\n"); 946 if (!Option_CID) { 947 printf("ok\n"); 948 } 764 949 } 765 950 if (Install_Config) { 766 printf(" þ Writing AiR-BOOT configuration..."); 951 if (!Option_CID) { 952 printf(" þ Writing AiR-BOOT configuration..."); 953 } 767 954 Install_WriteConfig(); 768 printf("ok\n"); 955 if (!Option_CID) { 956 printf("ok\n"); 957 } 769 958 } 770 959 771 960 if (!Track0Write()) { 772 printf("SAVE ERROR!\n"); 961 if (!Option_CID) { 962 printf("SAVE ERROR!\n"); 963 } 773 964 return 1; 774 965 } 775 printf("\n"); 776 printf("Your copy of AiR-BOOT is now fully functional.\n"); 777 printf("Please hit ESC to exit AiR-BOOT installer or ENTER to reboot your system...\n"); 778 if (Option_Silent) { 966 if (!Option_CID) { 967 printf("\n"); 968 printf("Your copy of AiR-BOOT is now fully functional.\n"); 969 printf("Please hit ESC to exit AiR-BOOT installer or ENTER to reboot your system...\n"); 970 } 971 if (Option_Silent || Option_CID) { 779 972 // Silent operation? Always reboot system (shall we do this really?) 780 973 UserKey = 0x0D; … … 784 977 } while (!((UserKey==0x0D) || (UserKey==0x1B))); 785 978 } 786 if (UserKey==0x0D) { // ENTER reboots system... 787 printf("Now rebooting system...\n"); 788 RebootSystem(); 979 if (UserKey==0x0D) { // ENTER reboots system... (if not in eCS install mode) 980 981 /* 982 // Rousseau: ## Disable Reboot when installing eComStation ## 983 // In the install-environment, the MEMDRIVE env-var is defined. 984 // So, only reboot if this env-var is not defined. 985 */ 986 if (!getenv("MEMDRIVE")) { 987 if (!Option_CID) { 988 printf("Now rebooting system...\n"); 989 } 990 //RebootSystem(); 991 } 992 ExitOnly = TRUE; 789 993 } 790 994 } else { 791 printf(" þ All components of AiR-BOOT are intact and up-to-date. Nothing to do.\n"); 995 if (!Option_CID) { 996 printf(" þ All components of AiR-BOOT are intact and up-to-date. Nothing to do.\n"); 997 } 792 998 ExitOnly = TRUE; 793 999 } … … 795 1001 } 796 1002 case 'd': { 797 printf(" þ Removing AiR-BOOT automatically is not possible at this time.\n"); 1003 if (!Option_CID) { 1004 printf(" þ Removing AiR-BOOT automatically is not possible at this time.\n"); 1005 } 798 1006 #ifdef PLATFORM_OS2 799 printf(" You may remove AiR-BOOT manually by entering \"FDISK /MBR\" or \"LVM /NEWMBR:1\"\n"); 800 printf(" in commandline.\n"); 1007 if (!Option_CID) { 1008 printf(" You may remove AiR-BOOT manually by entering \"FDISK /MBR\" or \"LVM /NEWMBR:1\"\n"); 1009 printf(" in commandline.\n"); 1010 } 801 1011 #endif 802 1012 #ifdef PLATFORM_WINNT 803 printf(" You may remove AiR-BOOT manually by entering \"FDISK /MBR\" in commandline.\n"); 1013 if (!Option_CID) { 1014 printf(" You may remove AiR-BOOT manually by entering \"FDISK /MBR\" in commandline.\n"); 1015 } 804 1016 #endif 805 1017 ExitOnly = TRUE; … … 811 1023 812 1024 if (ExitOnly) { 813 printf("\n"); 814 printf("Please hit ENTER to exit AiR-BOOT installer...\n"); 815 if (!Option_Silent) { 1025 if (!Option_CID) { 1026 printf("\n"); 1027 printf("Please hit ENTER to exit AiR-BOOT installer...\n"); 1028 } 1029 if (!Option_Silent || !Option_CID) { 816 1030 while (getch()!=0x0D); 817 1031 } -
trunk/INSTALL/C/OS2.WPJ
r29 r30 5 5 1 6 6 WRect 7 08 07 840 8 620 9 9 7680 10 921 610 9210 11 11 2 12 12 MProject … … 21 21 WFileName 22 22 12 23 inst-os2.tgt 23 INST-OS2.TGT 24 24 6 25 25 WVList … … 38 38 WFileName 39 39 12 40 inst-os2.tgt 40 INST-OS2.TGT 41 41 0 42 42 1 -
trunk/INSTALL/C/WIN32.WPJ
r29 r30 5 5 1 6 6 WRect 7 08 07 840 8 620 9 9 7680 10 921 610 9210 11 11 2 12 12 MProject … … 21 21 WFileName 22 22 12 23 inst-win.tgt 23 INST-WIN.TGT 24 24 6 25 25 WVList … … 30 30 WRect 31 31 576 32 52 932 520 33 33 5632 34 414 734 4140 35 35 0 36 36 0 … … 38 38 WFileName 39 39 12 40 inst-win.tgt 40 INST-WIN.TGT 41 41 0 42 42 1 -
trunk/INSTALL/DOS/AIRBOOT.ASM
r29 r30 29 29 COM_StartUp: jmp COM_Init 30 30 31 COM_Copyright db 'AiR-BOOT Installer for DOS v1.0 0', 13, 1031 COM_Copyright db 'AiR-BOOT Installer for DOS v1.07', 13, 10 32 32 db ' - (c) Copyright 2008-2009 by M. Kiewitz.', 13, 10 33 33 db 13, 10 … … 134 134 135 135 mov ah, 3Fh 136 mov cx, 30720; Image size136 mov cx, image_size ; Image size 137 137 mov dx, offset BootImage 138 138 int 21h ; DOS: READ FILE … … 141 141 call APIShowError 142 142 143 COM_DoneRead: cmp ax, 30720143 COM_DoneRead: cmp ax, image_size 144 144 je COM_DoneRead2 145 145 COM_InvalidFile:mov si, offset COM_FailedRead2 -
trunk/INSTALL/DOS/MAKE.BAT
r29 r30 19 19 echo Errorlevel not 0, make failed 20 20 :ExitMe 21 pause21 rem pause -
trunk/INSTALL/INST_X86/INSTALL.INC
r29 r30 158 158 je VirusRestoreNo 159 159 jmp VirusKeyLoop 160 160 161 161 VirusRestoreYes:call Init_CopyBackupMBR 162 162 VirusRestoreNo: jmp VirusSkip … … 191 191 mov si, offset TXT_MENU_OnCurSystem 192 192 call APIShowMessage 193 193 194 194 mov si, offset TXT_MENU_Delete 195 195 call APIShowMessage … … 347 347 call SaveImageSector ; Hide-Partition Table 2 348 348 call SaveImageSector ; MBR BackUp (just to be sure, no valid is there) 349 350 ;call SaveImageSector 351 ;call SaveImageSector 349 352 ret 350 353 InstallConfig EndP 351 354 352 355 353 356 354 357 ; Out: Carry Flag SET if Harddisc failed 62-sectors test 355 358 Init_CheckHarddisc Proc Near Uses -
trunk/TOOLS/DOS/INITHDD/INITHDD.ASM
r29 r30 20 20 21 21 Include ..\..\..\include\asm.inc 22 include ..\..\..\include\dos\airboot.inc22 ;include ..\..\..\include\dos\airboot.inc 23 23 24 24 .386p … … 36 36 TXT_ERROR_NotNeeded db 'INITHDD: Initialization not needed.', 13, 10, 0 37 37 TXT_Done db 'INITHDD: HDD was successfully initialized.', 13, 10, 0 38 TXT_Cleared db 'INITHDD: Reserved Sectors successfully cleared.', 13, 10, 0 ; Rousseau: added 38 39 39 40 StandardMBR: … … 68 69 dw 00000h, 00000h, 00000h, 0AA55h 69 70 70 Include ..\..\..\include\DOS\Const.asm71 ; Include ..\..\..\include\DOS\Const.asm 71 72 72 73 INITHDD_Start: mov ax, cs … … 84 85 mov ax, 0201h ; Read 1 sector 85 86 int 13h 87 jnc Clear ; Rousseau: added (only clear) 86 88 jnc LoadMBR_NoError 87 89 mov si, offset TXT_ERROR_IO … … 91 93 ; Check Master-Boot-Record Signature 92 94 cmp wptr ds:[CurMBR+01FEh], 0AA55h 93 je AlreadyInitialized95 ;;je AlreadyInitialized ; Rousseau: always initialize 94 96 95 97 mov ax, cs … … 107 109 mov si, offset TXT_Done 108 110 call MBR_Teletype 111 112 ; Rousseau: added 113 Clear: 114 call MBR_ClearReservedSectors 115 mov si, offset TXT_Cleared 116 call MBR_Teletype 117 ; Rousseau: end added 118 109 119 jmp GoByeBye 110 120 … … 132 142 MBR_Teletype EndP 133 143 144 145 ; Rousseau: added 146 MBR_ClearReservedSectors Proc Near 147 mov ax, cs 148 mov es, ax ; Make sure that ES is right 149 mov cx, 2 ; Index of first reserved sector to clear 150 MBR_ClearReservedSectors_loop: 151 push cx ; Put on stack for later use 152 mov bx, offset ZeroSEC ; Block of 0's 153 mov dx, 0080h ; First harddrive, Sector in cx 154 ;mov cx, 0001h 155 mov ax, 0301h ; Function 03, 1 sector to write 156 int 13h 157 pop cx ; Pop sector-index 158 inc cx ; Next sector 159 cmp cx, 62 ; If below 63 (Possible LVM) then... 160 jbe MBR_ClearReservedSectors_loop ; Repeat 161 ret 162 MBR_ClearReservedSectors EndP 163 164 165 134 166 CurMBR db 512 dup (?) 167 ZeroSEC db 512 dup (0) ; Rousseau: added 135 168 136 169 code_seg ends -
trunk/TOOLS/DOS/INITHDD/MAKE.BAT
r29 r30 19 19 echo Errorlevel not 0, make failed 20 20 :ExitMe 21 pause21 rem pause -
trunk/TOOLS/INTERNAL/FIXCODE.ASM
r29 r30 91 91 92 92 mov ah, 3Fh 93 mov cx, 30720; Image size93 mov cx, image_size ; Image size 94 94 mov dx, offset BootCode 95 95 int 21h ; DOS: READ FILE … … 98 98 call ShowError 99 99 100 DoneReadCode: cmp ax, 30720100 DoneReadCode: cmp ax, image_size 101 101 je DoneReadCode2 102 102 InvalidCode: mov dx, offset COM_FailedInvalidCode … … 232 232 233 233 mov ah, 40h 234 mov cx, 30720; Image size234 mov cx, image_size ; Image size 235 235 mov dx, offset BootCode 236 236 int 21h ; DOS: WRITE FILE … … 239 239 call ShowError 240 240 241 DoneWriteCode: cmp ax, 30720241 DoneWriteCode: cmp ax, image_size 242 242 jne FailedWriteCode 243 243 … … 250 250 251 251 ; Buffers for files 252 BootCode db 30720dup (?)252 BootCode db image_size dup (?) 253 253 MBRProtection db 1024 dup (?) 254 254 -
trunk/TOOLS/INTERNAL/MAKE.BAT
r29 r30 6 6 %linker% fixcode.obj >nul 7 7 if errorlevel 1 goto Failed 8 %exe2bin% fixcode.exe fixcode.com>nul8 %exe2bin% FIXCODE.EXE FIXCODE.COM >nul 9 9 if errorlevel 1 goto Failed 10 10 … … 17 17 echo Errorlevel not 0, make failed 18 18 :ExitMe 19 pause19 rem pause -
trunk/TOOLS/OS2/SETABOOT/SETABOOT.C
r29 r30 17 17 // 18 18 19 /* 20 // Rousseau: 2011-02-05 21 // - Made volumes compare case insensitive so fs-label matches volume-name on command-line. (around line 510) 22 // This means bootable volumes cannot not have the same and only differ in case. 23 */ 24 25 19 26 #define INCL_BASE 20 27 #define INCL_WINSHELLDATA … … 62 69 63 70 typedef struct _AiRBOOTCONFIG { 64 CHAR Identifier[13]; 71 CHAR Identifier[13]; // Rousseau: INVISIBLE CHAR AT END ! 65 72 UCHAR MajorVersion; 66 73 UCHAR MinorVersion; … … 110 117 UCHAR AutomaticPartition; 111 118 UCHAR ForceLBAUsage; 119 UCHAR IgnoreLVM; 120 UCHAR Reserved[82]; 121 CHAR InstallVolume[12]; 112 122 } AiRBOOTCONFIG; 113 123 typedef AiRBOOTCONFIG *PAiRBOOTCONFIG; 124 125 114 126 115 127 typedef struct _AiRBOOTIPENTRY { … … 139 151 140 152 153 /* Executables to search for */ 154 PCHAR classic_setboots[] = { 155 "SETBM.EXE", 156 NULL 157 }; 158 159 160 /* 161 // ProtoTypes. 162 */ 163 BOOL Track0DetectAirBoot (BOOL* ab_bad); 164 BOOL Track0WriteAiRBOOTConfig (void); 165 166 167 141 168 USHORT CountHarddrives (void) { 142 169 USHORT NumDrives = 0; … … 149 176 USHORT OS2_GetIOCTLHandle () { 150 177 USHORT IOCTLHandle = 0; 151 178 152 179 if (DosPhysicalDisk(INFO_GETIOCTLHANDLE, &IOCTLHandle, sizeof(IOCTLHandle),"1:" , 3) != 0) 153 180 return 0; … … 236 263 } 237 264 265 266 APIRET QueryBootDrive(char *bootdrv) 267 { 268 ULONG aulSysInfo[QSV_MAX] = {0}; // System Information Data Buffer 269 APIRET rc = NO_ERROR; // Return code 270 271 if(bootdrv==0) return 1; 272 273 rc = DosQuerySysInfo(1L, // Request all available system 274 QSV_MAX , // information 275 (PVOID)aulSysInfo, // Pointer to buffer 276 sizeof(ULONG)*QSV_MAX); // Size of the buffer 277 278 if (rc != NO_ERROR) { 279 return 1; 280 } 281 else { 282 //printf("Bootable drive: %c:\n", 283 // aulSysInfo[QSV_BOOT_DRIVE-1]+'A'-1); /* Max length of path name */ 284 bootdrv[0]=aulSysInfo[QSV_BOOT_DRIVE-1]+'A'-1; 285 286 /* 287 printf("Total physical memory is %u bytes.\n", 288 aulSysInfo[QSV_TOTPHYSMEM-1]); 289 */ 290 291 return 0; 292 } 293 294 295 } 296 238 297 USHORT GetChecksumOfSector (USHORT BaseCheck, USHORT SectorNo) { 239 298 PUSHORT CurPos = (PUSHORT)((ULONG)&Track0+(SectorNo-1)*512); … … 246 305 } 247 306 248 BOOL Track0DetectAirBoot (void) { 249 USHORT ResultCheck; 250 USHORT CurSectorNo = 0; 251 252 AiRBOOT_CodeSig = (PAiRBOOTCODESIG)&Track0[2]; 253 AiRBOOT_Config = (PAiRBOOTCONFIG)&Track0[(55-1)*512]; 254 AiRBOOT_IPT = (PAiRBOOTIPENTRY)&Track0[(56-1)*512]; 255 256 if (strncmp(AiRBOOT_CodeSig->Identifier, "AiRBOOT", 7)!=0) { 257 return FALSE; 258 } 259 260 if ((AiRBOOT_CodeSig->TotalCodeSectors)>53) { 261 puts ("SETABOOT: AiR-BOOT Code damaged!"); 262 return FALSE; 263 } 264 265 ResultCheck = 0; CurSectorNo = 0; 266 while (CurSectorNo<AiRBOOT_CodeSig->TotalCodeSectors) { 267 ResultCheck = GetChecksumOfSector(ResultCheck, CurSectorNo+2); 268 CurSectorNo++; 269 } 270 if (ResultCheck!=AiRBOOT_CodeSig->CheckSumOfCode) { 271 puts ("SETABOOT: AiR-BOOT Code damaged!"); 272 return FALSE; 273 } 274 275 if (strncmp(AiRBOOT_Config->Identifier, "AiRCFG-TABLE", 13)!=0) { 276 puts ("SETABOOT: AiR-BOOT Config damaged!"); 277 return FALSE; 278 } 279 280 // Set Config-CheckSum to 0 281 AiRBOOT_ConfigCheckSum = AiRBOOT_Config->CheckSumOfConfig; 282 AiRBOOT_Config->CheckSumOfConfig = 0; 283 284 // Calculate CheckSum... 285 ResultCheck = 0; CurSectorNo = 55; 286 while (CurSectorNo<60) { 287 ResultCheck = GetChecksumOfSector(ResultCheck, CurSectorNo); 288 CurSectorNo++; 289 } 290 if (ResultCheck!=AiRBOOT_ConfigCheckSum) { 291 puts ("SETABOOT: AiR-BOOT Config damaged!"); 292 return FALSE; 293 } 294 return TRUE; 295 } 296 297 BOOL Track0WriteAiRBOOTConfig (void) { 298 USHORT ResultCheck; 299 USHORT CurSectorNo = 0; 300 301 // Update Edit-Counter... 302 AiRBOOT_Config->EditCounter++; 303 AiRBOOT_Config->CheckSumOfConfig = 0; 304 305 // Calculate CheckSum... 306 ResultCheck = 0; CurSectorNo = 55; 307 while (CurSectorNo<60) { 308 ResultCheck = GetChecksumOfSector(ResultCheck, CurSectorNo); 309 CurSectorNo++; 310 } 311 AiRBOOT_Config->CheckSumOfConfig = ResultCheck; 312 313 if (!Track0Write()) 314 return FALSE; 315 return TRUE; 316 } 317 318 int main (int argc, char **argv) { 307 308 309 310 /* 311 // If AiR-BOOT is not installed, the user probably meant to control OS/2 BM with this utility. 312 // Since the functionality of this utility is for AiR-BOOT only, we will pass the request to 313 // the OS/2 BM SETBOOT utility which is called SETBM.EXE as of eCS 2.01. 314 // Since the objective here is to supply OS/2 BM SETBOOT compatibility, if SETBM.EXE is not found, 315 // some other system locations are searched for the OS/2 version of SETBOOT.EXE. 316 // Any SETBOOT.EXE that is found and that does not have a module-name of "setaboot" is invoked, 317 // and passed along the command-line the user issued. 318 // In this case also the return-value of the OS/2 version of SETBOOT.EXE is returned. 319 */ 320 int DoClassicActions(int argc, char **argv) { 321 APIRET rc = -1; 322 RESULTCODES crc = {-1,-1}; 323 PTIB ptib = NULL; 324 PPIB ppib = NULL; 325 char buffer[256] = "\0"; 326 char cmdline[256] = "\0"; 327 PSZ path = NULL; 328 char sresult[256] = "\0"; 329 char bootdrive = '?'; 330 char* p = NULL; 331 int i = 0; 332 333 //printf("\nCLASSIC ACTIONS !! (%d)\n", argc); 334 335 rc = QueryBootDrive(&bootdrive); 336 337 rc = DosScanEnv("PATH", &path); 338 rc = DosSearchPath(SEARCH_CUR_DIRECTORY | SEARCH_IGNORENETERRS, 339 path, 340 classic_setboots[0], 341 sresult, 342 sizeof(sresult)); 343 344 //printf("SRESULT: rc=%d, %s\n", rc, sresult); 345 346 if (rc) { 347 printf("\n"); 348 printf("ERROR: SETBOOT (AiR-BOOT version)\n"); 349 printf("Since the AiR-BOOT Boot Manager is not installed, this program (SETBOOT.EXE), funcions as a wrapper\n"); 350 printf("to %s that should be used to control IBM Boot Manager.\n", classic_setboots[0]); 351 printf("However, %s could not be found in the PATH, the error-code is: %d\n", classic_setboots[0], rc); 352 printf("You can resolve this situation by renaming a valid SETBOOT.EXE to %s\n", classic_setboots[0]); 353 printf("and put it in your %c:\\OS2 directory.", bootdrive); 354 printf("\n"); 355 exit(rc); 356 } 357 358 359 360 361 memset(cmdline, 0, sizeof(cmdline)); // Clear the command-line buffer. 362 p = cmdline; // Temporary pointer to insert arguments. 363 strcpy(p, sresult); // Copy the program-name. 364 p += strlen(sresult)+1; // Advance to point for space separated parameters. 365 366 /* 367 // Process all the arguments, 368 // inserting the separated by a space. 369 */ 370 for (i=1; i<argc; i++) { 371 strcpy(p, argv[i]); // Copy the argument. 372 p += strlen(argv[i]); // Advance pointer past argument. 373 *p++ = ' '; // Space separation. 374 } 375 376 /* 377 for (i=0; i<100; i++) { 378 printf("%c", cmdline[i] ? cmdline[i] : '#'); 379 } 380 printf("\n"); 381 */ 382 383 //printf("CMDLINE: %s\n", cmdline); 384 //printf("CMDLINE+: %s\n", cmdline+strlen(sresult)+1); 385 386 rc = DosExecPgm(buffer, 387 sizeof(buffer), 388 EXEC_SYNC, 389 cmdline, 390 NULL, 391 &crc, 392 sresult); 393 394 //rc = 3; 395 if (rc) { 396 printf("\n"); 397 printf("ERROR: SETBOOT (AiR-BOOT version)\n"); 398 printf("Since the AiR-BOOT Boot Manager is not installed, this program (SETBOOT.EXE), funcions as a wrapper\n"); 399 printf("to %s that should be used to control IBM Boot Manager.\n", classic_setboots[0]); 400 printf("However, something went wrong when executing %s.\n", classic_setboots[0]); 401 printf("The error-code is: %d and the termination-code is: %d\n", rc, crc.codeTerminate); 402 printf("\n"); 403 exit(rc); 404 } 405 406 407 //printf("DosExecPgm: rc=%08X, codeterminate=%08X, coderesult=%08X\n", rc, crc.codeTerminate, crc.codeResult); 408 409 /* 410 rc = DosGetInfoBlocks(&ptib, &ppib); 411 412 rc = DosQueryModuleName(ppib->pib_hmte, sizeof(buffer), buffer); 413 printf("MODULE: %s\n", buffer); 414 printf("CMDLINE: %s\n", ppib->pib_pchcmd); 415 */ 416 417 return crc.codeResult; 418 } 419 420 421 int DoAirBootActions(int argc, char **argv, BOOL ab_detected, BOOL ab_bad) { 319 422 ULONG CurArgument = 0; 320 423 ULONG ArgumentLen = 0; … … 347 450 ULONG XWPBootCount = 0; 348 451 CHAR XWPBootName[30][12]; 349 CHAR XWPBootCommand[30][28]; // 'setaboot /IBA:""' (16 chars)452 CHAR XWPBootCommand[30][28]; // 'setaboot /IBA:""' (16 chars) 350 453 BOOL XWPEntryFound = FALSE; 454 BOOL CDBoot = FALSE; // TRUE if booted from CD; New System will be added when using /4:"LABEL" 455 BOOL Track0Loaded = FALSE; // Assume track0 did not load correctly. 456 BOOL AiRBOOTBad = FALSE; 457 458 //printf("\nAiR-BOOT ACTIONS !!\n"); 459 460 AiRBOOTDetected = ab_detected; 461 AiRBOOTBad = ab_bad; 462 463 if (AiRBOOTBad) 464 return 1; 351 465 352 466 // Use OSO001.MSG, so we safe us the trouble of translating :) … … 354 468 return 1; 355 469 356 puts ("SETABOOT - AiR-BOOT Configuration Utility (OS/2) - (c) 2004-2009 by M. Kiewitz"); 470 /* 471 // Rousseau: changed version to be the same as the AiR-BOOT is accompanies. 472 */ 473 //puts ("SETABOOT - AiR-BOOT Configuration Utility (OS/2) - (c) 2004-2009 by M. Kiewitz"); 474 puts ("SETABOOT v1.07 - AiR-BOOT Configuration Utility - (c) 2004-2011 by M. Kiewitz"); 475 476 477 //return 0; 478 479 /* 480 // Rousseau: 481 // Log some debug stuff to (virtual) flop. 482 */ 483 /* 484 { 485 char buf[512]="\0"; 486 FILE* fp = NULL; 487 int i = 0; 488 489 fp = fopen("A:\\SETBOOT.TXT", "a"); 490 sprintf(buf, "Bliep"); 491 fprintf(fp,"Program: %s\n", argv[0]); 492 fprintf(fp,"Arguments: %d\n", argc); 493 for (i=0; i<argc-1; i++) { 494 fprintf(fp, "Arg %d: %s\n", i+1, argv[i+1]); 495 } 496 fprintf(fp, "\n"); 497 fclose(fp); 498 } 499 */ 500 501 502 503 /* 504 // Rousseau: ## Enable boot-through when installing new system ## 505 // In the install-environment, the MEMDRIVE env-var is defined. 506 // This modifies the behavior after phase 1. 507 */ 508 if (getenv("MEMDRIVE")) { 509 printf("CDBoot Environment.\n"); 510 CDBoot = TRUE; 511 } 512 357 513 358 514 if (argc==1) { … … 361 517 } 362 518 519 520 521 363 522 // Now we check for AiR-BOOT existance... 523 /* 364 524 if (CountHarddrives()>0) { 365 525 if (Track0Load()) { 366 if (Track0DetectAirBoot()) AiRBOOTDetected = TRUE; 367 } else { 526 // Rousseau: Track0DetectAirBoot() will init globals. 527 if (Track0DetectAirBoot()) // REPLACE WITH BOOL 528 AiRBOOTDetected = TRUE; 529 } 530 else { 368 531 MSG_Print (TXT_ERROR_DuringAccessHDD); 369 532 } 370 } else { 533 } 534 else { 371 535 MSG_Print (TXT_ERROR_DuringAccessHDD); 372 } 536 } 537 */ 373 538 374 539 CurArgument = 1; … … 460 625 461 626 *StartPos = 0; StartPos++; 627 462 628 // Search that partition in IPT of AiR-BOOT... 463 629 if ((CurChar=='4') && (ArgumentLen==0)) { … … 475 641 } 476 642 643 644 /* 645 // Rousseau: 646 // Insert label of newly installed system in AiR-BOOT configuration. 647 // Note that it is changed to uppercase because AiR-BOOT uses the FS-label when 648 // scanning partitions and LVM-info is not found. (Otherwise PART-label) 649 // The auto-boot flag is not set in this case as this is handled by the AiR-BOOT loader. 650 */ 651 if (CDBoot) { 652 strncpy(AiRBOOT_Config->InstallVolume, _strupr(StartPos), ArgumentLen); 653 AiRBOOT_Config->InstallVolume[ArgumentLen] = '\0'; 654 printf("Writing Install Volume: %s to AiR-BOOT configuration.\n", AiRBOOT_Config->InstallVolume); 655 Track0WriteAiRBOOTConfig(); 656 return 0; 657 } 658 659 660 661 477 662 BadValue = TRUE; 478 663 CurPartitionNo = 0; CurIPTEntry = AiRBOOT_IPT; 479 664 while (CurPartitionNo<AiRBOOT_Config->Partitions) { 480 if (strncmp(CurIPTEntry->PartitionName, StartPos, ArgumentLen)==0) { 665 /* 666 // Rousseau: Changed below to case-insensitive compare. 667 // This solves the part/vol-label (mixed-case) v.s. fs-label (upper-case) issue. 668 */ 669 /*if (strncmp(CurIPTEntry->PartitionName, StartPos, ArgumentLen)==0) {*/ 670 if (strnicmp(CurIPTEntry->PartitionName, StartPos, ArgumentLen)==0) { 481 671 if (ArgumentLen==11) { 482 672 BadValue = FALSE; … … 495 685 CurPartitionNo++; CurIPTEntry++; 496 686 } 687 497 688 498 689 if (BadValue) { … … 602 793 PrfWriteProfileData (HINI_USERPROFILE, "XWorkplace", "RebootTo", XWPOrgStringPtr, XWPStringSize); 603 794 free(XWPOrgStringPtr); 604 795 605 796 puts ("SETABOOT: XWorkPlace updated."); 606 797 return 0; … … 611 802 return 1; 612 803 } 613 printf ("SETABOOT: AiR-BOOT %X.%02X detected.\n\n", AiRBOOT_CodeSig->MajorVersion, AiRBOOT_CodeSig->MinorVersion); 804 printf("SETABOOT: AiR-BOOT %X.%02X detected.\n\n", AiRBOOT_CodeSig->MajorVersion, AiRBOOT_CodeSig->MinorVersion); 805 //printf("DEBUG: InstallVolume: %s\n", AiRBOOT_Config->InstallVolume); 614 806 if (AiRBOOT_Config->BootMenuActive) { 615 807 if (AiRBOOT_Config->TimedBoot) { … … 697 889 } 698 890 return 0; 891 892 893 894 } 895 896 897 /* 898 // Rousseau: 899 // Global pointers will be initialized here ! 900 */ 901 BOOL Track0DetectAirBoot (BOOL* ab_bad) { 902 USHORT ResultCheck; 903 USHORT CurSectorNo = 0; 904 905 /* Globals that get initialized */ 906 AiRBOOT_CodeSig = (PAiRBOOTCODESIG)&Track0[2]; 907 AiRBOOT_Config = (PAiRBOOTCONFIG)&Track0[(55-1)*512]; 908 AiRBOOT_IPT = (PAiRBOOTIPENTRY)&Track0[(56-1)*512]; 909 910 if (strncmp(AiRBOOT_CodeSig->Identifier, "AiRBOOT", 7)!=0) { 911 *ab_bad = FALSE; 912 return FALSE; 913 } 914 915 if ((AiRBOOT_CodeSig->TotalCodeSectors)>53) { 916 puts ("SETABOOT: AiR-BOOT Code damaged!"); 917 *ab_bad = TRUE; 918 return TRUE; 919 } 920 921 ResultCheck = 0; CurSectorNo = 0; 922 while (CurSectorNo<AiRBOOT_CodeSig->TotalCodeSectors) { 923 ResultCheck = GetChecksumOfSector(ResultCheck, CurSectorNo+2); 924 CurSectorNo++; 925 } 926 if (ResultCheck!=AiRBOOT_CodeSig->CheckSumOfCode) { 927 puts ("SETABOOT: AiR-BOOT Code damaged!"); 928 *ab_bad = TRUE; 929 return TRUE; 930 } 931 932 if (strncmp(AiRBOOT_Config->Identifier, "AiRCFG-TABLE", 13)!=0) { // Rousseau: INVISIBLE CHAR HERE ! 933 puts ("SETABOOT: AiR-BOOT Config damaged!"); 934 *ab_bad = TRUE; 935 return TRUE; 936 } 937 938 // Set Config-CheckSum to 0 939 AiRBOOT_ConfigCheckSum = AiRBOOT_Config->CheckSumOfConfig; 940 AiRBOOT_Config->CheckSumOfConfig = 0; 941 942 // Calculate CheckSum... 943 ResultCheck = 0; CurSectorNo = 55; 944 while (CurSectorNo<60) { 945 ResultCheck = GetChecksumOfSector(ResultCheck, CurSectorNo); 946 CurSectorNo++; 947 } 948 if (ResultCheck!=AiRBOOT_ConfigCheckSum) { 949 puts ("SETABOOT: AiR-BOOT Config damaged!"); 950 *ab_bad = TRUE; 951 return TRUE; 952 } 953 *ab_bad = FALSE; 954 return TRUE; 699 955 } 956 957 BOOL Track0WriteAiRBOOTConfig (void) { 958 USHORT ResultCheck; 959 USHORT CurSectorNo = 0; 960 961 // Update Edit-Counter... 962 AiRBOOT_Config->EditCounter++; 963 AiRBOOT_Config->CheckSumOfConfig = 0; 964 965 // Calculate CheckSum... 966 ResultCheck = 0; CurSectorNo = 55; 967 while (CurSectorNo<60) { 968 ResultCheck = GetChecksumOfSector(ResultCheck, CurSectorNo); 969 CurSectorNo++; 970 } 971 AiRBOOT_Config->CheckSumOfConfig = ResultCheck; 972 973 if (!Track0Write()) 974 return FALSE; 975 return TRUE; 976 } 977 978 979 /* 980 // Rousseau: # This is the main entry-point # 981 // Special behavior if eCS is booted from CDROM and phase 1 called this program. 982 // In that case, the name of the newly installed system is put in the AiR-BOOT configuration. 983 // This will cause AiR-BOOT to boot through after phase 1. 984 */ 985 int main (int argc, char **argv) { 986 BOOL AiRBOOTDetected = FALSE; 987 BOOL Track0Loaded = FALSE; // Assume track0 did not load correctly. 988 BOOL AiRBOOTBad = FALSE; 989 int rc = -1; 990 991 992 /* 993 // Rousseau: ## Changed order to first check for AiR-BOOT existance ## 994 // If AiR-BOOT is not installed, all action is passed-thru to IBM SETBOOT (SETBM.EXE). 995 */ 996 997 998 /* 999 // Try to load track zero. 1000 // We don't care if no harddisk is present, since we first want to know if AiR-BOOT is 1001 // installed to adjust our behaviour. 1002 // If it's not installed, or a loading error occurs, all actions will be deferred to 1003 // IBM SETBOOT (SETBM.EXE). 1004 // This means we also let IBM SETBOOT handle the situation in which no HD's are present. 1005 */ 1006 Track0Loaded = Track0Load(); 1007 1008 /* 1009 // Now see if AiR-BOOT is present. 1010 // If there was a loading error, no AiR-BOOT signature will be present, so 1011 // we pass-thru to IBM SETBOOT. 1012 */ 1013 AiRBOOTDetected = Track0DetectAirBoot(&AiRBOOTBad); 1014 1015 if (AiRBOOTDetected) { 1016 rc = DoAirBootActions(argc, argv, AiRBOOTDetected, AiRBOOTBad); 1017 } 1018 else { 1019 rc = DoClassicActions(argc, argv); 1020 } 1021 1022 1023 return rc; 1024 } -
trunk/TOOLS/OS2/SETABOOT/SETABOOT.TGT
r29 r30 22 22 5 23 23 MCommand 24 0 24 117 25 @ren SETABOOT.EXE SETABOOT.XEX 26 @ren SETABOOT.XEX SETABOOT.EXE 27 copy SETABOOT.EXE ..\..\..\RELEASE\OS2\SETABOOT.EXE 28 25 29 6 26 30 MItem 27 31 12 28 setaboot.exe 32 SETABOOT.EXE 29 33 7 30 34 WString … … 33 37 8 34 38 WVList 35 2 39 4 36 40 9 37 M CState41 MVState 38 42 10 39 43 WString … … 42 46 11 43 47 WString 48 22 49 ?????Other options(,): 50 1 51 12 52 WString 53 19 54 op map=SETABOOT.MAP 55 0 56 13 57 MCState 58 14 59 WString 60 7 61 OS2LINK 62 15 63 WString 44 64 13 45 65 ?????Map file 46 66 1 47 67 0 48 1 268 16 49 69 MCState 50 1 370 17 51 71 WString 52 72 7 53 73 OS2LINK 54 1 474 18 55 75 WString 56 76 24 … … 58 78 1 59 79 0 60 15 80 19 81 MVState 82 20 83 WString 84 7 85 OS2LINK 86 21 87 WString 88 22 89 ?????Other options(,): 90 0 91 22 92 WString 93 19 94 op map=SETABOOT.MAP 95 0 96 23 97 WVList 98 1 99 24 100 ActionStates 101 25 102 WString 103 5 104 &Make 105 26 61 106 WVList 62 107 0 … … 65 110 1 66 111 0 67 16 112 27 68 113 WPickList 69 114 2 70 17 115 28 71 116 MItem 72 117 3 73 118 *.C 74 18 119 29 75 120 WString 76 121 4 77 122 COBJ 78 19 123 30 79 124 WVList 80 125 0 81 20 126 31 82 127 WVList 83 128 0 … … 86 131 1 87 132 0 88 21 133 32 89 134 MItem 90 135 10 91 136 SETABOOT.C 92 22 137 33 93 138 WString 94 139 4 95 140 COBJ 96 23 141 34 97 142 WVList 98 143 0 99 24 144 35 100 145 WVList 101 146 0 102 17 147 28 103 148 1 104 149 1 -
trunk/TOOLS/OS2/SETABOOT/SETABOOT.WPJ
r29 r30 5 5 1 6 6 WRect 7 08 07 840 8 620 9 9 7680 10 921 610 9210 11 11 2 12 12 MProject … … 21 21 WFileName 22 22 12 23 setaboot.tgt 23 SETABOOT.TGT 24 24 6 25 25 WVList … … 31 31 0 32 32 0 33 56 7034 421 533 5664 34 4210 35 35 0 36 36 0 … … 38 38 WFileName 39 39 12 40 setaboot.tgt 40 SETABOOT.TGT 41 41 0 42 42 0
Note:
See TracChangeset
for help on using the changeset viewer.