Changeset 51
- Timestamp:
- Apr 13, 2014, 3:50:38 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 49 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BOOTCODE/AIR-BOOT.ASM
r50 r51 19 19 20 20 21 ;------------------------------------------------------------------------------ 21 22 23 24 25 26 ;############################################################################## 22 27 ; AiR-BOOT / DEFINITIONS 23 ;------------------------------------------------------------------------------ 24 ; 28 ;############################################################################## 25 29 26 30 ; 27 31 ; Include AiR-BOOT Version Information. 32 ; This version-info is defined using simpel EQU's so it can serve as a 33 ; single source for other formats. The AiR-BOOT signature and the 34 ; OS/2 BLDLEVEL use this basic version information. 28 35 ; 29 36 Include VERSION.INC … … 31 38 ; 32 39 ; Include OS/2 BLDLEVEL Information. 40 ; It uses the version-information in VERSION.INC to build it's signature. 33 41 ; 34 42 Include BLDLEVEL.INC 35 43 36 37 ; ------------------------- 38 ; Rousseau: JUMPS disabled 39 ; ------------------------- 44 ; 45 ; Include some macro's. 46 ; This file contains the ORIGIN macro that is used to detect overlaps. 47 ; 48 Include ../INCLUDE/ASM.INC 49 50 40 51 ; We actually don't want to use this directive because it generates extra 41 52 ; NOP instructions that we can do without. 42 ; Relative conditional jumps that are out-of-range are manually reworked by43 ; skipping an unconditional jump to the target on base of complementary44 ; condition logic and temporary labels.45 53 ; TASM also has a bug in that when the .ERR2 directive is used when 46 54 ; the .386 directive is in effect, the JUMPS directive is also active … … 54 62 ENDIF 55 63 64 56 65 ; 57 66 ; If defined then each module is prefixed with it's name. 58 ; This is used for debugging purposes .67 ; This is used for debugging purposes but it also increases code space. 59 68 ; It should be off in release code. 60 69 ; 61 ;ModuleNames equ 1 62 63 64 ; 65 ; The first harddisk is BIOS coded 80h. 66 ; This makes a total of 128 disk could be supported using this coding. 67 ; This value is used to store disk-information and this info is allocated 68 ; in the BSS. 69 ; 70 MaxDisks equ 64 71 72 73 74 75 ; 76 ; Include Debug Modules and enable COM-port debugging. 70 ;~ MODULE_NAMES EQU 71 72 73 74 ; ----------------------------------------------------------------------------- 75 ; DEBUG 76 ; ----------------------------------------------------------------------------- 77 78 ; 79 ; Enable this to include Debug Modules and enable COM-port debugging. 80 ; To have room for the debug-code, the FX-code can only be enabled 81 ; when AUX_DEBUG is not defined. 77 82 ; 78 83 ;~ AUX_DEBUG EQU 79 84 80 81 82 83 85 ; 86 ; To have FX enabled, make sure FX_ENABLE is defined. 87 ; There is no need (for now) to remove Cooper Bars from the setup-menu 88 ; because AiR-BOOT does not crash when enabling Cooper Bars while FX 89 ; is not compiled in. Only TAB to post-screen does not work. 90 ; Way to go Martin ! 91 ; 92 IFNDEF AUX_DEBUG 93 FX_ENABLED EQU 94 ENDIF 95 96 ; 97 ; If ReleaseCode is not defined, it will produce debug-able code... 98 ; Rousseau: This is currently *not* functional so don't use it ! 99 ; It was used to debug AiR-BOOT as a .COM file. 100 ; 101 ReleaseCode equ -1 102 103 104 ; ----------------------------------------------------------------------------- 105 ; AUX 106 ; ----------------------------------------------------------------------------- 84 107 ; 85 108 ; bits 7-5 = datarate … … 106 129 107 130 108 ; 109 ; If ReleaseCode is not defined, it will produce debug-able code... 110 ; 111 ReleaseCode equ -1 112 113 114 ; 115 ; All Special Equ's for this project 116 ; 131 ; ----------------------------------------------------------------------------- 132 ; LABELS 133 ; ----------------------------------------------------------------------------- 134 ; Address labels after code-move 135 BootBaseSeg equ 08000h ; Pre-boot, in the low 640K 136 BootBasePtr equ 0h ; We put our MBR to this location 137 BootBaseExec equ BootBasePtr+offset MBR_RealStart 138 StackSeg equ 07000h ; Put the stack below the code 117 139 118 140 ; Use different addresses depending on whether in pre-boot … … 129 151 ENDIF 130 152 131 ; Address labels after code-move 132 BootBaseSeg equ 08000h ; Pre-boot, in the low 640K 133 BootBasePtr equ 0h ; We put our MBR to this location 134 BootBaseExec equ BootBasePtr+offset MBR_RealStart 135 StackSeg equ 07000h ; Put the stack below the code 136 153 154 155 ; ----------------------------------------------------------------------------- 156 ; VIDEO 157 ; ----------------------------------------------------------------------------- 137 158 ; Video pages, no INT 10h is used for menu-drawing etc. 138 159 VideoIO_Page0 equ 0B800h … … 141 162 VideoIO_Page4 equ 0BC00h 142 163 VideoIO_FXSegment equ 0A000h 143 144 ; Include some macro's145 Include ../INCLUDE/ASM.INC146 164 147 165 ; Special line-drawing characters … … 155 173 TextChar_WinRep6 equ 0D8h ; 'Ø' 156 174 157 ; Offsets for Partition-Entries in MBR/EPRs 175 176 177 ; ----------------------------------------------------------------------------- 178 ; PARTITION TABLE 179 ; ----------------------------------------------------------------------------- 180 ; Offsets for Partition-Entries in MBR/EBRs 158 181 LocBRPT_LenOfEntry equ 16 ; Length of a standard MBR or EPR entry 159 182 LocBRPT_Flags equ 0 ; Bootable, Hidden, etc. 160 LocBRPT_BeginCHS equ 1 ; Combined 10-bits cyl with 6 bits161 LocBRPT_BeginHead equ 1 ; Start head (0<=H<255) 255 is invalid !162 LocBRPT_BeginSector equ 2 ; Start sector (1<=S<=255)163 LocBRPT_BeginCylinder equ 3 ; Start cylinder (0<=C<[1024,16384,65536,n])183 LocBRPT_BeginCHS equ 1 ; Packed CHS value 184 LocBRPT_BeginHead equ 1 ; Start head, usually < 16 185 LocBRPT_BeginSector equ 2 ; Start sector, max 63 + cyl high bits 186 LocBRPT_BeginCylinder equ 3 ; Start cylinder 8+2 bits, max 1023 164 187 LocBRPT_SystemID equ 4 ; Type of system using the partition 165 LocBRPT_EndCHS equ 5 ; Same for end of partition 166 LocBRPT_EndHead equ 5 167 LocBRPT_EndSector equ 6 168 LocBRPT_EndCylinder equ 7 169 LocBRPT_RelativeBegin equ 8 170 LocBRPT_AbsoluteLength equ 12 171 172 LocBR_Magic equ 510 173 174 188 LocBRPT_EndCHS equ 5 ; Packed CHS value 189 LocBRPT_EndHead equ 5 ; End head, usually < 16 190 LocBRPT_EndSector equ 6 ; End sector, max 63 + cyl high bits 191 LocBRPT_EndCylinder equ 7 ; End cylinder 8+2 bits, max 1023 192 LocBRPT_RelativeBegin equ 8 ; LBA32 address of partition 193 LocBRPT_AbsoluteLength equ 12 ; 32-bit length of partition 194 195 ; Signature relative to start of MBR/EBR 196 LocBR_Magic equ 510 ; Offset of 0AA55h signature 197 198 ; ----------------------------------------------------------------------------- 199 ; LVM RECORD 200 ; ----------------------------------------------------------------------------- 175 201 ; Used as a quick compare in LVM.ASM 176 202 LocLVM_SignatureByte0 equ 02h … … 193 219 LocLVM_MaxEntries equ 4 ; Max entries in an LVM-sector 194 220 221 222 ; ----------------------------------------------------------------------------- 223 ; LVM ENTRY 224 ; ----------------------------------------------------------------------------- 195 225 ; Offsets for LVM entry. 196 226 ; These are relative to the start of the entry. 197 LocLVM_VolumeID equ 00h ; isDWORD198 LocLVM_PartitionID equ 04h ; isDWORD199 LocLVM_PartitionSize equ 08h ; isDWORD200 LocLVM_PartitionStart equ 0ch ; isDWORD227 LocLVM_VolumeID equ 00h ; DWORD 228 LocLVM_PartitionID equ 04h ; DWORD 229 LocLVM_PartitionSize equ 08h ; DWORD 230 LocLVM_PartitionStart equ 0ch ; DWORD 201 231 LocLVM_OnBootMenu equ 10h ; is on IBM BM Bootmenu 202 232 LocLVM_Startable equ 11h ; is Startable (newly installed system) 203 LocLVM_VolumeLetter equ 12h ; is Drive Letter for partition (C-Z or 0) 204 LocLVM_Unknown equ 13h ; unknown BYTE 233 LocLVM_VolumeLetter equ 12h ; Drive Letter for partition (C-Z or 0) 234 LocLVM_Unknown equ 13h ; unknown BYTE (can be used ?) 235 LocLVM_InstallLetter equ 13h ; unknown BYTE (can be used ?) 205 236 206 237 ; Truncated to 11 chars when displayed in menu. … … 213 244 214 245 ; LVM constants. 215 LocLVM_LabelLen equ 14h ; Length of an LVM Label (Disk/Part/Vol) 216 LocLVM_DiskNameLen equ 14h ; Length of an LVM DiskName 217 LocLVM_VolumeNameLen equ 14h ; Length of an LVM VolumeName 218 LocLVM_PartitionNameLen equ 14h ; Length of an LVM PartitionName 219 220 221 246 LocLVM_LabelLen equ 14h ; Length of LVM Label (Disk/Part/Vol) 247 LocLVM_DiskNameLen equ 14h ; Length of LVM DiskName 248 LocLVM_VolumeNameLen equ 14h ; Length of LVM VolumeName 249 LocLVM_PartitionNameLen equ 14h ; Length of LVM PartitionName 250 251 252 ; ----------------------------------------------------------------------------- 253 ; AiR-BOOT IPT 254 ; ----------------------------------------------------------------------------- 222 255 ; Offsets for IPT (Internal Partition Table) 223 LocIPT_MaxPartitions equ partition_count ; 45 in v1.07256 LocIPT_MaxPartitions equ max_partitions ; 45 in v1.07+ 224 257 LocIPT_LenOfSizeElement equ 6 ; Size of one Size-Element 225 258 LocIPT_LenOfIPT equ 34 ; Length of an IPT-entry … … 228 261 LocIPT_Drive equ 15 ; Drive-ID (80h,81h) 229 262 LocIPT_SystemID equ 16 ; Partition-Type (06,07,etc) 230 LocIPT_Flags equ 17 ; AiR-BOOT Flags for part ition(see below)263 LocIPT_Flags equ 17 ; AiR-BOOT Flags for part (see below) 231 264 LocIPT_BootRecordCRC equ 18 ; CRC of Boot-Record 232 265 LocIPT_LocationBegin equ 20 ; Begin of Partition … … 235 268 LocIPT_AbsolutePartTable equ 30 ; Absolute Sector of PartTable 236 269 237 ; Hidden Partition Table238 ;~ LocHPT_LenOfHPT equ 30 ; Length of an HPT-entry239 ; Length of an HPT-entry ((45 * 6 bits-per-part) / 8) * 45240 ; Packed table !241 LocHPT_LenOfHPT equ 34242 270 243 271 ; AiR-BOOT IPT-Flags 244 272 LocIPT_DefaultFlags equ 00000011b ; Don't know if boot-able :) 245 LocIPT_DefaultNonBootFlags equ 00000010b ; ...VIBR Detection is always on273 LocIPT_DefaultNonBootFlags equ 00000010b ; VIBR Detection is always on 246 274 247 275 Flags_Bootable equ 00000001b … … 259 287 FileSysFlags_DriveLetter equ 01000000b ; DriveLetter Feature possible 260 288 289 290 ; ----------------------------------------------------------------------------- 291 ; AiR-BOOT HPT 292 ; ----------------------------------------------------------------------------- 293 ; Hidden Partition Table 294 ; Length of an HPT-entry ((45 * 6 bits-per-part) / 8) * 45 295 ; 33.75 = 34 bytes for HPT-entry, coincidently same as length of IPT-entry. 296 ; Packed table ! 297 LocHPT_LenOfHPT equ 34 298 299 300 ; ----------------------------------------------------------------------------- 301 ; NAVIGATION KEYS 302 ; ----------------------------------------------------------------------------- 261 303 ; Navigation keys 262 304 Keys_Up equ 48h … … 274 316 Keys_F1 equ 3Bh 275 317 Keys_F10 equ 44h 276 Keys_C equ 2Eh ; Add. Check aufCtrl!318 Keys_C equ 2Eh ; Add. Check for Ctrl! 277 319 Keys_Y equ 2Ch 278 320 Keys_Z equ 15h … … 286 328 287 329 288 289 290 291 292 ;------------------------------------------------------------------------------ 330 ; ----------------------------------------------------------------------------- 331 ; MISC 332 ; ----------------------------------------------------------------------------- 333 ; Initial value for the FreeDriveletterMap 334 ; Meaning A,B not free; C-Z free, rest unused. (right to left) 335 ; Each partition with an assigned drive-letter clears a bit in this map. 336 ; (Not implemented yet) 337 InitialFreeDriveletterMap equ 00000011111111111111111111111100b 338 339 ; 340 ; The first harddisk is BIOS coded 80h. 341 ; This makes a total of 128 disks that could be supported using this coding. 342 ; This value is used to store disk-information and this info is allocated 343 ; in the BSS. 64 disks ought to be enough for everybody :-) 344 ; 345 MaxDisks equ 64 346 347 348 349 350 351 352 ;############################################################################## 293 353 ; AiR-BOOT / MAIN-CODE 294 ;------------------------------------------------------------------------------ 295 296 ; ------------------------------------------ 297 ; Rousseau: # Changed this from .386 to .286 298 ; ------------------------------------------ 354 ;############################################################################## 355 356 ; 299 357 ; Because of the TASM-bug the processor had to be changed to turn JUMPS 300 358 ; off. Existing movzx instructions were replaced with 286 equivalent code. 301 359 ; Out of range relative jumps have been recoded. 302 ; TASM still generates an extra NOP after test [mem],1 303 ; instructions. 304 ; JWasm produces tighter code. 305 ; JWasm: 306 ; With segment overrides, the address is expanded to the bit-width. 307 ; So, .386 will generate a 32-bit address, even in a USE16 segment. 360 ; 361 ; Since version 1.0.8, JWasm is the preferred assembler and Tasm will be 362 ; dropped. Also, the chances of AiR-BOOT being used on a 286-machine are 363 ; very slim, so a future version will revert back to .386 and also incorporate 364 ; 32-bit code. This will enable some enhanced constructs such as scaled 365 ; indexing, bit-instructions, 32-bit registers and what not. 366 ; 308 367 .286 309 368 310 ; This influences the uses directive and other stuff, 311 ; like calling-style and local variables. 312 ; The model itself,large, has no effect because we generate 313 ; a binairy image and not a segmented executable. 314 315 ; Tasm needs a memory model for USES on PROC to work. 369 ; 370 ; For Tasm, MODEL is needed for the USES directive to work. 371 ; So always use a model when assembling with Tasm otherwise registers on 372 ; function calls that use USES are not saved and restored. 373 ; The model itself, has no real effect because we generate a binary image 374 ; and not a segmented executable. 375 ; For the other assemblers we define no model to get rid of the default C/C++ 376 ; segments for future object-linked versions of AiR-BOOT. 377 ; 316 378 IFDEF TASM 317 379 ;~ .model large, basic … … 320 382 321 383 ; 322 ; This is used to switch between the original 1-segment (code_seg) and the 323 ; 2-segment (code_seg and bss_data). 384 ; The below is used to switch between the original 1-segment (code_seg) layout 385 ; and the new 2-segment (code_seg and bss_data) layout. 386 ; It will be removed in future versions. 324 387 ; The 2-segment layout was needed for JWasm because it does not treat 325 ; db ? in a code segment as bss-data, even if at the end of the code segment.388 ; db ? at the end of a code segment as bss-data. 326 389 ; Therefore, a true BSS segment is now used. 327 ; Both the code_seg and the bss_data are grouped to the logical airboot390 ; Both the code_seg and the bss_data are grouped to the logical AIRBOOT 328 391 ; segment. 329 392 ; Note that this influences the offsets in the BSS in the list-file and … … 334 397 SEGMENTED EQU 335 398 336 IFDEF SEGMENTED 337 AIRBOOT GROUP LDRIMAGE,VOLATILE 338 ENDIF 339 340 ; Our code-segment starts here. 341 LDRIMAGE SEGMENT USE16 PUBLIC 'CODE' 342 343 IFDEF SEGMENTED 344 ASSUME CS:AIRBOOT, DS:AIRBOOT, ES:nothing, SS:nothing 345 ELSE 346 ASSUME CS:LDRIMAGE,DS:LDRIMAGE,ES:nothing, SS:nothing 347 ENDIF 399 IFDEF SEGMENTED 400 AIRBOOT GROUP LDRIMAGE,VOLATILE 401 ENDIF 402 403 ; Our code-segment starts here. 404 LDRIMAGE SEGMENT USE16 PUBLIC 'CODE' 405 406 IFDEF SEGMENTED 407 ASSUME CS:AIRBOOT, DS:AIRBOOT, ES:nothing, SS:nothing 408 ELSE 409 ASSUME CS:LDRIMAGE,DS:LDRIMAGE,ES:nothing, SS:nothing 410 ENDIF 411 412 348 413 349 414 ;============================================================================== 350 ; Sector 1 351 352 ;############################################################################## 415 ; Sector 1 416 ;============================================================================== 417 418 ;------------------------------------------------------------------------------ 353 419 ; We are not a .COM file at 100h but a BINARY image 354 420 ; of which only the 1st sector gets loaded at 0000:07c00h … … 357 423 ; Then it jumps to a new entry-point and loads the rest of 358 424 ; the image to the new location. 359 org 00000h ; Sector 1 360 ;############################################################################## 361 362 363 ; 364 ; Start of sector 1 365 ; This is the MBR. 366 ; Note the AiRBOOT signature, it's date, version and language. 367 ; Version 1.07 was intruduced in 2011, version 1.0.8 in 2012. 368 ; These new versions fix issues with huge drives, lvm and more. 369 ; For a detailed description see AIR-BOOT.HIS. 370 ; 371 372 ; 373 ; --------------------------------------------- 374 ; Rousseau: # Combined letter and jump offset # 375 ; --------------------------------------------- 425 org 00000h 426 ;------------------------------------------------------------------------------ 427 428 429 ; 430 ; Since AiR-BOOT is a boot-loader residing in track0, the first 512 bytes 431 ; have the layout of a Master Boot Record (MBR). When AiR-BOOT get's installed, 432 ; the first 512 bytes of this code get's merged with the Partition Table. 433 ; The rest is installed in the remaining sectors with sector 62 (LBA 61) 434 ; being the last sector used by AiR-BOOT. Sector 63 is reserved for IBM LVM. 435 ; The last sector used by AiR-BOOT is a copy of the MBR that AiR-BOOT makes 436 ; every time a system gets booted. 437 ; 438 439 ; 440 ; Due to the addition of an extra 'I13X' sugnature and code to preserve the 441 ; values of the registers on entry, the MBR-code has become a bit messy. 442 ; This will be cleaned-up in future versions. 443 ; 444 445 ; 376 446 ; Martin had a short jump followed by the AiRBOOT signature at first. 377 447 ; Then he encountered strange behaviour by some M$ operating-systems 378 448 ; if the the first insruction was not a CLI. 379 449 ; But there was no room to insert the CLI and of course he did not want to 380 ; change the location of the AiR BOOT signature.450 ; change the location of the AiR-BOOT signature. 381 451 ; He solved this by inserting the M$ needed CLI at offset 0 followed by a short 382 ; jump that uses the 'A' of the AiRBOOT signature as the jump displacement. 383 ; 384 385 386 ;------------------------------------------------------------------------------ 452 ; jump that uses the 'A' of the AiR-BOOT signature as the jump displacement. 453 ; 454 455 456 ; ----------------------------------------------------------------------------- 457 ; FIRST ENTRY-POINT 458 ; ----------------------------------------------------------------------------- 459 ; ###################################################### 460 ; # ENTRY-POINT WHERE THE BIOS TRANSFERS CONTROL TO US # 461 ; ###################################################### 387 462 AiR_BOOT: 388 389 ; Some M$ operating systems need a CLI 390 ; here otherwise they will go beserk 391 ; and will do funny things during 392 ; boot phase, it's laughable! 393 cli 394 395 ; JMP-Short -> MBR_Start 396 ; Uses the 'A' from the signature as the displacement ! 397 db 0EBh 398 399 ; ID String, Date (DD,MM,CC,YY), Version Number, Language ID 400 ;~ db 'AiRBOOT', 24h, 02h, 20h, 12h, 01h, 08h, TXT_LanguageID 401 InsertAirbootSignature TXT_LanguageID 402 403 ; Total Sectors Count. 404 ; Will get overwritten by FIXCODE. 405 db 1 406 407 ; Total Sectors Count, 408 ; Dynamic calculation. 409 ;~ db (code_end-$)/512 410 411 412 MBR_CheckCode dw 0 ; Check-Sum for Code 413 463 ; Some M$ operating systems need a CLI 464 ; here otherwise they will go beserk 465 ; and will do funny things during 466 ; boot phase, it's laughable! 467 MBR_1stOpc: cli 468 469 ; JMP-Short -> MBR_Start 470 ; Uses the 'A' from the signature as the displacement ! 471 MBR_JmpOpc db 0EBh 472 473 ; ID String, Date (DD,MM,CC,YY), Version Number, Language ID 474 ;~ db 'AiRBOOT',24h,02h,20h,12h,01h,08h,TXT_LanguageID 475 MBR_ABSig: InsertAirbootSignature TXT_LanguageID 476 477 ; Total Code Sectors Count. 478 ; Actual value will be inserted by FIXCODE. 479 MBR_CodeSecs db 1 480 481 ; Total Code Sectors Count, dynamically calculated. 482 ;~ db (code_end-$)/512 483 484 ; Check-Sum for Code 485 MBR_CheckCode dw 0 486 487 488 489 ; ----------------------------------------------------------------------------- 490 ; THIRD ENTRY-POINT 491 ; ----------------------------------------------------------------------------- 414 492 ; 415 493 ; No single instruction below should be changed, added or removed in the code … … 417 495 ; 418 496 MBR_Start: 419 sti ; This opcode is dedicated to: 420 cld ; =MICROSOFT JUMP DEPARTMENT= 421 497 ; 498 ; When we arrive here, no registers have been used yet. 499 ; So, they still contain the values the BIOS left in them. 500 ; We want to preserve those value's for later inspection 501 ; by putting them on the stack. 502 ; 503 504 ; No space for this instruction here. 505 ; We'll enable interrupts later. 506 ;sti ; This opcode is dedicated to: 507 ; =MICROSOFT JUMP DEPARTMENT= 508 509 510 ; Push all registers with values provided by the BIOS 511 ; on the stack. 512 pusha 513 ; Temporary save SS and SP so we still have access to this 514 ; stack after we have setup our own. 515 mov dx,ss 516 mov bx,sp 517 518 ; 422 519 ; Setup some base stuff 423 520 ; AX got loaded wrongly for debug, changed the instructions 424 521 ; without modifying the number of bytes. 425 ; Don't comment-out the redundant instruction below because this522 ; Don't comment-out the redundant instruction below because it 426 523 ; *will* change the number of bytes and break the jump-chain. 427 mov ax, StartBaseSeg ; The segment we are moving ourself from (NOT USED) 524 ; 525 526 ; The segment we are moving ourself from (NOT USED) 527 ;mov ax, StartBaseSeg 428 528 ;mov ds, ax 529 530 ; Make sure DS points to CS. 429 531 push cs 430 532 pop ds 431 mov si, StartBasePtr ; The offset we are moving ourself from 432 mov ax, BootBaseSeg ; The target segment we are moving ourself to 533 534 ; Setup the source and destination for the code move. 535 mov si, StartBasePtr ; The offset we move ourself from 536 mov ax, BootBaseSeg ; The target segment we move to 433 537 mov es, ax 434 mov di, BootBasePtr ; The target offset we are moving ourself to 435 436 ; Depending on pre-boot or debug, 437 ; only move first 512 bytes or the whole she-bang++ (65400 bytes) 538 ;mov di, BootBasePtr ; The target offset we move to 539 ; Changed the instruction to make room. 540 ; So, BootBasePtr is not used ! 541 ; The offset in the target segment is assumed to be 0000 542 ; anyway. 543 xor di,di 544 ;sti 545 546 ; Depending on pre-boot or debug. 547 ; Note that ReleaseCode is obsolete, so we will always move 548 ; 256 words; aka this sector, the MBR. 438 549 IFDEF ReleaseCode 439 550 mov cx, 256 ; Pre-boot environment 440 551 ELSE 441 mov cx, 32700 ; Debug environment (move ~64kB)552 mov cx, 32700 ; Old Debug environment (move ~64kB) 442 553 ENDIF 443 554 444 555 ; 445 ; LET's MOVE OURSELVES ! 446 ; 556 ; This moves this 512-byte sector, loaded by the BIOS at 557 ; 0000:7c00 to 8000:0000. 558 ; 559 cld 447 560 rep movsw 448 561 449 ; Code an intersegment jump to the new location 562 ; Code an intersegment jump to the new location. 563 ; jmp BootBaseSeg:BootBaseExec 564 ; Note that DX:BX containts the old SS:SP. 450 565 db 0EAh 451 566 dw BootBaseExec ; This is MBR_RealStart + BootBasePtr 452 567 dw BootBaseSeg ; This is 08000h 453 ;jmp far ptr BootBaseSeg:BootBaseExec 454 455 568 569 570 571 572 ; ----------------------------------------------------------------------------- 573 ; SIMPLE MBR FUNCTIONS 574 ; ----------------------------------------------------------------------------- 456 575 ; 457 576 ; Some MBR-functions to provide absolute minimum functionality. … … 469 588 cli 470 589 jmp MBR_HaltSys 471 ;db 100 dup (0)472 473 590 474 591 … … 478 595 ORIGIN 0003Ch 479 596 480 ; Comport settings 481 ; It had to be moved to create room for the double I13X 482 ; signature. 597 ; Comport settings. 598 ; It had to be moved to create room for the double I13X signature. 483 599 ; It cannot be in the config-area (sector 55) 484 600 ; because that area is crc-protected and would not allow 'poking'. 485 601 BIOS_AuxParms dw BIOS_AUXPARMS_DEFAULT 486 602 603 604 IFDEF AUX_DEBUG 487 605 reserved db 6 dup('X') 488 489 606 ELSE 607 reserved db 6 dup(0) 608 ENDIF 609 610 611 612 613 ; ----------------------------------------------------------------------------- 614 ; SECOND ENTRY-POINT 615 ; ----------------------------------------------------------------------------- 490 616 ; 491 617 ; We arrive here after the first jump using the 'A' of the 492 ; AiR-BOOT signature. 493 ; So we ensure the jump is always at this offset. 494 ; We jump here, because Martin needed to 495 ; insert a CLI on start and did not 496 ; want to change the AiR-BOOT signature 497 ; because of Microsoft inventions... 618 ; AiR-BOOT signature. So we ensure the jump is always at 619 ; this offset. We jump here, because Martin needed to 620 ; insert a CLI on start and did not want to change the 621 ; AiR-BOOT signature because of Microsoft inventions... 498 622 ; 499 623 ORIGIN 00044h 500 624 501 625 ; Jump again... 502 ; This time to the setup-code.626 ; This time to the code that relocates to 8000:0000. 503 627 jmp MBR_Start 504 628 … … 573 697 574 698 575 ; 576 ; This is where the rest of AiR-BOOT gets loaded. 699 ; ----------------------------------------------------------------------------- 700 ; ENTRY-POINT OF MOVED CODE 701 ; ----------------------------------------------------------------------------- 702 703 ; 704 ; When we arrive here we are running at 8000:0000. 705 ; DX:BX contains the SS:SP of the old stack. 706 ; 707 708 ; 709 ; This is where the rest of AiR-BOOT gets loaded from track0. 577 710 ; 578 711 579 712 ;------------------------------------------------------------------------------ 580 713 MBR_RealStart: 714 ; 715 ; Setup new stack and other segment registers. 716 ; 581 717 mov ax, StackSeg ; 07000h, below the moved code 582 718 mov ss, ax 583 ;mov sp, 7FFFh ; Odd stack-pointer ??584 719 mov sp, 7FFEh ; Even is better 585 mov ax, es ; ES holds segment where we moved to 586 mov ds, ax ; Set DS==ES to Code Segment 720 push es ; ES holds segment where we moved to 721 pop ds ; Set DS==ES to Code Segment 722 723 ; 724 ; Push the old SS:SP which was saved in DX:BX on the new stack. 725 ; 726 push dx ; Old SS 727 push bx ; Old SP 587 728 588 729 … … 592 733 ; loaded by dos while when air-boot is active from the MBR it 593 734 ; does the loading itself. 735 ; (This debug environment is obsolete and dis-fuctional) 594 736 IFNDEF ReleaseCode 595 737 jmp AiR_BOOT_Start 596 738 ENDIF 597 739 598 599 ; Load missing parts from harddrive...600 ;mov ax, cs ; actually obsolete601 ;mov es, ax ; actually obsolete602 603 740 ; Load the configuration-sectors from disk. 741 ; These are the main configuration sector and the various 742 ; tables that follow it upto but not including the MBR backup. 604 743 mov bx, offset Configuration 605 mov dx, 0080h ; First harddrive , Sector 55606 mov cx, 0037h ; Is 55d is config-sector744 mov dx, 0080h ; First harddrive 745 mov cx, 0037h ; Config sector is at 55d (CHS) 607 746 608 747 ; Call the i/o-part 609 748 call MBR_LoadConfig 610 611 749 jnc MBR_ConfigCopy_NoError 612 750 613 751 ; Some error occured 614 752 MBR_ConfigCopy_LoadError: 615 call MBR_LoadError ; Will Abort BootUp753 call MBR_LoadError ; Will Abort BootUp 616 754 617 755 ; Load the code sectors 618 756 MBR_ConfigCopy_NoError: 619 mov bx, offset FurtherMoreLoad 620 mov dx, 0080h ; First harddrive 621 mov cx, 0002h ; Second sector 622 mov ah, 02h 623 624 ; This location is in the code-segment. 625 ; When segment overrides are applied, the address is 626 ; expanded to the bit-with. 627 ; So the .286 or .386 directive influences the length 628 ; of the instruction, even with a USE16 segment. 629 mov al, ds:[10h] ; Number of code sectors 630 int 13h 757 mov bx, offset FurtherMoreLoad ; Directly after MBR in mem 758 mov dx, 0080h ; First harddrive 759 mov cx, 0002h ; Start at second sector 760 mov ah, 02h ; Read sectors 761 762 ; This location is in the MBR. 763 ; It is filled in by the FIXCODE helper that post processes 764 ; the AIRBOOT loader image after it has been built. 765 ; FIXCODE also embeds the MBR protection-image. 766 mov al, ds:[10h] ; Number of code sectors 767 int 13h ; Call BIOS service 631 768 jnc MBR_RealStart_NoError 632 769 jmp MBR_ConfigCopy_LoadError … … 645 782 ; Update: These are actually MOV EAX,'X31I' instructions 646 783 ; in the eCS LVM MBR-code. They are at different places in 647 ; the v1.x and v2.x LVM code.648 ; Let's protect their location.784 ; the v1.x and v2.x LVM MBR-code. Other code might depend on 785 ; their presence. Let's protect their location. 649 786 ORIGIN 000d0h 650 787 db 'I13X',0,'I13X',0 … … 659 796 mov ch,0 660 797 798 ; Claculate checksum 661 799 xor bx, bx 662 800 MBR_RealStart_CheckCodeLoop: … … 675 813 call MBR_Teletype 676 814 jmp MBR_HaltSystem 815 816 817 ; 818 ; OK, all loading went fine so the rest of the code 819 ; is present now, so we jump to it. 820 ; The old SS:SP is still on the stack. 821 ; 677 822 MBR_RealStart_CheckSuccess: 678 823 jmp AiR_BOOT_Start … … 683 828 684 829 ;------------------------------------------------------------------------------ 685 Include TEXT/TXTMBR.ASM; All translateable Text in MBR830 Include TEXT/TXTMBR.ASM ; All translateable Text in MBR 686 831 ;------------------------------------------------------------------------------ 687 832 … … 711 856 712 857 ; AiR-BOOT will merge the field from the MBR it replaces. 713 858 MBR_DrvSig db 'DSIG' 714 859 715 860 ; Unused word at 01BCh. 716 861 ; An LVM 2.x MBR puts 0CC33h here. 717 862 ; AiR-BOOT will merge the field from the MBR it replaces. 718 863 MBR_Spare dw '$$' 719 864 720 865 … … 726 871 ; The 4 entries just for show. 727 872 ; AiR-BOOT will merge them from the MBR it replaces. 873 MBR_PartTable: 728 874 db 16 dup('0') 729 875 db 16 dup('1') … … 732 878 733 879 ; Boot Sigbature 734 735 736 ; End of sector 1 880 MBR_Sig dw 0aa55h 881 882 737 883 738 884 … … 741 887 742 888 ;============================================================================== 743 ; Sector 2 744 745 ; 746 ; Here starts the second sector, sector 2 747 ; 889 ; Sector 2 890 ;============================================================================== 891 892 ; ----------------------------------------------------------------------------- 893 ; FILE-SYSTEM TABLES 894 ; ----------------------------------------------------------------------------- 895 896 748 897 ORIGIN 00200h 749 898 … … 759 908 760 909 ; first Normal-Partition-ID, Hidden-Partition-ID 761 ; 910 ; and Default-Partition-Flags. 762 911 ; 01h -> Boot-Able 763 912 ; 10h -> FAT32 - Name Getting Scheme … … 795 944 796 945 946 947 797 948 ;============================================================================== 798 ; Sector 3 799 ; 800 ; Sector 3 801 ; 949 ; Sector 3 950 ;============================================================================== 951 952 ; ----------------------------------------------------------------------------- 953 ; ENTRY-POINT AFTER LOADING THE REST OF THE CODE 954 ; ----------------------------------------------------------------------------- 955 802 956 ORIGIN 00400h 803 957 804 958 805 ; ############################################## 806 ; ## ENTRY-POINT AFTER ALL THE INITIAL HASSLE ## 807 ; ############################################## 808 809 810 811 959 ; ############################################ 960 ; # ENTRY-POINT AFTER ALL THE INITIAL HASSLE # 961 ; ############################################ 812 962 AiR_BOOT_Start: 813 963 814 964 815 965 ; 966 ; Enable interrupts. 967 ; 968 sti 969 970 ; 971 ; Pop the old SS:SP from the stack and save it in the BSS. 972 ; 973 pop [OldSP] 974 pop [OldSS] 975 976 977 ; ----------------------------------------------------------------------------- 978 ; IBM-BM BOOT PREPARATION 979 ; ----------------------------------------------------------------------------- 816 980 ; 817 981 ; Since v1.0.8, AiR-BOOT is able to chainload IBM-BM. … … 826 990 ; 0000:7E00 in case the partition that will be started is IBM-BM. 827 991 ; This copy is located at 8000:0000 and DS already points to this 828 ; segment. 992 ; segment. The 'I13X' signature and FS will be setup later. 829 993 ; 830 994 pusha ; Save all the general purpose regs … … 841 1005 842 1006 843 ;~ nop 844 ;~ mov ax, offset sobss 845 ;~ mov ax,offset BeginOfVariables 846 ;~ mov ax,offset [TrueSecs] 847 ;~ lea ax, [TrueSecs] ; Tasm generates mov here 848 ;~ mov ax,word ptr [TrueSecs] 849 ;~ mov ax,offset EndOfVariables 850 ;~ mov ax, offset eobss 851 ;~ nop 852 853 854 855 ;jmp skip 856 857 mov al, byte ptr [CFG_Partitions] 858 mov byte ptr [OldPartitionCount], al 859 860 ; Initialize Variable-Tables, Detections, etc. 1007 ; ----------------------------------------------------------------------------- 1008 ; PRECRAP 1009 ; ----------------------------------------------------------------------------- 1010 1011 ; 1012 ; First it clears the BSS area. 1013 ; Note that the old SS:SP is stored outside this area so ti 1014 ; does not get lost. 1015 ; Then initialize various runtime variables and structures. 1016 ; 861 1017 call PRECRAP_Main 862 863 ; Number of harddisks is now known 864 865 IFDEF AUX_DEBUG 1018 ; Number of harddisks and other system-info is now known. 1019 1020 ;! 1021 ;! DEBUG_BLOCK 1022 ;! Let's see what the BIOS supplied us with... 1023 ;! Uncomment below to activate. 1024 ;! 1025 __DUMP_BIOS_REGS__ EQU 1026 IFDEF AUX_DEBUG 1027 IFDEF __DUMP_BIOS_REGS__ 1028 pushf 1029 pusha 1030 ; Print title. 1031 mov si,offset [bios_reg] 1032 call AuxIO_Print 1033 ; Save the current stack (SS:SP). 1034 mov ax,ss 1035 mov [CurrentSS],ax 1036 mov [CurrentSP],sp 1037 1038 ; Restore the old stack. 1039 mov ss,[OldSS] 1040 mov sp,[OldSP] 1041 1042 ; Pop the registers with the BIOS values. 1043 popa 1044 ; Push them back for AiR-BOOT restart (debug mode). 1045 pusha 1046 ; Dump them to the serial-port. 1047 call DEBUG_DumpRegisters 1048 ; Restore the current stack. 1049 mov ax,[CurrentSS] 1050 mov ss,ax 1051 mov sp,[CurrentSP] 1052 1053 ; Restore registers. 1054 popa 1055 popf 1056 ENDIF 1057 ENDIF 1058 1059 1060 1061 1062 ;! 1063 ;! DEBUG_BLOCK 1064 ;! Dump the registers at this point. 1065 ;! Uncomment below to activate. 1066 ;! 1067 IFDEF AUX_DEBUG 1068 ;~ call DEBUG_DumpRegisters 1069 ; Dump drive-letters of dl-feature before partitions are 1070 ; scanned and processed. 1071 call DEBUG_DumpDriveLetters 1072 call DEBUG_DumpVolumeLetters 1073 call DEBUG_DumpPartitionXref 1074 ENDIF 1075 1076 ; ----------------------------------------------------------------------------- 1077 ; PARTITION SCAN 1078 ; ----------------------------------------------------------------------------- 1079 ; 1080 ; Scan all partitions 1081 ; 1082 call PARTSCAN_ScanForPartitions 1083 ; Internal Partition Table is now populated. 1084 1085 ;! 1086 ;! DEBUG_BLOCK 1087 ;! Dump various tables. 1088 ;! Uncomment below to activate. 1089 ;! 1090 IFDEF AUX_DEBUG 866 1091 ;~ call DEBUG_DumpIPT 867 1092 ;~ call DEBUG_DumpPartitionPointers 868 ;~ call DEBUG_DumpPartitionXref869 1093 ;~ call DEBUG_DumpNewPartTable 870 1094 ;~ call DEBUG_DumpDriveLetters 871 ENDIF 872 873 ; Scan all partitions 874 call PARTSCAN_ScanForPartitions 1095 call DEBUG_DumpDriveLetters 1096 call DEBUG_DumpVolumeLetters 1097 call DEBUG_DumpPartitionXref 1098 ENDIF 1099 1100 1101 ; ----------------------------------------------------------------------------- 1102 ; RESTORE FORCED DRIVELETTER CORRELATION [LVM] 1103 ; ----------------------------------------------------------------------------- 1104 1105 ; 1106 ; Reconnect forced drive-letters to their corresponding 1107 ; partitions. 1108 ; 1109 call PARTSCAN_UpdateDriveLetters 1110 ; Driveletter <-> Partition correlation is now restored. 1111 1112 1113 1114 ;! 1115 ;! DEBUG_BLOCK 1116 ;! Dump various tables. 1117 ;! Uncomment below to activate. 1118 ;! 1119 IFDEF AUX_DEBUG 1120 ;~ call DEBUG_DumpIPT 1121 ;~ call DEBUG_DumpPartitionPointers 1122 ;~ call DEBUG_DumpNewPartTable 1123 ;~ call DEBUG_DumpDriveLetters 1124 call DEBUG_DumpDriveLetters 1125 call DEBUG_DumpVolumeLetters 1126 call DEBUG_DumpPartitionXref 1127 ENDIF 1128 1129 1130 ; ----------------------------------------------------------------------------- 1131 ; SHOW WE ARE ALIVE 1132 ; ----------------------------------------------------------------------------- 1133 1134 ; 1135 ; Put some info about AiR-BOOT and the system on the screen. 1136 ; 875 1137 876 1138 ; Display number of physical disks found … … 899 1161 900 1162 901 IFDEF AUX_DEBUG 902 ;~ call DEBUG_DumpIPT 903 ;~ call DEBUG_DumpPartitionPointers 904 ;~ call DEBUG_DumpPartitionXref 905 ;~ call DEBUG_DumpNewPartTable 906 ENDIF 907 908 909 ; ======================910 ; == eCS PHASE1 check ==911 ; ======================912 913 ; If the fir t byte ifname of the Install Volume is not 01163 1164 1165 1166 ; ----------------------------------------------------------------------------- 1167 ; eComStation PHASE1 CHECK 1168 ; ----------------------------------------------------------------------------- 1169 1170 ; 1171 ; Here we check if eComStation v2.1 is being installed. 1172 ; If so, we forgo the menu and directly boot it. 1173 ; 1174 1175 ; If the first byte of the name of the Install Volume is not 0 914 1176 ; then we potentially have a phase1 boot. 915 1177 test byte ptr [eCS_InstallVolume],0ffh … … 926 1188 927 1189 1190 ; 928 1191 ; == Install Volume Found == 929 930 ; Because the old IPT read from disk differs from the new 931 ; IPT, we need to rescan all partitions. 932 ; This causes the PartitionXref table to be filled with 933 ; correct values so the auto-boot from the new partition 934 ; works correctly. 935 call PARTSCAN_ScanForPartitions 936 937 ; Setup automatic boot to forgo the Menu. 938 ; PART_SetupPhase1 has filled in the other variables. 939 mov byte ptr [CFG_AutomaticBoot],1 940 941 942 IFDEF AUX_DEBUG 1192 ; 1193 1194 1195 ;! 1196 ;! DEBUG_BLOCK 1197 ;! Dump various tables. 1198 ;! Uncomment below to activate. 1199 ;! 1200 IFDEF AUX_DEBUG 943 1201 ;~ call DEBUG_DumpIPT 944 1202 ;~ call DEBUG_DumpPartitionPointers 945 1203 ;~ call DEBUG_DumpPartitionXref 946 1204 ;~ call DEBUG_DumpNewPartTable 947 ENDIF 948 949 1205 ;~ call DEBUG_DumpDriveLetters 1206 ENDIF 1207 1208 1209 ; Because one or more partitions are possibly added, the 1210 ; PartitionXref table is not 'in sync' and could cause the 1211 ; wrong system to be automatically booted. 1212 ; So we rescan all partitions causing the PartitionXref 1213 ; table to be filled with correct values so the auto-boot 1214 ; from the new partition will work correctly. 1215 call PARTSCAN_ScanForPartitions 1216 1217 1218 ;! 1219 ;! DEBUG_BLOCK 1220 ;! Dump various tables. 1221 ;! Uncomment below to activate. 1222 ;! 1223 IFDEF AUX_DEBUG 1224 ;~ call DEBUG_DumpIPT 1225 ;~ call DEBUG_DumpPartitionPointers 1226 ;~ call DEBUG_DumpPartitionXref 1227 ;~ call DEBUG_DumpNewPartTable 1228 ;~ call DEBUG_DumpDriveLetters 1229 ENDIF 1230 1231 ; Setup automatic boot to forgo the Menu. 1232 ; PART_SetupPhase1 has filled in the other variables. 1233 mov byte ptr [CFG_AutomaticBoot],1 1234 1235 ; 1236 ; At this point the AiR-BOOT configuration has been altered 1237 ; to automatically boot the newly installed system without 1238 ; displaying the menu. 1239 ; Code further down the road will take care of that. 1240 ; 950 1241 jmp MBR_Main_ContinueBoot 951 1242 … … 953 1244 954 1245 955 1246 ; 1247 ; Wether a new system is being installed or not, 1248 ; booting continues here. 1249 ; 956 1250 MBR_Main_ContinueBoot: 1251 1252 ; 1253 ; Inform user how to switch between post-screen and menu 1254 ; by putting this info on the screen. 1255 ; 957 1256 xor si,si 958 1257 call MBR_TeletypeNL 959 1258 xor si,si 960 1259 call MBR_TeletypeNL 961 962 963 1260 call MBR_TeletypeSyncPos 964 965 1261 xor si,si 966 1262 call MBR_TeletypeNL 967 1263 call MBR_TeletypeNL 968 969 970 971 1264 mov si, offset ShowMenu 972 1265 call MBR_TeletypeBold 973 1266 974 1267 975 976 977 1268 ; 1269 ; Debug stop. 1270 ; 978 1271 979 1272 ; … … 981 1274 ; 982 1275 983 984 ; Rousseau:985 1276 ; Wait for key so we can see debug log if ab-menu hangs. 986 1277 ;~ xor ax, ax 987 1278 ;~ int 16h 988 989 1279 ;call SOUND_Beep 990 1280 991 ; Rousseau: delayed save of video-page 992 1281 1282 ; Copy BIOS POST to Second Page 993 1283 mov ax, VideoIO_Page1 994 call VideoIO_BackUpTo ; Copy BIOS POST to Second Page1284 call VideoIO_BackUpTo 995 1285 996 1286 ;call SOUND_Beep 997 998 999 ;1000 ; COM-PORT DEBUG1001 ;1002 ;call AuxIO_TeletypeNL1003 ;mov si, offset PartitionTable1004 ;call AuxIO_DumpSector1005 ;call AuxIO_TeletypeNL1006 1287 1007 1288 1008 1289 ; Save configuration so phase1 boot-through is disabled 1009 1290 ; on next boot. 1010 mov byte ptr [eCS_InstallVolume], 0 ; disable phase 1 for next boot1291 mov byte ptr [eCS_InstallVolume], 0 1011 1292 call DriveIO_SaveConfiguration 1012 1293 … … 1014 1295 1015 1296 ; 1016 ; RE-ENTER SETUP1297 ; See if setup needs to be entered. 1017 1298 ; 1018 1299 MBR_Main_ReEnterSetup: 1019 1300 call SETUP_CheckEnterSETUP 1020 1301 1021 ; call SOUND_Beep1022 1023 ; Rousseau: Every time I see "AfterCrap" I have to laugh :-)1302 ; 1303 ; Do some post processing. 1304 ; 1024 1305 call AFTERCRAP_Main 1025 1306 … … 1034 1315 1035 1316 MBR_Main_ReEnterBootMenuPre: 1036 1037 1317 ; SetUp PartitionPointers for BootMenu (filter non-bootable) 1038 1318 call PART_CalculateMenuPartPointers … … 1090 1370 MBR_Main_GotBootMenu: 1091 1371 ; ------------------------------------------ BOOT-MENU VISUALS 1372 1373 1374 IFDEF FX_ENABLED 1092 1375 call FX_StartScreen 1093 1094 ;call SOUND_Beep 1376 ENDIF 1095 1377 1096 1378 call BOOTMENU_BuildBackground 1097 1379 call BOOTMENU_BuildMain 1380 1381 IFDEF FX_ENABLED 1098 1382 call FX_EndScreenRight 1383 ENDIF 1384 1099 1385 call PASSWORD_AskSystemPwd 1100 1386 call BOOTMENU_ResetTimedBoot 1101 1387 1102 ;call SOUND_Beep1103 1104 1388 call BOOTMENU_Execute 1105 1106 ;call SOUND_Beep1107 1389 1108 1390 jc MBR_Main_ReEnterSetup 1109 1391 call BOOTMENU_SetVarsAfterMenu 1110 1392 1111 ;call SOUND_Beep1112 1113 1393 ; ---------------------------------------------------- BOOTING 1114 1394 MBR_Main_NoBootMenu: 1395 1396 IFDEF FX_ENABLED 1115 1397 call FX_StartScreen 1398 ENDIF 1399 1116 1400 call BOOTMENU_BuildGoodBye 1401 1402 IFDEF FX_ENABLED 1117 1403 call FX_EndScreenRight 1404 ENDIF 1405 1118 1406 call PASSWORD_AskChangeBootPwd 1119 1407 … … 1121 1409 ; Debug Code to terminate DOS .COM program - used for 1122 1410 ; testing AiR-BOOT 1411 ; Obsolete. 1123 1412 int 3 1124 1413 mov ax, 6200h … … 1136 1425 mov dl, byte ptr [Menu_EntrySelected] 1137 1426 1427 1428 ; 1429 ; Prepare to start the partition. 1430 ; 1138 1431 jmp MBR_Main_StartPartition 1139 1432 1140 1433 1141 1434 1435 ; ----------------------------------------------------------------------------- 1436 ; START PARTITION 1437 ; ----------------------------------------------------------------------------- 1438 1142 1439 MBR_Main_StartPartition: 1143 1440 1144 IFDEF AUX_DEBUG1441 IFDEF AUX_DEBUG 1145 1442 ;~ call DEBUG_DumpIPT 1146 1443 ;~ call DEBUG_DumpPartitionPointers 1147 1444 ;~ call DEBUG_DumpPartitionXref 1148 1445 ;~ call DEBUG_DumpNewPartTable 1149 ENDIF1446 ENDIF 1150 1447 1151 1448 1152 1449 ; -------------------------------------------- START PARTITION 1450 ; THIS DOES NOT RETURN ! 1153 1451 call PART_StartPartition 1154 1452 1155 1453 1156 1454 1455 1456 ; 1457 ; This entry-point restarts AiR-BOOT almost from scratch. 1458 ; It skips the movement of the MBR but otherwise it is a functional restart. 1459 ; The old BIOS SS:SP where the registers on entry are stored is passed along. 1460 ; 1461 AirbootRestart: 1462 mov bx, [OldSP] ; Old SP when BIOS transferred control to AB 1463 mov dx, [OldSS] ; Old SS when BIOS transferred control to AB 1464 jmp MBR_RealStart 1465 1466 1467 ; 1468 ; This entry-point displays a popup that the system is halted 1469 ; and then halts the system. 1470 ; It is entered on severe error conditions. 1471 ; 1472 HaltSystem: 1473 call VideoIO_ClearScreen 1474 mov ax,0ababh 1475 mov cx, 0C04h 1476 mov si, offset SystemHalted 1477 call SETUP_ShowErrorBox 1478 ; Halt the system. 1479 jmp MBR_HaltSystem 1480 1481 1482 1483 1484 1485 1486 ; 1487 ; The following section includes various assembler 1488 ; modules. These contain functionality for a multitude of 1489 ; categories like disk-access, video-io, lvm, debugging, etc. 1490 ; 1491 1492 1493 ; ----------------------------------------------------------------------------- 1494 ; INCLUDED FILE SECTION 1495 ; ----------------------------------------------------------------------------- 1496 1157 1497 ; 1158 1498 ; Include other code-modules here. 1159 ; Because TASM is a multiple pass assembler, forward references 1160 ; are possible. 1161 ; 1499 ; 1500 1162 1501 b_std_txt: 1163 1502 Include REGULAR/STD_TEXT.ASM ; Standard (non-translateable text) … … 1204 1543 size_main = $-b_main 1205 1544 1206 1207 1208 IFDEF TXT_IncludeCyrillic 1545 b_math: 1546 Include REGULAR/MATH.ASM ; Math functions (like 32-bit multiply) 1547 size_math = $-b_math 1548 1549 b_txtother: 1550 Include TEXT/TXTOTHER.ASM ; All translateable Text-Strings 1551 size_txtother = $-b_txtother 1552 1553 b_txtmenus: 1554 Include TEXT/TXTMENUS.ASM ; All translateable Menu-text 1555 size_txtmenus = $-b_txtmenus 1556 1557 b_charset: 1558 Include TEXT/CHARSET.ASM ; Special Video Charsets (if needed) 1559 size_charset = $-b_charset 1560 1561 b_conv: 1562 Include REGULAR/CONV.ASM ; Various conversion routines 1563 size_conv = $-b_conv 1564 1565 b_virus: 1566 Include SPECIAL/VIRUS.ASM ; Virus Detection / Anti-Virus 1567 size_virus = $-b_virus 1568 1569 ; [Linux support removed since v1.02] 1570 ;Include SPECIAL/FAT16.ASM ; FAT-16 Support 1571 ;Include SPECIAL/LINUX.ASM ; Linux Kernel Support 1572 1573 b_billsuxx: 1574 Include SPECIAL/F00K/BILLSUXX.ASM ; Extended Partition - Microsoft-Hack 1575 size_billsuxx = $-b_billsuxx 1576 1577 b_sound: 1578 Include SPECIAL/SOUND.ASM ; Sound 1579 size_sound = $-b_sound 1580 1581 b_apm: 1582 Include SPECIAL/APM.ASM ; Power Managment Support 1583 size_apm = $-b_apm 1584 1585 1586 1587 ; 1588 ; Cyrillic support. 1589 ; 1590 IFDEF TXT_IncludeCyrillic 1209 1591 b_ccharset: 1210 1592 Include SPECIAL/CHARSET.ASM ; Charset Support (e.g. Cyrillic) … … 1212 1594 ENDIF 1213 1595 1214 1215 b_math:1216 Include REGULAR/MATH.ASM ; Math functions (like 32-bit multiply)1217 size_math = $-b_math1218 1219 1220 1221 1222 1596 ; Various debugging routines, uses AUXIO and CONV 1223 IFDEF AUX_DEBUG1597 IFDEF AUX_DEBUG 1224 1598 b_debug: 1225 1599 Include REGULAR/DEBUG.ASM ; Debug module … … 1230 1604 ENDIF 1231 1605 1232 1233 1234 1235 ;============================================================================== 1236 1237 ; 1238 ; Moved up. 1239 ; 1240 1241 ; 1242 ; This is the AiR-BOOT MBR-Protection Image. 1243 ; 04600 / 200h = 23h = 35d sectors are before this point. 1244 ; The stuff generated here gets overwritten when the 1245 ; MBR_PROT.ASM module, which is assembled separately, 1246 ; gets merged. 1247 ; So you won't find the string below in the generated binary. 1248 ; 1249 ; MOVED TO 6800h to create space and have a continuous 1250 ; code block. 1251 ; This makes the RU version buildable again with Tasm. 1252 ; 1253 ;org 04600h ; Sector 36-37 1254 1255 1256 ; Rousseau: It needed a sector alignment, so moved it up to 1257 ; have as much space as possible for the modules 1258 ; included here. 1259 1260 1261 ;============================================================================== 1262 ; Sector 38-x 1263 ; 1264 ; This section contains translatable texts. 1265 ; 1266 ;org 04A00h 1267 1268 1269 b_txtother: 1270 Include TEXT/TXTOTHER.ASM ; All translateable Text-Strings 1271 size_txtother = $-b_txtother 1272 1273 b_txtmenus: 1274 Include TEXT/TXTMENUS.ASM ; All translateable Menu-text 1275 size_txtmenus = $-b_txtmenus 1276 1277 b_charset: 1278 Include TEXT/CHARSET.ASM ; Special Video Charsets (if needed) 1279 size_charset = $-b_charset 1280 1281 b_conv: 1282 Include REGULAR/CONV.ASM ; Various conversion routines 1283 size_conv = $-b_conv 1284 1285 b_virus: 1286 Include SPECIAL/VIRUS.ASM ; Virus Detection / Anti-Virus 1287 size_virus = $-b_virus 1288 ; [Linux support removed since v1.02] 1289 ;Include SPECIAL/FAT16.ASM ; FAT-16 Support 1290 ;Include SPECIAL/LINUX.ASM ; Linux Kernel Support 1291 b_billsuxx: 1292 Include SPECIAL/F00K/BILLSUXX.ASM ; Extended Partition - Microsoft-Hack 1293 size_billsuxx = $-b_billsuxx 1294 1295 1296 1297 ; 1298 ; Critical end of code marker. 1299 ; Should always be in the image, otherwise something 1300 ; is very wrong. 1301 ; 1302 db 'DEAD' 1303 db 'FACE' 1304 1305 ; 1306 ; Keep these modules here at the end of the code section. 1307 ; When debugging, extra code space is used and code will move up towards 1308 ; the protection image that is 'orged' and will thus overlay. 1309 ; The effects are turned off in debug mode, so it does not matter much that 1310 ; this code get's lost. 1311 ; 1312 b_sound: 1313 Include SPECIAL/SOUND.ASM ; Sound 1314 size_sound = $-b_sound 1315 1316 b_apm: 1317 Include SPECIAL/APM.ASM ; Power Managment Support 1318 size_apm = $-b_apm 1319 1606 ; 1607 ; We only include this if FX_ENABLED is defined. 1608 ; FX is disabled when debugging to have more room for debug-code. 1609 ; The module compiles to 50eh = 1294 bytes, so that is a lot. 1610 ; 1611 IFDEF FX_ENABLED 1320 1612 b_fx: 1321 1613 Include SPECIAL/FX.ASM ; l33t Cooper-Bars/Scrolling <bg> 1322 1614 size_fx = $-b_fx 1323 1324 1325 ; If we are debugging, we overwrite the FX code.1326 ; As long as FX is disabled this will do no harm.1327 IFDEF AUX_DEBUG1328 ORG 06780h1329 1615 ENDIF 1616 1617 1618 ; 1619 ; End of code marker. 1620 ; 1621 db 'BABE' 1622 db 'FACE' 1623 1624 1625 ; ----------------------------------------------------------------------------- 1626 ; END OF CODE 1627 ; ----------------------------------------------------------------------------- 1628 code_end: 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 ; ----------------------------------------------------------------------------- 1640 ; BLDLEVEL INFORMATION 1641 ; ----------------------------------------------------------------------------- 1642 1643 ORIGIN 068A0h 1644 1645 ; 1646 ; The space between this offset and code_end is the space 1647 ; available for code. 1648 ; 1649 zzz_code_space = $ - code_end 1330 1650 1331 1651 … … 1334 1654 ; Here we insert the OS/2 BLDLEVEL Information. 1335 1655 ; It is composed of the AiR-BOOT version-info and other 1336 ; information. 1337 ; It is unique for each release of AiR-BOOT. 1656 ; information. It is unique for each release of AiR-BOOT. 1657 ; 1658 1338 1659 ; 1339 1660 ; ?? When AUX_DEBUG is enabled and the above org is active, … … 1346 1667 InsertBuildLevel 1347 1668 1348 ;bliep <> 1349 1350 ; 1351 ; End of code marker. 1352 ; If this one vanishes in the image, the FX code will not 1353 ; be operational. 1354 ; Will happen with debugging enabled. 1355 ; 1356 db 'BABE' 1357 db 'FACE' 1358 1359 code_end: 1360 1361 1362 ; 1363 ; AiR-BOOT Protection Image. 1364 ; Moved from below to have it not break the included modules 1365 ; with it's sector alignment requirement. 1366 ; 1367 ORIGIN 06800h 1368 1369 zzz_code_space = $ - code_end 1669 1670 1671 1672 1673 ;============================================================================== 1674 ; Sector 53 1675 ;============================================================================== 1676 1677 ; 1678 ; From here on, the layout of the image consists of: 1679 ; - AiR-BOOT Protection Image 1680 ; - AiR-BOOT Configuration 1681 ; - DriveLetters 1682 ; - Install Volume 1683 ; - Floppy/CDROM/BIOS BOOT ENTRIES 1684 ; - Internal Partition Table (IPT) 1685 ; - Hidden Partition Table (HPT) 1686 ; - MBR Backup 1687 ; 1688 1689 ; 1690 ; After that, the BSS follows with several runtime 1691 ; variables and structures. 1692 ; The BSS is not part of the image on disk of course. 1693 ; 1694 1695 ; ----------------------------------------------------------------------------- 1696 ; PROTECTION IMAGE 1697 ; ----------------------------------------------------------------------------- 1698 1370 1699 ; 1371 1700 ; This is the AiR-BOOT MBR-Protection Image. 1372 ; 06800 / 200h = 34h = 52d sectors are before this point.1373 1701 ; The stuff generated here gets overwritten when the 1374 ; MBR_PROT .ASMmodule, which is assembled separately,1375 ; gets merged.1702 ; MBR_PROT module, which is assembled separately, 1703 ; gets binary merged. 1376 1704 ; So you won't find the string below in the generated binary. 1377 1705 ; 1378 1379 ; 06800-068FF 1380 ; 06900-069FF 1381 ; 06A00-06AFF 1382 ; 06B00-06BFF 1383 1384 ; 1385 ; Hardcoded to 1k (1024 bytes) (MBR_PROT.ASM) 1706 ORIGIN 06900h 1707 1708 1709 1710 1711 ; 1712 ; Hardcoded to 768 bytes (MBR_PROT.ASM) 1386 1713 ; The string below is searched for by the FIXCODE helper and *must* be 1387 ; sector (512-bytes) aligned. 1714 ; page (256 bytes) aligned. 1715 ; 1716 ; It seems to be possible to shrink the protection-image to 768 bytes. 1717 ; That gives us an additional 256 bytes of code-space. 1718 ; MBR-PROT.ASM,FIXCODE.C,PARTMAIN.ASM and AIR-BOOT.ASM need to be adjusted for that. 1719 ; Also the granularity needs to change from 512 bytes to 256 bytes since 1720 ; 6900h is not a 512-byte boundary. 1721 ; 1722 ; 20120908 - Done. 1388 1723 ; 1389 1724 MBR_Protection db 'AiR-BOOT MBR-Protection Image' 1390 1725 1391 1726 ; Just fill. 1392 db 1024-($-MBR_Protection) dup('M') 1727 ;~ db 1024-($-MBR_Protection) dup('M') 1728 db 768-($-MBR_Protection) dup('M') 1729 1730 1731 1732 1733 1393 1734 1394 1735 1395 1736 ;============================================================================== 1396 ; Sector 55 1737 ; Sector 55 1738 ;============================================================================== 1739 ; ----------------------------------------------------------------------------- 1740 ; AiR-BOOT CONFIGURATION 1741 ; ----------------------------------------------------------------------------- 1397 1742 1398 1743 ; … … 1412 1757 ; AiR-BOOT will not function because it cannot 1413 1758 ; find the config-signature which includes this 1414 ; invisible character. The code of the char is: 0 x0ad.1759 ; invisible character. The code of the char is: 0adh. 1415 1760 db 'AiRCFG-TABLE' 1416 1761 db 01h, 08h, 'U' ; "Compressed" ID String … … 1438 1783 1439 1784 CFG_Partitions db 0 ; Count of partitions in IPT 1440 db 0 ; Was BootParts - Removed since v0.28b 1785 CFG_MiscFlags db 1 ; Miscellaneous Flags (See EQUates) 1441 1786 CFG_PartDefault db 0 ; Default-Partition (Base=0) 1442 1787 … … 1478 1823 CFG_MakeSound db 0 ; Should be clear ;) 1479 1824 CFG_FloppyBootGetTimer db 0 ; Floppy Name will get updated every 2 secs 1480 CFG_ResumeBIOSbootSeq db 0; If BIOS Boot Sequence should be resumed1825 CFG_ResumeBIOSbootSeq db 1 ; If BIOS Boot Sequence should be resumed 1481 1826 ; 0 - Disabled 1482 1827 ; 1 - CD-ROM … … 1506 1851 1507 1852 1853 ; ----------------------------------------------------------------------------- 1854 ; DRIVE LETTERS 1855 ; ----------------------------------------------------------------------------- 1856 1508 1857 ; 1509 1858 ; Moved here to make room for packed hiddenparttable. 1859 ; This gets filled when drive-letters that are assigned using the dl-feature. 1510 1860 ; 1511 1861 DriveLetters db LocIPT_MaxPartitions dup (0) … … 1514 1864 ; Drive-Letter : BYTE (80h-C:, 81h-D:) 1515 1865 ; --------------------> 1 Byte * 45 1866 1867 1868 1869 ; ----------------------------------------------------------------------------- 1870 ; INSTALL VOLUME 1871 ; ----------------------------------------------------------------------------- 1516 1872 1517 1873 ; … … 1530 1886 ;eCS_InstallVolume db 'ECS-HIGH',0,0,0,0 1531 1887 ;eCS_InstallVolume db 'ECS-HIGH',0,'NO',0 1532 eCS_InstallVolume db 'KANWEG2',01533 ;eCS_InstallVolume db 0,'NOPHASEONE' ,01888 ;eCS_InstallVolume db 'KANWEG2',0 1889 eCS_InstallVolume db 0,'NOPHASEONE' ,0 1534 1890 1535 1891 ; 1536 1892 ; THERE IS ROOM RESERVED HERE FOR MORE VARIABLES 1537 1893 ; 1894 1895 1896 ; ----------------------------------------------------------------------------- 1897 ; FLOPPY/CDROM/BIOS BOOT ENTRIES 1898 ; ----------------------------------------------------------------------------- 1538 1899 1539 1900 ; … … 1584 1945 db 0, 1, 0 ; Location of Partition/Boot Record 1585 1946 dd 0, 0 1586 ;------------------------------------------------------------------------------ 1587 1588 ;org 06E00h ; Sector 56-57 1947 1948 1949 1950 ; ----------------------------------------------------------------------------- 1951 ; INTERNAL PARTITION TABLE (IPT) 1952 ; ----------------------------------------------------------------------------- 1589 1953 1590 1954 ; … … 1597 1961 ; Rousseau: This is the start of the AiR-BOOT IPT 1598 1962 ; 1599 1600 1601 1963 PartitionTable db (LocIPT_MaxPartitions * LocIPT_LenOfIPT) dup (0) 1602 1964 ; no-partitions detected... :] … … 1632 1994 1633 1995 1634 ;------------------------------------------------------------------------------ 1635 ;org 07400h ; Sector 58 1636 1996 1997 ; ----------------------------------------------------------------------------- 1998 ; HIDDEN PARTITION TABLE (HPT) 1999 ; ----------------------------------------------------------------------------- 1637 2000 1638 2001 ; … … 1665 2028 1666 2029 1667 ;------------------------------------------------------------------------------ 1668 ;org 07A00h 1669 ; Sector 60 2030 ;============================================================================== 2031 ; Sector 62 2032 ;============================================================================== 2033 ; ----------------------------------------------------------------------------- 2034 ; MBR BACKUP 2035 ; ----------------------------------------------------------------------------- 1670 2036 1671 2037 ; … … 1693 2059 1694 2060 2061 2062 ; 2063 ; Terminate LDRIMAGE segment. 2064 ; 1695 2065 IFDEF SEGMENTED 1696 ;1697 ; End of AiR-BOOT code and data.1698 ;1699 1700 2066 LDRIMAGE ENDS 1701 1702 ;DATA_SEG ENDS 1703 1704 ; 1705 ; Uninitialized Data (BSS) 1706 ; 2067 ENDIF 2068 2069 2070 2071 2072 2073 2074 2075 ;############################################################################## 2076 ; BSS SEGMENT 2077 ;############################################################################## 2078 2079 2080 2081 ; 2082 ; Open BSS segment. 2083 ; 2084 IFDEF SEGMENTED 1707 2085 VOLATILE SEGMENT USE16 PUBLIC 'BSS' 1708 1709 2086 ENDIF 1710 2087 … … 1739 2116 1740 2117 2118 ; ----------------------------------------------------------------------------- 2119 ; START OF BSS DATA 2120 ; ----------------------------------------------------------------------------- 2121 1741 2122 ; This space actually gets initialized in PreCrap to NUL (till EndOfVariables) 1742 2123 BeginOfVariables: 2124 2125 2126 ; ----------------------------------------------------------------------------- 2127 ; SECTOR BUFFERS 2128 ; ----------------------------------------------------------------------------- 1743 2129 PartitionSector db 512 dup (?) ; Temporary Sector for Partition 1744 JfsPBR db 512 dup (?) ; Temporary Sector for JFS PBRwriteback2130 PBRSector db 512 dup (?) ; Temporary Sector for JFS/HPFS writeback 1745 2131 LVMSector db 512 dup (?) ; Temporary Sector for LVM 1746 2132 TmpSector db 512 dup (?) ; Temporary Sector 1747 2133 Scratch db 256 dup (?) ; Scratch buffer 1748 2134 2135 ; ----------------------------------------------------------------------------- 2136 ; NEW PARTITION TABLE 2137 ; ----------------------------------------------------------------------------- 1749 2138 ; Everything used to build a new IPT and reference it to the old one 1750 ; IETS OVERSCHRIJFT DIT !!1751 2139 NewPartTable db 1536 dup (?) ; New Partition Table 1752 2140 2141 2142 ; ----------------------------------------------------------------------------- 2143 ; NEW HIDE PARTITION TABLE 2144 ; ----------------------------------------------------------------------------- 1753 2145 ; New Hide-Partition Table 1754 NewHidePartTable db partition_count * LocHPT_LenOfHPT dup (?) 1755 2146 NewHidePartTable db LocIPT_MaxPartitions * LocHPT_LenOfHPT dup (?) 2147 2148 ;~ even 2149 2150 ; ----------------------------------------------------------------------------- 2151 ; NEW DRIVE LETTERS 2152 ; ----------------------------------------------------------------------------- 1756 2153 ; Logical Drive-Letters 1757 NewDriveLetters db partition_count dup (?) 1758 2154 NewDriveLetters db LocIPT_MaxPartitions dup (?) 2155 2156 ;~ even 2157 2158 ; ----------------------------------------------------------------------------- 2159 ; PARTITION SIZE TABLE 2160 ; ----------------------------------------------------------------------------- 1759 2161 ; Size-Table (6 bytes per partition) 1760 PartitionSizeTable db partition_count * 6 dup (?) 1761 2162 PartitionSizeTable db LocIPT_MaxPartitions * 6 dup (?) 2163 2164 2165 ; ----------------------------------------------------------------------------- 2166 ; PARTITION POINTERS 2167 ; ----------------------------------------------------------------------------- 1762 2168 ; Maximum is 52 word entries till now 1763 2169 PartitionPointers dw 52 dup (?) … … 1766 2172 PartitionPointerCount db ? 1767 2173 2174 ; ----------------------------------------------------------------------------- 2175 ; XREF TABLE 2176 ; ----------------------------------------------------------------------------- 2177 1768 2178 ; X-Reference Table (holds new partnr, index is old part nr) 1769 PartitionXref db partition_count dup (?) 2179 PartitionXref db LocIPT_MaxPartitions dup (?) 2180 2181 ; ----------------------------------------------------------------------------- 2182 ; VOLUME LETTERS 2183 ; ----------------------------------------------------------------------------- 1770 2184 1771 2185 ; Volume-Letters … … 1773 2187 ; 1 - LVM support, but no letter 1774 2188 ; 'C'-'Z' - assigned drive letter 1775 PartitionVolumeLetters db partition_count dup (?) 1776 1777 1778 1779 2189 PartitionVolumeLetters db LocIPT_MaxPartitions dup (?) 2190 2191 2192 2193 ; ----------------------------------------------------------------------------- 2194 ; MISC VARS AND FLAGS 2195 ; ----------------------------------------------------------------------------- 1780 2196 TotalHarddiscs db ? ; Total harddrives (by POST) 1781 2197 LBASwitchTable db 128 dup (?) ; Bit 25-18 for CHS/LBA Switching … … 1798 2214 ;GotLinux db ? ; 1-Linux found 1799 2215 2216 2217 ; ----------------------------------------------------------------------------- 2218 ; MENU RELATED VARS 2219 ; ----------------------------------------------------------------------------- 1800 2220 Menu_EntrySelected db ? ; Which partition we boot this time... 1801 2221 Menu_UpperPart db ? ; Which number (Base=0) is the partition upper pos … … 1808 2228 ; - All adjusted to menu locations 1809 2229 2230 ; ----------------------------------------------------------------------------- 2231 ; PARTITION RELATED VARS 2232 ; ----------------------------------------------------------------------------- 1810 2233 PartSetup_UpperPart db ? ; Partition-Setup (like Menu_UpperPart) 1811 2234 PartSetup_ActivePart db ? ; Active Partition … … 1814 2237 PartSetup_HiddenAdd db ? ; Adjust for Hidden-Setup 1815 2238 2239 ; ----------------------------------------------------------------------------- 2240 ; TIMER / SETUP RELATED VARS 2241 ; ----------------------------------------------------------------------------- 1816 2242 TimedBootEnable db ? ; Local Enable/Disable for timed boot 1817 2243 TimedTimeOut dd ? ; TimeOut Timer for TimedBoot (too much time here;) … … 1830 2256 SyncLvmLabels db ? ; Sync LVM labels after user-edit ? 1831 2257 2258 2259 ; ----------------------------------------------------------------------------- 2260 ; FX RELATED VARS 2261 ; ----------------------------------------------------------------------------- 1832 2262 FX_UseCount dw ? 1833 2263 FX_OverallTimer dw ? … … 1840 2270 FX_WideScrollerBounceSpeed db ? 1841 2271 FX_CooperBarsTimer dw ? 2272 2273 ; Dynamically Generated Tables - do not need to get initialized with NUL 2274 FX_CooperColors db 672 dup (?) ; 7 cooper bars*96 - runtime calculated 2275 FX_CooperState db 7 dup (?) 2276 FX_SinusPos db 7 dup (?) 2277 FX_CooperPos dw 7 dup (?) 2278 2279 2280 ; ----------------------------------------------------------------------------- 2281 ; CHARSET BUFFER 2282 ; ----------------------------------------------------------------------------- 2283 CharsetTempBuffer db 4096 dup (?) ; Uninitialized Charset buffer 2284 2285 ; ----------------------------------------------------------------------------- 2286 ; LVM CRC TABLE 2287 ; ----------------------------------------------------------------------------- 2288 LVM_CRCTable dd 256 dup (?) ; LVM-CRC (->SPECiAL\LVM.asm) 1842 2289 1843 2290 ;~ ; [Linux support removed since v1.02] … … 1856 2303 ;~ LINUX_KernelSizeTable db 120 dup (?) ; Size-Table (6 bytes per kernel) 1857 2304 1858 ; Dynamically Generated Tables - do not need to get initialized with NUL1859 FX_CooperColors db 672 dup (?) ; 7 cooper bars*96 - runtime calculated1860 FX_CooperState db 7 dup (?)1861 FX_SinusPos db 7 dup (?)1862 FX_CooperPos dw 7 dup (?)1863 CharsetTempBuffer db 4096 dup (?) ; Uninitialized Charset buffer1864 LVM_CRCTable dd 256 dup (?) ; LVM-CRC (->SPECiAL\LVM.asm)1865 1866 1867 1868 2305 1869 2306 ; 1870 2307 ; Rousseau: added some stuff. 1871 2308 ; 1872 2309 ; ----------------------------------------------------------------------------- 2310 ; ECS PHASE1 RELATED 2311 ; ----------------------------------------------------------------------------- 1873 2312 Phase1Active db ? 1874 2313 OldPartitionCount db ? 1875 2314 2315 2316 ; ----------------------------------------------------------------------------- 2317 ; DISK PARAMETERS 2318 ; ----------------------------------------------------------------------------- 1876 2319 ;EVEN 1877 2320 HugeDisk db MaxDisks dup(?) … … 1903 2346 LOG_TotalSecs dq MaxDisks dup(?) 1904 2347 1905 ; End of transient variables. 1906 EndOfVariables: 1907 1908 2348 ; Get's initialized at startup to: 00000011111111111111111111111100b 2349 ; Meaning A,B not free; C-Z free, rest unused. (right to left) 2350 ; Each partition with an assigned drive-letter clears a bit in this map. 2351 FreeDriveletterMap dd ? 2352 2353 ; LBA address of master LVM sector, zero if non-existant 2354 MasterLVMLBA dd ? 2355 2356 2357 ; ----------------------------------------------------------------------------- 2358 ; I13X BUFFER 2359 ; ----------------------------------------------------------------------------- 1909 2360 ; 1910 2361 ; Temporary buffer for 48h INT13X bios call. … … 1926 2377 ott db 512 dup(?) 1927 2378 2379 2380 ; End of transient variables. 2381 EndOfVariables: 2382 2383 2384 2385 2386 ; ----------------------------------------------------------------------------- 2387 ; OLD AND NEW STACKS 2388 ; ----------------------------------------------------------------------------- 2389 2390 ; 2391 ; These need to be outside the variable section because AiR-BOOT can restart 2392 ; itself in debug-mode. If the OldSP and OldSS would be in the variable area, 2393 ; they would be cleared on AiR-BOOT restart. 2394 ; 2395 2396 ; The variable section is cleared word-wise, so it could clear one byte extra 2397 ; depending on the alignment and size. This DD prevents the OldSP and OldSS 2398 ; to be partly overwritten by the clearing routine. 2399 dd ? 2400 2401 ; SS:SP from before our relocation. 2402 ; The registers values when the BIOS transferred control to us were pushed 2403 ; on this stack. 2404 2405 OldSP dw ? 2406 OldSS dw ? 2407 2408 ; SS:SP currently in use. 2409 ; They are temporarily dumped here so we can pop the resgisters from 2410 ; the old stack to display them in debug mode. 2411 CurrentSP dw ? 2412 CurrentSS dw ? 2413 2414 2415 2416 ; 2417 ; End of BSS segment. 2418 ; 1928 2419 eobss: 1929 2420 2421 ; 2422 ; Close BSS segment. 2423 ; 1930 2424 IFDEF SEGMENTED 1931 2425 VOLATILE ENDS -
trunk/BOOTCODE/AIR-BOOT.HIS
r50 r51 21 21 22 22 23 ; --------------------------------- 24 ; Rousseau: Fixes and Enhancements25 ; --------------------------------- 26 ; 27 ; v1.0.8-rc3-bld20120 5nn23 ; ------------------------------------------------ 24 ; Rousseau: Fixes, Enhancements and fresh bugs :-) 25 ; ------------------------------------------------ 26 ; 27 ; v1.0.8-rc3-bld20120909 28 28 ; ---------------------- 29 ; # Added Show LVM Drive Letters in SETUP/BASIC # 30 ; This will toggle the display of LVM drive-letters in the main menu. 31 ; By default this option is enabled. 32 ; 33 ; # Reduced MBR Protection Image from 1024 bytes to 768 bytes # 34 ; The fight for code-space continues... 35 ; Luckily the MBR Protection Image code does not exceed 768 bytes, 36 ; so that gives us another 256 bytes of precious code-space. 37 ; Now the non-EN versions are happy again. 38 ; Note that the alignment for the image changed from 512 to 256 bytes. 39 ; MBR-PROT.ASM, FIXCODE.C, PARTMAIN.ASM and AIR-BOOT.ASM have been 40 ; adjusted for this change. 41 ; 42 ; # Updating from v1.06 now also copies over drive-letters # 43 ; When the user has forced drive-letters in v1.06 these will be copied over 44 ; to the v1.0.8 configuration when upgrading. 45 ; Because the drive-letter feature is broken in v1.07, the drive-letter 46 ; table does not get copied over when upgrading from v1.07. 47 ; 48 ; # Fixed a minor bug with displaying LVM drive-letters # 49 ; When more partitions that can be displayed were present, scrolling the 50 ; menu would not scroll the drive-letter. Fixed. 51 ; 52 ; # Added DOCU directory for documentation # 53 ; This contains the AiR-BOOT User Manual in Open Office .odt-format. 54 ; To also have OS/2 INF format, a transformation script and sheet have been 55 ; created to convert the .odt document to an ipf-source that can be compiled 56 ; with Watcoms wipfc ipf compiler. (IBM ipfc does not work correctly) 57 ; This makes it possible to write documentation in OOo Writer and export that 58 ; to PDF and INF format. 59 ; 60 ; # Fixed a bug with regard to the drive-letter feature # 61 ; When partitions were deleted, and some partitions above the deleted 62 ; partition(s) had a drive-letter forced, these partitions would lose this 63 ; assignment. This bug is also present in v1.06. 64 ; 65 ; # Implemented a very simple interactive debugger # 66 ; Making use of the main menu-loop, pressing a digit or a letter activates 67 ; some debugging routine. Mostly such a routine dumps a part of the internal 68 ; state to the com-port. Other purposes are the interrogation of certain 69 ; BIOS functions, as these can differ substantially between machines. 70 ; 71 ; # Made FX-code optional to compile in # 72 ; The FX-code supplies the shifting screen-effects when 'Cooper Bars' is 73 ; enabled in the setup. With the current enhancements made however, 74 ; there is a continuous lack of code-space, especially when debug-code is 75 ; included during development. The FX-code occupies some 1200 bytes, a space 76 ; that can be put to better use. Therefore inclusion the FX-code has been 77 ; made conditional to make room for either debugging or future new features. 78 ; 79 ; # Also write PBR to HPFS # 80 ; Earlier, a fix was made to write a modified PBR back in case JFS was used. 81 ; This was done to enable the drive-letter feature on JFS, since the PBR 82 ; JFS-bootcode does not use the supplied PBR in memory. 83 ; With the enhancements in the drive-letter feature, the HPFS PBR needs to 84 ; be updated on disk also, to cope with zero drive-letters in the HPFS PBR. 85 ; 86 ; # Added drive-letters in display for LVM volumes # 87 ; A populair request was to show drive-letter information in the menu. 88 ; Drive-letters however, are OS specific and AiR-BOOT cannot accurately 89 ; predict what drive-letter DOS would assign to what partition. 90 ; eCS LVM drive-letters however are stored in the LVM-record and can thus 91 ; be displayed. This has been implemented. 92 ; 93 ; # Enhanced drive-letter feature # 94 ; Enable multiple eComStation installations using the same drive-letter 95 ; This makes it possible to clone a system with XCOPY /h /e /s /t /r /v 96 ; to another drive and have that boot from the same drive-letter. 97 ; (Or installing to the same drive by hiding the other system) 98 ; 29 99 ; # Removed Force LBA Usage from Setup # 30 100 ; When AiR-BOOT is installed on an USB-stick, there is a possibility that 31 101 ; the CHS-geometry varies between different machines where the stick is 32 ; booted. This would invalidate any CHS-values that were stored in the IPT. 102 ; booted. This would invalidate the CHS-values in the partition table 103 ; and also the values that were stored in the AiR-BOOT's internal partition 104 ; table, the IPT. 33 105 ; To prevent more nasty things like below from happening, LBA-addressing 34 ; is now always used. 106 ; is now always used and the setting has been removed from the setup-menu. 107 ; While this may prevent AiR-BOOT from running on very old systems, 108 ; the focus of AiR-BOOT development is geared towards the future. 109 ; Such old systems can use v1.06. 110 ; 111 ; # Added extra MBR protection # 112 ; When AiR-BOOT is active, it is only AiR-BOOT that writes to the MBR. 113 ; To protect the MBR from programming errors, like the one below, 114 ; any write to the MBR is now checked for validity. 115 ; In essence this is protecting your MBR from bad programming done by me... 35 116 ; 36 117 ;!## Fixed a very very nasty bug that can destroy the MBR on multiple disks ##! … … 48 129 ; would be auto-booted instead of the newly installed system. 49 130 ; This has been fixed. 50 ; This bug is also present in v1.07 .131 ; This bug is also present in v1.07 and does not apply to previous versions. 51 132 ; 52 133 ; v1.0.8-rc2-bld20120423 -
trunk/BOOTCODE/BLDLEVEL.INC
r47 r51 1 ; 2 ; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz 3 ; 4 ; This file is part of AiR-BOOT 5 ; 6 ; AiR-BOOT is free software: you can redistribute it and/or modify it under 7 ; the terms of the GNU General Public License as published by the Free 8 ; Software Foundation, either version 3 of the License, or (at your option) 9 ; any later version. 10 ; 11 ; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY 12 ; WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS 13 ; FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 ; details. 15 ; 16 ; You should have received a copy of the GNU General Public License along with 17 ; AiR-BOOT. If not, see <http://www.gnu.org/licenses/>. 18 ; 19 20 21 22 1 23 ; 2 24 ; OS/2 BLDLEVEL Information. … … 32 54 BLDLVL_MINUTES EQU (AB_MINUTES SHR 4)+'0',(AB_MINUTES AND 0Fh)+'0' 33 55 BLDLVL_SECONDS EQU (AB_SECONDS SHR 4)+'0',(AB_SECONDS AND 0Fh)+'0' 34 ; Build machine 56 ; Build machine (16 chars max ?) 35 57 ;BLDLVL_MACHINE EQU 'ecs-devbox' 36 58 BLDLVL_MACHINE EQU '*UNKNOWN*' … … 75 97 ;~ db BLDLVL_MACHINE 76 98 ;~ db '::' 77 ;~ ; Wasm can only process the reference to 'lang' in pass 2 because it comes78 ;~ ; from an included file which it has not processed yet at pass 1.99 ;~ ; Wasm can only process the reference to 'lang' in pass 2 because it 100 ;~ ;comes from an included file which it has not processed yet at pass 1. 79 101 ;~ IFDEF WASM 80 102 ;~ IF2 -
trunk/BOOTCODE/MBR-PROT/MBR-PROT.ASM
r46 r51 179 179 xxx: 180 180 181 org 1023 182 db 0 181 ;~ org 1019 182 org 763 183 184 ; 185 ; MBR-PROT signature at end. 186 ; 187 db 'MBRPI' 183 188 184 189 CODE_SEG ENDS -
trunk/BOOTCODE/MBR-PROT/Makefile
r46 r51 54 54 # 55 55 # This is a list of the Targets to be built. 56 # For MBR_PROT there is only one real target: MBR _PROT.BIN.56 # For MBR_PROT there is only one real target: MBR-PROT.BIN. 57 57 # 58 58 TARGET=$(MODULE).BIN … … 63 63 #ASM=masm 64 64 #ASM=alp 65 ASM=tasm65 #ASM=tasm 66 66 #ASM=wasm 67 #ASM=jwasm67 ASM=jwasm 68 68 69 69 # -
trunk/BOOTCODE/Makefile
r49 r51 395 395 # This gives problems when building in an OS/2 DOS-Box on a (samba) network 396 396 # share with a case-sensitive file-system where also a Linux build-environment 397 # is active. The Linux build-environment iswill not find the lowercase files.397 # is active. The Linux build-environment will not find the lowercase files. 398 398 # For example, a clean from Linux will not work properly in that case. 399 399 # This does not influence building DOS targets on Linux. 400 400 # It can be circumvented by using a case-insensitive file-system for the 401 401 # network share, like OS/2 JFS for instance. 402 # Linux can use OS/2 JFS and will recognizeit's case insensitivity.402 # Linux can use OS/2 JFS and will honor it's case insensitivity. 403 403 # Or you could loop-mount the samba share either with the usual cifs tools 404 404 # or fuse-smb. … … 513 513 $(ASM) $(ASM_FLAGS) $(BASENAME).ASM 514 514 !ifndef __MSDOS__ 515 @wdis -fi $^. > $^..WDA 516 !endif 515 517 @wdis -a -p -fi $^. > $^&.WDA 516 !endif517 @wdis -fi $^. > $^..WDA518 518 519 519 … … 544 544 @echo. 545 545 @bldlevel $(TARGET) 546 !endif 547 !ifdef __LINUX__ 548 @echo. 549 @if exist AIR-BOOT.LST @grep ^zzz_code_space AIR-BOOT.LST 550 @echo. 546 551 !endif 547 552 -
trunk/BOOTCODE/REGULAR/AUXIO.ASM
r46 r51 29 29 ; High byte is initialization; see below. (0e3h) 30 30 31 IFDEF ModuleNames31 IFDEF MODULE_NAMES 32 32 DB 'AUXIO',0 33 33 ENDIF … … 93 93 94 94 ; Copy assembler specification. 95 IFDEFJWASM95 IFDEF JWASM 96 96 mov al,'[' 97 97 stosb 98 98 mov si,offset jwasm_txt 99 ENDIF 100 IFDEF TASM 99 ELSEIFDEF TASM 101 100 mov al,' ' 102 101 stosb … … 104 103 stosb 105 104 mov si,offset tasm_txt 106 ENDIF 107 IFDEF WASM105 106 ELSEIFDEF WASM 108 107 mov al,' ' 109 108 stosb … … 111 110 stosb 112 111 mov si,offset wasm_txt 113 ENDIF 114 IFDEF MASM 112 ELSEIFDEF MASM 115 113 mov al,' ' 116 114 stosb … … 118 116 stosb 119 117 mov si,offset masm_txt 120 ELSE118 ELSE 121 119 mov al,' ' 122 120 stosb … … 124 122 stosb 125 123 mov si,offset unknown_txt 126 ENDIF 124 ENDIF 125 127 126 AuxIO_PrintBuildInfo_a1: 128 127 lodsb … … 143 142 call AuxIO_Print 144 143 call AuxIO_TeletypeNL 144 145 ; OS/2 BLDLEVEL information. 146 mov si, offset bld_level 147 call AuxIO_Print 148 call AuxIO_TeletypeNL 149 145 150 ret 146 151 AuxIO_PrintBuildInfo EndP … … 149 154 ; Print char to com-port (teletype style) 150 155 AuxIO_Teletype Proc Near Uses ax dx 156 157 158 ;~ pusha 159 ;~ xor dx,dx 160 ;~ mov ah,03h 161 ;~ mov al,00h 162 ;~ int 14h 163 ;~ mov ah,al 164 ;~ shr al,4 165 ;~ and al,0fh 166 ;~ add al,'0' 167 ;~ cmp al,'9' 168 ;~ jbe @F 169 ;~ add al,7 170 ;~ @@: push ax 171 ;~ xor dx,dx 172 ;~ mov ah,01h 173 ;~ int 14h 174 ;~ pop ax 175 ;~ mov al,ah 176 ;~ and al,0fh 177 ;~ add al,'0' 178 ;~ cmp al,'9' 179 ;~ jbe @F 180 ;~ add al,7 181 ;~ @@: xor dx,dx 182 ;~ mov ah,01h 183 ;~ int 14h 184 ;~ popa 185 186 ;~ pusha 187 ;~ @@: 188 ;~ xor dx,dx 189 ;~ mov ah,03h 190 ;~ mov al,00h 191 ;~ int 14h 192 ;~ and al,20h 193 ;~ cmp al,20h 194 ;~ jnz @B 195 ;~ popa 196 197 151 198 mov dx,[BIOS_AuxParms] ; get port and parameters 152 199 xor dh,dh ; we don't need the parameters … … 170 217 171 218 219 ; Print Bin-byte to com-port (teletype style) 220 ; This outputs 8 characters ('0' or '1' for each bit) 221 ; In: AL - byte to send 222 ; Out: AL - byte sent 223 ; Destroyed: None 224 AuxIO_TeletypeBinByte Proc Near Uses ax cx 225 mov ah,al 226 mov cx,8 227 AuxIO_TeletypeBinByte_nextchar: 228 xor al,al 229 rcl ah,1 230 rcl al,1 231 add al,'0' 232 call AuxIO_Teletype 233 loop AuxIO_TeletypeBinByte_nextchar 234 ret 235 AuxIO_TeletypeBinByte EndP 236 237 ; Print Bin-word to com-port (teletype style) 238 ; This outputs 16 characters ('0' or '1' for each bit) 239 ; In: AX - byte to send 240 ; Out: AX - byte sent 241 ; Destroyed: None 242 AuxIO_TeletypeBinWord Proc 243 xchg al,ah ; High byte first 244 call AuxIO_TeletypeBinByte ; Output to com-port 245 xchg al,ah ; low byte next 246 call AuxIO_TeletypeBinByte ; Output to com-port 247 ret 248 AuxIO_TeletypeBinWord EndP 249 250 ; Print Bin-dword to com-port (teletype style) 251 ; This outputs 32 characters ('0' or '1' for each bit) 252 ; In: DX:AX - dword to send 253 ; Out: DX:AX - dword sent 254 ; Destroyed: None 255 AuxIO_TeletypeBinDWord Proc Near 256 xchg ax,dx 257 call AuxIO_TeletypeBinWord ; High word first 258 xchg ax,dx 259 call AuxIO_TeletypeBinWord ; Low word next 260 ret 261 AuxIO_TeletypeBinDWord EndP 262 263 ; Print Bin-qword to com-port (teletype style) 264 ; This outputs 64 characters ('0' or '1' for each bit) 265 ; In: BX:CX:DX:AX - qword to send 266 ; Out: BX:CX:DX:AX - qword sent 267 ; Destroyed: None 268 AuxIO_TeletypeBinQWord Proc Near 269 xchg dx,bx 270 xchg ax,cx 271 call AuxIO_TeletypeBinDWord ; High dword first 272 xchg dx,bx 273 xchg ax,cx 274 call AuxIO_TeletypeBinDWord ; Low dword next 275 ret 276 AuxIO_TeletypeBinQWord EndP 277 278 172 279 ; Print hex-byte to com-port (teletype style) 173 280 ; This outputs two characters … … 325 432 AuxIO_DumpParagraph_Next_2: 326 433 mov ah,'.' ; char to use ufnot printable 327 lodsb 434 lodsb ; load byte 328 435 call CONV_ConvertToPrintable ; use dot's if not printable 329 436 call AuxIO_Teletype ; print it … … 337 444 mov cx,32 ; Number of paragraphs in a sector 338 445 AuxIO_DumpSector_Next: 339 call AuxIO_DumpParagraph ; Dump t e paragraph446 call AuxIO_DumpParagraph ; Dump the paragraph 340 447 add si,16 ; Advance pointer 341 448 call AuxIO_TeletypeNL … … 345 452 346 453 347 AuxIOHello db 'AiR-BOOT com-port debugging',10,0 348 349 350 454 AuxIOHello db 10,10,10,10,10,'AiR-BOOT com-port debugging',10,0 455 456 -
trunk/BOOTCODE/REGULAR/BOOTMENU.ASM
r46 r51 20 20 ;--------------------------------------------------------------------------- 21 21 22 IFDEF ModuleNames22 IFDEF MODULE_NAMES 23 23 DB 'BOOTMENU',0 24 24 ENDIF … … 227 227 call VideoIO_Color 228 228 229 ; Additional message how to power off system 230 mov si, offset TXT_BootMenuPowerOff 231 call GetLenOfString 232 mov dx, 1902h 233 ;~ sub dl, cl 234 mov cx, dx 235 call VideoIO_Locate 236 mov al, TextChar_WinRep4 237 call VideoIO_PrintSingleChar 238 call VideoIO_Print 239 mov al, TextChar_WinRep5 240 call VideoIO_PrintSingleChar 241 242 229 243 ; Additional message how to enter setup 230 244 mov si, offset TXT_BootMenuEnterSetup … … 507 521 CLR_FS_NAME_BM = 0701h 508 522 523 ; Color for drive-letter 524 CLR_DL_BM = 0f01h 525 509 526 mov cx, CLR_FS_NAME_BM 510 527 call VideoIO_Color ; Hrot, Blau 511 528 mov cl, 8 512 529 call VideoIO_FixedPrint 530 531 532 533 DRIVELETTERS_ENABLE EQU 534 535 IFDEF DRIVELETTERS_ENABLE 536 537 ; 538 ; THIS IS WHERE WE CAN SHOW DRIVE-LETTERS ! 539 ; 540 541 pusha 542 543 mov al,[CFG_MiscFlags] 544 and al,00000001b 545 jz skip_show_dl 546 547 548 ; Dirty hack to clear remaining line when menu is scrolled. 549 ; Padd with spaces. 550 ; Should be implemented in scrolling routine. 551 push word ptr [TextPosX] 552 mov si, offset spaces 553 mov cl,24 554 call VideoIO_FixedPrint 555 pop word ptr [TextPosX] 556 557 mov si, [PartPointer] 558 mov ah, [si+LocIPT_SystemID] 559 560 IFDEF AUX_DEBUG 561 mov al, ' ' 562 call VideoIO_PrintSingleChar 563 mov al, ah 564 call VideoIO_PrintHexByte 565 mov al, ' ' 566 call VideoIO_PrintSingleChar 567 ENDIF 568 569 mov al, ah 570 571 cmp al, 07h 572 je show_dl 573 cmp al, 0fch 574 je show_dl 575 576 jmp skip_show_dl 577 578 show_dl: 579 580 ;~ mov al, ' ' 581 ;~ call VideoIO_PrintSingleChar 582 583 mov dl, byte ptr [si+LocIPT_Drive] 584 mov cx, [si+LocIPT_AbsoluteBegin+00h] 585 mov bx, [si+LocIPT_AbsoluteBegin+02h] 586 587 mov si, offset [TmpSector] 588 mov di,ds 589 call DriveIO_LoadSectorLBA 590 mov al, [si+25h] 591 592 IFDEF AUX_DEBUG 593 call VideoIO_PrintHexByte 594 ENDIF 595 596 mov dh,al 597 sub dh,3dh 598 599 call LVM_GetDriveLetter 600 601 test al,al 602 jnz show_dl2 603 604 605 606 mov si, offset [dl_hidden] 607 mov cx, CLR_DL_BM 608 call VideoIO_Color 609 call VideoIO_Print 610 611 mov cx, 0701h 612 call VideoIO_Color 613 614 mov al, dh 615 call VideoIO_PrintSingleChar 616 mov al, ':' 617 call VideoIO_PrintSingleChar 618 619 jmp skip_show_dl 620 621 show_dl2: 622 623 mov si, offset [dl_text] 624 625 call VideoIO_Print 626 627 mov cx, CLR_DL_BM 628 call VideoIO_Color 629 630 call VideoIO_PrintSingleChar 631 mov al,':' 632 call VideoIO_PrintSingleChar 633 634 skip_show_dl: 635 popa 636 637 ENDIF 638 639 513 640 ret 514 641 BOOTMENU_BuildPartitionText EndP 642 643 dl_text db ' on drive ',0 644 dl_hidden db ' hidden ',0 645 spaces db ' ',0 515 646 516 647 ; In: DL - Active Partition … … 825 956 push dx 826 957 call TIMER_GetTicCount 827 cmp dx, w ptr [FloppyGetNameTimer+2]958 cmp dx, word ptr [FloppyGetNameTimer+2] 828 959 ja BME_ExpiredGetFloppy 829 cmp ax, w ptr [FloppyGetNameTimer+0]960 cmp ax, word ptr [FloppyGetNameTimer+0] 830 961 jb BME_NoFloppyNameExpired 831 962 BME_ExpiredGetFloppy: … … 862 993 int 16h 863 994 pop dx 864 cmp ah, Keys_ENTER 995 996 ;! 997 ;! DEBUG_BLOCK 998 ;! Handle keys to activate debugging routines. 999 ;! 1000 IFDEF AUX_DEBUG 1001 call DEBUG_HandleKeypress 1002 ENDIF 1003 1004 cmp ah, Keys_ENTER 865 1005 je BME_KeyEnter 866 1006 cmp ah, Keys_F10 … … 950 1090 mov dx, 160 951 1091 xor di, di 1092 1093 IFDEF FX_ENABLED 952 1094 call FX_InterleaveCopy 953 1095 call FX_ScrollScreenLeft 1096 ENDIF 1097 954 1098 mov ah, 0 955 1099 int 16h ; Wait for any key 956 1100 call BOOTMENU_ResetTimedBoot ; Reset Timer 957 1101 call BOOTMENU_BuildTimedBootText ; Refresh TimedBootText 1102 1103 IFDEF FX_ENABLED 958 1104 call FX_ScrollScreenRight 959 1105 call FX_EndScreenInternalCleanUp 1106 ENDIF 1107 960 1108 call BOOTMENU_ResetTimedBoot ; Reset Timer again... 961 1109 popa … … 983 1131 ret 984 1132 BOOTMENU_ResetGetFloppy EndP 1133 1134 1135 -
trunk/BOOTCODE/REGULAR/CONV.ASM
r46 r51 28 28 29 29 30 IFDEF ModuleNames30 IFDEF MODULE_NAMES 31 31 DB 'CONV',0 32 32 ENDIF -
trunk/BOOTCODE/REGULAR/DEBUG.ASM
r50 r51 26 26 ; This module contains functions for debugging AiR-BOOT. 27 27 ; It is only included in debug builds and the codesize of AiR-BOOT increases 28 ; in that case. 29 ; 30 ; Had problems with RU language version because it includes cyrillic charset.31 ; Parts disabled for now. 32 33 34 IFDEF ModuleNames28 ; in that case. To compensate for that, the FX code is disabled when debugging 29 ; is active. Also, most of the debug-routines can selectively be disabled 30 ; by commenting-out the define above it. 31 32 33 34 IFDEF MODULE_NAMES 35 35 DB 'DEBUG',0 36 36 ENDIF 37 37 38 DEBUG_CheckMath Proc Near 39 ;~ pushf 40 ;~ pusha 41 ;~ 42 ;~ ; Msg check math-module 43 ;~ mov si,offset db_checkmath 44 ;~ call AuxIO_Print 45 ;~ 46 ;~ ; Output hex-word 47 ;~ mov ax,0BABEh 48 ;~ call AuxIO_TeletypeHexWord 49 ;~ 50 ;~ mov al,' ' 51 ;~ call AuxIO_Teletype 52 ;~ mov al,'*' 53 ;~ call AuxIO_Teletype 54 ;~ mov al,' ' 55 ;~ call AuxIO_Teletype 56 ;~ 57 ;~ ; Output hex-word 58 ;~ mov ax,0BABEh 59 ;~ call AuxIO_TeletypeHexWord 60 ;~ 61 ;~ mov al,' ' 62 ;~ call AuxIO_Teletype 63 ;~ mov al,'=' 64 ;~ call AuxIO_Teletype 65 ;~ mov al,' ' 66 ;~ call AuxIO_Teletype 67 ;~ 68 ;~ mov ax,0BABEh 69 ;~ mul ax 70 ;~ call AuxIO_TeletypeHexDWord 71 ;~ 72 ;~ ; Start new line 73 ;~ call AuxIO_TeletypeNL 74 ;~ 75 ;~ ; Output hex-dword 76 ;~ mov dx,0DEADh 77 ;~ mov ax,0FACEh 78 ;~ call AuxIO_TeletypeHexDWord 79 ;~ 80 ;~ mov al,' ' 81 ;~ call AuxIO_Teletype 82 ;~ mov al,'*' 83 ;~ call AuxIO_Teletype 84 ;~ mov al,' ' 85 ;~ call AuxIO_Teletype 86 ;~ 87 ;~ ; Output hex-dword 88 ;~ mov dx,0DEADh 89 ;~ mov ax,0FACEh 90 ;~ call AuxIO_TeletypeHexDWord 91 ;~ 92 ;~ mov al,' ' 93 ;~ call AuxIO_Teletype 94 ;~ mov al,'=' 95 ;~ call AuxIO_Teletype 96 ;~ mov al,' ' 97 ;~ call AuxIO_Teletype 98 ;~ 99 ;~ mov bx,0DEADh 100 ;~ mov cx,0FACEh 101 ;~ mov dx,0DEADh 102 ;~ mov ax,0FACEh 103 ;~ call MATH_Mul32 104 ;~ call AuxIO_TeletypeHexQWord 105 ;~ 106 ;~ call AuxIO_TeletypeNL 107 ;~ call AuxIO_TeletypeNL 108 ;~ 109 ;~ popa 110 ;~ popf 111 112 ret 113 DEBUG_CheckMath EndP 114 115 116 DEBUG_DumpGeo Proc 117 ;~ pushf 118 ;~ pusha 119 ;~ 120 ;~ ; BIOS cyls 121 ;~ mov dx,word ptr [BIOS_Cyls+02] 122 ;~ mov ax,word ptr [BIOS_Cyls+00] 123 ;~ call AuxIO_TeletypeHexDWord 124 ;~ call AuxIO_TeletypeNL 125 ;~ 126 ;~ ; BIOS heads 127 ;~ mov dx,word ptr [BIOS_Heads+02] 128 ;~ mov ax,word ptr [BIOS_Heads+00] 129 ;~ call AuxIO_TeletypeHexDWord 130 ;~ call AuxIO_TeletypeNL 131 ;~ 132 ;~ ; BIOS secs 133 ;~ mov dx,word ptr [BIOS_Secs+02] 134 ;~ mov ax,word ptr [BIOS_Secs+00] 135 ;~ call AuxIO_TeletypeHexDWord 136 ;~ call AuxIO_TeletypeNL 137 ;~ 138 ;~ ; Bytes per sector 139 ;~ mov ax,[BIOS_Bytes] 140 ;~ call AuxIO_TeletypeHexWord 141 ;~ call AuxIO_TeletypeNL 142 ;~ 143 ;~ ; Total secs 144 ;~ mov bx, word ptr [BIOS_TotalSecs+06] 145 ;~ mov cx, word ptr [BIOS_TotalSecs+04] 146 ;~ mov dx, word ptr [BIOS_TotalSecs+02] 147 ;~ mov ax, word ptr [BIOS_TotalSecs+00] 148 ;~ call AuxIO_TeletypeHexDWord 149 ;~ call AuxIO_TeletypeNL 150 ;~ 151 ;~ ; CHS to LBA 152 ;~ mov dx,1 153 ;~ mov ax,29e5h 154 ;~ mov bx,23h 155 ;~ mov cx,9h 156 ;~ call CONV_CHS2LBA 157 ;~ call AuxIO_TeletypeHexDWord 158 ;~ call AuxIO_TeletypeNL 159 ;~ 160 ;~ popa 161 ;~ popf 162 163 ret 164 DEBUG_DumpGeo Endp 165 166 167 168 DEBUG_DumpIPT Proc 169 pushf 170 pusha 171 172 call AuxIO_TeletypeNL 173 174 mov si,offset [PartitionTable] 175 call AuxIO_DumpSector 176 177 popa 178 popf 179 ret 180 DEBUG_DumpIPT EndP 181 182 DEBUG_DumpNewPartTable Proc 183 pushf 184 pusha 185 186 call AuxIO_TeletypeNL 187 188 mov si,offset [NewPartTable] 189 call AuxIO_DumpSector 190 191 popa 192 popf 193 ret 194 DEBUG_DumpNewPartTable EndP 195 196 DEBUG_DumpPartitionPointers Proc 197 pushf 198 pusha 199 200 call AuxIO_TeletypeNL 201 202 mov si,offset [PartitionPointers] 203 mov cx,7 204 205 DEBUG_DumpPartitionPointers_next: 206 call AuxIO_DumpParagraph 207 add si,16 208 call AuxIO_TeletypeNL 209 loop DEBUG_DumpPartitionPointers_next 210 211 popa 212 popf 213 ret 214 DEBUG_DumpPartitionPointers EndP 215 216 217 DEBUG_DumpPartitionXref Proc 218 pushf 219 pusha 220 221 call AuxIO_TeletypeNL 222 223 mov si,offset [PartitionXref] 224 mov cx,3 225 226 DEBUG_DumpPartitionXref_next: 227 call AuxIO_DumpParagraph 228 add si,16 229 call AuxIO_TeletypeNL 230 loop DEBUG_DumpPartitionXref_next 231 232 popa 233 popf 234 ret 235 DEBUG_DumpPartitionXref EndP 236 237 238 239 DEBUG_DumpDriveLetters Proc 240 pushf 241 pusha 242 243 call AuxIO_TeletypeNL 244 245 mov si,offset [DriveLetters] 246 mov cx,2 247 248 DEBUG_DumpDriveLetters_next: 249 call AuxIO_DumpParagraph 250 add si,16 251 call AuxIO_TeletypeNL 252 loop DEBUG_DumpDriveLetters_next 253 254 popa 255 popf 256 ret 257 DEBUG_DumpDriveLetters EndP 258 259 260 DEBUG_DumpRegisters Proc 261 pushf 262 pusha 263 264 call AuxIO_TeletypeHexWord 265 call AuxIO_TeletypeNL 266 267 mov ax,bx 268 call AuxIO_TeletypeHexWord 269 call AuxIO_TeletypeNL 270 271 mov ax,cx 272 call AuxIO_TeletypeHexWord 273 call AuxIO_TeletypeNL 274 275 mov ax,dx 276 call AuxIO_TeletypeHexWord 277 call AuxIO_TeletypeNL 278 279 mov ax,si 280 call AuxIO_TeletypeHexWord 281 call AuxIO_TeletypeNL 282 283 mov ax,di 284 call AuxIO_TeletypeHexWord 285 call AuxIO_TeletypeNL 286 287 mov ax,ds 288 call AuxIO_TeletypeHexWord 289 call AuxIO_TeletypeNL 290 291 mov ax,es 292 call AuxIO_TeletypeHexWord 293 call AuxIO_TeletypeNL 294 295 call AuxIO_TeletypeNL 296 297 popa 298 popf 299 ret 300 DEBUG_DumpRegisters EndP 38 ; 39 ; Display a number that was put on the stack. 40 ; Used to track code-flow. 41 ; 42 dbp db '>---------->> DebugProbe: ',0 43 DEBUG_Probe Proc 44 push bp 45 mov bp,sp 46 pushf 47 pusha 48 49 mov si,offset [dbp] ; Default probe-text. 50 call AuxIO_Print 51 mov ax,[bp+04] ; Get probe-number from stack. 52 call AuxIO_TeletypeHexWord 53 call AuxIO_TeletypeNL 54 55 ; Also display registers. 56 popa 57 pusha 58 call DEBUG_DumpRegisters 59 60 popa 61 popf 62 pop bp 63 ret 2 64 DEBUG_Probe Endp 65 66 67 68 ; 69 ; Show help on keys. 70 ; 71 dbh db 10,'h=HELP, d=DRIVE-LETTERS, g=GEO, i=IPT, r=RESTART, v=VOL-LETTERS, x=XREF',10,10,0 72 DEBUG_ShowHelp Proc 73 pushf 74 pusha 75 mov si, offset dbh 76 call AuxIO_Print 77 popa 78 popf 79 ret 80 DEBUG_ShowHelp EndP 81 82 83 ; 84 ; Call list for debug hot-keys. 85 ; 86 dbg_call_list: 87 db 'd' 88 dw offset DEBUG_DumpDriveLetters 89 db 'g' 90 dw offset DEBUG_DumpGeo 91 db 'h' 92 dw offset DEBUG_ShowHelp 93 db 'i' 94 dw offset DEBUG_DumpIPT 95 db 'r' 96 dw offset AirbootRestart 97 db 'v' 98 dw offset DEBUG_DumpVolumeLetters 99 db 'x' 100 dw offset DEBUG_DumpPartitionXref 101 db 'R' 102 dw offset AirbootRestart 103 db 0 104 105 ; 106 ; Handle keypresses when the main menu is active. 107 ; 108 DEBUG_HandleKeypress Proc 109 pushf 110 pusha 111 112 ; Save hot-key 113 mov dl,al 114 115 ; Check for digit. 116 cmp al,'0' 117 jb DEBUG_HandleKeypress_exit 118 cmp al,'9' 119 ja DEBUG_HandleKeypress_try_alpha 120 ; It was a digit. 121 jmp DEBUG_HandleKeypress_check_it 122 123 ; Check for alpha. 124 DEBUG_HandleKeypress_try_alpha: 125 ; Force upper-case. 126 and al,11011111b 127 cmp al,'A' 128 jb DEBUG_HandleKeypress_exit 129 cmp al,'Z' 130 ja DEBUG_HandleKeypress_exit 131 ; It was an alpha. 132 jmp DEBUG_HandleKeypress_check_it 133 134 135 ; Check if the key is a hot-key. 136 DEBUG_HandleKeypress_check_it: 137 cld 138 mov si,offset dbg_call_list 139 140 ; Loop over jump-list. 141 DEBUG_HandleKeypress_next_entry: 142 143 ; Load the hot-key. 144 lodsb 145 ; No hot-key (not implemented) if end-of-list. 146 test al,al 147 jz DEBUG_HandleKeypress_ni 148 149 ; Compare hot-key and iterate if not the same. 150 cmp dl,al 151 lodsw 152 jne DEBUG_HandleKeypress_next_entry 153 154 ; Entry found, call corresponding routine. 155 mov bx,ax 156 call bx 157 158 ; Done. 159 jmp DEBUG_HandleKeypress_exit 160 161 ; Call not-assigned routine. 162 DEBUG_HandleKeypress_ni: 163 call DEBUG_NotAssigned 164 jmp DEBUG_HandleKeypress_exit 165 166 ; Return to caller. 167 DEBUG_HandleKeypress_exit: 168 popa 169 popf 170 ret 171 DEBUG_HandleKeypress Endp 172 173 174 175 ; 176 ; Show not assigned message. 177 ; 178 dbg_na db 'This key is not assigned, press ''h'' for Help.',10,0 179 DEBUG_NotAssigned Proc 180 pushf 181 pusha 182 mov si,offset dbg_na 183 call AuxIO_Print 184 popa 185 popf 186 ret 187 DEBUG_NotAssigned Endp 188 189 301 190 302 191 ; … … 318 207 ; Start new line 319 208 call AuxIO_TeletypeNL 320 call AuxIO_TeletypeNL209 ;~ call AuxIO_TeletypeNL 321 210 322 211 ;~ call DEBUG_DumpHidePartTables 323 324 212 ;~ call DEBUG_CheckMath 325 326 213 ;~ call DEBUG_DumpGeo 327 328 214 ;~ call DEBUG_CheckBitFields 329 215 … … 334 220 335 221 222 ; 223 ; Check the simple 32-bit math functions. 224 ; 225 ;~ __CHECK_MATH__ EQU 226 DEBUG_CheckMath Proc Near 227 IFDEF __CHECK_MATH__ 228 pushf 229 pusha 230 231 ; Msg check math-module 232 mov si,offset db_checkmath 233 call AuxIO_Print 234 235 ; Output hex-word 236 mov ax,0BABEh 237 call AuxIO_TeletypeHexWord 238 239 mov al,' ' 240 call AuxIO_Teletype 241 mov al,'*' 242 call AuxIO_Teletype 243 mov al,' ' 244 call AuxIO_Teletype 245 246 ; Output hex-word 247 mov ax,0BABEh 248 call AuxIO_TeletypeHexWord 249 250 mov al,' ' 251 call AuxIO_Teletype 252 mov al,'=' 253 call AuxIO_Teletype 254 mov al,' ' 255 call AuxIO_Teletype 256 257 mov ax,0BABEh 258 mul ax 259 call AuxIO_TeletypeHexDWord 260 261 ; Start new line 262 call AuxIO_TeletypeNL 263 264 ; Output hex-dword 265 mov dx,0DEADh 266 mov ax,0FACEh 267 call AuxIO_TeletypeHexDWord 268 269 mov al,' ' 270 call AuxIO_Teletype 271 mov al,'*' 272 call AuxIO_Teletype 273 mov al,' ' 274 call AuxIO_Teletype 275 276 ; Output hex-dword 277 mov dx,0DEADh 278 mov ax,0FACEh 279 call AuxIO_TeletypeHexDWord 280 281 mov al,' ' 282 call AuxIO_Teletype 283 mov al,'=' 284 call AuxIO_Teletype 285 mov al,' ' 286 call AuxIO_Teletype 287 288 mov bx,0DEADh 289 mov cx,0FACEh 290 mov dx,0DEADh 291 mov ax,0FACEh 292 call MATH_Mul32 293 call AuxIO_TeletypeHexQWord 294 295 call AuxIO_TeletypeNL 296 call AuxIO_TeletypeNL 297 298 popa 299 popf 300 ENDIF 301 ret 302 DEBUG_CheckMath EndP 303 304 305 ; 306 ; Dump the geometry. 307 ; 308 __DUMP_GEO__ EQU 309 DEBUG_DumpGeo Proc 310 IFDEF __DUMP_GEO__ 311 pushf 312 pusha 313 314 ; BIOS cyls 315 mov dx,word ptr [BIOS_Cyls+02] 316 mov ax,word ptr [BIOS_Cyls+00] 317 call AuxIO_TeletypeHexDWord 318 call AuxIO_TeletypeNL 319 320 ; BIOS heads 321 mov dx,word ptr [BIOS_Heads+02] 322 mov ax,word ptr [BIOS_Heads+00] 323 call AuxIO_TeletypeHexDWord 324 call AuxIO_TeletypeNL 325 326 ; BIOS secs 327 mov dx,word ptr [BIOS_Secs+02] 328 mov ax,word ptr [BIOS_Secs+00] 329 call AuxIO_TeletypeHexDWord 330 call AuxIO_TeletypeNL 331 332 ; Bytes per sector 333 mov ax,[BIOS_Bytes] 334 call AuxIO_TeletypeHexWord 335 call AuxIO_TeletypeNL 336 337 ; Total secs 338 mov bx, word ptr [BIOS_TotalSecs+06] 339 mov cx, word ptr [BIOS_TotalSecs+04] 340 mov dx, word ptr [BIOS_TotalSecs+02] 341 mov ax, word ptr [BIOS_TotalSecs+00] 342 call AuxIO_TeletypeHexDWord 343 call AuxIO_TeletypeNL 344 345 ; CHS to LBA 346 mov dx,1 347 mov ax,29e5h 348 mov bx,23h 349 mov cx,9h 350 call CONV_CHS2LBA 351 call AuxIO_TeletypeHexDWord 352 call AuxIO_TeletypeNL 353 354 popa 355 popf 356 ENDIF 357 358 ret 359 DEBUG_DumpGeo Endp 360 361 362 ; 363 ; Dump the internal partition table. 364 ; 365 __DUMP_IPT__ EQU 366 DEBUG_DumpIPT Proc 367 IFDEF __DUMP_IPT__ 368 pushf 369 pusha 370 371 call AuxIO_TeletypeNL 372 373 mov si,offset [BIOScontIPTentry] 374 ;~ mov si,offset [PartitionTable] 375 call AuxIO_DumpSector 376 377 popa 378 popf 379 ENDIF 380 ret 381 DEBUG_DumpIPT EndP 382 383 384 ; 385 ; Dump the new partitions table. 386 ; 387 ;~ __DUMP_NPT__ EQU 388 DEBUG_DumpNewPartTable Proc 389 IFDEF __DUMP_NPT__ 390 pushf 391 pusha 392 393 call AuxIO_TeletypeNL 394 395 mov si,offset [NewPartTable] 396 call AuxIO_DumpSector 397 398 popa 399 popf 400 ENDIF 401 ret 402 DEBUG_DumpNewPartTable EndP 403 404 405 ; 406 ; Dump the partition pointers table. 407 ; 408 ;~ __DUMP_PP__ EQU 409 DEBUG_DumpPartitionPointers Proc 410 IFDEF __DUMP_PP__ 411 pushf 412 pusha 413 414 call AuxIO_TeletypeNL 415 416 mov si,offset [PartitionPointers] 417 mov cx,7 418 419 DEBUG_DumpPartitionPointers_next: 420 call AuxIO_DumpParagraph 421 add si,16 422 call AuxIO_TeletypeNL 423 loop DEBUG_DumpPartitionPointers_next 424 425 popa 426 popf 427 ENDIF 428 ret 429 DEBUG_DumpPartitionPointers EndP 430 431 432 ; 433 ; Dump the partition x-ref table. 434 ; 435 __DUMP_PX__ EQU 436 DEBUG_DumpPartitionXref Proc 437 IFDEF __DUMP_PX__ 438 pushf 439 pusha 440 441 mov si, offset [xrt] 442 call AuxIO_Print 443 ;~ call AuxIO_TeletypeNL 444 445 mov si,offset [PartitionXref] 446 mov cx,3 447 448 DEBUG_DumpPartitionXref_next: 449 call AuxIO_DumpParagraph 450 add si,16 451 call AuxIO_TeletypeNL 452 loop DEBUG_DumpPartitionXref_next 453 454 popa 455 popf 456 ENDIF 457 ret 458 DEBUG_DumpPartitionXref EndP 459 460 461 ; 462 ; Dump the dl-feature drive-letters. 463 ; 464 __DUMP_DL__ EQU 465 DEBUG_DumpDriveLetters Proc 466 IFDEF __DUMP_DL__ 467 pushf 468 pusha 469 470 mov si, offset [ddl] 471 call AuxIO_Print 472 473 ; Dump the old drive-letters as set with the dl-feature. 474 mov si,offset [DriveLetters] 475 mov cx,3 476 DEBUG_DumpDriveLetters_next_1: 477 call AuxIO_DumpParagraph 478 add si,16 479 call AuxIO_TeletypeNL 480 loop DEBUG_DumpDriveLetters_next_1 481 482 ; Dump the new drive-letters as composed when scanning partitions 483 ; and partitions were added or removed. 484 mov si,offset [NewDriveLetters] 485 mov cx,3 486 DEBUG_DumpDriveLetters_next_2: 487 call AuxIO_DumpParagraph 488 add si,16 489 call AuxIO_TeletypeNL 490 loop DEBUG_DumpDriveLetters_next_2 491 492 popa 493 popf 494 ENDIF 495 ret 496 DEBUG_DumpDriveLetters EndP 497 498 499 ; 500 ; Dump the lvm volume drive-letters. 501 ; 502 __DUMP_VL__ EQU 503 DEBUG_DumpVolumeLetters Proc 504 IFDEF __DUMP_VL__ 505 pushf 506 pusha 507 508 mov si, offset [dvl] 509 call AuxIO_Print 510 511 mov si,offset [PartitionVolumeLetters] 512 mov cx,3 513 514 DEBUG_DumpVolumeLetters_next: 515 call AuxIO_DumpParagraph 516 add si,16 517 call AuxIO_TeletypeNL 518 loop DEBUG_DumpVolumeLetters_next 519 520 popa 521 popf 522 ENDIF 523 ret 524 DEBUG_DumpVolumeLetters EndP 525 526 527 528 529 ; 530 ; Dump the registers. 531 ; 532 __DUMP_REG__ EQU 533 IFDEF __DUMP_REG__ 534 regAX db 'AX:',0 535 regBX db ' BX:',0 536 regCX db ' CX:',0 537 regDX db ' DX:',0 538 regSI db ' SI:',0 539 regDI db ' DI:',0 540 541 regBP db 'CS:',0 542 regSP db ' DS:',0 543 regCS db ' ES:',0 544 regSS db ' SS:',0 545 regDS db ' SP:',0 546 regES db ' BP:',0 547 548 ;~ regFS db 'FS:',0 549 ;~ regGS db ' GS:',0 550 ENDIF 551 DEBUG_DumpRegisters Proc 552 IFDEF __DUMP_REG__ 553 pushf 554 pusha 555 556 push si 557 mov si, offset regAX 558 call AuxIO_Print 559 call AuxIO_TeletypeHexWord 560 ;~ call AuxIO_TeletypeNL 561 562 call AuxIO_Print 563 mov ax,bx 564 call AuxIO_TeletypeHexWord 565 ;~ call AuxIO_TeletypeNL 566 567 call AuxIO_Print 568 mov ax,cx 569 call AuxIO_TeletypeHexWord 570 ;~ call AuxIO_TeletypeNL 571 572 call AuxIO_Print 573 mov ax,dx 574 call AuxIO_TeletypeHexWord 575 ;~ call AuxIO_TeletypeNL 576 577 call AuxIO_Print 578 pop ax 579 call AuxIO_TeletypeHexWord 580 ;~ call AuxIO_TeletypeNL 581 582 call AuxIO_Print 583 mov ax,di 584 call AuxIO_TeletypeHexWord 585 call AuxIO_TeletypeNL 586 587 588 589 call AuxIO_Print 590 mov ax,cs 591 call AuxIO_TeletypeHexWord 592 ;~ call AuxIO_TeletypeNL 593 594 call AuxIO_Print 595 mov ax,ds 596 call AuxIO_TeletypeHexWord 597 ;~ call AuxIO_TeletypeNL 598 599 call AuxIO_Print 600 mov ax,es 601 call AuxIO_TeletypeHexWord 602 ;~ call AuxIO_TeletypeNL 603 604 call AuxIO_Print 605 mov ax,ss 606 call AuxIO_TeletypeHexWord 607 ;~ call AuxIO_TeletypeNL 608 609 call AuxIO_Print 610 mov ax,sp 611 call AuxIO_TeletypeHexWord 612 ;~ call AuxIO_TeletypeNL 613 614 call AuxIO_Print 615 mov ax,bp 616 call AuxIO_TeletypeHexWord 617 call AuxIO_TeletypeNL 618 619 ;~ call AuxIO_Print 620 ;~ mov ax,fs 621 ;~ call AuxIO_TeletypeHexWord 622 ;~ call AuxIO_TeletypeNL 623 624 ;~ call AuxIO_Print 625 ;~ mov ax,gs 626 ;~ call AuxIO_TeletypeHexWord 627 ;~ call AuxIO_TeletypeNL 628 629 call AuxIO_TeletypeNL 630 631 popa 632 popf 633 ENDIF 634 ret 635 DEBUG_DumpRegisters EndP 636 637 638 ; 639 ; Dump CHS values. 640 ; 641 __DUMP_CHS__ EQU 642 DEBUG_DumpCHS Proc Near 643 IFDEF __DUMP_CHS__ 644 pushf 645 pusha 646 mov al,'C' 647 call AuxIO_Teletype 648 mov al,':' 649 call AuxIO_Teletype 650 mov ah,cl 651 shr ah,6 652 mov al,ch 653 call AuxIO_TeletypeHexWord 654 mov al,' ' 655 call AuxIO_Teletype 656 mov al,'H' 657 call AuxIO_Teletype 658 mov al,':' 659 call AuxIO_Teletype 660 mov al,dh 661 call AuxIO_TeletypeHexByte 662 mov al,' ' 663 call AuxIO_Teletype 664 mov al,'S' 665 call AuxIO_Teletype 666 mov al,':' 667 call AuxIO_Teletype 668 mov al,cl 669 and al,00111111b 670 call AuxIO_TeletypeHexByte 671 call AuxIO_TeletypeNL 672 popa 673 popf 674 ENDIF 675 ret 676 DEBUG_DumpCHS EndP 677 678 679 ; 680 ; Dump BSS. 681 ; 682 ;~ __DUMP_BSS__ EQU 336 683 DEBUG_DumpBSSSectors Proc Near 337 ;~ pushf 338 ;~ pusha 339 ;~ 340 ;~ mov si, offset [PartitionSector] 341 ;~ call AuxIO_DumpSector 342 ;~ call AuxIO_TeletypeNL 343 ;~ 344 ;~ mov si, offset [JfsPBR] 345 ;~ call AuxIO_DumpSector 346 ;~ call AuxIO_TeletypeNL 347 ;~ 348 ;~ mov si, offset [LVMSector] 349 ;~ call AuxIO_DumpSector 350 ;~ call AuxIO_TeletypeNL 351 ;~ 352 ;~ mov si, offset [TmpSector] 353 ;~ call AuxIO_DumpSector 354 ;~ call AuxIO_TeletypeNL 355 ;~ 356 ;~ mov si, offset [NewPartTable] 357 ;~ call AuxIO_DumpSector 358 ;~ call AuxIO_TeletypeNL 359 ;~ call AuxIO_TeletypeNL 360 ;~ 361 ;~ popa 362 ;~ popf 684 IFDEF __DUMP_BSS__ 685 pushf 686 pusha 687 688 mov si, offset [PartitionSector] 689 call AuxIO_DumpSector 690 call AuxIO_TeletypeNL 691 692 mov si, offset [PBRSector] 693 call AuxIO_DumpSector 694 call AuxIO_TeletypeNL 695 696 mov si, offset [LVMSector] 697 call AuxIO_DumpSector 698 call AuxIO_TeletypeNL 699 700 mov si, offset [TmpSector] 701 call AuxIO_DumpSector 702 call AuxIO_TeletypeNL 703 704 mov si, offset [NewPartTable] 705 call AuxIO_DumpSector 706 call AuxIO_TeletypeNL 707 call AuxIO_TeletypeNL 708 709 popa 710 popf 711 ENDIF 363 712 ret 364 713 DEBUG_DumpBSSSectors EndP 365 714 366 715 716 ; 717 ; Dump 6-bit packed hide partition table. 718 ; 719 ;~ __DUMP_HPT__ EQU 367 720 DEBUG_DumpHidePartTables Proc Near 368 ;~ pushf 369 ;~ pusha 370 ;~ 371 ;~ mov cx,3 372 ;~ mov si, offset [HidePartitionTable] 373 ;~ again1: 374 ;~ call AuxIO_DumpSector 375 ;~ add si,512 376 ;~ loop again1 377 ;~ call AuxIO_TeletypeNL 378 ;~ 379 ;~ mov cx,3 380 ;~ mov si, offset [PartitionXref] 381 ;~ again2: 382 ;~ call AuxIO_DumpParagraph 383 ;~ call AuxIO_TeletypeNL 384 ;~ add si,16 385 ;~ loop again2 386 ;~ call AuxIO_TeletypeNL 387 ;~ 388 ;~ mov cx,3 389 ;~ mov si, offset [NewHidePartTable] 390 ;~ again3: 391 ;~ call AuxIO_DumpSector 392 ;~ add si,512 393 ;~ loop again3 394 ;~ call AuxIO_TeletypeNL 395 ;~ 396 ;~ popa 397 ;~ popf 721 IFDEF __DUMP_HPT__ 722 pushf 723 pusha 724 725 mov cx,3 726 mov si, offset [HidePartitionTable] 727 again1: 728 call AuxIO_DumpSector 729 add si,512 730 loop again1 731 call AuxIO_TeletypeNL 732 733 mov cx,3 734 mov si, offset [PartitionXref] 735 again2: 736 call AuxIO_DumpParagraph 737 call AuxIO_TeletypeNL 738 add si,16 739 loop again2 740 call AuxIO_TeletypeNL 741 742 mov cx,3 743 mov si, offset [NewHidePartTable] 744 again3: 745 call AuxIO_DumpSector 746 add si,512 747 loop again3 748 call AuxIO_TeletypeNL 749 750 popa 751 popf 752 ENDIF 398 753 ret 399 754 DEBUG_DumpHidePartTables EndP 400 755 401 756 757 ; 758 ; Check the bitfield routines. 759 ; 760 ;~ __CBF__ EQU 402 761 DEBUG_CheckBitFields Proc 403 ;~ pushf 404 ;~ pusha 405 ;~ 406 ;~ mov bx,offset [ott] 407 ;~ 408 ;~ mov al,0 409 ;~ mov dl,0 410 ;~ mov dh,6 411 ;~ DEBUG_CheckBitFields_next_write: 412 ;~ call CONV_SetBitfieldValue 413 ;~ inc al 414 ;~ inc dl 415 ;~ jnz DEBUG_CheckBitFields_next_write 416 ;~ 417 ;~ mov dl,0 418 ;~ mov dh,6 419 ;~ DEBUG_CheckBitFields_next_read: 420 ;~ mov al,dl 421 ;~ call AuxIO_TeletypeHexByte 422 ;~ mov al,':' 423 ;~ call AuxIO_Teletype 424 ;~ call CONV_GetBitfieldValue 425 ;~ call AuxIO_TeletypeHexWord 426 ;~ call AuxIO_TeletypeNL 427 ;~ inc dl 428 ;~ jnz DEBUG_CheckBitFields_next_read 429 ;~ 430 ;~ popa 431 ;~ popf 762 IFDEF __CBF__ 763 pushf 764 pusha 765 766 mov bx,offset [ott] 767 768 mov al,0 769 mov dl,0 770 mov dh,6 771 DEBUG_CheckBitFields_next_write: 772 call CONV_SetBitfieldValue 773 inc al 774 inc dl 775 jnz DEBUG_CheckBitFields_next_write 776 777 mov dl,0 778 mov dh,6 779 DEBUG_CheckBitFields_next_read: 780 mov al,dl 781 call AuxIO_TeletypeHexByte 782 mov al,':' 783 call AuxIO_Teletype 784 call CONV_GetBitfieldValue 785 call AuxIO_TeletypeHexWord 786 call AuxIO_TeletypeNL 787 inc dl 788 jnz DEBUG_CheckBitFields_next_read 789 790 popa 791 popf 792 ENDIF 432 793 ret 433 794 DEBUG_CheckBitFields EndP 434 795 796 797 798 435 799 ; 436 800 ; Dump information before the partition is booted. 437 801 ; 802 ;~ __DMP2__ EQU 438 803 DEBUG_Dump2 Proc Near 439 ;~ pushf 440 ;~ pusha 441 ;~ 442 ;~ 443 ;~ call AuxIO_TeletypeNL 444 ;~ call AuxIO_TeletypeNL 445 ;~ 446 ;~ 447 ;~ mov si,offset db_config 448 ;~ call AuxIO_Print 449 ;~ 450 ;~ mov si,offset db_cfgparts 451 ;~ call AuxIO_Print 452 ;~ mov al,[CFG_Partitions] 453 ;~ call AuxIO_TeletypeHexByte 454 ;~ call AuxIO_TeletypeNL 455 ;~ 456 ;~ mov si,offset db_cfgpartdef 457 ;~ call AuxIO_Print 458 ;~ mov al,[CFG_PartDefault] 459 ;~ call AuxIO_TeletypeHexByte 460 ;~ call AuxIO_TeletypeNL 461 ;~ 462 ;~ mov si,offset db_cfgpartlast 463 ;~ call AuxIO_Print 464 ;~ mov al,[CFG_PartLast] 465 ;~ call AuxIO_TeletypeHexByte 466 ;~ call AuxIO_TeletypeNL 467 ;~ call AuxIO_TeletypeNL 468 ;~ 469 ;~ 470 ;~ 471 ;~ mov si,offset db_vars 472 ;~ call AuxIO_Print 473 ;~ 474 ;~ mov si,offset db_newpart 475 ;~ call AuxIO_Print 476 ;~ mov si,offset NewPartTable 477 ;~ call AuxIO_DumpSector 478 ;~ call AuxIO_TeletypeNL 479 ;~ add si,512 480 ;~ call AuxIO_DumpSector 481 ;~ call AuxIO_TeletypeNL 482 ;~ call AuxIO_TeletypeNL 483 ;~ 484 ;~ mov si,offset db_newhide 485 ;~ call AuxIO_Print 486 ;~ mov si,offset NewHidePartTable 487 ;~ call AuxIO_DumpSector 488 ;~ call AuxIO_TeletypeNL 489 ;~ add si,512 490 ;~ call AuxIO_DumpSector 491 ;~ call AuxIO_TeletypeNL 492 ;~ call AuxIO_TeletypeNL 493 ;~ 494 ;~ mov si,offset db_dletters 495 ;~ call AuxIO_Print 496 ;~ mov si,offset NewDriveLetters 497 ;~ call AuxIO_DumpParagraph 498 ;~ call AuxIO_TeletypeNL 499 ;~ add si,16 500 ;~ call AuxIO_DumpParagraph 501 ;~ call AuxIO_TeletypeNL 502 ;~ call AuxIO_TeletypeNL 503 ;~ 504 ;~ mov si,offset db_tmpec 505 ;~ call AuxIO_Print 506 ;~ mov si,offset TmpSector 507 ;~ call AuxIO_DumpSector 508 ;~ call AuxIO_TeletypeNL 509 ;~ call AuxIO_TeletypeNL 510 ;~ 511 ;~ mov si,offset db_partsec 512 ;~ call AuxIO_Print 513 ;~ mov si,offset PartitionSector 514 ;~ call AuxIO_DumpSector 515 ;~ call AuxIO_TeletypeNL 516 ;~ call AuxIO_TeletypeNL 517 ;~ 518 ;~ popa 519 ;~ popf 804 IFDEF __DMP2__ 805 pushf 806 pusha 807 808 call AuxIO_TeletypeNL 809 call AuxIO_TeletypeNL 810 811 mov si,offset db_config 812 call AuxIO_Print 813 814 mov si,offset db_cfgparts 815 call AuxIO_Print 816 mov al,[CFG_Partitions] 817 call AuxIO_TeletypeHexByte 818 call AuxIO_TeletypeNL 819 820 mov si,offset db_cfgpartdef 821 call AuxIO_Print 822 mov al,[CFG_PartDefault] 823 call AuxIO_TeletypeHexByte 824 call AuxIO_TeletypeNL 825 826 mov si,offset db_cfgpartlast 827 call AuxIO_Print 828 mov al,[CFG_PartLast] 829 call AuxIO_TeletypeHexByte 830 call AuxIO_TeletypeNL 831 call AuxIO_TeletypeNL 832 833 mov si,offset db_vars 834 call AuxIO_Print 835 836 mov si,offset db_newpart 837 call AuxIO_Print 838 mov si,offset NewPartTable 839 call AuxIO_DumpSector 840 call AuxIO_TeletypeNL 841 add si,512 842 call AuxIO_DumpSector 843 call AuxIO_TeletypeNL 844 call AuxIO_TeletypeNL 845 846 mov si,offset db_newhide 847 call AuxIO_Print 848 mov si,offset NewHidePartTable 849 call AuxIO_DumpSector 850 call AuxIO_TeletypeNL 851 add si,512 852 call AuxIO_DumpSector 853 call AuxIO_TeletypeNL 854 call AuxIO_TeletypeNL 855 856 mov si,offset db_dletters 857 call AuxIO_Print 858 mov si,offset NewDriveLetters 859 call AuxIO_DumpParagraph 860 call AuxIO_TeletypeNL 861 add si,16 862 call AuxIO_DumpParagraph 863 call AuxIO_TeletypeNL 864 call AuxIO_TeletypeNL 865 866 mov si,offset db_tmpec 867 call AuxIO_Print 868 mov si,offset TmpSector 869 call AuxIO_DumpSector 870 call AuxIO_TeletypeNL 871 call AuxIO_TeletypeNL 872 873 mov si,offset db_partsec 874 call AuxIO_Print 875 mov si,offset PartitionSector 876 call AuxIO_DumpSector 877 call AuxIO_TeletypeNL 878 call AuxIO_TeletypeNL 879 880 popa 881 popf 882 ENDIF 520 883 ret 521 884 DEBUG_Dump2 EndP … … 523 886 524 887 525 db_mbr db "## MBR ##",10,0 526 db_masterlvm db "## MLVMR ##",10,0 527 528 db_checkmath db "## CHK MATH ##",10,0 529 530 531 db_config db '## CFG (DMP2) ##',10,0 532 db_cfgparts db 'CFG_Partitions:',0 533 db_cfgpartdef db 'CFG_PartDefault:',0 534 db_cfgpartlast db 'CFG_PartLast:',0 535 536 537 db_vars db '## VARS ##',10,0 538 db_partsec db 'PartitionSector:',10,0 539 ;db_lvmsec db 'LVMSector :',10,0 540 db_tmpec db 'TmpSector :',10,0 541 542 db_newpart db 'NewPartTable :',10,0 543 db_newhide db 'NewHideTable:',10,0 544 db_dletters db 'NewDriveLetters:',10,0 545 546 ;db_partsize db 'PartitionSizeTable:',10,0 547 ;db_partpoint db 'PartitionPointers:',10,0 548 ;db_partpointcnt db 'PartitionPointerCount:',0 549 ;db_partxref db 'PartitionXref:',10,0 550 ;db_partvoldl db 'PartitionVolumeLetters:',10,0 551 552 ;db_totaldisks db 'TotalHarddiscs:',0 553 ;db_lbaswitchtab db 'LBASwitchTable:',10,0 554 ;db_newparts db 'NewPartitions:',0 555 556 ;db_exabspos db 'ExtendedAbsPos:',0 557 ;db_exabsposset db 'ExtendedAbsPosSet:',0 558 559 db_curpartloc db 'CurPartition_Location:',0 560 ;db_curiox db 'CurIO_UseExtension:',0 561 562 db_curlvmsec db 'Current LVM Sector:',0 563 564 565 drive db 'drive : ',0 566 before_lvm_adjust db 'before lvm adjust : ',0 567 after_lvm_adjust db 'after lvm adjust : ',0 568 before_lvm_adjust_log db 'before lvm logical adjust: ',0 569 after_lvm_adjust_log db 'after lvm logical adjust : ',0 570 spt_used db 'spt used : ',0 888 xrt db 10,'XrefTable:',10,0 889 ddl db 10,'Driveletters:',10,0 890 dvl db 10,'VolumeLetters:',10,0 891 dlra db 10,'LVM_DoLetterReassignment: ',0 892 ptetb db 10,'Partition Table Entry to boot',10,0 893 bios_reg db 10,'Registers passed by BIOS:',10,0 894 ;~ diopmbr db 10,'DriveIO_ProtectMBR',10,0 895 dioss db 10,'DriveIO_SaveSector',10,0 896 897 898 ;~ db_mbr db "## MBR ##",10,0 899 ;~ db_masterlvm db "## MLVMR ##",10,0 900 901 ;~ db_checkmath db "## CHK MATH ##",10,0 902 903 904 ;~ db_config db '## CFG (DMP2) ##',10,0 905 ;~ db_cfgparts db 'CFG_Partitions:',0 906 ;~ db_cfgpartdef db 'CFG_PartDefault:',0 907 ;~ db_cfgpartlast db 'CFG_PartLast:',0 908 909 910 ;~ db_vars db '## VARS ##',10,0 911 ;~ db_partsec db 'PartitionSector:',10,0 912 ;~ db_lvmsec db 'LVMSector :',10,0 913 ;~ db_tmpec db 'TmpSector :',10,0 914 915 ;~ db_newpart db 'NewPartTable :',10,0 916 ;~ db_newhide db 'NewHideTable:',10,0 917 ;~ db_dletters db 'NewDriveLetters:',10,0 918 919 ;~ db_partsize db 'PartitionSizeTable:',10,0 920 ;~ db_partpoint db 'PartitionPointers:',10,0 921 ;~ db_partpointcnt db 'PartitionPointerCount:',0 922 ;~ db_partxref db 'PartitionXref:',10,0 923 ;~ db_partvoldl db 'PartitionVolumeLetters:',10,0 924 925 ;~ db_totaldisks db 'TotalHarddiscs:',0 926 ;~ db_lbaswitchtab db 'LBASwitchTable:',10,0 927 ;~ db_newparts db 'NewPartitions:',0 928 929 ;~ db_exabspos db 'ExtendedAbsPos:',0 930 ;~ db_exabsposset db 'ExtendedAbsPosSet:',0 931 932 ;~ db_curpartloc db 'CurPartition_Location:',0 933 ;~ db_curiox db 'CurIO_UseExtension:',0 934 935 ;~ db_curlvmsec db 'Current LVM Sector:',0 936 937 938 ;~ drive db 'drive : ',0 939 ;~ before_lvm_adjust db 'before lvm adjust : ',0 940 ;~ after_lvm_adjust db 'after lvm adjust : ',0 941 ;~ before_lvm_adjust_log db 'before lvm logical adjust: ',0 942 ;~ after_lvm_adjust_log db 'after lvm logical adjust : ',0 943 ;~ spt_used db 'spt used : ',0 -
trunk/BOOTCODE/REGULAR/DRIVEIO.ASM
r50 r51 22 22 23 23 24 IFDEF ModuleNames24 IFDEF MODULE_NAMES 25 25 DB 'DRIVEIO',0 26 26 ENDIF … … 161 161 pop si 162 162 pop ds 163 mov TotalHarddiscs, dh163 mov [TotalHarddiscs], dh 164 164 ret 165 165 DriveIO_GetHardDriveCount EndP … … 172 172 DriveIO_InitLBASwitchTable Proc Near Uses es di 173 173 mov di, offset LBASwitchTable 174 mov dh, TotalHarddiscs174 mov dh, [TotalHarddiscs] 175 175 mov dl, 80h 176 176 DIOILUT_DriveLoop: … … 206 206 207 207 208 209 208 210 ; Adjusts BX:AX / CX:DX to meet LVM sector location 211 ; BX:AX / CX:DX point to MBR or EBR ! 209 212 ; Destroys SI 210 213 ; Rousseau: Enhanced to handle sector-numbers 127 and 255 besides 63 for LVM-info sectors. 211 214 ; Ugly, need to cleanup. 212 215 DriveIO_LVMAdjustToInfoSector Proc Near 213 214 ;~ pusha 215 ;~ call AuxIO_TeletypeNL 216 ;~ 217 ;~ ; LBA 218 ;~ xchg dx,bx 219 ;~ call AuxIO_TeletypeHexDWord 220 ;~ call AuxIO_TeletypeNL 221 ;~ xchg bx,dx 222 ;~ 223 ;~ ; CYL 224 ;~ mov al,ch 225 ;~ call AuxIO_TeletypeHexByte 226 ;~ call AuxIO_TeletypeNL 227 ;~ 228 ;~ ; HEAD 229 ;~ mov al,dh 230 ;~ call AuxIO_TeletypeHexByte 231 ;~ call AuxIO_TeletypeNL 232 ;~ 233 ;~ ; SEC 234 ;~ mov al,cl 235 ;~ call AuxIO_TeletypeHexByte 236 ;~ call AuxIO_TeletypeNL 237 ;~ 238 ;~ ; DRIVE 239 ;~ mov al,dl 240 ;~ call AuxIO_TeletypeHexByte 241 ;~ call AuxIO_TeletypeNL 242 ;~ popa 243 ;~ 244 ;~ ;local ts:word 245 ;~ ;local ts2:word 246 247 pusha 248 249 ; Dump drive 250 ;mov si,offset drive 251 ;call AuxIO_Print 252 ;xchg al,dl 253 ;call AuxIO_TeletypeHexByte 254 ;call AuxIO_TeletypeNL 255 ;xchg dl,al 256 257 ; Dump SPT 258 ;mov si,offset spt_used 259 ;call AuxIO_Print 260 push dx 261 push bx 262 xor dh,dh 263 and dl,01111111b 264 shl dx,1 265 shl dx,1 266 mov bx, offset TrueSecs 267 add bx,dx 268 mov ax,word ptr [bx] 269 ;mov [ts],ax 270 ;call AuxIO_TeletypeHexWord 271 ;call AuxIO_TeletypeNL 272 pop bx 273 pop dx 274 275 pusha 276 push dx 277 ; Location of extended position 278 mov dx,word ptr [ExtendedAbsPos+02] 279 mov ax,word ptr [ExtendedAbsPos+00] 280 ;call AuxIO_TeletypeHexDWord 281 ;call AuxIO_TeletypeNL 282 pop dx 283 284 xor dh,dh 285 and dl,01111111b 286 shl dx,1 287 shl dx,1 288 mov bx, offset TrueSecs 289 add bx,dx 290 291 mov ax, word ptr[bx] 216 push cx ; Save Cyl/Sec part 217 xor ch,ch ; Clear low Cyl part 218 and cl,63 ; Clear high Cyl part 219 push bx ; We need BX... 220 push dx ; and DX temoraily 221 mov bx,offset [TrueSecs] ; Offset of sector table 222 xor dh,dh ; Clear DH because we use DL as index 223 and dl,01111111b ; Remove high bit of BIOS disk-nr 224 shl dx,2 ; Index to DWORD table 225 add bx,dx ; Point to TrueSecs for this disk 226 mov si,[bx] ; Get SPT for this disk 227 pop dx ; Restore DX... 228 pop bx ; and BX 229 ;~ sub si,cx ; Adjust offset !! INCORRECT FOR LBA (TP CX != 0 !!) 230 dec si 231 pop cx ; Restore Cyl/Sec part 232 add ax,si ; Add offset to low part... 233 adc bx,0 ; and high part of LBA address 234 or cl,63 ; Adjust CHS part !FIX ME for > 63! !! FIX HUGE DRIVE !! 235 ret 236 237 238 ;;jmp bliep 239 ;; pusha 240 241 ;; push dx 242 ;; push bx 243 ;; xor dh,dh 244 ;; and dl,01111111b 245 ;; shl dx,1 246 ;; shl dx,1 247 ;; mov bx, offset [TrueSecs] 248 ;; add bx,dx 249 ;; mov ax,word ptr [bx] 250 ;; pop bx 251 ;; pop dx 252 253 254 ; 255 ; AX now contains LVM secs 256 ; 257 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 ;; mov ax, word ptr[bx] 275 292 276 ;call AuxIO_TeletypeHexWord 293 277 ;call AuxIO_TeletypeNL 294 mov al,[ExtendedAbsPosSet] ; if true -> 1st sector of extpart (EBR), not logpart(BPB)278 ;; mov al,[ExtendedAbsPosSet] ; if true -> 1st sector of extpart (EBR), not logpart(BPB) 295 279 ;call AuxIO_TeletypeHexByte 296 280 ;call AuxIO_TeletypeNL 297 281 ;mov si,offset PartitionSector 298 282 ;call AuxIO_DumpSector 299 popa283 ;; popa 300 284 301 285 ; LBA … … 307 291 ;call AuxIO_TeletypeNL 308 292 ;xchg bx,dx 309 popa 310 293 ;; popa 294 295 296 ;;bliep: 311 297 312 298 ;or bx,ax 313 test byte ptr [ExtendedAbsPosSet],1 314 jz pri 315 316 317 318 319 ;pusha 320 ;mov si,offset before_lvm_adjust_log 321 ;call AuxIO_Print 322 ; LBA 323 ;xchg dx,bx 324 ;call AuxIO_TeletypeHexDWord 325 ;call AuxIO_TeletypeNL 326 ;xchg bx,dx 327 ;popa 328 329 330 push dx 331 push bx 332 333 xor dh,dh 334 and dl,01111111b 335 shl dx,1 336 shl dx,1 337 mov bx,offset TrueSecs 338 add bx,dx 339 mov dx,[bx] 340 dec dx 341 add ax,dx 342 343 pop bx 344 pop dx 345 adc bx,0 346 347 348 ;pusha 349 ;mov si,offset after_lvm_adjust_log 350 ;call AuxIO_Print 351 ; LBA 352 ;xchg dx,bx 353 ;call AuxIO_TeletypeHexDWord 354 ;call AuxIO_TeletypeNL 355 ;xchg bx,dx 356 ;popa 357 358 jmp done 359 360 361 362 363 pri: 364 365 366 push ax 367 push cx 368 xor ch, ch ; Zero out upper-byte 369 370 push dx 371 xor dh,dh 372 and dl,01111111b 373 shl dx,1 374 shl dx,1 375 376 push bx 377 mov bx,offset TrueSecs 378 add bx,dx 379 mov ax,[bx] 299 ;; test byte ptr [ExtendedAbsPosSet],1 300 ;; jz pri 301 302 303 ;; push dx 304 ;; push bx 305 306 ;; xor dh,dh 307 ;; and dl,01111111b ; Strip high bit from disk 308 ;; shl dx,1 ; Convert to index 309 ;; shl dx,1 ; into TrueSecs table 310 ;; mov bx,offset [TrueSecs] ; Base of table 311 ;; add bx,dx ; Point to entry for disk 312 ;; mov dx,[bx] ; Get TrueSecs (LVM) 313 ;; dec dx 314 ;; add ax,dx 315 316 ;; pop bx 317 ;; pop dx 318 ;; adc bx,0 319 320 321 ;; jmp done 322 323 324 325 ;; pri: 326 327 328 ;; push ax 329 ;; push cx 330 ;; xor ch, ch ; Zero out upper-byte 331 332 ;; push dx 333 ;; xor dh,dh 334 ;; and dl,01111111b 335 ;; shl dx,1 336 ;; shl dx,1 337 338 ;; push bx 339 ;; mov bx,offset [TrueSecs] 340 ;; add bx,dx 341 ;; mov ax,[bx] 380 342 ;mov [ts2],ax 381 pop bx382 pop dx343 ;; pop bx 344 ;; pop dx 383 345 384 346 … … 394 356 ; ALLEEN TOEPASSEN ALS INT13X NIET ACTIEF ! 395 357 396 and cl, al ; Isolate lower bits, because upper397 mov ah, 0398 mov si, ax ; ones may be used for cylinder399 sub si, cx400 401 pop cx402 pop ax403 404 or cl, al ; Set sector to last sector405 add ax, si ; Adjust lower LBA406 adc bx, 0 ; Adjust LBA Sector (BX:AX)358 ;; and cl, al ; Isolate lower bits, because upper 359 ;; mov ah, 0 360 ;; mov si, ax ; ones may be used for cylinder 361 ;; sub si, cx 362 363 ;; pop cx 364 ;; pop ax 365 366 ;; or cl, al ; Set sector to last sector 367 ;; add ax, si ; Adjust lower LBA 368 ;; adc bx, 0 ; Adjust LBA Sector (BX:AX) 407 369 408 370 … … 421 383 ;~ and ax,[ts] 422 384 423 jmp done424 425 426 427 done:385 ;; jmp done 386 387 388 389 ;; done: 428 390 429 391 ;pusha … … 461 423 ;~ popa 462 424 463 ret425 ;; ret 464 426 DriveIO_LVMAdjustToInfoSector EndP 465 427 … … 496 458 DIOLP_Success: 497 459 498 IFDEF AUX_DEBUG460 IFDEF AUX_DEBUG 499 461 ; show current partition location 500 462 ;~ pushf … … 553 515 DriveIO_SaveTmpSector EndP 554 516 517 518 555 519 ; Keeps DS:SI for caller, sets carry if valid LVM sector encountered 556 520 DriveIO_LoadLVMSector Proc Near Uses ax bx cx dx … … 567 531 call DriveIO_LoadSector 568 532 569 IFDEF AUX_DEBUG533 IFDEF AUX_DEBUG 570 534 ; show current partition location 571 535 ;~ pushf … … 597 561 DriveIO_LoadLVMSector EndP 598 562 563 564 599 565 ; Keeps DS:SI for caller, saves at anytime w/o checks (!) 600 566 DriveIO_SaveLVMSector Proc Near Uses ax bx cx dx … … 608 574 jnc DIOSLVMS_SevereError ; LVM Signature must be there 609 575 610 IFDEF AUX_DEBUG 611 ;~ call DEBUG_DumpRegisters 612 ENDIF 576 IFDEF AUX_DEBUG 577 ;~ dioatlvm db 'DriveIO_LVMAdjustToInfoSector',10,0 578 ;~ pushf 579 ;~ pusha 580 ;~ mov si,offset dioatlvm 581 ;~ call AuxIO_Print 582 ;~ popa 583 ;~ popf 584 call DEBUG_DumpRegisters 585 call DEBUG_DumpCHS 586 ENDIF 613 587 614 588 call DriveIO_LVMAdjustToInfoSector 615 589 616 IFDEF AUX_DEBUG 617 ;~ call DEBUG_DumpRegisters 618 ENDIF 590 IFDEF AUX_DEBUG 591 call DEBUG_DumpRegisters 592 call DEBUG_DumpCHS 593 ENDIF 619 594 620 595 mov si, offset LVMSector … … 670 645 ; Preserve: all registers 671 646 ; ######################################################################### 672 DriveIO_LoadSector Proc Near Uses ax bx ds si es di647 DriveIO_LoadSector Proc Near Uses ax bx cx dx ds si es di 673 648 ; Is the drive not a harddrive? 674 649 cmp dl, 80h … … 680 655 jnz DIOLS_UseExtension 681 656 682 ; Upper 8 bits of LBA-address set? -> Use LBA (maximum boundary is FB0400h) 657 ; Upper 8 bits of LBA-address set? 658 ; Then use LBA (maximum boundary is 16320x16x63 = FB0400h) 683 659 or bh, bh 684 660 jnz DIOLS_UseExtension … … 787 763 788 764 765 ; 766 ; ############################################################ 767 ; # Check for a valid MBR-sector to be written to disk # 768 ; ############################################################ 769 ; 770 ; In 771 ; -- 772 ; DL = Physical Disk 773 ; BX:CX = LBA sector 774 ; DI:SI = Source buffer 775 ; 776 ; Out 777 ; --- 778 ; CY = 1 if invalid MBR in source buffer, 0 if valid 779 ; 780 ; This routine is called when DriveIO_SaveSector attempts to write to the MBR. 781 ; It checks if the sector to be written has some sensible values in certain 782 ; places. In fact, if the sector is written to the boot-disk, the AiR-BOOT 783 ; signature should be present and the partition table should be the same 784 ; as the one at the start of the AiR-BOOT code in memory, except maybe for the 785 ; active flags. 786 ; For other disks, only the active flags are checked to be 00h or 80h and 787 ; the AA55h MBR signature. 788 ; 789 DriveIO_ProtectMBR Proc Near 790 pusha ; Push all registers 791 push es ; Push ES because we need it for string instructions 792 push cs ; Make ES point... 793 pop es ; to CS 794 795 ; Save the pointer to the sector to write in BX 796 mov bx,si 797 798 ; 799 ; If the sector to be written is not the boot-disk, then skip 800 ; checking the AiR-BOOT MBR. 801 ; 802 cmp dl,80h 803 ja DriveIO_ProtectMBR_is_not_bootdisk 804 805 ; 806 ; The boot-disk is accessed so the sector to be written must be 807 ; the AiR-BOOT MBR. This is the same as the first 512 bytes 808 ; relocated to 8000:0000 and this the start of the AB-code. 809 ; 810 mov si,bx ; Get pointer to sector to write 811 xor di,di ; Point DI to start of AB-code (MBR) 812 mov cx, offset [MBR_PartTable] ; Bytes upto P-table must be same 813 cld ; Compare upwards 814 repe cmpsb ; Compare upto P-table 815 816 ; If not the same this is not the an AiR-BOOT boot-disk MBR ! 817 jne DriveIO_ProtectMBR_not_valid_MBR ; SEVERE ERROR ! 818 819 ; Continue with signature check 820 jmp DriveIO_ProtectMBR_check_signature 821 822 823 ; 824 ; The disk is not the boot-disk so we don't know what kind of MBR is on it. 825 ; Some sanity checks should be here. 826 ; 827 DriveIO_ProtectMBR_is_not_bootdisk: 828 829 ; 830 ; sanity checks... 831 ; 832 833 ; Continue with signature check 834 jmp DriveIO_ProtectMBR_check_signature 835 836 837 DriveIO_ProtectMBR_check_signature: 838 ; See if the sector to write contains a valid signature 839 mov si,bx ; Get pointer to sector to write 840 mov di, offset [MBR_Sig] ; Offset to MBR signature 841 add si,di ; Make SI point to it in sec to write 842 lodsw ; Load it 843 cmp ax,0aa55h ; See if it is valid 844 845 ; If no signature this cannot be a valid MBR ! 846 jne DriveIO_ProtectMBR_not_valid_MBR ; SEVERE ERROR ! 847 848 849 ; 850 ; The sector to be written seems to be valid. 851 ; Set CY=0 to indicate a valid MBR. 852 ; 853 DriveIO_ProtectMBR_is_valid_MBR: 854 clc 855 jmp DriveIO_ProtectMBR_end 856 857 ; 858 ; Something is terribly wrong; a non-MBR sector seems about to be written. 859 ; Set CY=1 and let the calling code handle this situation. 860 ; 861 DriveIO_ProtectMBR_not_valid_MBR: 862 stc 863 jmp DriveIO_ProtectMBR_end 864 865 ; 866 ; Return to the caller with no registers modyfied except FLAGS. 867 ; 868 DriveIO_ProtectMBR_end: 869 pop es 870 popa 871 ret 872 DriveIO_ProtectMBR Endp 873 874 875 876 ; ######################################################################### 877 ; Routine: Checks if the MBR is addressed by either CHS or LBA 878 ; ######################################################################### 879 ; Calling : bx:ax - Absolute sector 880 ; cx:dx - Cylinder/Sector, Side/Drive (hi/lo-byte) 881 ; Returns : ZF=1 if MBR is addressed, else ZF=0 882 ; Preserve: all registers 883 ; ######################################################################### 884 DriveIO_MBR_Addressed Proc 885 push ax 886 push bx 887 888 or bx,ax ; Results in 0 in BX if MBR is addressed by LBA 889 jz DriveIO_MBR_Addressed_done 890 891 mov ax,cx ; Results in 1 in AX if CYL 0, SEC 1 is addressed 892 add al,dh ; Results in 1 in AX if HEAD 0 is addressed 893 dec ax ; Results in 0 in AX if MBR is addressed by CHS 894 895 DriveIO_MBR_Addressed_done: 896 pop bx 897 pop ax 898 ret 899 DriveIO_MBR_Addressed EndP 900 901 902 789 903 790 904 ; ######################################################################### … … 797 911 ; Preserve: all registers 798 912 ; ######################################################################### 799 DriveIO_SaveSector Proc Near Uses ax bx cx ds si es di 800 801 IFDEF AUX_DEBUG 913 DriveIO_SaveSector Proc Near Uses ax bx cx dx ds si es di 914 915 916 ;! 917 ;! DEBUG_BLOCK 918 ;! Force write to LBA0 to test interception routine. 919 ;! Do *NOT* enable unless you are debugging, will overwrite MBR ! 920 ;! 921 ;~ __DIO_FORCE_LBA0_WRITE__ EQU 922 IFDEF AUX_DEBUG 923 IFDEF __DIO_FORCE_LBA0_WRITE__ 924 xor ax,ax 925 xor bx,bx 926 xor cx,cx 927 inc cx 928 xor dh,dh 929 ENDIF 930 ENDIF 931 932 933 ;! 934 ;! DEBUG_BLOCK 935 ;! Check what is being written to disk. 936 ;! Uncomment below to activate. 937 ;! 938 __DIO_SS_DMP__ EQU 939 IFDEF AUX_DEBUG 940 IFDEF __DIO_SS_DMP__ 941 pusha 942 push si 943 mov si,offset dioss 944 call AuxIO_Print 945 pop si 802 946 call DEBUG_DumpRegisters 803 947 call AuxIO_DumpSector 804 948 call AuxIO_TeletypeNL 805 ENDIF 806 949 popa 950 ENDIF 951 ENDIF 952 953 ; 954 ; Check if the MBR is the destination for the write. 955 ; ZF=1 if so. 956 ; 957 call DriveIO_MBR_Addressed 958 jnz DriveIO_SaveSector_continue_write 959 960 961 ; MBR is addressed, check the sector that is requested to be written. 962 ; For the bootdisk it should contain the AiR-BOOT signature, valid 963 ; partition-table entries and the AA55h signature. 964 ; If not, something is terribly wrong in some piece of the AB code. 965 ; For any other disk (80h+) at least a valid partition table should 966 ; be present together with the AA55h signature. 967 call DriveIO_ProtectMBR 968 jnc DriveIO_SaveSector_continue_write 969 970 971 ; 972 ; WE HAVE A SEVERE ERROR CONDITION ! 973 ; SOME AB CODE TRIES TO WRITE A NON-MBR TO THE DISK ! 974 ; ASK THE USER TO REPORT THIS ! 975 ; HALT THE SYSTEM ! 976 ; 977 978 ; Show error-box 979 mov cx, 0C04h 980 mov si, offset NonMBRwrite 981 call SETUP_ShowErrorBox 982 mov cx, 0C04h 983 mov si, offset NonMBRwrite_rep 984 call SETUP_ShowErrorBox 985 986 987 IFDEF AUX_DEBUG 988 pusha 989 mov si, offset NonMBRwrite 990 call AuxIO_TeletypeNL 991 call AuxIO_Print 992 call AuxIO_TeletypeNL 993 popa 994 ENDIF 995 996 ; Show popup and halt the system. 997 jmp HaltSystem 998 999 1000 1001 ; 1002 ; Continue the write if not MBR sector or MBR to write is validated. 1003 ; 1004 DriveIO_SaveSector_continue_write: 807 1005 test byte ptr cs:[CurIO_UseExtension], 1 808 1006 jz DIOSS_UseNormal … … 880 1078 ; Rousseau: # Load the master LVM-sector if one exists # 881 1079 ; ------------------------------------------------------ 882 ; Load the master LVM-sector to get the number of sectors per track as eCS views the drive. 883 ; If no master LVM-sector is found it is assumed eCS is not installed. 884 ; The master LVM-sector can be located at three different places according to drive size 885 ; and partitioning scheme and driver used. 886 ; When DANIS506.ADD is used, the eCS extended geometry will be 255/127 for drives >502GiB but <1TiB. 887 ; Then the location will be sector 127 which is LBA 126 (7Eh). 1080 ; Load the master LVM-sector to get the number of sectors per track as 1081 ; eCS views the drive. If no master LVM-sector is found it is assumed eCS 1082 ; is not installed. The master LVM-sector can be located at three different 1083 ; places depending on drive size and partitioning scheme and driver used. 1084 ; When DANIS506.ADD is used, the eCS extended geometry will be 255/127 for 1085 ; drives >502GiB but <1TiB. Then the location will be sector 127 which 1086 ; is LBA 126 (7Eh). 888 1087 ; IBM1S506.ADD will always use 255/255 for the extended eCS geometry. 889 1088 ; DANIS506.ADD will use 255/255 for drives >1TiB. 890 1089 ; Then the location of the master LVM-sector will be 255 which is LBA 254 (FEh). 891 ; When eCS is installed on a huge drive that alread had a system on it, eCS will be confined to the 892 ; lower 502GiB of the drive. In this case the normal geometry from Int13X will be used. 1090 ; When eCS is installed on a huge drive that alread had a system on it, eCS 1091 ; will be confined to the lower 502GiB of the drive. 1092 ; In this case the normal geometry from Int13X will be used. 893 1093 ; This is also the case when no valid master LVM-sector can be found. 894 1094 ; … … 914 1114 915 1115 ; Loop over the sector-translation table, 916 ; process the first three values from high (255) to low (bios spt, most likely 63) 1116 ; process the first three values from high (255) to low. 1117 ; (bios spt, most likely 63) 917 1118 mov cx,3 918 1119 DriveIO_LoadMasterLVMSector_NextTry: … … 921 1122 922 1123 ; Setup destination address 923 mov si, offset LVMSector924 mov w ptr [DriveIO_DAP_Transfer+0],si1124 mov si, offset [LVMSector] 1125 mov word ptr [DriveIO_DAP_Transfer+0],si 925 1126 mov ax, ds 926 mov w ptr [DriveIO_DAP_Transfer+2],ax1127 mov word ptr [DriveIO_DAP_Transfer+2],ax 927 1128 928 1129 ; Get the sector-number of the next possible LVM sector (255,127,63) … … 950 1151 ;~ pop ax 951 1152 952 IFDEFAUX_DEBUG1153 IFDEF AUX_DEBUG 953 1154 ; Dump the value 954 1155 ;~ call AuxIO_TeletypeHexByte 955 1156 ;~ call AuxIO_TeletypeNL 956 ENDIF1157 ENDIF 957 1158 958 1159 ; Setup the requested LBA sector number 959 mov w ptr [DriveIO_DAP_Absolute+0],ax ; LBA low960 mov w ptr [DriveIO_DAP_Absolute+2],00h; LBA high961 mov si, offset DriveIO_DAP ; address request packet1160 mov word ptr [DriveIO_DAP_Absolute+0],ax ; LBA low NORMAL I/O GEBRUIKEN ! 1161 mov word ptr [DriveIO_DAP_Absolute+2],00h ; LBA high 1162 mov si, offset DriveIO_DAP ; address request packet 962 1163 mov ah, 42h 963 int 13h ; do the i/o1164 int 13h ; do the i/o 964 1165 cmc ; Complement carry so we can exit imm. on error 965 1166 jnc DriveIO_LoadMasterLVMSector_End ; oops, return with NC 966 1167 967 1168 968 mov si,offset LVMSector1169 mov si,offset [LVMSector] 969 1170 970 1171 ; See if this is a valid LVM-sector 1172 ; CY=1 if valid 971 1173 call DriveIO_LVMSectorValid 972 1174 … … 992 1194 993 1195 DriveIO_LoadMasterLVMSector_Found: 1196 ; Store the address for later use. 1197 mov ax, word ptr [DriveIO_DAP_Absolute] 1198 mov word ptr [MasterLVMLBA], ax 1199 994 1200 DriveIO_LoadMasterLVMSector_End: 995 1201 popa … … 1011 1217 ; There are a few boundaries that are of importance. 1012 1218 ; Note that these are disk-boundaries and not partition boundaries. 1013 ; Even with a small partition, like <502GiB, OS/2 will use extended geometry on an1014 ; empty huge disk.1219 ; Even with a small partition, like <502GiB, OS/2 will use extended geometry on 1220 ; an empty huge disk. 1015 1221 ; These boundaries are (from high to low): 1016 1222 … … 1040 1246 ; (code 1) 1041 1247 ; 65536*255*63 = 1052835840 = 3EC10000 sectors ~ 502 GiB 1042 ; This is the current OS/2 limit using this geometry because OS/2 can currently 1043 ; not address more than 65536 cylinders. 1044 ; DANI will address space above with 255/127 extended geometry up until the DANI 1TiB boundary (code 2) 1248 ; This is the current OS/2 limit using this geometry because OS/2 can 1249 ; currently not address more than 65536 cylinders. 1250 ; DANI will address space above with 255/127 extended geometry up until 1251 ; the DANI 1TiB boundary (code 2) 1045 1252 1046 1253 ; (code 0) … … 1052 1259 ; 1053 1260 1054 ; 5 = This drive is above the 2^32 LBA32 (2TB) boundary and has more than 4294967296 sectors. 1261 ; 5 = This drive is above the 2^32 LBA32 (2TB) boundary and has more 1262 ; than 4294967296 sectors. 1055 1263 ; LBA48 addressing is needed to access the complete capacity of the drive. 1056 1264 ; OS/2 is currently unable to do so. 1057 1265 1058 1266 ; 4 = This drive is above the 65536*255*255 (4261478400) boundary but below 2^32. 1059 ; This is an OS/2 boundary and OS/2 is not able to access the drive above this boundary. 1060 1061 ; 3 = This drive is above the 2^31 (1TB) boundary and has more than 2147483648 sectors. 1267 ; This is an OS/2 boundary and OS/2 is not able to access the drive above 1268 ; this boundary. 1269 1270 ; 3 = This drive is above the 2^31 (1TB) boundary and has more than 1271 ; 2147483648 sectors. 1062 1272 ; OS/2 is able to access the drive using it's extended geometry. 1063 1273 ; Both DANIS506 and IBM1S506 will use the 255/255 scheme. … … 1067 1277 ; Both DANIS506 and IBM1S506 will use the 255/255 scheme. 1068 1278 1069 ; 1 = This drive is above the 65536*255*63 (1052835840) boundary but below 65536*255*127. 1279 ; 1 = This drive is above the 65536*255*63 (1052835840) boundary but 1280 ; below 65536*255*127. 1070 1281 ; OS/2 is able to access the drive using it's extended geometry. 1071 1282 ; Note that DANIS506 will use 255/127 and IBM1S506 will use 255/255 geometry ! -
trunk/BOOTCODE/REGULAR/MATH.ASM
r30 r51 28 28 29 29 30 IFDEF ModuleNames30 IFDEF MODULE_NAMES 31 31 DB 'MATH',0 32 32 ENDIF -
trunk/BOOTCODE/REGULAR/OTHER.ASM
r50 r51 20 20 ;--------------------------------------------------------------------------- 21 21 22 IFDEF ModuleNames22 IFDEF MODULE_NAMES 23 23 DB 'OTHER',0 24 24 ENDIF … … 82 82 GetLenOfStrings EndP 83 83 84 85 86 87 ; 88 ; DO PREPARING STUFF. 89 ; 84 90 PRECRAP_Main Proc Near 85 91 ; First initialize Variable-Area (everything with NUL) … … 87 93 ; to an offset. We want everything after the code to be nullified. 88 94 mov di, offset sobss 89 mov cx, offset EndOfVariables -offset BeginOfVariables95 mov cx, offset EndOfVariables - offset sobss 90 96 xor ax, ax 91 97 shr cx, 1 … … 93 99 rep stosw 94 100 101 102 ; 103 ; Tasm needs .386 to handle 32-bit constants so we push the current 104 ; operating state and switch temporarily to handle 105 ; InitialFreeDriveletterMap. 106 ; 107 IFDEF TASM 108 pushstate 109 .386 110 ENDIF 111 ; Initialize the FreeDriveletterMap. 112 ; This is used by driveletter reassignment functions. 113 mov di, offset [FreeDriveletterMap] 114 mov ax, InitialFreeDriveletterMap AND 0ffffh 115 cld 116 stosw 117 mov ax, InitialFreeDriveletterMap SHR 16 118 stosw 119 ; 120 ; Restore Tasm operating state. 121 ; 122 IFDEF TASM 123 popstate 124 ENDIF 125 126 127 ; Use video page 0 for screen output 95 128 mov word ptr [VideoIO_Segment], VideoIO_Page0 96 129 … … 134 167 135 168 136 ; This sets [CurIO_UseExtension] flag 169 ; This sets [CurIO_UseExtension] flag. 137 170 call PRECRAP_CheckFor13extensions 138 171 mov al,[CurIO_UseExtension] 139 172 test al,al 140 jnz INT13X_Present 141 142 ; 143 ; Change this to a popup. 144 ; 145 INT13X_Missing db '!! NO INT13X !!',0 146 mov si, offset INT13X_Missing 147 call MBR_Teletype 148 jmp MBR_HaltSystem 149 150 INT13X_Present: 173 jnz INT13X_Supported 174 175 ; 176 ; Show Message that BIOS INT13X is not supported 177 ; and Halt the System. 178 ; 179 mov cx, 0C04h 180 mov si, offset TXT_NoINT13XSupport 181 call SETUP_ShowErrorBox 182 183 ; Halt the system. 184 jmp HaltSystem 185 186 187 ; 188 ; INT13X Supported so continue. 189 ; 190 INT13X_Supported: 191 151 192 xor cx,cx 152 193 PRECRAP_Main_next_disk: … … 160 201 call DriveIO_GatherDiskInfo ; Also used to fill the geo, should be separate function 161 202 162 mov bx,offset HugeDisk203 mov bx,offset [HugeDisk] 163 204 add bx,cx 164 205 mov [bx], al … … 178 219 ;~ call VideoIO_PrintSingleChar 179 220 180 mov bx, offset TrueSecs221 mov bx, offset [TrueSecs] 181 222 add bx,cx 182 223 add bx,cx … … 190 231 191 232 ; ?? 3f bij disk 80h maar 0 bij disk 81h 192 mov si,offset LVMSector233 mov si,offset [LVMSector] 193 234 mov ax,[si+LocLVM_Secs] 194 235 … … 209 250 NoValidMasterLVM: 210 251 push bx ; push truesecs pointer 211 mov bx, offset BIOS_Secs252 mov bx, offset [BIOS_Secs] 212 253 add bx,cx 213 254 add bx,cx … … 227 268 228 269 229 IFDEF AUX_DEBUG270 IFDEF AUX_DEBUG 230 271 ; Write some debug-info to the com-port 231 272 call DEBUG_Dump1 … … 253 294 254 295 ; Huge Disk indicator 255 mov si, offset HugeBootDisk296 mov si, offset [HugeBootDisk] 256 297 call MBR_Teletype 257 298 mov al,[HugeDisk] 258 mov si, offset No299 mov si, offset [No] 259 300 test al,al 260 301 jz MBR_HugeDriveIndicator 261 mov si, offset Yes302 mov si, offset [Yes] 262 303 263 304 MBR_HugeDriveIndicator: … … 270 311 ; Phase 1 Indicator 271 312 ; 272 mov si, offset Phase1313 mov si, offset [Phase1] 273 314 call MBR_Teletype 274 315 … … 286 327 287 328 ; Calculate Cooper-Bar Tables 329 IFDEF FX_ENABLED 288 330 call FX_CalculateTables 331 ENDIF 289 332 290 333 ; Calculate LVM-CRC-Table … … 312 355 313 356 314 call PRECRAP_CheckConfiguration 357 ; 358 ; Check valididy of the AiR-BOOT Configuration. 359 ; 360 call PRECRAP_CheckConfiguration 315 361 316 362 … … 366 412 ret 367 413 PRECRAP_Main EndP 414 415 416 368 417 369 418 AFTERCRAP_Main Proc Near … … 381 430 ret 382 431 AFTERCRAP_Main EndP 432 433 434 383 435 384 436 PRECRAP_CheckFor13extensions Proc Near -
trunk/BOOTCODE/REGULAR/PARTMAIN.ASM
r50 r51 20 20 ;--------------------------------------------------------------------------- 21 21 22 IFDEF ModuleNames22 IFDEF MODULE_NAMES 23 23 DB 'PARTMAIN',0 24 24 ENDIF 25 25 26 26 PART_FixUpDefaultPartitionValues Proc Near Uses dx si di 27 ; Fix-Up Default and Last Partition - If lost, search for Bootable28 xor bl, bl29 mov dl, CFG_PartDefault30 call PART_FixUpSelectionNumber31 mov CFG_PartDefault, dl32 mov dl, CFG_PartLast33 call PART_FixUpSelectionNumber34 mov CFG_PartLast, dl35 mov dl, CFG_PartAutomatic36 call PART_FixUpSelectionNumber37 mov CFG_PartAutomatic, dl27 ; Fix-Up Default and Last Partition - If lost, search for Bootable 28 xor bl, bl 29 mov dl, CFG_PartDefault 30 call PART_FixUpSelectionNumber 31 mov CFG_PartDefault, dl 32 mov dl, CFG_PartLast 33 call PART_FixUpSelectionNumber 34 mov CFG_PartLast, dl 35 mov dl, CFG_PartAutomatic 36 call PART_FixUpSelectionNumber 37 mov CFG_PartAutomatic, dl 38 38 39 39 ; [Linux support removed since v1.02] … … 68 68 ; Out: DL - New number of partition (guessed normally ;) 69 69 PART_FixUpSelectionNumber Proc Near Uses ax cx 70 cmp dl, 080h 71 je PFUPN_SelectionDisabled 72 ja PFUPN_SpecialSelection 73 call PARTSCAN_GetXref ; DL - PartitionNo prev IPT 74 cmp dh, 0FFh ; DH -> Partition No in new IPT 75 je PFUPN_SelectionGone 76 mov dl, dh 77 PFUPN_SelectionDisabled: 78 ret 79 80 PFUPN_SpecialSelection: 81 cmp dl, 0FEh ; Resume-BIOS? 82 ja PFUPN_SpecialSelectionFloppy 83 cmp byte ptr [CFG_ResumeBIOSbootSeq], 0 84 je PFUPN_SelectionGone 85 jmp PFUPN_Found 86 PFUPN_SpecialSelectionFloppy: 87 cmp byte ptr [CFG_IncludeFloppy], 0 88 je PFUPN_SelectionGone 89 jmp PFUPN_Found 90 91 ; Partition is not referenced in New-IPT or Resume-BIOS/Floppy selected, but 92 ; actual media is disabled...so dig for requested partition 93 PFUPN_SelectionGone: 94 mov cl, CFG_Partitions 95 or cl, cl 96 jz PFUPN_NothingFound ; No partitions available -> so fail 97 or bl, bl 98 jz PFUPN_BootableSearchLoop 99 ; Search for Partition ID "BL" 100 PFUPN_PartIDsearchLoop: 101 call PART_GetPartitionPointer ; Gets SI for partition DL 102 cmp bptr ds:[si+LocIPT_SystemID], bl 103 je PFUPN_Found 104 dec cl 105 jz PFUPN_NothingFound 106 inc dl ; Increase 107 cmp CFG_Partitions, dl 108 ja PFUPN_PartIDsearchLoop 109 xor dl, dl 110 jmp PFUPN_PartIDsearchLoop 111 112 ; Search for Partition ID "BL" 113 PFUPN_BootableSearchLoop: 114 call PART_GetPartitionPointer ; Gets SI for partition DL 115 mov al, ds:[si+LocIPT_Flags] 116 and al, Flags_Bootable 117 jnz PFUPN_Found 118 dec cl 119 jz PFUPN_NothingFound 120 inc dl ; Increase 121 cmp CFG_Partitions, dl 122 ja PFUPN_PartIDsearchLoop 123 xor dl, dl 124 jmp PFUPN_PartIDsearchLoop 125 126 PFUPN_NothingFound: 127 mov dl, 080h ; Now being Disabled 128 PFUPN_Found: 129 ret 70 cmp dl, 080h 71 je PFUPN_SelectionDisabled 72 ja PFUPN_SpecialSelection 73 call PARTSCAN_GetXref ; DL - PartitionNo prev IPT 74 cmp dh, 0FFh ; DH -> Partition No in new IPT 75 je PFUPN_SelectionGone 76 mov dl, dh 77 PFUPN_SelectionDisabled: 78 ret 79 80 PFUPN_SpecialSelection: 81 cmp dl, 0FEh ; Resume-BIOS? 82 ja PFUPN_SpecialSelectionFloppy 83 cmp byte ptr [CFG_ResumeBIOSbootSeq], 0 84 je PFUPN_SelectionGone 85 jmp PFUPN_Found 86 PFUPN_SpecialSelectionFloppy: 87 cmp byte ptr [CFG_IncludeFloppy], 0 88 je PFUPN_SelectionGone 89 jmp PFUPN_Found 90 91 ; Partition is not referenced in New-IPT or Resume-BIOS/Floppy selected, but 92 ; actual media is disabled...so dig for requested partition 93 PFUPN_SelectionGone: 94 mov cl, CFG_Partitions 95 or cl, cl 96 jz PFUPN_NothingFound ; No partitions available -> so fail 97 or bl, bl 98 jz PFUPN_BootableSearchLoop 99 ; Search for Partition ID "BL" 100 PFUPN_PartIDsearchLoop: 101 call PART_GetPartitionPointer ; Gets SI for partition DL 102 cmp bptr ds:[si+LocIPT_SystemID], bl 103 je PFUPN_Found 104 dec cl 105 jz PFUPN_NothingFound 106 inc dl ; Increase 107 cmp CFG_Partitions, dl 108 ja PFUPN_PartIDsearchLoop 109 xor dl, dl 110 jmp PFUPN_PartIDsearchLoop 111 112 ; Search for Partition ID "BL" 113 PFUPN_BootableSearchLoop: 114 call PART_GetPartitionPointer ; Gets SI for partition DL 115 mov al, ds:[si+LocIPT_Flags] 116 and al, Flags_Bootable 117 jnz PFUPN_Found 118 dec cl 119 jz PFUPN_NothingFound 120 121 inc dl ; Increase 122 cmp CFG_Partitions, dl 123 ja PFUPN_PartIDsearchLoop 124 xor dl, dl 125 jmp PFUPN_PartIDsearchLoop 126 127 PFUPN_NothingFound: 128 mov dl, 080h ; Now being Disabled 129 PFUPN_Found: 130 ret 130 131 PART_FixUpSelectionNumber EndP 131 132 … … 135 136 ; Out: *none* (BootRecordCRD updated) 136 137 PART_UpdateBootRecordCRC Proc Near Uses bx 137 mov si, offset PartitionSector138 mov bx, 4B4Dh ; Magic: 'MK'139 call MBR_GetCheckOfSector140 mov [si+LocIPT_BootRecordCRC], bx141 ret138 mov si, offset PartitionSector 139 mov bx, 4B4Dh ; Magic: 'MK' 140 call MBR_GetCheckOfSector 141 mov [si+LocIPT_BootRecordCRC], bx 142 ret 142 143 PART_UpdateBootRecordCRC EndP 144 145 146 ; 147 ; What happens here ? 148 ; 149 150 ; Rousseau: 151 ; --------- 152 ; Bug: 153 ; When ResumeBIOSbootSeq is zero, BX still gets decremented and shifted left. 154 ; Then when used as an index into ContinueBIOSbootTable to get the address 155 ; of the device-name, the index is two bytes too low, and SI get's loaded 156 ; with whatever is before the ContinueBIOSbootTable. 157 ; Then when SI is used to copy a null-terminated string, it depends on the 158 ; bogus location SI points to where a null-byte will appear. 159 ; Since I placed some text before the ContinueBIOSbootTable, the bogus pointer 160 ; SI obtained pointed to an area where there was no null-byte in sight for 161 ; more than 11 bytes, causing SI to overwrite the CD-ROM IPT entry with 162 ; garbage. It took me a while to tackle this one because I was baffled why 163 ; moving text around in STD_TEXT.ASM, where ContinueBIOSbootTable resides, 164 ; mattered while the offset of ContinueBIOSbootTable did not change. 165 ; This bug is also present in v1.06 but never surfaced because STD_TEXT.ASM 166 ; is kinda static and luck has it that the word preceding ContinueBIOSbootTable 167 ; presumably pointed to an area where a null byte was near. 168 ; 169 ; Fix: 170 ; Test BX for zero and if so, skip the 171 143 172 144 173 ; Copies the device-name to the Resume-BIOS IPT entry 145 174 PART_UpdateResumeBIOSName Proc Near Uses ax bx cx si di 146 ;movzx bx, CFG_ResumeBIOSbootSeq 147 mov bl,CFG_ResumeBIOSbootSeq 148 mov bh,0 149 150 dec bx 151 shl bx, 1 152 mov si, wptr [ContinueBIOSbootTable+bx] 153 mov di, offset BIOScontIPTentry+LocIPT_Name 154 push di 155 mov cx, 11 156 mov al, ' ' 157 rep stosb 158 pop di 159 PURBN_BootDeviceCopyLoop: 160 lodsb 161 or al, al 162 jz PURBN_NoResumeBootSeq 163 stosb 164 jmp PURBN_BootDeviceCopyLoop 165 PURBN_NoResumeBootSeq: 166 ret 175 176 ; Get BIOS resume indicator. 177 ;movzx bx, CFG_ResumeBIOSbootSeq 178 mov bl,CFG_ResumeBIOSbootSeq 179 mov bh,0 180 181 ; Clear name of IPT-entry. 182 mov di, offset BIOScontIPTentry+LocIPT_Name 183 push di 184 mov cx, 11 185 mov al, ' ' 186 rep stosb 187 pop di 188 189 ; If no resume then exit. 190 test bx,bx 191 jz PURBN_NoResumeBootSeq 192 193 ; Convert to index in name-table. 194 dec bx 195 shl bx, 1 196 197 ; Put the pointer to the name in SI. 198 mov si, word ptr [ContinueBIOSbootTable+bx] 199 200 ; Copy the name to the IPT-entry. 201 PURBN_BootDeviceCopyLoop: 202 lodsb 203 or al, al 204 jz PURBN_NoResumeBootSeq 205 stosb 206 jmp PURBN_BootDeviceCopyLoop 207 208 ; We're done. 209 PURBN_NoResumeBootSeq: 210 211 ret 167 212 PART_UpdateResumeBIOSName EndP 213 214 168 215 169 216 ; ============================================================================ … … 173 220 ; Builds Pointer-Table straight (without filtering, w/o Floppy/CD-ROM/Kernels) 174 221 PART_CalculateStraightPartPointers Proc Near 175 mov ax, offset PartitionTable 176 mov bx, offset PartitionPointers 177 mov cx, LocIPT_MaxPartitions 178 PCSPP_Loop: 179 mov ds:[bx], ax 180 add bx, 2 181 add ax, LocIPT_LenOfIPT 182 dec cx 183 jnz PCSPP_Loop 184 mov al, ds:[CFG_Partitions] 185 mov ds:[PartitionPointerCount], al 186 ret 222 mov ax, offset PartitionTable 223 mov bx, offset PartitionPointers 224 mov cx, LocIPT_MaxPartitions 225 226 PCSPP_Loop: 227 mov ds:[bx], ax ; Move address IPT entry to PPT 228 add bx, 2 ; Advance pointer to PPT entry 229 add ax, LocIPT_LenOfIPT ; Advance pointer to IPT entry 230 dec cx ; Decrement counter 231 jnz PCSPP_Loop ; Next iteration 232 233 mov al, ds:[CFG_Partitions] ; Get number of partitions 234 mov ds:[PartitionPointerCount], al ; Update number for PPT 235 ret 187 236 PART_CalculateStraightPartPointers EndP 188 237 … … 190 239 ; [this means filtering and including Floppy/CD-ROM/Kernels, if wanted] 191 240 PART_CalculateMenuPartPointers Proc Near Uses si 192 mov si, offset PartitionTable 193 mov bx, offset PartitionPointers 194 test byte ptr [CFG_IncludeFloppy], 1 195 jz PCMPP_NoFloppyInclude 196 mov ax, offset FloppyIPTentry 197 mov ds:[bx], ax 198 add bx, 2 199 PCMPP_NoFloppyInclude: 200 201 test byte ptr [CFG_ResumeBIOSbootSeq], 0FFh 202 jz PCMPP_NoResumeBootSeqInclude 203 mov ax, offset BIOScontIPTentry 204 mov ds:[bx], ax 205 add bx, 2 206 PCMPP_NoResumeBootSeqInclude: 241 242 ;! 243 ;! DEBUG_PROBE 244 ;! 245 IFDEF AUX_DEBUGx 246 push 1241h 247 call DEBUG_Probe 248 ENDIF 249 250 mov si, offset PartitionTable 251 mov bx, offset PartitionPointers 252 test byte ptr [CFG_IncludeFloppy], 1 253 jz PCMPP_NoFloppyInclude 254 mov ax, offset FloppyIPTentry 255 mov ds:[bx], ax 256 add bx, 2 257 PCMPP_NoFloppyInclude: 258 259 test byte ptr [CFG_ResumeBIOSbootSeq], 0FFh 260 jz PCMPP_NoResumeBootSeqInclude 261 mov ax, offset BIOScontIPTentry 262 mov ds:[bx], ax 263 add bx, 2 264 PCMPP_NoResumeBootSeqInclude: 207 265 208 266 ; [Linux support removed since v1.02] … … 220 278 ; PCMPP_NoLinuxKernels: 221 279 222 ;movzx cx, CFG_Partitions ; LocIPT_MaxPartitions223 mov cl,CFG_Partitions ; LocIPT_MaxPartitions224 mov ch,0225 226 or cx, cx227 jz PCMPP_NoPartitions228 PCMPP_Loop:229 mov al, ds:[si+LocIPT_Flags]230 and al, Flags_Bootable231 jz PCMPP_IsNotBootable232 mov ds:[bx], si233 add bx, 2234 235 add si, LocIPT_LenOfIPT236 dec cx237 jnz PCMPP_Loop238 PCMPP_NoPartitions:239 sub bx, offset PartitionPointers240 shr bx, 1241 mov ds:[PartitionPointerCount], bl242 ret280 ;movzx cx, CFG_Partitions ; LocIPT_MaxPartitions 281 mov cl,CFG_Partitions ; LocIPT_MaxPartitions 282 mov ch,0 283 284 or cx, cx 285 jz PCMPP_NoPartitions 286 PCMPP_Loop: 287 mov al, ds:[si+LocIPT_Flags] 288 and al, Flags_Bootable 289 jz PCMPP_IsNotBootable 290 mov ds:[bx], si 291 add bx, 2 292 PCMPP_IsNotBootable: 293 add si, LocIPT_LenOfIPT 294 dec cx 295 jnz PCMPP_Loop 296 PCMPP_NoPartitions: 297 sub bx, offset PartitionPointers 298 shr bx, 1 299 mov ds:[PartitionPointerCount], bl 300 ret 243 301 PART_CalculateMenuPartPointers EndP 244 302 … … 247 305 ; Out: SI - Pointer to it 248 306 PART_GetPartitionPointer Proc Near Uses bx 249 cmp dl, 0FEh 250 je PGPP_IsBIOSbootSeq ; FEh -> Resume BIOS boot Sequence 251 ja PGPP_IsFloppy ; FFh -> Floppy 252 ;movzx bx, dl 253 mov bl,dl 254 mov bh,0 255 256 shl bx, 1 257 mov si, wptr [PartitionPointers+bx] 258 ret 259 PGPP_IsBIOSbootSeq: 260 mov si, offset BIOScontIPTentry 261 ret 262 PGPP_IsFloppy: 263 mov si, offset FloppyIPTentry ; PartitionTable-LocIPT_LenOfIPT 264 ret 307 cmp dl, 0FEh 308 je PGPP_IsBIOSbootSeq ; FEh -> Resume BIOS boot Sequence 309 ja PGPP_IsFloppy ; FFh -> Floppy 310 ;movzx bx, dl 311 mov bl,dl 312 mov bh,0 313 314 shl bx, 1 315 mov si, word ptr [PartitionPointers+bx] 316 ret 317 318 PGPP_IsBIOSbootSeq: 319 ;! 320 ;! DEBUG_PROBE 321 ;! 322 IFDEF AUX_DEBUGx 323 push 1242h 324 call DEBUG_Probe 325 ENDIF 326 327 mov si, offset BIOScontIPTentry 328 ret 329 330 PGPP_IsFloppy: 331 mov si, offset FloppyIPTentry ; PartitionTable-LocIPT_LenOfIPT 332 ret 265 333 PART_GetPartitionPointer EndP 266 334 … … 269 337 ; Out: DL - Number of partition 270 338 PART_GetPartitionNumber Proc Near Uses bx 271 mov dl, ds:[PartitionPointerCount] 272 mov bx, offset PartitionPointers 273 PGPN_SearchLoop: 274 cmp wptr ds:[bx], si 275 je PGPN_Found 276 add bx, 2 277 dec dl 278 jnz PGPN_SearchLoop 279 mov dl, 0FFh 280 ret 281 PGPN_Found: 282 sub dl, ds:[PartitionPointerCount] 283 dec dl 284 not dl 285 ret 339 mov dl, ds:[PartitionPointerCount] 340 mov bx, offset PartitionPointers 341 PGPN_SearchLoop: 342 cmp word ptr ds:[bx], si 343 je PGPN_Found 344 add bx, 2 345 dec dl 346 jnz PGPN_SearchLoop 347 mov dl, 0FFh 348 ret 349 350 PGPN_Found: 351 sub dl, ds:[PartitionPointerCount] 352 dec dl 353 not dl 354 ret 286 355 PART_GetPartitionNumber EndP 287 356 357 358 ; 288 359 ; Following functions are only usable, when Partition-Pointer-View is filtered 360 ; 361 289 362 ; They will convert from and to unfiltered view (used in Boot-Menu) 290 363 ; In: DL - Number of partition in filtered view 291 364 ; Out: DL - Number of partition in straight view 365 ; 366 ; This gets the address of the IPT-entry from the Partition Pointer Table and 367 ; converts that to an index into the IPT; the straight view. 368 ; 292 369 PART_ConvertToStraight Proc Near 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 299 cmp ax, offset FloppyIPTentry 300 jb PCTS_IsBIOSbootSeq 301 je PCTS_IsFloppy 370 ;movzx bx, dl 371 mov bl,dl ; Partition number to BX 372 mov bh,0 373 374 shl bx, 1 ; Convert to word index 375 mov ax, word ptr cs:[PartitionPointers+bx] ; Get the partition pointer 376 cmp ax, offset FloppyIPTentry ; Check for Floppy 377 jb PCTS_IsBIOSbootSeq ; Nope, is BIOS-bootseq 378 je PCTS_IsFloppy ; Is Floppy 379 302 380 ; [Linux support removed since v1.02] 303 381 ; cmp ax, offset LINUX_KernelEntries 304 382 ; jae PCTS_IsKernelEntry 305 sub ax, offset PartitionTable 306 mov bl, LocIPT_LenOfIPT 307 div bl ; Divide with IPTlength 308 mov dl, al 309 ret 383 384 ; 385 ; Is partition, AX contains pointer to IPT entry 386 ; 387 sub ax, offset PartitionTable ; Make relative 388 mov bl, LocIPT_LenOfIPT ; Length of IPT entry 389 div bl ; Divide with IPTlength 390 mov dl, al ; Index in IPT 391 ret 392 310 393 ; [Linux support removed since v1.02] 311 394 ; PCTS_IsKernelEntry: 312 395 ; mov dl, 0FDh 313 396 ; ret 314 PCTS_IsBIOSbootSeq: 315 mov dl, 0FEh 316 ret 317 PCTS_IsFloppy: 318 mov dl, 0FFh 319 ret 397 398 PCTS_IsBIOSbootSeq: 399 mov dl, 0FEh 400 ret 401 PCTS_IsFloppy: 402 mov dl, 0FFh 403 ret 320 404 PART_ConvertToStraight EndP 405 406 321 407 322 408 ; In: DL - Number of partition in straight view 323 409 ; Out: DL - Number of partition in filtered view 410 ; 411 ; This searches for the absolute offset of an IPT-entry in the 412 ; PartitionPointers table. 413 ; This table holds the offsets of IPT partition entries that are in the Menu ? 414 ; If the offset/entry is found it's index, the filtered number, is returned. 415 ; 324 416 PART_ConvertFromStraight Proc Near Uses es di 325 cmp dl, 0FEh 326 jb PCFS_IsPartition 327 mov ax, offset BIOScontIPTentry 328 je PCFS_DoSearch 329 mov ax, offset FloppyIPTentry 330 jmp PCFS_DoSearch 331 PCFS_IsPartition: 332 ; First we get Partition-Offset in AX 333 ;movzx ax, dl 334 mov al,dl 335 mov ah,0 336 337 mov bl, LocIPT_LenOfIPT 338 mul bl 339 add ax, offset PartitionTable 340 PCFS_DoSearch: 341 ; Now search for this offset in our filtered Partition-Pointer-Table 342 push cs 343 pop es 344 mov di, offset PartitionPointers 345 mov cx, LocIPT_MaxPartitions 346 xor dl, dl ; Reply on Not-Found = Partition==0 347 repne scasw ; Compare-Loop 348 jne PCFS_NotFound 349 sub di, 2 ; One Back, so point to compared value 350 mov dx, di 351 sub dx, offset PartitionPointers 352 shr dx, 1 353 ; Adjust for IncludeFloppy/etc. is automatically done, due Pointer-LookUp 354 PCFS_NotFound: 355 ret 417 ;! 418 ;! DEBUG_PROBE 419 ;! 420 IFDEF AUX_DEBUGx 421 push 1243h 422 call DEBUG_Probe 423 ENDIF 424 425 cmp dl, 0FEh 426 jb PCFS_IsPartition 427 mov ax, offset BIOScontIPTentry 428 je PCFS_DoSearch 429 mov ax, offset FloppyIPTentry 430 jmp PCFS_DoSearch 431 432 433 PCFS_IsPartition: 434 ; First we get Partition-Offset in AX 435 ;movzx ax, dl 436 mov al,dl ; Index in IPT to AX 437 mov ah,0 438 mov bl, LocIPT_LenOfIPT ; Length of an IPT entry 439 mul bl ; Mul to get relative offset 440 add ax, offset PartitionTable ; Add to get absolute offset 441 442 ; 443 ; AX now points to the IPT entry of the partition. 444 ; This address is searched for in the Partition Pointer Table. 445 ; 446 447 PCFS_DoSearch: 448 ; Now search for this offset in our filtered Partition-Pointer-Table 449 push cs 450 pop es 451 mov di, offset PartitionPointers ; Point to table 452 mov cx, LocIPT_MaxPartitions ; Max number of entries to search 453 xor dl, dl ; Reply on Not-Found = Partition==0 454 repne scasw ; Compare-Loop 455 jne PCFS_NotFound 456 sub di, 2 ; One Back, so point to compared value 457 mov dx, di ; Offset in DX 458 sub dx, offset PartitionPointers ; Make relative 459 shr dx, 1 ; Convert to Index 460 ; Adjust for IncludeFloppy/etc. is automatically done, due Pointer-LookUp 461 PCFS_NotFound: 462 ret 356 463 PART_ConvertFromStraight EndP 464 465 357 466 358 467 ; In: AX - Pointer to IPT Entry … … 363 472 ; cmp ax, offset LINUX_KernelEntries 364 473 ; jae PGSEP_IsKernelEntry 365 mov si, offset PartitionSizeTable366 sub ax, offset PartitionTable474 mov si, offset PartitionSizeTable 475 sub ax, offset PartitionTable 367 476 ; jmp PGSEP_Continue 368 477 ; [Linux support removed since v1.02] … … 371 480 ; sub ax, offset LINUX_KernelEntries 372 481 ; PGSEP_Continue: 373 mov bl, LocIPT_LenOfIPT374 div bl ; Divide with IPTlength375 ;movzx bx, al376 mov bl,al377 mov bh,0378 379 shl ax, 1380 shl bx, 2381 add ax, bx ; My way of multiplying with 6382 add si, ax ; SI - Partition Size-Element383 ret482 mov bl, LocIPT_LenOfIPT 483 div bl ; Divide with IPTlength 484 ;movzx bx, al 485 mov bl,al 486 mov bh,0 487 488 shl ax, 1 489 shl bx, 2 490 add ax, bx ; My way of multiplying with 6 491 add si, ax ; SI - Partition Size-Element 492 ret 384 493 PART_GetSizeElementPointer EndP 385 494 … … 389 498 ; Destroyed: AX, BX, DI 390 499 PART_FillOutSizeElement Proc Near Uses cx dx 391 add di, 3 ; ES:DI - Last Digit of Size Digits392 shr bx, 1393 rcr ax, 1 ; /2 -> Sector Size is now KByte Size394 xor cl, cl ; 0 - KByte, 1 - MByte, 2 - GByte395 PFOSE_MakeSmallerLoop:396 or bx, bx397 jnz PFOSE_MakeSmaller398 cmp ax, 9999399 jbe PFOSE_IsSmallEnough400 401 mov dx, bx402 and dx, 1023 ; My crazy way of dividing a 32-bit403 shr ax, 10 ; value through 1024 using 16-bit404 shr bx, 10 ; instructions...405 shl dx, 6406 or ax, dx407 inc cl ; Value got smaller...408 jmp PFOSE_MakeSmallerLoop409 410 PFOSE_IsSmallEnough:411 ; First write the type of this Size-Element (KB/MB/GB)412 mov bx, 'BK'413 cmp cl, 1414 jb PFOSE_WriteType415 je PFOSE_IsMBtype416 mov bx, 'BG'417 jmp PFOSE_WriteType418 PFOSE_IsMBtype:419 mov bx, 'BM'420 PFOSE_WriteType:421 mov wptr es:[di+1], bx422 mov bx, 10 ; Digits are 10-Based423 xor dx, dx424 PFOSE_DigitLoop:425 xor dx, dx426 div bx ; AX - Digit, DX - Remainder427 add dl, '0' ; Convert digit to ASCII digit428 mov es:[di], dl429 or ax, ax430 jz PFOSE_EndOfDigitLoop431 dec di ; Go to previous char432 jmp PFOSE_DigitLoop433 434 PFOSE_EndOfDigitLoop:435 ret500 add di, 3 ; ES:DI - Last Digit of Size Digits 501 shr bx, 1 502 rcr ax, 1 ; /2 -> Sector Size is now KByte Size 503 xor cl, cl ; 0 - KByte, 1 - MByte, 2 - GByte 504 PFOSE_MakeSmallerLoop: 505 or bx, bx 506 jnz PFOSE_MakeSmaller 507 cmp ax, 9999 508 jbe PFOSE_IsSmallEnough 509 PFOSE_MakeSmaller: 510 mov dx, bx 511 and dx, 1023 ; My crazy way of dividing a 32-bit 512 shr ax, 10 ; value through 1024 using 16-bit 513 shr bx, 10 ; instructions... 514 shl dx, 6 515 or ax, dx 516 inc cl ; Value got smaller... 517 jmp PFOSE_MakeSmallerLoop 518 519 PFOSE_IsSmallEnough: 520 ; First write the type of this Size-Element (KB/MB/GB) 521 mov bx, 'BK' 522 cmp cl, 1 523 jb PFOSE_WriteType 524 je PFOSE_IsMBtype 525 mov bx, 'BG' 526 jmp PFOSE_WriteType 527 PFOSE_IsMBtype: 528 mov bx, 'BM' 529 PFOSE_WriteType: 530 mov word ptr es:[di+1], bx 531 mov bx, 10 ; Digits are 10-Based 532 xor dx, dx 533 PFOSE_DigitLoop: 534 xor dx, dx 535 div bx ; AX - Digit, DX - Remainder 536 add dl, '0' ; Convert digit to ASCII digit 537 mov es:[di], dl 538 or ax, ax 539 jz PFOSE_EndOfDigitLoop 540 dec di ; Go to previous char 541 jmp PFOSE_DigitLoop 542 543 PFOSE_EndOfDigitLoop: 544 ret 436 545 PART_FillOutSizeElement EndP 437 546 … … 450 559 ; Destroyed: None 451 560 PART_HidePartition Proc Near Uses ax bx cx dx si di 452 call PART_GetPartitionPointer ; Pointer to partition (DL) -> SI453 454 ; First load the partition table of that partition...455 mov ax, wptr [si+LocIPT_AbsolutePartTable+0]456 mov bx, wptr [si+LocIPT_AbsolutePartTable+2]457 mov cx, wptr [si+LocIPT_LocationPartTable+1]458 mov dh, bptr [si+LocIPT_LocationPartTable+0]459 mov dl, [si+LocIPT_Drive]460 call DriveIO_LoadPartition461 ; Partition-Table now LOADED462 mov di, offset PartitionSector+446 ; ES:DI - 1st partitionentry...463 464 ; Put our partition's location into registers...465 mov ax, wptr [si+LocIPT_AbsoluteBegin+0]466 mov bx, wptr [si+LocIPT_AbsoluteBegin+2]467 sub ax, wptr [si+LocIPT_AbsolutePartTable+0]468 sbb bx, wptr [si+LocIPT_AbsolutePartTable+2]469 ; BX:AX - absolute position of partition relative to partition table470 ; ...and search for it...471 PHP_SearchLoop:472 cmp ax, wptr es:[di+LocBRPT_RelativeBegin]473 jne PHP_SearchMismatch474 cmp bx, wptr es:[di+LocBRPT_RelativeBegin+2]475 jne PHP_SearchMismatch476 jmp PHP_SearchMatch477 478 add di, LocBRPT_LenOfEntry ; 16 Bytes per partition entry479 cmp di, 500+offset PartitionSector480 jb PHP_SearchLoop481 jmp MBR_HaltSystem ; not found, something is wrong here482 483 ; Found entry...484 PHP_SearchMatch:485 mov al, bptr es:[di+LocBRPT_SystemID] ; Partition-ID into AL486 call PART_SearchFileSysHiddenID ; Put on =STEALTH=487 mov bptr es:[di+LocBRPT_SystemID], al488 IFDEF ReleaseCode489 call DriveIO_SavePartition ; Saves Partition-Table490 ENDIF491 ret561 call PART_GetPartitionPointer ; Pointer to partition (DL) -> SI 562 563 ; First load the partition table of that partition... 564 mov ax, wptr [si+LocIPT_AbsolutePartTable+0] 565 mov bx, wptr [si+LocIPT_AbsolutePartTable+2] 566 mov cx, wptr [si+LocIPT_LocationPartTable+1] 567 mov dh, bptr [si+LocIPT_LocationPartTable+0] 568 mov dl, [si+LocIPT_Drive] 569 call DriveIO_LoadPartition 570 ; Partition-Table now LOADED 571 mov di, offset PartitionSector+446 ; ES:DI - 1st partitionentry... 572 573 ; Put our partition's location into registers... 574 mov ax, wptr [si+LocIPT_AbsoluteBegin+0] 575 mov bx, wptr [si+LocIPT_AbsoluteBegin+2] 576 sub ax, wptr [si+LocIPT_AbsolutePartTable+0] 577 sbb bx, wptr [si+LocIPT_AbsolutePartTable+2] 578 ; BX:AX - absolute position of partition relative to partition table 579 ; ...and search for it... 580 PHP_SearchLoop: 581 cmp ax, wptr es:[di+LocBRPT_RelativeBegin] 582 jne PHP_SearchMismatch 583 cmp bx, wptr es:[di+LocBRPT_RelativeBegin+2] 584 jne PHP_SearchMismatch 585 jmp PHP_SearchMatch 586 PHP_SearchMismatch: 587 add di, LocBRPT_LenOfEntry ; 16 Bytes per partition entry 588 cmp di, 500+offset PartitionSector 589 jb PHP_SearchLoop 590 jmp MBR_HaltSystem ; not found, something is wrong here 591 592 ; Found entry... 593 PHP_SearchMatch: 594 mov al, bptr es:[di+LocBRPT_SystemID] ; Partition-ID into AL 595 call PART_SearchFileSysHiddenID ; Put on =STEALTH= 596 mov bptr es:[di+LocBRPT_SystemID], al 597 IFDEF ReleaseCode 598 call DriveIO_SavePartition ; Saves Partition-Table 599 ENDIF 600 ret 492 601 PART_HidePartition EndP 602 603 604 605 493 606 494 607 ; This here is for marking the first "good" non-hidden partition as being … … 499 612 ; do anything else. 500 613 PART_MarkFirstGoodPrimary Proc Near Uses ax si di 501 mov di, offset PartitionSector+446 ; DS:SI - 1st partitionentry502 ; First action to do: Remove the active flag from every partition503 push di504 mov cl, 4505 506 507 508 dec cl509 jnz PMPP_RemoveActiveFlagLoop510 pop di511 ; First Search, will hit on any PartitionID that is:512 ; a) not 0513 ; b) not hidden514 ; c) not extended partition (05h or 0Fh)515 PMPP_Search1Loop:516 mov al, bptr es:[di+LocBRPT_SystemID]517 or al, al518 jz PMPP_Search1NoHit519 cmp al, 05h520 je PMPP_Search1NoHit521 cmp al, 0Fh522 je PMPP_Search1NoHit523 mov bl, al ; BL == AL == PartitionID524 push si525 526 pop si ; AL == UnhiddenPartitionID527 cmp al, bl ; if ID is unhidden...528 je PMPP_SearchHit529 PMPP_Search1NoHit:530 add di, LocBRPT_LenOfEntry ; 16 Bytes per Partition-Entry531 cmp di, 500+offset PartitionSector532 jb PMPP_Search1Loop533 534 mov di, offset PartitionSector+446 ; DS:SI - 1st Partition-Entry535 ; Second Search, hit on anything that is not an extended partition536 ; (05 or 0Fh)537 PMPP_Search2Loop:538 mov al, bptr es:[di+LocBRPT_SystemID]539 or al, al540 jz PMPP_Search2NoHit541 cmp al, 05h542 je PMPP_Search2NoHit543 cmp al, 0Fh544 jne PMPP_SearchHit545 PMPP_Search2NoHit:546 add di, LocBRPT_LenOfEntry ; 16 Bytes per Partition-Entry547 cmp di, 500+offset PartitionSector548 jb PMPP_Search2Loop549 jmp PMPP_SearchFailed550 551 PMPP_SearchHit:552 or bptr es:[di], 80h ; SET ACTIVE PARTITION553 PMPP_SearchFailed:554 ret614 mov di, offset PartitionSector+446 ; DS:SI - 1st partitionentry 615 ; First action to do: Remove the active flag from every partition 616 push di 617 mov cl, 4 618 PMPP_RemoveActiveFlagLoop: 619 and bptr es:[di+LocBRPT_Flags], 7Fh 620 add di, LocBRPT_LenOfEntry 621 dec cl 622 jnz PMPP_RemoveActiveFlagLoop 623 pop di 624 ; First Search, will hit on any PartitionID that is: 625 ; a) not 0 626 ; b) not hidden 627 ; c) not extended partition (05h or 0Fh) 628 PMPP_Search1Loop: 629 mov al, bptr es:[di+LocBRPT_SystemID] 630 or al, al 631 jz PMPP_Search1NoHit 632 cmp al, 05h 633 je PMPP_Search1NoHit 634 cmp al, 0Fh 635 je PMPP_Search1NoHit 636 mov bl, al ; BL == AL == PartitionID 637 push si 638 call PART_SearchFileSysName 639 pop si ; AL == UnhiddenPartitionID 640 cmp al, bl ; if ID is unhidden... 641 je PMPP_SearchHit 642 PMPP_Search1NoHit: 643 add di, LocBRPT_LenOfEntry ; 16 Bytes per Partition-Entry 644 cmp di, 500+offset PartitionSector 645 jb PMPP_Search1Loop 646 647 mov di, offset PartitionSector+446 ; DS:SI - 1st Partition-Entry 648 ; Second Search, hit on anything that is not an extended partition 649 ; (05 or 0Fh) 650 PMPP_Search2Loop: 651 mov al, bptr es:[di+LocBRPT_SystemID] 652 or al, al 653 jz PMPP_Search2NoHit 654 cmp al, 05h 655 je PMPP_Search2NoHit 656 cmp al, 0Fh 657 jne PMPP_SearchHit 658 PMPP_Search2NoHit: 659 add di, LocBRPT_LenOfEntry ; 16 Bytes per Partition-Entry 660 cmp di, 500+offset PartitionSector 661 jb PMPP_Search2Loop 662 jmp PMPP_SearchFailed 663 664 PMPP_SearchHit: 665 or bptr es:[di], 80h ; SET ACTIVE PARTITION 666 PMPP_SearchFailed: 667 ret 555 668 PART_MarkFirstGoodPrimary EndP 556 669 … … 561 674 ; Destroyed: *none* 562 675 PART_SearchFileSysName Proc Near Uses bx dx 563 ;movzx bx, al564 mov bl,al565 mov bh,0566 567 mov si, offset FileSysIDs568 PSFSN_SearchLoop:569 lodsw ; AL - NormalID, AH-HiddenID570 mov dl, ds:[si] ; DL - File-System-Flags571 inc si572 cmp al, bl ; Check, if Unhidden-ID matches...573 je PSFSN_Match574 cmp ah, bl ; Check, if Hidden-ID matches...575 je PSFSN_Match576 mov al, bl ; So Unhidden-ID will be Original-ID577 cmp ah, 0 ; Unknown (last ID in table)578 je PSFSN_Match579 inc bh580 jmp PSFSN_SearchLoop581 582 PSFSN_Match:583 ; AL is already Unhidden-ID584 mov ah, dl585 ; AH is now the FileSystem-Flag586 ;movzx bx, bh587 mov bl,bh588 mov bh,0589 590 shl bx, 3 ; Offsets * 8591 mov si, offset FileSysNames592 add si, bx593 ret676 ;movzx bx, al 677 mov bl,al 678 mov bh,0 679 680 mov si, offset FileSysIDs 681 PSFSN_SearchLoop: 682 lodsw ; AL - NormalID, AH-HiddenID 683 mov dl, ds:[si] ; DL - File-System-Flags 684 inc si 685 cmp al, bl ; Check, if Unhidden-ID matches... 686 je PSFSN_Match 687 cmp ah, bl ; Check, if Hidden-ID matches... 688 je PSFSN_Match 689 mov al, bl ; So Unhidden-ID will be Original-ID 690 cmp ah, 0 ; Unknown (last ID in table) 691 je PSFSN_Match 692 inc bh 693 jmp PSFSN_SearchLoop 694 695 PSFSN_Match: 696 ; AL is already Unhidden-ID 697 mov ah, dl 698 ; AH is now the FileSystem-Flag 699 ;movzx bx, bh 700 mov bl,bh 701 mov bh,0 702 703 shl bx, 3 ; Offsets * 8 704 mov si, offset FileSysNames 705 add si, bx 706 ret 594 707 PART_SearchFileSysName EndP 595 708 … … 598 711 ; Out: AL - Hidden File-System-ID 599 712 PART_SearchFileSysHiddenID Proc Near Uses bx 600 ;movzx bx, al601 mov bl,al602 mov bh,0603 604 mov si, offset FileSysIDs605 PSFSHI_SearchLoop:606 lodsw ; AL - NormalID, AH-HiddenID607 inc si608 cmp al, bl ; Check, if Unhidden-ID matches...609 je PSFSHI_Match610 cmp ah, bl ; Check, if Hidden-ID matches...611 je PSFSHI_Match612 mov ah, bl ; So Unhidden-ID will get replied...613 cmp ah, 0 ; Unknown (last ID in table)614 je PSFSHI_Match615 inc bh616 jmp PSFSHI_SearchLoop617 618 PSFSHI_Match:619 mov al, ah ; AL = Hidden ID620 ret713 ;movzx bx, al 714 mov bl,al 715 mov bh,0 716 717 mov si, offset FileSysIDs 718 PSFSHI_SearchLoop: 719 lodsw ; AL - NormalID, AH-HiddenID 720 inc si 721 cmp al, bl ; Check, if Unhidden-ID matches... 722 je PSFSHI_Match 723 cmp ah, bl ; Check, if Hidden-ID matches... 724 je PSFSHI_Match 725 mov ah, bl ; So Unhidden-ID will get replied... 726 cmp ah, 0 ; Unknown (last ID in table) 727 je PSFSHI_Match 728 inc bh 729 jmp PSFSHI_SearchLoop 730 731 PSFSHI_Match: 732 mov al, ah ; AL = Hidden ID 733 ret 621 734 PART_SearchFileSysHiddenID EndP 622 735 … … 625 738 ; Destroyed: None 626 739 PART_CheckForValidPartName Proc Near Uses ax cx dx si 627 ; Our logic is as follows:628 ; If all chars are U -> Invalid (due reformated signature)629 ; If anything below 32, but 0 -> Invalid (due invalid chars)630 ; If anything above 165 -> Invalid (due invalid chars)631 ; If anything between 123-128 -> Invalid (due invalid chars)632 ; DX - holds count of 'U's633 push cx634 or cx, cx635 jz PCFVPN_InvalidName636 xor dx, dx637 638 lodsb639 cmp al, 0640 je PCFVPN_ValidChar641 cmp al, 32642 jb PCFVPN_InvalidName643 cmp al, 165644 ja PCFVPN_InvalidName645 cmp al, 123646 jb PCFVPN_ValidChar647 cmp al, 128648 jbe PCFVPN_InvalidName649 650 cmp al, 'U'651 jne PCFVPN_NoMagic652 inc dx653 654 dec cx655 jnz PCFVPN_CheckLoop656 pop cx657 cmp cx, dx658 clc659 je PCFVPN_WasMagic660 stc661 PCFVPN_WasMagic:662 ret663 PCFVPN_InvalidName:664 pop cx665 clc666 ret740 ; Our logic is as follows: 741 ; If all chars are U -> Invalid (due reformated signature) 742 ; If anything below 32, but 0 -> Invalid (due invalid chars) 743 ; If anything above 165 -> Invalid (due invalid chars) 744 ; If anything between 123-128 -> Invalid (due invalid chars) 745 ; DX - holds count of 'U's 746 push cx 747 or cx, cx 748 jz PCFVPN_InvalidName 749 xor dx, dx 750 PCFVPN_CheckLoop: 751 lodsb 752 cmp al, 0 753 je PCFVPN_ValidChar 754 cmp al, 32 755 jb PCFVPN_InvalidName 756 cmp al, 165 757 ja PCFVPN_InvalidName 758 cmp al, 123 759 jb PCFVPN_ValidChar 760 cmp al, 128 761 jbe PCFVPN_InvalidName 762 PCFVPN_ValidChar: 763 cmp al, 'U' 764 jne PCFVPN_NoMagic 765 inc dx 766 PCFVPN_NoMagic: 767 dec cx 768 jnz PCFVPN_CheckLoop 769 pop cx 770 cmp cx, dx 771 clc 772 je PCFVPN_WasMagic 773 stc 774 PCFVPN_WasMagic: 775 ret 776 PCFVPN_InvalidName: 777 pop cx 778 clc 779 ret 667 780 PART_CheckForValidPartName EndP 668 781 … … 673 786 ; CY set if this entry is also the install-volume 674 787 PART_IsInstallVolume Proc Near Uses ax cx dx si di 675 cld ; Advance upwards with lodsb676 mov di, offset eCS_InstallVolume ; Address of install-volume label (max. 11 chars)677 678 mov cx, 11 ; Maximum length of label679 xor dl, dl ; Not found yet788 cld ; Advance upwards with lodsb 789 mov di, offset eCS_InstallVolume ; Address of install-volume label (max. 11 chars) 790 791 mov cx, 11 ; Maximum length of label 792 xor dl, dl ; Not found yet 680 793 681 794 ; Compare next character 682 795 PART_IsInstallVolumeNext: 683 lodsb ; Load byte from SI (IPT-entry)684 ;cmp al,' ' ; If space then use zero685 ;jne PART_IsInstallVolume_skip1686 ;xor al,al687 PART_IsInstallVolume_skip1:688 xchg ah,al ; Save char to AH689 xchg si,di ; Exchange pointers690 lodsb ; Load byte from SI (install-volume label)691 ;cmp al,' ' ; If space then use zero692 ;jne PART_IsInstallVolume_skip2693 ;xor al,al694 PART_IsInstallVolume_skip2:695 xchg si,di ; Reexchange pointers696 ;call AuxIO_Teletype697 call CONV_ToUpper698 ;call AuxIO_Teletype699 xchg al,ah700 ;call AuxIO_Teletype701 call CONV_ToUpper702 ;call AuxIO_Teletype703 ;call AuxIO_TeletypeNL704 705 ; Are both of them zero ?706 ; Then the names could be the same, but cx must not equal 11707 ; because that would indicate a null-string.708 mov dh,al709 or dh,ah710 jz PART_IsInstallVolumeFound711 712 cmp ah,al ; Are the the same ?713 jnz PART_IsInstallVolumeNotFound ; Nope, compare ended714 loop PART_IsInstallVolumeNext ; Yep, Compare next character715 716 PART_IsInstallVolumeFound:717 ; If CX is still 11 this was a zero string718 ; and thus not a valid volume-name.719 ; This should not occur as this function is only called when the first720 ; byte is non-zero.721 cmp cx,11722 je PART_IsInstallVolumeNotFound723 ; Found !724 mov dl,1 ; Found725 jmp PART_IsInstallVolumeEnd726 727 728 PART_IsInstallVolumeNotFound:729 mov dl,0730 jmp PART_IsInstallVolumeEnd731 732 733 PART_IsInstallVolumeEnd:734 ; Set the status in CY735 mov al,dl736 add al,'0'737 ;call AuxIO_TeletypeHexByte738 ;call AuxIO_TeletypeNL739 rcr dl,1 ; Put found-flag in CY740 ret796 lodsb ; Load byte from SI (IPT-entry) 797 ;cmp al,' ' ; If space then use zero 798 ;jne PART_IsInstallVolume_skip1 799 ;xor al,al 800 PART_IsInstallVolume_skip1: 801 xchg ah,al ; Save char to AH 802 xchg si,di ; Exchange pointers 803 lodsb ; Load byte from SI (install-volume label) 804 ;cmp al,' ' ; If space then use zero 805 ;jne PART_IsInstallVolume_skip2 806 ;xor al,al 807 PART_IsInstallVolume_skip2: 808 xchg si,di ; Reexchange pointers 809 ;~ call AuxIO_Teletype 810 call CONV_ToUpper 811 ;~ call AuxIO_Teletype 812 xchg al,ah 813 ;~ call AuxIO_Teletype 814 call CONV_ToUpper 815 ;~ call AuxIO_Teletype 816 ;~ call AuxIO_TeletypeNL 817 818 ; Are both of them zero ? 819 ; Then the names could be the same, but cx must not equal 11 820 ; because that would indicate a null-string. 821 mov dh,al 822 or dh,ah 823 jz PART_IsInstallVolumeFound 824 825 cmp ah,al ; Are the the same ? 826 jnz PART_IsInstallVolumeNotFound ; Nope, compare ended 827 loop PART_IsInstallVolumeNext ; Yep, Compare next character 828 829 PART_IsInstallVolumeFound: 830 ; If CX is still 11 this was a zero string 831 ; and thus not a valid volume-name. 832 ; This should not occur as this function is only called when the first 833 ; byte is non-zero. 834 cmp cx,11 835 je PART_IsInstallVolumeNotFound 836 ; Found ! 837 mov dl,1 ; Found 838 jmp PART_IsInstallVolumeEnd 839 840 841 PART_IsInstallVolumeNotFound: 842 mov dl,0 843 jmp PART_IsInstallVolumeEnd 844 845 846 PART_IsInstallVolumeEnd: 847 ; Set the status in CY 848 mov al,dl 849 add al,'0' 850 ;~ call AuxIO_TeletypeHexByte 851 ;~ call AuxIO_TeletypeNL 852 rcr dl,1 ; Put found-flag in CY 853 ret 741 854 PART_IsInstallVolume EndP 742 855 … … 749 862 PART_SetupPhase1 Proc Uses bx cx dx si di 750 863 751 752 753 754 755 756 757 758 759 760 761 762 763 864 ; 865 ; Enumberate Bootable Systems by name 866 ; and prepare Phase 1 if active. 867 ; 868 ; This can also be implemented using the 869 ; Installable LVM-flag I think. 870 ; But at the time I had lesser knowledge about LVM... 871 ; So this algorithm may change in the future. 872 ; 873 mov byte ptr [Phase1Active],0 ; Clear phase1 indicator 874 mov si, offset PartitionTable ; Pointer to IPT 875 xor cx,cx 876 mov cl,[CFG_Partitions] ; Partitions in IPT 764 877 765 878 ; Process next entry in IPT 766 879 MBR_Parts: 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 880 add si, 4 881 ;push si 882 ;push si 883 ;call MBR_TeletypeVolName 884 ;pop si 885 call PART_IsInstallVolume ; Check if this is install-volume 886 jnc MBR_Parts_NI 887 888 ; 889 ; Install Volume found 890 ; 891 mov byte ptr [Phase1Active],1 ; Set phase1 indicator 892 893 mov al,' ' 894 mov bl,7 895 mov ah, 0eh 896 int 10h 897 898 mov al,'(' 899 mov bl,7 900 mov ah, 0eh 901 int 10h 902 903 904 905 mov al,[CFG_Partitions] 906 sub al,cl 907 908 mov dh,al 909 910 911 mov [CFG_PartAutomatic],al ; Setup entry for install-volume 912 mov [CFG_PartLast],al 913 914 add al,'1' 915 mov bl,7 916 mov ah, 0eh 917 int 10h 918 919 mov al,')' 920 mov bl,7 921 mov ah, 0eh 922 int 10h 923 924 ;mov bx,cx ; ???? 925 926 mov al,dh 927 stc 928 jmp PART_SetupPhase1_found 816 929 817 930 MBR_Parts_NI: 818 819 820 821 822 823 824 825 931 ;xor si,si 932 ;call MBR_TeletypeNL 933 ;pop si 934 add si, 30 ; Add remainder of IPT entry 935 loop MBR_Parts 936 937 mov al,0ffh 938 clc 826 939 827 940 PART_SetupPhase1_found: 828 941 829 942 ret 830 943 831 944 PART_SetupPhase1 EndP … … 836 949 ;~ PART_GetOldPartitionCount Proc Uses cx dx di 837 950 ;~ mov di,offset [PartitionXref] 838 ;~ mov dx, partition_count951 ;~ mov dx,LocIPT_MaxPartitions 839 952 ;~ mov cx,dx 840 953 ;~ mov al,0ffh … … 849 962 850 963 964 965 966 ;~ HELEMAAL NAKIJKEN ! 967 ;~ DRIVELETTER ASIGNMENT CORRIGEREN 968 ;~ WORDT TOCH BOOTDRIVE IN BPB GEZET ALS NON eCS SYSTEEM BOOT ? 969 970 971 851 972 ; ################### 852 973 ; # START PARTITION # … … 857 978 ; Out: No Return... 858 979 ; Destroyed: None, due to no return ;-) 859 ; Logic: - Harddrive: loads partition Table860 ; sets partition active861 ; saves partition table862 ; hides partitions, if needed863 ; Linux-Support, if needed864 ; load boot sector865 ; VIBR checking, if wanted866 ; install MBR Protection, if wanted867 ; Special Boot Support, if needed (OS/2 Extended partitions)868 ; Copy boot-sector to StartBase869 ; run boot sector...980 ; Logic: - Harddrive: loads partition Table 981 ; sets partition active 982 ; saves partition table 983 ; hides partitions, if needed 984 ; Linux-Support, if needed 985 ; load boot sector 986 ; VIBR checking, if wanted 987 ; install MBR Protection, if wanted 988 ; Special Boot Support, if needed (OS/2 Extended partitions) 989 ; Copy boot-sector to StartBase 990 ; run boot sector... 870 991 PART_StartPartition Proc Near Uses ax dx es di 871 local BootPartNo:byte 872 local PhysDiskBpbIndex:word ; Index into BPB to field of phys-disk 873 local FSType:byte ; The FS used on the loaded BPB 992 ; 993 ; Local Storage for this much too large function. 994 ; 995 local BootPartNo:byte 996 local PhysDiskBpbIndex:word ; Index into BPB to field of phys-disk 997 local FSType:byte ; The FS used on the loaded BPB 874 998 ; Only used for FAT/HPFS/JFS 875 876 ; Get Partition-Pointer (SI) to Partition-To-Boot (DL) 877 call PART_GetPartitionPointer 878 879 call PART_ConvertToStraight ; ...we save straight view for later... 880 mov BootPartNo, dl 881 ; Straight - FFh -> Floppy boot 882 ; FEh -> BIOS continue (CD-ROM, ZIP, etc.) 883 884 ; We need straight pointers from now on, so calculate the table... 885 call PART_CalculateStraightPartPointers 886 887 ; SI contains the pointer to the IPT to what partition to boot 888 ; in this whole routine...it may never get messed up. 889 890 push si 891 mov dl, [si+LocIPT_Drive] 892 mov dh, [si+LocIPT_SystemID] 893 ; Copy Partition-Name to BootingNow area for display purposes 894 add si, LocIPT_Name 895 896 897 ;pusha 898 ;call MBR_Teletype 899 ;mov si,offset TXT_BootingNowPartName 900 ;call MBR_Teletype 901 ;popa 902 903 mov cx, 11 904 call GetLenOfName 905 mov di, offset TXT_BootingNowPartName 906 jz PSP_NoName 907 rep movsb ; Copy label-name to boot 908 PSP_NoName: 909 xor al, al 910 stosb ; Ending Zero 911 mov si, offset TXT_BootingNow1 ; "Booting the system using " 912 call MBR_Teletype 999 local LVMdl:byte ; LVM drive-letter 1000 local BPBdl:byte ; BPB boot-drive-letter. (at 25h) 1001 1002 1003 ; Get Partition-Pointer (SI) to Partition-To-Boot (DL). 1004 ; DL is filtered partition number and thus uses the PPT. 1005 ; Returned is the address of the IPT entry of the partition to boot. 1006 call PART_GetPartitionPointer 1007 1008 1009 ; 1010 ; SI now points to the IPT entry for the partition to be booted. 1011 ; 1012 1013 1014 ; This converts DL filered view to straight view, aka index into the IPT. 1015 ; Needed for later. 1016 ; Destroys AX,BX 1017 call PART_ConvertToStraight 1018 1019 ; Save for later use. 1020 mov [BootPartNo], dl 1021 ; Straight - FFh -> Floppy boot 1022 ; FEh -> BIOS continue (CD-ROM, ZIP, etc.) 1023 1024 ; This converts the PPT to have pointers to all the IPT entries. 1025 ; We need straight pointers from now on, so calculate the table... 1026 ; Destroys AX,BX,CX 1027 call PART_CalculateStraightPartPointers 1028 1029 1030 1031 ; SI contains the pointer to the IPT to what partition to boot 1032 ; in this whole routine...it may never get messed up. 1033 1034 ; ------------------------------------------------- PRINT NAME BEING BOOTED 1035 1036 push si 1037 mov dl, [si+LocIPT_Drive] ; Disk where partition resides 1038 mov dh, [si+LocIPT_SystemID] ; AB FileSystem ID (08=NTFS, FC=JFS) 1039 ; Copy Partition-Name to BootingNow area for display purposes 1040 add si, LocIPT_Name ; Advance to AB partition-name 1041 mov cx, 11 ; Max. length of AB name/label 1042 call GetLenOfName ; Returns CX with length of label 1043 mov di, offset TXT_BootingNowPartName 1044 jz PSP_NoName ; Don't copy if zero length label 1045 rep movsb ; Copy label-name to boot 1046 PSP_NoName: 1047 xor al, al ; Null-terminate label-string 1048 stosb ; Ending Zero 1049 1050 ; 1051 ; Display "Booting the system using " 1052 ; 1053 mov si, offset TXT_BootingNow1 1054 call MBR_Teletype 1055 1056 913 1057 ; [Linux support removed since v1.02] 914 1058 ; cmp dh, 0FDh 915 1059 ; je PSP_IsKernel 916 1060 917 ;pusha 918 ;call MBR_Teletype 919 ;mov si,offset TXT_BootingNowPartName 920 ;call MBR_Teletype 921 ;popa 922 923 924 or dl, dl 925 jnz PSP_IsHarddisc 926 ; When booting floppy/CD-ROM/etc., we got other text to be displayed... 927 mov si, offset TXT_BootingNowPartName 928 call MBR_TeletypeVolName 929 jmp PSP_IsFloppyCDROMetc 1061 ;~ pusha 1062 ;~ call MBR_Teletype 1063 ;~ mov si,offset TXT_BootingNowPartName 1064 ;~ call MBR_Teletype 1065 ;~ popa 1066 1067 1068 ; 1069 ; DL will be zero for floppy-disk or 80h+ for harddisk. 1070 ; Note thus that DL contains the BIOS disk numer and not the AB value 1071 ; for floppy or cdrom. 1072 ; 1073 or dl, dl 1074 jnz PSP_IsHarddisc 1075 1076 ; When booting floppy/CD-ROM/etc., we got other text to be displayed... 1077 mov si, offset TXT_BootingNowPartName 1078 call MBR_TeletypeVolName 1079 jmp PSP_IsFloppyCDROMetc ; JUMPS BUITEN SI POP !!! AANPASSEN 1080 930 1081 931 1082 ; [Linux support removed since v1.02] … … 940 1091 ; jmp PSP_IsFloppyCDROMetc 941 1092 942 PSP_IsHarddisc: 943 IFDEF ReleaseCode 944 ; Save configuration on HDD boots (save CFG_PartLast) 945 call DriveIO_SaveConfiguration ; Rousseau: SAVE CONFIGURATION ! 946 ENDIF 947 ;call MBR_Teletype ; Prints out BootingNow2 including PartitionName 948 mov si, offset TXT_BootingNowPartName 949 call MBR_TeletypeVolName 950 mov si, offset TXT_BootingNowPartition 951 call MBR_Teletype 952 pop si ; restores SI (IPT-pointer) 953 954 mov ax, wptr [si+LocIPT_AbsolutePartTable+0] 955 mov bx, wptr [si+LocIPT_AbsolutePartTable+2] 956 mov cx, wptr [si+LocIPT_LocationPartTable+1] 957 mov dh, bptr [si+LocIPT_LocationPartTable+0] 958 mov dl, [si+LocIPT_Drive] 959 960 961 962 ; This loads the MBR in case of PRI or the EBR in case of LOG partitions. 963 call DriveIO_LoadPartition ; Load Table... [LOAD] 964 965 966 967 ; --------------------------------------------------- MODIFY PARTITION TABLE 968 push cs 969 pop es 970 mov di, offset PartitionSector+446 ; ES:DI - First Partitionentry 971 972 ; Remove all active-flags for safety reasons, primary partition table will 973 ; have one partition set active by ScanPartition-routine. 974 push di 975 mov cl, 4 976 PSP_RemoveActiveFlagLoop: 977 and bptr es:[di+LocBRPT_Flags], 7Fh 978 add di, LocBRPT_LenOfEntry 979 dec cl 980 jnz PSP_RemoveActiveFlagLoop 981 pop di 982 983 ; Put the partition-to-be-booted location into registers... 984 mov ax, wptr [si+LocIPT_AbsoluteBegin+0] 985 mov bx, wptr [si+LocIPT_AbsoluteBegin+2] 986 sub ax, wptr [si+LocIPT_AbsolutePartTable+0] 987 sbb bx, wptr [si+LocIPT_AbsolutePartTable+2] 988 ; BX:AX - absolute position of partition relative to partition table 989 ; ...and search for it... 990 PSP_SearchLoop: 991 cmp ax, wptr es:[di+LocBRPT_RelativeBegin] 992 jne PSP_SearchMismatch 993 cmp bx, wptr es:[di+LocBRPT_RelativeBegin+2] 994 jne PSP_SearchMismatch 995 jmp PSP_SearchMatch 996 PSP_SearchMismatch: 997 add di, LocBRPT_LenOfEntry ; 16 Bytes per Partition-Entry 998 cmp di, 500+offset PartitionSector 999 jb PSP_SearchLoop 1000 jmp MBR_HaltSystem 1001 1002 ; -------------------------------------------------------------- ENTRY FOUND 1003 PSP_SearchMatch: 1004 or byte ptr es:[di+LocBRPT_Flags], 80h ; set ACTIVE partition 1005 IFDEF ReleaseCode 1006 call DriveIO_SavePartition ; Saves the Partition-Table [SAVE] 1007 ENDIF 1008 1009 1010 1011 ; ---------------------------------------------------------- OS/2 / eCS I13X 1012 ; Now check if the partition to get booted is above 8 GB. 1013 ; If yes, set magic bytes 'I13X' at 3000:0 for boot-loader to recognize. 1014 ; This method is (c) by IBM <g> 1015 ; Rousseau: Booting IBM-BM also requires the LBA address of the IBM-BM 1016 ; partitionafter the 'I13X' signature. 1017 ; Also, FS needs to be set to 3000H. 1018 ; This info was obtained by examining the LVM 2,x MBR-code. 1019 mov ax, wptr [si+LocIPT_AbsoluteBegin+0] 1020 mov bx, wptr [si+LocIPT_AbsoluteBegin+2] 1021 add ax, wptr es:[di+LocBRPT_AbsoluteLength+0] ; Add length to absolute 1022 adc bx, wptr es:[di+LocBRPT_AbsoluteLength+2] ; begin location 1023 ; BX:AX -> Absolute End-Position of Partition 1024 1025 test byte ptr [CFG_ForceLBAUsage], 1 1093 1094 PSP_IsHarddisc: 1095 1096 1097 IFDEF ReleaseCode 1098 ; 1099 ; Save configuration on HDD boots (save CFG_PartLast) 1100 ; 1101 call DriveIO_SaveConfiguration 1102 ENDIF 1103 1104 1105 ; 1106 ; Prints out BootingNow2 including PartitionName 1107 ; 1108 mov si, offset TXT_BootingNowPartName 1109 call MBR_TeletypeVolName 1110 mov si, offset TXT_BootingNowPartition 1111 call MBR_Teletype 1112 1113 ; restores SI (IPT-pointer) 1114 pop si 1115 1116 1117 1118 ; 1119 ; Get the CHS and LBA location of sector containing 1120 ; the partition-table for the partition. 1121 ; 1122 mov ax, wptr [si+LocIPT_AbsolutePartTable+0] 1123 mov bx, wptr [si+LocIPT_AbsolutePartTable+2] 1124 mov cx, wptr [si+LocIPT_LocationPartTable+1] 1125 mov dh, bptr [si+LocIPT_LocationPartTable+0] 1126 mov dl, [si+LocIPT_Drive] 1127 1128 IFDEF AUX_DEBUG 1129 pusha 1130 mov si,offset ptetb 1131 call AuxIO_Print 1132 call DEBUG_DumpRegisters 1133 call AuxIO_TeletypeNL 1134 mov ax, word ptr [FreeDriveletterMap+00h] 1135 mov dx, word ptr [FreeDriveletterMap+02h] 1136 call AuxIO_TeletypeBinDWord 1137 popa 1138 ENDIF 1139 1140 1141 ; 1142 ; This loads the MBR in case of PRI or the EBR in case of LOG partitions. 1143 ; 1144 call DriveIO_LoadPartition ; Load Table... [LOAD] 1145 1146 1147 ; -------------------------------------------------- MODIFY PARTITION TABLE 1148 1149 ; Make sure ES is correctly setup. 1150 push cs 1151 pop es 1152 1153 ; ES:DI - First Partitionentry 1154 mov di, offset PartitionSector+446 1155 1156 ; Remove all active-flags for safety reasons, primary partition table will 1157 ; have one partition set active by ScanPartition-routine. 1158 push di 1159 mov cl, 4 1160 PSP_RemoveActiveFlagLoop: 1161 and bptr es:[di+LocBRPT_Flags], 7Fh 1162 add di, LocBRPT_LenOfEntry 1163 dec cl 1164 jnz PSP_RemoveActiveFlagLoop 1165 pop di 1166 1167 1168 ; 1169 ; Put the partition-to-be-booted location into registers... 1170 ; 1171 mov ax, wptr [si+LocIPT_AbsoluteBegin+0] 1172 mov bx, wptr [si+LocIPT_AbsoluteBegin+2] 1173 sub ax, wptr [si+LocIPT_AbsolutePartTable+0] 1174 sbb bx, wptr [si+LocIPT_AbsolutePartTable+2] 1175 1176 1177 ; BX:AX - absolute position of partition relative to partition table 1178 ; ...and search for it... 1179 PSP_SearchLoop: 1180 cmp ax, wptr es:[di+LocBRPT_RelativeBegin] 1181 jne PSP_SearchMismatch 1182 cmp bx, wptr es:[di+LocBRPT_RelativeBegin+2] 1183 jne PSP_SearchMismatch 1184 jmp PSP_SearchMatch 1185 PSP_SearchMismatch: 1186 add di, LocBRPT_LenOfEntry ; 16 Bytes per Partition-Entry 1187 cmp di, 500+offset PartitionSector 1188 jb PSP_SearchLoop 1189 1190 ; 1191 ; Entry not found, Halt System. 1192 ; 1193 jmp MBR_HaltSystem 1194 1195 ; ------------------------------------------------------------- ENTRY FOUND 1196 PSP_SearchMatch: 1197 or byte ptr es:[di+LocBRPT_Flags], 80h ; set ACTIVE partition 1198 1199 1200 1201 IFDEF ReleaseCode 1202 ; 1203 ; Save the Partition Table. 1204 ; 1205 call DriveIO_SavePartition ; Saves the Partition-Table [SAVE] 1206 ENDIF 1207 1208 1209 1210 ; --------------------------------------------------------- OS/2 / eCS I13X 1211 ; Now check if the partition to get booted is above 8 GB. 1212 ; If yes, set magic bytes 'I13X' at 3000:0 for boot-loader to recognize. 1213 ; This method is (c) by IBM <g> 1214 ; Rousseau: Booting IBM-BM also requires the LBA address of the IBM-BM 1215 ; partitionafter the 'I13X' signature. 1216 ; Also, FS needs to be set to 3000H. 1217 ; This info was obtained by examining the LVM 2,x MBR-code. 1218 mov ax, wptr [si+LocIPT_AbsoluteBegin+0] 1219 mov bx, wptr [si+LocIPT_AbsoluteBegin+2] 1220 add ax, wptr es:[di+LocBRPT_AbsoluteLength+0] ; Add length to absolute 1221 adc bx, wptr es:[di+LocBRPT_AbsoluteLength+2] ; begin location 1222 ; BX:AX -> Absolute End-Position of Partition 1223 1224 1225 ; 1226 ; Always use INT13X v1.0.8. 1227 ; 1228 ;~ test byte ptr [CFG_ForceLBAUsage], 1 1026 1229 ;~ jnz PSP_ForceI13X 1027 1230 jmp PSP_ForceI13X 1028 1231 1029 ; LBA-boundary at 16450560 (FB0400h) (16320x16x63) 1030 cmp bx, 00FBh 1031 jb PSP_NoI13X 1032 1033 1034 PSP_ForceI13X: 1232 ; LBA-boundary at 16450560 (FB0400h) (16320x16x63) 1233 cmp bx, 00FBh 1234 jb PSP_NoI13X 1235 1236 ; 1237 ; Setup 'I13X' signature. 1238 ; 1239 PSP_ForceI13X: 1035 1240 push es 1036 1241 push di 1037 1242 push si 1038 1243 1039 ; Setup ES and FS.1040 ; FS needs to keep this address.1041 mov ax, 3000h1042 mov es, ax1043 ; mov fs,ax1044 db 08eh1045 db 0e0h1046 1047 ; Insert signature1048 xor di, di1049 mov word ptr es:[di+00], '1I'1050 mov word ptr es:[di+02], 'X3'1051 1052 ;mov wptr es:[di], 01053 ;mov wptr es:[di+2], 01054 1055 ; Insert LBA address.1056 mov ax, [si+LocIPT_AbsoluteBegin+0]1057 mov es:[di+04], ax1058 mov ax, [si+LocIPT_AbsoluteBegin+2]1059 mov es:[di+06], ax1244 ; Setup ES and FS. 1245 ; FS needs to keep this address. 1246 mov ax, 3000h 1247 mov es, ax 1248 ; mov fs,ax 1249 db 08eh 1250 db 0e0h 1251 1252 ; Insert signature 1253 xor di, di 1254 mov word ptr es:[di+00], '1I' 1255 mov word ptr es:[di+02], 'X3' 1256 1257 ;mov wptr es:[di], 0 1258 ;mov wptr es:[di+2], 0 1259 1260 ; Insert LBA address. 1261 mov ax, [si+LocIPT_AbsoluteBegin+0] 1262 mov es:[di+04], ax 1263 mov ax, [si+LocIPT_AbsoluteBegin+2] 1264 mov es:[di+06], ax 1060 1265 1061 1266 pop si … … 1065 1270 1066 1271 1067 PSP_NoI13X: 1068 1069 ; now check, if we need to hide any partition 1070 test byte ptr [si+LocIPT_Flags], Flags_HideFeature 1071 jz PSP_NoHideFeature 1072 ; --------------------------------------------------------- PARTITION HIDING 1073 push si 1074 mov si, offset TXT_BootingHide 1075 call MBR_Teletype ; display "hide active" 1076 pop si 1077 ; First, find Hide-Config 1078 mov dl, BootPartNo ; EntryNumber is straight view 1079 ;~ mov ax, LocIPT_MaxPartitions 1080 mov ax, LocHPT_LenOfHPT 1081 mul dl 1082 mov di, offset HidePartitionTable 1083 add di, ax ; We got the pointer 1272 PSP_NoI13X: 1273 1274 ; now check, if we need to hide any partition 1275 test byte ptr [si+LocIPT_Flags], Flags_HideFeature 1276 jz PSP_NoHideFeature 1277 1278 ; ---------------------------------------------------- PARTITION HIDING 1279 1280 ; display "hide active" 1281 push si 1282 mov si, offset TXT_BootingHide 1283 call MBR_Teletype 1284 pop si 1285 1286 1287 ; First, find Hide-Config 1288 mov dl, [BootPartNo] ; EntryNumber is straight view 1289 ;~ mov ax, LocIPT_MaxPartitions 1290 mov ax, LocHPT_LenOfHPT 1291 mul dl 1292 mov di, offset HidePartitionTable 1293 add di, ax ; We got the pointer 1084 1294 1085 1295 … … 1087 1297 ; each points to a partition. 1088 1298 ; 3Fh is end-marker / maximum entries = CFG_Partitions 1089 mov cl, CFG_Partitions 1090 mov ch,0 ; Index in bitfield array. 1091 mov dh,6 ; Bitfield width. 1092 mov bx,di ; Pointer to entry. 1299 mov cl, [CFG_Partitions] 1300 mov ch,0 ; Index in bitfield array. 1301 mov dh,6 ; Bitfield width. 1302 mov bx,di ; Pointer to entry. 1303 1093 1304 PSP_PartitionsHideLoop: 1094 1305 mov dl,ch … … 1105 1316 dec cl 1106 1317 jnz PSP_PartitionsHideLoop 1318 1319 1107 1320 PSP_EndOfHideProcess: 1108 1321 1109 ; --- HIDE COMPLETED --- 1110 ; So something got hidden and we have to remark a primary partition, 1111 ; if we are booting something non-primary from 1st hdd. 1112 cmp bptr [si+LocIPT_Drive], 80h 1113 ja PSP_HideAdjustPrimaryMark ; When booting any hdd, but 1st 1114 mov ax, wptr [si+LocIPT_AbsolutePartTable] 1115 mov bx, wptr [si+LocIPT_AbsolutePartTable+2] 1116 or ax, ax 1117 jnz PSP_HideAdjustPrimaryMark ; or booting non-primary partition 1118 or bx, bx ; on 1st harddrive. 1119 jz PSP_NoHideAdjustPrimaryMark 1120 PSP_HideAdjustPrimaryMark: 1121 ; Load Primary Partition Table... 1122 xor ax, ax 1123 xor bx, bx 1124 mov cx, 0001h ; Cylinder 0, Sector 1 1125 mov dx, 0080h ; First HD, Head 0 1322 ; --- HIDE COMPLETED --- 1323 ; So something got hidden and we have to remark a primary partition, 1324 ; if we are booting something non-primary from 1st hdd. 1325 cmp bptr [si+LocIPT_Drive], 80h 1326 ja PSP_HideAdjustPrimaryMark ; When booting any hdd, but 1st 1327 mov ax, wptr [si+LocIPT_AbsolutePartTable] 1328 mov bx, wptr [si+LocIPT_AbsolutePartTable+2] 1329 or ax, ax 1330 jnz PSP_HideAdjustPrimaryMark ; or booting non-primary partition 1331 or bx, bx ; on 1st harddrive. 1332 jz PSP_NoHideAdjustPrimaryMark 1333 1334 PSP_HideAdjustPrimaryMark: 1335 ; Load Primary Partition Table... 1336 xor ax, ax 1337 xor bx, bx 1338 mov cx, 0001h ; Cylinder 0, Sector 1 1339 mov dx, 0080h ; First HD, Head 0 1126 1340 ; Load MBR 1127 call DriveIO_LoadPartition ; Load Primary Partition Table 1128 call PART_MarkFirstGoodPrimary 1129 IFDEF ReleaseCode 1130 ; Save MBR 1131 call DriveIO_SavePartition ; Saves the Partition-Table 1132 ENDIF 1133 PSP_NoHideAdjustPrimaryMark: 1134 1135 PSP_NoHideFeature: 1136 ; Check, if we are supposed to ignore LVM altogether... 1137 test byte ptr [CFG_IgnoreLVM], 1 1138 jnz PSP_NoLVMReassignment 1139 ; --------------------------------------------------------- LVM REASSIGNMENT 1140 ; Driveletter must be set for this partition 1141 test byte ptr [si+LocIPT_Flags], Flags_DriveLetter 1142 jz PSP_NoLVMReassignment 1143 ;movzx bx, BootPartNo ; EntryNumber is straight view 1144 mov bl,BootPartNo ; EntryNumber is straight view 1145 mov bh,0 1146 1147 mov al, bptr [DriveLetters+bx] 1148 sub al, 3Dh ; Convert e.g. 80h -> 'C' 1149 cmp al, bptr [PartitionVolumeLetters+bx] 1150 je PSP_NoLVMReassignment ; If driveletters match -> no change 1151 call LVM_DoLetterReassignment ; Give partition SI letter AL 1152 PSP_NoLVMReassignment: 1153 push si 1154 ; ------------------------------------------------------- -"PLEASE WAIT..."- 1155 PSP_IsFloppyCDROMetc: 1156 mov si, offset TXT_BootingWait 1157 call MBR_Teletype ; display "please wait" 1158 pop si 1159 1160 ; Process Partition Tables, if M$-Hack required (changes Ext Part Type) 1161 call MSHACK_ProcessPartTables 1162 1163 test byte ptr [CFG_BootMenuActive], 0FFh 1164 jz PSP_NoMenuNoSound 1165 1166 ; --------------------------------------------------------------- BOOT-SOUND 1167 call SOUND_ExecuteBoot 1168 PSP_NoMenuNoSound: 1169 1170 ; -------------------------------------------------- SPECIAL BOOT PROCESSING 1171 ; Check here, if the Boot shall be done via resume to BIOS... 1172 mov al, byte ptr [si+LocIPT_SystemID] 1173 cmp al, 0FEh ; Via BIOS ? (aka resume BIOS boot sequence) 1174 je PSP_ResumeBIOSbootSeq 1341 call DriveIO_LoadPartition ; Load Primary Partition Table 1342 call PART_MarkFirstGoodPrimary 1343 1344 IFDEF ReleaseCode 1345 call DriveIO_SavePartition ; Saves the Partition-Table 1346 ENDIF 1347 1348 1349 PSP_NoHideAdjustPrimaryMark: 1350 1351 1352 PSP_NoHideFeature: 1353 ; Check, if we are supposed to ignore LVM altogether... 1354 test byte ptr [CFG_IgnoreLVM], 1 1355 jnz PSP_NoLVMReassignment 1356 1357 ; ---------------------------------------------------- LVM REASSIGNMENT 1358 1359 ; Driveletter must be set for this partition 1360 test byte ptr [si+LocIPT_Flags], Flags_DriveLetter 1361 jz PSP_NoLVMReassignment 1362 ;movzx bx, BootPartNo ; EntryNumber is straight view 1363 mov bl,[BootPartNo] ; EntryNumber is straight view 1364 mov bh,0 1365 1366 mov al, bptr [DriveLetters+bx] 1367 sub al, 3Dh ; Convert e.g. 80h -> 'C' 1368 cmp al, bptr [PartitionVolumeLetters+bx] 1369 1370 1371 ;~ je PSP_NoLVMReassignment ; If driveletters match -> no change 1372 ; Rousseau: 1373 ; But there can still be other partitions with the same drive-letter. 1374 ; For instance if the user did an advanced installation with multiple 1375 ; eComStation systems using the same boot-drive-letter. 1376 ; So, even if the drive-letter forced is the same as the 1377 ; partition-volume-letter, other partitions still need to be checked 1378 ; and possibly hidden. So we always do the drive-letter reassignment, 1379 ; which is enhanced to keep data-partitions (those -not- in the Menu) 1380 ; visible. So the 'je' instruction above is commented-out. 1381 1382 1383 ; 1384 ; Give partition SI letter AL 1385 ; 1386 call LVM_DoLetterReassignment 1387 1388 1389 1390 1391 PSP_NoLVMReassignment: 1392 push si 1393 ; -------------------------------------------------- -"PLEASE WAIT..."- 1394 PSP_IsFloppyCDROMetc: 1395 mov si, offset TXT_BootingWait 1396 call MBR_Teletype ; display "please wait" ; SI staat nog op stack; aanpassen !!!! 1397 pop si 1398 1399 ; Process Partition Tables, if M$-Hack required (changes Ext Part Type) 1400 call MSHACK_ProcessPartTables 1401 1402 test byte ptr [CFG_BootMenuActive], 0FFh 1403 jz PSP_NoMenuNoSound 1404 1405 ; ---------------------------------------------------------- BOOT-SOUND 1406 call SOUND_ExecuteBoot 1407 1408 PSP_NoMenuNoSound: 1409 1410 ; --------------------------------------------- SPECIAL BOOT PROCESSING 1411 ; Check here, if the Boot shall be done via resume to BIOS... 1412 mov al, byte ptr [si+LocIPT_SystemID] 1413 cmp al, 0FEh ; Via BIOS ? (aka resume BIOS boot sequence) 1414 je PSP_ResumeBIOSbootSeq 1415 1175 1416 ; [Linux support removed since v1.02] 1176 ; cmp al, 0FDh ; Kernel-Booting ?1417 ; cmp al, 0FDh ; Kernel-Booting ? 1177 1418 ; je PSP_KernelBooting 1178 jmp PSP_StartNormal 1179 1180 PSP_ResumeBIOSbootSeq: 1181 int 18h ; Give control back to BIOS 1182 db 0EAh ; if return to here -> Reboot 1183 dw 0FFF0h 1184 dw 0F000h 1419 1420 jmp PSP_StartNormal 1421 1422 PSP_ResumeBIOSbootSeq: 1423 int 18h ; Give control back to BIOS 1424 db 0EAh ; if return to here -> Reboot 1425 dw 0FFF0h 1426 dw 0F000h 1185 1427 1186 1428 ; [Linux support removed since v1.02] … … 1191 1433 ; dw 0F000h 1192 1434 1193 ; ======================================================================= 1194 ; FROM THIS POINT ON, ONLY DS and SI REGISTER IS NEEDED TO BE PRESERVED 1195 ; =======================================================================1196 1197 PSP_StartNormal:1198 mov ax, wptr [si+LocIPT_AbsoluteBegin+0] 1199 mov bx, wptr [si+LocIPT_AbsoluteBegin+2]1200 mov cx, [si+LocIPT_LocationBegin+1]1201 mov dh, [si+LocIPT_LocationBegin+0]1202 mov dl, [si+LocIPT_Drive]1203 1204 ; This loads the PBR of the partition.1205 call DriveIO_LoadPartition ; Loads boot-sector... [PARTBOOTSEC] 1206 1207 ;1208 ; The JFS PBR-code does not use the passed BPB in memory but uses the BPB 1209 ; on disk. This breaks the drive-letter feature on JFS.1210 ; So we make a copy of the PBR in memory, and if the partition is JFS1211 ; we later adjust the physical-disk and boot-drive-letter in this1212 ; copy and write it back to disk.1213 ; Then the JFS PBR-code will see the correct boot-drive-letter.1214 ;1215 pusha1216 mov si,offset PartitionSector1217 mov di,offset JfsPBR1218 mov cx,100h1219 cld1220 rep movsw1221 popa1222 1223 1224 1225 ; Check if the disk is a harddisk or a floppy. 1226 mov dl,[si+LocIPT_Drive] 1227 cmp dl, 80h1228 jae is_harddisk1229 1230 ;1231 ; This is a dirty hack to fix booting from a floppy. 1232 ; With all the modifications made since v1.06 this feature was broken1233 ; because Int13X is used implicitly now, and that does not work1234 ; for diskette access.1235 ; This jumps to the code that loads and starts the pbr-code.1236 ; Note that it also skips virus checking !1237 ; This will be fixed at a later date.1238 jmp boot_from_floppy1239 1240 1241 1242 1243 ;1244 ; The disk is a harddisk so we need to do various checks and fixes.1245 ;1246 is_harddisk: 1247 1248 test byte ptr [CFG_DetectVIBR], 11249 jz PSP_NoVIBR1250 test byte ptr [si+LocIPT_Flags], Flags_VIBR_Detection1251 jz PSP_NoVIBR 1252 ; ---------------------------------------------------------- CHECKS FOR VIBR1253 push si1254 mov si, offset PartitionSector1255 mov bx, 4B4Dh ; Magic: 'MK'1256 call MBR_GetCheckOfSector1257 pop si1258 cmp [si+LocIPT_BootRecordCRC], bx 1259 je PSP_NoVIBR1260 mov bx, [si+LocIPT_BootRecordCRC]1261 or bx, bx1262 jz PSP_NoVIBR1263 ; Oh Oh, got a virus :(1264 mov si, offset TXT_VirusFoundMain1265 call MBR_Teletype1266 mov si, offset TXT_VirusFound2 ; VIBR-Virus1267 call MBR_Teletype1268 mov si, offset TXT_VirusFoundEnd1269 call MBR_Teletype1270 jmp MBR_HaltSystem1271 1272 PSP_NoVIBR: 1273 test byte ptr [CFG_ProtectMBR], 11274 jz PSP_NoMBRprotect1275 ; -------------------------------------------------- INSTALLS MBR-PROTECTION1276 ; We need DS:SI later...1277 push ds1278 push si1279 ; First subtract 1024 bytes from Base-Memory...1280 push ds 1281 mov ax, 40h1282 mov ds, ax1283 mov dx, word ptr ds:[13h]1284 dec dx ; 1 == 1kbyte1285 mov word ptr ds:[13h], dx1286 pop ds1287 shl dx, 6 ; trick, now DX is a segment1288 1289 ; Now copy in our code (to DX:0)...1290 1291 mov si, offset MBR_Protection ; DS:SI - Source Image1292 mov es, dx 1293 xor di, di ; ES:DI - Destination1294 mov cx, 5121295 rep movsw ; Move 1024 bytes...1296 1297 ; Now fill in variables...1298 1299 xor ax, ax 1300 mov ds, ax1301 mov si, 10h*4 1302 xor di, di ; INT 10h Vector to MBR Protection1303 ;movsd1304 movsw1305 movsw1306 1307 mov si, 13h*4 ; INT 13h Vector to MBR Protection1308 ;movsd1309 movsw 1310 movsw1311 1312 mov al, CFG_IgnoreWriteToMBR ; Option to MBR Protection1313 stosb1314 1315 ; Now switch INT 13h vectorto MBR Protection1316 1317 sub si, 4 1318 mov ax, 91319 mov ds:[si], ax 1320 mov ds:[si+2], dx ; Vector hardcoded at DS:00091321 ; MBR-Protection now active :)1322 ; Restore DS:SI1323 pop si1324 pop ds1325 1326 1327 1328 1435 1436 1437 ; ======================================================================= 1438 ; FROM THIS POINT ON, ONLY DS and SI REGISTER IS NEEDED TO BE PRESERVED 1439 ; ======================================================================= 1440 1441 PSP_StartNormal: 1442 mov ax, wptr [si+LocIPT_AbsoluteBegin+0] 1443 mov bx, wptr [si+LocIPT_AbsoluteBegin+2] 1444 mov cx, [si+LocIPT_LocationBegin+1] 1445 mov dh, [si+LocIPT_LocationBegin+0] 1446 mov dl, [si+LocIPT_Drive] 1447 1448 ; This loads the PBR of the partition. 1449 call DriveIO_LoadPartition ; Loads boot-sector... [PARTBOOTSEC] 1450 1451 ; 1452 ; The JFS PBR-code does not use the passed BPB in memory but uses the BPB 1453 ; on disk. This breaks the drive-letter feature on JFS. 1454 ; So we make a copy of the PBR in memory, and if the partition is JFS 1455 ; we later adjust the physical-disk and boot-drive-letter in this 1456 ; copy and write it back to disk. 1457 ; Then the JFS PBR-code will see the correct boot-drive-letter. 1458 ; 1459 pusha 1460 mov si,offset [PartitionSector] 1461 mov di,offset [PBRSector] 1462 mov cx,100h 1463 cld 1464 rep movsw 1465 popa 1466 1467 1468 1469 ; Check if the disk is a harddisk or a floppy. 1470 mov dl,[si+LocIPT_Drive] 1471 cmp dl, 80h 1472 jae is_harddisk 1473 1474 ; 1475 ; This is a dirty hack to fix booting from a floppy. 1476 ; With all the modifications made since v1.06 this feature was broken 1477 ; because Int13X is used implicitly now, and that does not work 1478 ; for diskette access. 1479 ; This jumps to the code that loads and starts the pbr-code. 1480 ; Note that it also skips virus checking ! 1481 ; This will be fixed at a later date. 1482 jmp boot_from_floppy 1483 1484 ; 1485 ; The disk is a harddisk so we need to do various checks and fixes. 1486 ; 1487 is_harddisk: 1488 1489 test byte ptr [CFG_DetectVIBR], 1 1490 jz PSP_NoVIBR 1491 test byte ptr [si+LocIPT_Flags], Flags_VIBR_Detection 1492 jz PSP_NoVIBR 1493 1494 ; ----------------------------------------------------- CHECKS FOR VIBR 1495 push si 1496 mov si, offset PartitionSector 1497 mov bx, 4B4Dh ; Magic: 'MK' 1498 call MBR_GetCheckOfSector 1499 pop si 1500 1501 cmp [si+LocIPT_BootRecordCRC], bx 1502 je PSP_NoVIBR 1503 mov bx, [si+LocIPT_BootRecordCRC] 1504 or bx, bx 1505 jz PSP_NoVIBR 1506 ; Oh Oh, got a virus :( 1507 mov si, offset TXT_VirusFoundMain 1508 call MBR_Teletype 1509 mov si, offset TXT_VirusFound2 ; VIBR-Virus 1510 call MBR_Teletype 1511 mov si, offset TXT_VirusFoundEnd 1512 call MBR_Teletype 1513 jmp MBR_HaltSystem 1514 1515 PSP_NoVIBR: 1516 test byte ptr [CFG_ProtectMBR], 1 1517 jz PSP_NoMBRprotect 1518 ; --------------------------------------------- INSTALLS MBR-PROTECTION 1519 ; We need DS:SI later... 1520 push ds 1521 push si 1522 1523 ; First subtract 1024 bytes from Base-Memory... 1524 push ds 1525 mov ax, 40h 1526 mov ds, ax 1527 mov dx, word ptr ds:[13h] 1528 dec dx ; 1 == 1kbyte 1529 mov word ptr ds:[13h], dx 1530 pop ds 1531 shl dx, 6 ; trick, now DX is a segment 1532 1533 ; Now copy in our code (to DX:0)... 1534 1535 mov si, offset MBR_Protection ; DS:SI - Source Image 1536 mov es, dx 1537 xor di, di ; ES:DI - Destination 1538 ;~ mov cx, 512 1539 mov cx, 384 1540 rep movsw ; Move 768 bytes... 1541 1542 ; Now fill in variables... 1543 1544 xor ax, ax 1545 mov ds, ax 1546 mov si, 10h*4 1547 xor di, di ; INT 10h Vector to MBR Protection 1548 ;movsd 1549 movsw 1550 movsw 1551 1552 mov si, 13h*4 ; INT 13h Vector to MBR Protection 1553 ;movsd 1554 movsw 1555 movsw 1556 1557 mov al, CFG_IgnoreWriteToMBR ; Option to MBR Protection 1558 stosb 1559 1560 ; Now switch INT 13h vector to MBR Protection 1561 1562 sub si, 4 1563 mov ax, 9 1564 mov ds:[si], ax 1565 mov ds:[si+2], dx ; Vector hardcoded at DS:0009 1566 ; MBR-Protection now active :) 1567 1568 ; Restore DS:SI 1569 pop si 1570 pop ds 1329 1571 1330 1572 … … 1386 1628 ; Get index of phys-disk field in BX 1387 1629 call PART_GetFieldIndex 1388 mov PhysDiskBpbIndex,ax1630 mov [PhysDiskBpbIndex],ax 1389 1631 mov bx,ax 1390 1632 1391 1633 ; Locate cursor for output of debug-info 1392 pusha 1393 mov ch,7 1394 mov cl,0 1395 call VideoIO_Color 1396 mov ch,6 1397 mov cl,1 1398 call VideoIO_Locate 1399 popa 1400 1401 1402 1634 ;~ pusha 1635 ;~ mov ch,7 1636 ;~ mov cl,0 1637 ;~ call VideoIO_Color 1638 ;~ mov ch,6 1639 ;~ mov cl,1 1640 ;~ call VideoIO_Locate 1641 ;~ popa 1403 1642 1404 1643 … … 1431 1670 1432 1671 1433 1434 1435 1436 1437 1672 ; 1438 1673 ; If the partition is IBM-BM we skip all the BPB adjustments. … … 1451 1686 ; BX holds index to phys-disk field 1452 1687 ; 1453 mov al,byte ptr [si+LocIPT_Drive] 1688 mov al,byte ptr [si+LocIPT_Drive] ; Moet dit niet later gebeuren ??? (NT/WIN LDR hangs) 1454 1689 mov es:[di+bx],al 1455 1690 … … 1467 1702 ; Fix hidden sectors field 1468 1703 ; 1469 1470 ; Low word of 32-bits "hidden sectors"1471 1704 mov ax,[si+LocIPT_AbsoluteBegin] 1472 mov es:[di+1ch], ax 1473 ; High word of 32-bits "hidden sectors" 1705 mov es:[di+1ch], ax ; Low word of 32-bits "hidden sectors" 1706 1474 1707 mov ax,[si+LocIPT_AbsoluteBegin+2] 1475 mov es:[di+1eh], ax 1476 1477 1478 1479 1708 mov es:[di+1eh], ax ; High word of 32-bits "hidden sectors" 1480 1709 1481 1710 ; … … 1531 1760 ; depending on FS used. 1532 1761 ; AL will be 0 for any file-system other than FAT12/FAT16/HPFS/JFS. 1762 ; In that case no fixing of boot-drive-letters is needed. 1533 1763 ; 1534 1764 test al,al … … 1536 1766 1537 1767 1538 1539 ; Check if the boot-drive-letter is non-zero. 1540 mov bx,PhysDiskBpbIndex 1541 inc bx 1542 mov al,es:[di+bx] 1543 test al,al 1544 ; Non-zero, so no fixing needed. 1545 ;jnz bdl_ok ;; Why not always fix ? (so, jnz disabled) 1546 1547 1548 ; 1549 ; Always fix boot-drive-letter on FAT12/FAT16/HPFS/JFS 1550 ; 1551 1768 ; 1769 ; We have a partition that potentially can have incorrect values 1770 ; for the boot-drive-letter or incorrect LVM drive-letters. 1771 ; 1772 ; The boot-drive-letter can be zero as the result of copying / moving 1773 ; partitions or restoring a HPFS system from archive. 1774 ; In that case the LVM drive-letter is used if present. 1775 ; 1776 ; Incorrect LVM drive-letters are the result of the drive-letter 1777 ; reassign function when two or more eComStation installations use the 1778 ; same boot-drive-letter. 1779 ; In that case the boot-drive-letter is assigned to the 1780 ; LVM drive-letter. 1781 ; 1782 ; If both are zero there is no way to obtain the correct 1783 ; boot-drive-letter value. The user needs to examine CONFIG.SYS and 1784 ; force that letter for the partition. 1785 ; 1786 1787 1788 1789 1790 1791 ; 1552 1792 ; Get the drive-letter for the partition from the LVM-info. 1793 ; Returns CY=1 if AL contains drive-letter, CY=0 and AL=0 if 1794 ; no letter assigned (hidden) or no LVM info found. 1795 ; 1553 1796 mov dl,byte ptr [si+LocIPT_Drive] 1554 1797 mov cx,[si+LocIPT_AbsoluteBegin+00h] … … 1556 1799 call LVM_GetDriveLetter 1557 1800 1558 ; Save the status for later use 1559 pushf 1801 1802 ; Save for later use. 1803 mov byte ptr [LVMdl], al 1560 1804 1561 1805 ; See if the drive-letter feature is active. … … 1563 1807 test byte ptr [si+LocIPT_Flags], Flags_DriveLetter 1564 1808 1565 ; Nope, it's not so we don't force the boot-drive-letter 1566 ; using field 25h. 1809 ; Nope, it's not so we don't force the boot-drive-letter. 1567 1810 jz PSP_NoLogicalSupport 1568 1811 1569 1812 ; Partition index in BX 1570 mov bl, BootPartNo; EntryNumber is straight view1813 mov bl,[BootPartNo] ; EntryNumber is straight view 1571 1814 mov bh,0 1572 1815 1573 ; Pointer to the user specified boot-drive1574 ; Get it and convert to ASCII letter1816 ; Get the user specified boot-drive-letter. 1817 ; 80h notation. 1575 1818 mov al, bptr [DriveLetters+bx] 1576 sub al,3dh ; Convert BIOS notation to ASCII drive-letter 1577 1819 1820 ; Safety check for zero value. 1821 test al,al 1822 jz PSP_NoValidUserDriveLetter 1823 1824 ; Convert 80h notation to ASCII. 1825 sub al,3dh ; 80h - 3dh = 43h = 'C', etc. 1826 1827 PSP_NoValidUserDriveLetter: 1828 ; Here we misuse the LVM-dl storage to store the user forced 1829 ; or zero drive-letter. 1830 mov byte ptr [LVMdl], al 1578 1831 1579 1832 1580 1833 PSP_NoLogicalSupport: 1581 1834 1582 ; Drive letter is LVM obtained or user-forced. 1583 ; Save it in AH. 1835 ; A possibly valid drive-letter has been obtained from either 1836 ; LVM-info or the drive-letter feature. 1837 ; It's in [LDMdl] local storage. 1838 1839 1840 1841 ; 1842 ; Get the boot-drive-letter from the BPB of the partition. 1843 ; 1844 mov bx, [PhysDiskBpbIndex] 1845 inc bx 1846 mov al,es:[di+bx] ; 80h=C:,81h=D:, etc. 1847 ; Store it for later use 1848 mov byte ptr [BPBdl], al 1849 1850 1851 ; See if both the LVM drive-letter and the BPB drive-letter are zero. 1852 ; If so, then we have a problem. 1853 ; No valid drive-letter can be obtained and the user has to examine 1854 ; CONFIG.SYS and set that letter in the drive-letter feature 1855 ; for the partition. 1584 1856 mov ah,al 1585 1586 1587 ; Restore the status whether an LVM drive-letter could be obtained 1588 popf 1589 1590 1591 ; 1592 ; No valid LVM-info if no info found or drive-letter is zero. 1593 ; 1594 jnc no_valid_lvm_info 1595 test al,al 1596 jz no_valid_lvm_info 1597 1598 1599 ; 1600 ; We have found a valid drive-letter in the LVM-info. 1601 ; 1602 1857 mov al, byte ptr [LVMdl] 1858 or al,ah 1859 jz no_valid_boot_drive_letter_found 1860 1861 1862 ; See if both the LVM drive-letter and the BPB drive-letter are 1863 ; the same. In that case we should have a valid situation and no 1864 ; adjustments need to be made. 1865 cmp al,ah 1866 jz PSP_valid_boot_drive 1867 1868 1869 ; 1870 ; Ok, at least one of them is valid. 1871 ; 1872 1873 ; See if the BPB boot-drive-letter is valid 1874 ; This one is supposed not to change since eCS cannot be booted 1875 ; from another drive then it was installed on. 1876 test ah,ah 1877 jnz BPB_boot_drive_valid 1878 1879 ; Nope it's not. 1880 ; So we use the LVM drive-letter for the BPB boot-drive-letter. 1603 1881 ; Convert to BIOS notation ('C'+3dh=80h, 'D'->81h, etc.) 1882 ; This is where the user can fix this issue by using the 1883 ; drive-letter feature. 1604 1884 add al,3dh 1605 1885 mov bx,[PhysDiskBpbIndex] 1886 ; Advance to field for drive-letter in BIOS notation (OS/2 - eCS) 1887 inc bx 1888 ; Fix the boot-drive-letter field in the BPB 1889 mov es:[di+bx],al 1890 1891 jmp PSP_valid_boot_drive 1606 1892 1607 1893 ; … … 1617 1903 1618 1904 1619 ; Fix the boot-drive-letter field in the BPB 1620 mov bx,PhysDiskBpbIndex 1621 ; Advance to field for drive-letter in BIOS notation (OS/2 - eCS) 1905 ; 1906 ; Here we enter when the LVM drive-letter is zero or not the same 1907 ; as the BPB boot-drive-letter. 1908 ; This can be the case when booting a hidden partition, LVM-dl = zero, 1909 ; or the LVM-dl was reassigned because another system with the same 1910 ; drive-letter was booted previously. 1911 ; In any case, we set the LVM drive-letter to the BPB boot-drive-letter 1912 ; so the system can be booted. 1913 ; Driveletters on other partitions have already been reassigned by the 1914 ; reassignement-procedure earlier. 1915 ; 1916 BPB_boot_drive_valid: 1917 1918 1919 1920 1921 ; 1922 ; ALWAYS SET LVM to BPB 1923 ; 1924 ;~ mov dl,byte ptr [si+LocIPT_Drive] 1925 ;~ mov cx,[si+LocIPT_AbsoluteBegin+00h] 1926 ;~ mov bx,[si+LocIPT_AbsoluteBegin+02h] 1927 ;~ mov al,[BPBdl] 1928 ;~ sub al,3dh 1929 ;~ call LVM_SetDriveLetter ; !!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1930 1931 1932 ; 1933 ; ALWAYS SET BPB to LVM 1934 ; 1935 mov dl,byte ptr [si+LocIPT_Drive] 1936 mov cx,[si+LocIPT_AbsoluteBegin+00h] 1937 mov bx,[si+LocIPT_AbsoluteBegin+02h] 1938 call LVM_GetDriveLetter ; !!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1939 add al,3dh 1940 mov bx,[PhysDiskBpbIndex] 1622 1941 inc bx 1623 1942 mov es:[di+bx],al 1624 1943 1625 1944 1626 jmp bdl_ok 1627 1628 1629 no_valid_lvm_info: 1945 update_PBR: 1946 1947 1948 1949 ; 1950 ; Here both the boot-drive-letter and the LVM drive-letter are zero. 1951 ; So the only way to determine the drive-letter is to examine CONFIG.SYS. 1952 ; Then force that drive-letter in the drive-letter feature. 1953 no_valid_boot_drive_letter_found: 1630 1954 ; HERE SHOULD COME AN ERROR POP-UP ABOUT NO BOOT-DRIVE OR NO LVM-INFO. 1631 1955 ; WE CONTINUE BOOTING BUT OS/2 - eCS WILL MOST PROBABLY FAIL TO BOOT. 1956 1957 ; FIXME: 1958 ; ISSUE SOME KIND OF WARNING... 1632 1959 1633 1960 ;mov ah,07h … … 1639 1966 1640 1967 1968 1969 1970 PSP_valid_boot_drive: 1971 1972 1973 1974 1641 1975 ; 1642 1976 ; Boot DriveLetter OK. … … 1644 1978 bdl_ok: 1645 1979 1980 1981 IFDEF AUX_DEBUG 1982 pusha 1983 call AuxIO_TeletypeNL 1984 mov bx, [PhysDiskBpbIndex] 1985 inc bx 1986 mov al, [di+bx] 1987 call AuxIO_TeletypeHexByte 1988 mov bl,[BootPartNo] 1989 mov al, [DriveLetters+bx] 1990 call AuxIO_TeletypeHexByte 1991 mov al, [PartitionVolumeLetters+bx] 1992 add al, 3dh 1993 call AuxIO_TeletypeHexByte 1994 mov al, [LVMdl] 1995 add al, 3dh 1996 call AuxIO_TeletypeHexByte 1997 mov al, [si+LocIPT_SystemID] 1998 call AuxIO_TeletypeHexByte 1999 mov al,[FSType] 2000 call AuxIO_TeletypeHexByte 2001 popa 2002 ENDIF 1646 2003 1647 2004 ; … … 1655 2012 mov al,[FSType] 1656 2013 cmp al,04h ; JFS 1657 jnz no_jfs_pbr 2014 je write_back_pbr 2015 cmp al,02h ; HPFS 2016 je write_back_pbr 2017 2018 jmp no_jfs_pbr 2019 2020 2021 write_back_pbr: 1658 2022 1659 2023 ; Save IPT pointer … … 1661 2025 1662 2026 ; Copy the boot-drive and boot-drive-letter fields. 1663 mov si,offset PartitionSector1664 mov di,offset JfsPBR2027 mov si,offset [PartitionSector] 2028 mov di,offset [PBRSector] 1665 2029 mov al,[si+24h] 1666 2030 mov [di+24h],al … … 1679 2043 1680 2044 ; Write the adjusted JFS PBR to disk. 1681 mov si, offset JfsPBR2045 mov si, offset [PBRSector] 1682 2046 call DriveIO_SaveSector 1683 2047 … … 1693 2057 1694 2058 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 2059 ; ----------------------------------------------- LOGICAL PARTITION SUPPORT 1708 2060 1709 2061 1710 2062 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 2063 ; AiR-BOOT now works around it by using the LVM-info (DLAT) of 2064 ; the partiton if present. 2065 ; Note however that if the drive-letter feature is active, 2066 ; this will override AB's automatic fixing. 2067 ; 2068 ; Test if the drive-letter feature is active for this partition. 2069 ; If so, then the drive that the user defined will be placed at 2070 ; byte 25h (37d) of the in-ram PartitionSector (BPB). 2071 ; (BIOS 80h notation: 80h=C, 81h=D, etc.) 2072 ; This is a remedy for when the corresponding field (25h) in the BPB on 2073 ; disk is zero. 2074 ; 1723 2075 1724 2076 … … 1759 2111 1760 2112 1761 IFDEF AUX_DEBUG 1762 call DEBUG_Dump2 1763 ;~ call DEBUG_DumpBSSSectors 1764 ;~ call DEBUG_DumpDriveLetters 1765 ENDIF 2113 IFDEF AUX_DEBUG 2114 pusha 2115 call DEBUG_Dump2 2116 ;~ call DEBUG_DumpBSSSectors 2117 call DEBUG_DumpDriveLetters 2118 call DEBUG_DumpVolumeLetters 2119 call AuxIO_TeletypeNL 2120 popa 2121 ENDIF 1766 2122 1767 2123 … … 1771 2127 ; 1772 2128 1773 ; Skip wait-for-key 1774 jmp start_pbr 2129 IFNDEF AUX_DEBUG 2130 ; Skip wait-for-key 2131 jmp StartPBR 2132 ENDIF 1775 2133 1776 2134 ; … … 1784 2142 1785 2143 ; Nope, Go activate PBR loader 1786 jne start_pbr2144 jne StartPBR 1787 2145 1788 2146 ;push ds 1789 2147 ;pop es 1790 2148 2149 ; Yep, restart AiR-BOOT so simulate load DX:BX with old BIOS SS:SP 2150 jmp AirbootRestart 2151 1791 2152 ; Yep, Reenter bootmenu 1792 jmpMBR_Main_ReEnterBootMenuPre2153 ;~ jmp MBR_Main_ReEnterBootMenuPre 1793 2154 1794 2155 … … 1797 2158 ; Transfer control to the PBR 1798 2159 ; 1799 start_pbr:2160 StartPBR: 1800 2161 1801 2162 ; Debug display index … … 1812 2173 1813 2174 ; 1814 ; Show "wait dots" 1815 ; 1816 pusha 1817 ; Color white on black 1818 mov ch,7 1819 mov cl,0 1820 call VideoIO_Color 1821 ; Locate cursor for output of debug-info 1822 mov ch,8 1823 mov cl,1 1824 call VideoIO_Locate 1825 1826 ; Print dots with interval. 1827 mov cx,10 1828 print_next_dot: 1829 mov al,'.' 1830 call VideoIO_PrintSingleChar 1831 ; Value 30 is about 1.5 seconds 1832 mov al,1 1833 call TIMER_WaitTicCount 1834 loop print_next_dot 1835 popa 2175 ; Show dot's to indicate something is happening... 2176 ; 2177 call VideoIO_ShowWaitDots 1836 2178 1837 2179 ; … … 1842 2184 1843 2185 1844 ; 1845 ; BYE BYE 2186 2187 ; 2188 ; BYE BYE (prepare some registers? look at other MBR-code) 1846 2189 ; 1847 2190 xor ax, ax … … 1855 2198 1856 2199 1857 ; 1858 ; JUMP TO PBR loader1859 ; 2200 ; ############################### 2201 ; # JUMP TO THE PBR LOADER CODE # 2202 ; ############################### 1860 2203 IFDEF ReleaseCode 1861 2204 db 0EAh … … 1869 2212 1870 2213 1871 ; 1872 ; THE FUNCTIONS HERE BELOW WERE INTRODUCED TO ENHANCE THE PBR PROCESSING, 1873 ; BUT THEY ARE ACTUALLY OBSOLETE BECAUSE THE INFORMATION THEY PROVIDE CAN 1874 ; ALSO BE OBTAINED FROM THE IPT. HOWEVER, THE IPT USES DIFFERENT IDENTIFIERS 1875 ; FOR PARTICULAR FILE-SYSTEMS / PBR TYPES, LIKE JFS BEING REPRESENTED AS 0FCh. 1876 ; POSSIBLY THE INFO IN THE IPT NEEDS TO BE EXPANDED TO DISTINGUISH BETWEEN 1877 ; OTHER BOOT-RECORDS AND FILE-SYSTEMS TOO, LIKE VISTA/WIN7 BMGR AND GRUB, ETC. 1878 ; THIS WOULD NEED TO BE DONE IN THE PARTSCAN ROUTINES. 1879 ; SO, FOR NOW WE KEEP USING THE STUFF BELOW. 1880 ; 2214 2215 2216 1881 2217 1882 2218 … … 1964 2300 ; In 1965 2301 ; -- 1966 ; DL = Physical Disk 1967 ; BX:CX = LBA sector 2302 ; SI = Pointer to IPT entry 1968 2303 ; 1969 2304 ; Out … … 1971 2306 ; CY = Set if HPFS partition, clear if not 1972 2307 ; 1973 PART_IsHPFS Proc Near Uses ax bx cx dx si di ds es 1974 1975 ; Load specified LBA sector (BX:CX) from the disk in DL 1976 mov di,ds 1977 mov si,offset [TmpSector] 1978 call DriveIO_LoadSectorLBA 1979 1980 ; Point to location of 'HPFS ' identifier. 1981 add si,36h 1982 1983 ; DL holds equality status 1984 xor dl,dl 1985 cld 1986 1987 ; Load letter into AL, xor with letter will result 0 if the same. 1988 ; Then or to DL. 1989 ; If at the end of the sequence DL is zero, the signature is present. 1990 lodsb 1991 xor al,'H' 1992 or dl,al 1993 lodsb 1994 xor al,'P' 1995 or dl,al 1996 lodsb 1997 xor al,'F' 1998 or dl,al 1999 lodsb 2000 xor al,'S' 2001 or dl,al 2002 lodsb 2003 xor al,' ' 2004 or dl,al 2005 lodsb 2006 xor al,' ' 2007 or dl,al 2008 lodsb 2009 xor al,' ' 2010 or dl,al 2011 lodsb 2012 xor al,' ' 2013 or dl,al 2014 2015 ; Assume not present 2016 clc 2017 jnz PART_IsHPFS_exit 2018 2019 ; JFS signature found 2020 stc 2021 2308 PART_IsHPFS Proc Near Uses ax 2309 mov al, [si+LocIPT_SystemID] ; Get SystemID 2310 cmp al, 07h ; Compare with AiR-BOOT ID for HPFS 2311 stc ; Assume HPFS 2312 je PART_IsHPFS_exit ; Yep 2313 clc ; Nope, clear CY 2022 2314 PART_IsHPFS_exit: 2023 2315 ret … … 2032 2324 ; In 2033 2325 ; -- 2034 ; DL = Physical Disk 2035 ; BX:CX = LBA sector 2326 ; SI = Pointer to IPT entry 2036 2327 ; 2037 2328 ; Out … … 2039 2330 ; CY = Set if JFS partition, clear if not 2040 2331 ; 2041 PART_IsJFS Proc Near Uses ax bx cx dx si di ds es 2042 2043 ; Load specified LBA sector (BX:CX) from the disk in DL 2044 mov di,ds 2045 mov si,offset [TmpSector] 2046 call DriveIO_LoadSectorLBA 2047 2048 ; Point to location of 'JFS ' identifier. 2049 add si,36h 2050 2051 ; DL holds equality status 2052 xor dl,dl 2053 cld 2054 2055 ; Load letter into AL, xor with letter will result 0 if the same. 2056 ; Then or to DL. 2057 ; If at the end of the sequence DL is zero, the signature is present. 2058 lodsb 2059 xor al,'J' 2060 or dl,al 2061 lodsb 2062 xor al,'F' 2063 or dl,al 2064 lodsb 2065 xor al,'S' 2066 or dl,al 2067 lodsb 2068 xor al,' ' 2069 or dl,al 2070 lodsb 2071 xor al,' ' 2072 or dl,al 2073 lodsb 2074 xor al,' ' 2075 or dl,al 2076 lodsb 2077 xor al,' ' 2078 or dl,al 2079 lodsb 2080 xor al,' ' 2081 or dl,al 2082 2083 ; Assume not present 2084 clc 2085 jnz PART_IsJFS_exit 2086 2087 ; JFS signature found 2088 stc 2089 2332 PART_IsJFS Proc Near Uses ax 2333 mov al, [si+LocIPT_SystemID] ; Get SystemID 2334 cmp al, 0fch ; Compare with AiR-BOOT ID for JFS 2335 stc ; Assume JFS 2336 je PART_IsJFS_exit ; Yep 2337 clc ; Nope, clear CY 2090 2338 PART_IsJFS_exit: 2091 2339 ret 2092 2340 PART_IsJFS Endp 2093 2341 2342 2343 2344 ; 2345 ; ############################# 2346 ; # Is this an NTFS partition # 2347 ; ############################# 2348 ; 2349 ; In 2350 ; -- 2351 ; SI = Pointer to IPT entry 2352 ; 2353 ; Out 2354 ; --- 2355 ; CY = Set if NTFS partition, clear if not 2356 ; 2357 PART_IsNTFS Proc Near Uses ax 2358 mov al, [si+LocIPT_SystemID] ; Get SystemID 2359 cmp al, 08h ; Compare with AiR-BOOT ID for NTFS 2360 stc ; Assume NTFS 2361 je PART_IsNTFS_exit ; Yep 2362 clc ; Nope, clear CY 2363 PART_IsNTFS_exit: 2364 ret 2365 PART_IsNTFS Endp 2094 2366 2095 2367 … … 2101 2373 ; In 2102 2374 ; -- 2103 ; DL = Physical Disk 2104 ; BX:CX = LBA sector 2375 ; SI = Pointer to IPT entry 2105 2376 ; 2106 2377 ; Out … … 2108 2379 ; CY = Set if FAT12 or FAT16 partition, clear if not 2109 2380 ; 2110 ; This can be a FAT12 or FAT16 partition. 2111 ; When OS/2 formats volume with FAT it does not use the FAT16 identifier, 2112 ; but uses the FAT identifier. 2113 ; 2114 PART_IsFAT Proc Near Uses ax bx cx dx si di ds es 2115 2116 ; First see if this is a FAT32 partition. 2117 ; If it is, exit with NC indicating not FAT12 or FAT16. 2118 call PART_IsFAT32 2119 cmc 2120 jnc PART_IsFAT_exit 2121 2122 ; Load specified LBA sector (BX:CX) from the disk in DL 2123 mov di,ds 2124 mov si,offset [TmpSector] 2125 call DriveIO_LoadSectorLBA 2126 2127 ; Point to location of 'FAT ' identifier. 2128 add si,36h 2129 2130 ; DL holds equality status 2131 xor dl,dl 2132 cld 2133 2134 ; Load letter into AL, xor with letter will result 0 if the same. 2135 ; Then or to DL. 2136 ; If at the end of the sequence DL is zero, the signature is present. 2137 lodsb 2138 xor al,'F' 2139 or dl,al 2140 lodsb 2141 xor al,'A' 2142 or dl,al 2143 lodsb 2144 xor al,'T' 2145 or dl,al 2146 lodsb 2147 2148 ; Since OS/2 formats FAT volumes with an identifier of 'FAT ', 2149 ; and others with 'FAT16 ', we skip two bytes for comparison. 2150 ; The rest must be spaces however. 2151 ; xor al,' ' 2152 ; or dl,al 2153 lodsb 2154 ; xor al,' ' 2155 ; or dl,al 2156 2157 lodsb 2158 xor al,' ' 2159 or dl,al 2160 lodsb 2161 xor al,' ' 2162 or dl,al 2163 lodsb 2164 xor al,' ' 2165 or dl,al 2166 2167 ; Assume not present 2168 clc 2169 jnz PART_IsFAT_exit 2170 2171 ; FAT signature found 2381 PART_IsFAT Proc Near Uses ax 2382 mov al, [si+LocIPT_SystemID] ; Get SystemID 2383 cmp al, 04h ; Is FAT12 ? 2172 2384 stc 2173 2385 je PART_IsFAT_exit ; Yep 2386 cmp al, 06h ; Is FAT16 CHS ? 2387 stc 2388 je PART_IsFAT_exit ; Yep 2389 cmp al, 0eh ; Is FAT16 LBA ? 2390 stc 2391 je PART_IsFAT_exit ; Yep 2392 clc ; Nope 2174 2393 PART_IsFAT_exit: 2175 2394 ret … … 2184 2403 ; In 2185 2404 ; -- 2186 ; DL = Physical Disk 2187 ; BX:CX = LBA sector 2405 ; SI = Pointer to IPT entry 2188 2406 ; 2189 2407 ; Out … … 2191 2409 ; CY = Set if FAT32 partition, clear if not 2192 2410 ; 2193 PART_IsFAT32 Proc Near Uses ax bx cx dx si di ds es 2194 2195 ; Load specified LBA sector (BX:CX) from the disk in DL 2196 mov di,ds 2197 mov si,offset [TmpSector] 2198 call DriveIO_LoadSectorLBA 2199 2200 ; Point to location of 'FAT32 ' identifier. 2201 add si,52h 2202 2203 ; DL holds equality status 2204 xor dl,dl 2205 cld 2206 2207 ; Load letter into AL, xor with letter will result 0 if the same. 2208 ; Then or to DL. 2209 ; If at the end of the sequence DL is zero, the signature is present. 2210 lodsb 2211 xor al,'F' 2212 or dl,al 2213 lodsb 2214 xor al,'A' 2215 or dl,al 2216 lodsb 2217 xor al,'T' 2218 or dl,al 2219 lodsb 2220 xor al,'3' 2221 or dl,al 2222 lodsb 2223 xor al,'2' 2224 or dl,al 2225 lodsb 2226 xor al,' ' 2227 or dl,al 2228 lodsb 2229 xor al,' ' 2230 or dl,al 2231 lodsb 2232 xor al,' ' 2233 or dl,al 2234 2235 ; Assume not present 2236 clc 2237 jnz PART_IsFAT32_exit 2238 2239 ; FAT32 signature found 2411 PART_IsFAT32 Proc Near Uses ax 2412 mov al, [si+LocIPT_SystemID] ; Get SystemID 2413 cmp al, 0bh ; Is FAT32 CHS ? 2240 2414 stc 2241 2415 je PART_IsFAT32_exit ; Yep 2416 cmp al, 0ch ; Is FAT32 LBA ? 2417 stc 2418 je PART_IsFAT32_exit ; Yep 2419 clc ; Nope 2242 2420 PART_IsFAT32_exit: 2243 2421 ret -
trunk/BOOTCODE/REGULAR/PARTSCAN.ASM
r50 r51 21 21 22 22 23 IFDEF ModuleNames23 IFDEF MODULE_NAMES 24 24 DB 'PARTSCAN',0 25 25 ENDIF … … 48 48 mov byte ptr [CurIO_Scanning], 0 ; Reset flag due scanning complete 49 49 50 IFDEF AUX_DEBUG50 IFDEF AUX_DEBUG 51 51 ;~ pusha 52 52 ;~ call DEBUG_DumpHidePartTables 53 53 ;~ popa 54 ENDIF54 ENDIF 55 55 ; Use X-Reference to sync NewPartitionTable with Hide-Config 56 56 call PARTSCAN_SyncHideConfigWithXref 57 57 58 IFDEF AUX_DEBUG58 IFDEF AUX_DEBUG 59 59 ;~ pusha 60 60 ;~ call DEBUG_DumpHidePartTables 61 61 ;~ popa 62 ENDIF62 ENDIF 63 63 64 64 ; Now we copy the new IPT over the old one... … … 128 128 ret 129 129 PARTSCAN_ScanForPartitions EndP 130 131 132 133 ; 134 ; This function reconnects a forced drive-letter with it's partition 135 ; when partitions are removed. 136 ; 137 PARTSCAN_UpdateDriveLetters Proc 138 pusha 139 xor bx,bx ; index-pointer 140 xor cx,cx ; counter 141 xor dx,dx ; backup index-pointer 142 mov cl,LocIPT_MaxPartitions ; nr of entries to process 143 mov si,offset [PartitionXref] ; old-new relation table 144 mov di,offset [DriveLetters] ; forced drive-letters table 145 146 ; 147 ; Loop over each entry in the xref-table to see if the partition 148 ; has been removed or has been given a new index in the IPT. 149 ; A removed partition has 0ffh in it's slot and for a partition 150 ; that has a new index in the IPT the value at the slot is different 151 ; from the index of the slot in the xref-table. 152 ; 153 PARTSCAN_UpdateDriveLetters_next_entry: 154 jcxz PARTSCAN_UpdateDriveLetters_done 155 dec cl ; decrement counter 156 mov al,[si+bx] ; get possibly old index for this entry 157 mov dl,bl ; save current index 158 inc bl ; advance index-pointer 159 inc al ; 0ffh will become 0, part removed so continue 160 jz PARTSCAN_UpdateDriveLetters_next_entry 161 162 ; 163 ; If value in slot is the same as the index of the slot then 164 ; the partition has not moved in the IPT. 165 ; 166 dec al ; restore possibly out-of-date index 167 cmp al,dl ; same as array index? then ok, do next 168 je PARTSCAN_UpdateDriveLetters_next_entry 169 170 ;! 171 ;! DEBUG_PROBE 172 ;! 173 IFDEF AUX_DEBUG 174 push 1234h 175 call DEBUG_Probe 176 ENDIF 177 178 ; 179 ; The partition has moved in the IPT so we lookup it's forced 180 ; drive-letter at the old location and put it at the new one. 181 ; The old location is identified by the index in the xref-table 182 ; and the new location is identified by the value at that index. 183 ; Thus, when no partitions have been deleted or added, the xref-table 184 ; contains the sequence 0,1,2,3,...,n,0ffh,0ffh, etc. 185 ; The value 0ffh means that no partition is using the slot. 186 ; 187 xor ah,ah ; no drive-letter 188 dec bl ; backup index-pointer one position 189 xchg ah,[di+bx] ; get drive-letter and store zero 190 xchg bl,al ; use slot value as new index 191 mov [di+bx],ah ; store drive-letter 192 xchg al,bl ; restore index-pointer 193 inc bl ; point to next entry 194 jmp PARTSCAN_UpdateDriveLetters_next_entry 195 PARTSCAN_UpdateDriveLetters_done: 196 popa 197 ret 198 PARTSCAN_UpdateDriveLetters EndP 199 200 201 130 202 131 203 ; Scannt die Festplatte auf jegliche Partitionstabellen... … … 270 342 adc bx, wptr [CurPartition_Location+2] ; sectors 271 343 344 345 272 346 ; Sets up DS:SI - TmpSector 273 call DriveIO_LoadTmpSector ; Loads Boot record ; Rousseau: LOAD PARTITION BOOT RECORD !!347 call DriveIO_LoadTmpSector ; Loads Boot record 274 348 275 349 -
trunk/BOOTCODE/REGULAR/PASSWORD.ASM
r46 r51 20 20 ;--------------------------------------------------------------------------- 21 21 22 IFDEF ModuleNames22 IFDEF MODULE_NAMES 23 23 DB 'PASSWORD',0 24 24 ENDIF -
trunk/BOOTCODE/REGULAR/STD_TEXT.ASM
r50 r51 20 20 ;--------------------------------------------------------------------------- 21 21 22 IFDEF ModuleNames22 IFDEF MODULE_NAMES 23 23 DB 'STD_TEXT',0 24 24 ENDIF … … 50 50 ; 51 51 Copyright: 52 db ' AiR-BOOT v' 53 db BLDLVL_MAJOR_VERSION,'.' 54 db BLDLVL_MIDDLE_VERSION,'.' 55 db BLDLVL_MINOR_VERSION,' - (c) ' 56 db BLDLVL_YEAR 57 db ' M. Kiewitz <<Internal Release 3e>> (bld: ' 58 ;~ db ' M. Kiewitz <<Release Candidate 2>> (bld: ' 59 db BLDLVL_YEAR 60 db BLDLVL_MONTH 61 db BLDLVL_DAY,')' 62 db 0 52 db ' AiR-BOOT v' 53 db BLDLVL_MAJOR_VERSION,'.' 54 db BLDLVL_MIDDLE_VERSION,'.' 55 db BLDLVL_MINOR_VERSION,' - (c) ' 56 db BLDLVL_YEAR 57 ;~ db ' M. Kiewitz <<Internal Release 3o>> (bld: ' 58 ;~ db ' M. Kiewitz <<@ Interim Release @>> (bld: ' 59 ;~ db ' M. Kiewitz <<Release Candidate 2>> (bld: ' 60 db ' M. Kiewitz <<Release Candidate 3>> (bld: ' 61 db BLDLVL_YEAR 62 db BLDLVL_MONTH 63 db BLDLVL_DAY,')' 64 db 0 65 66 ; 67 ; Normal copyright notice. 68 ; 69 ;~ Copyright db ' AiR-BOOT v1.0.8 - (c) 1998-2012 M. Kiewitz, Dedicated to Gerd Kiewitz', 0 63 70 64 71 65 ;Copyright db ' AiR-BOOT v1.0.8 - (c) 1998-2012 M. Kiewitz, Dedicated to Gerd Kiewitz', 066 72 67 ; Message in case the user wants to edit the label of a type 0x35 partition 68 TXT_SETUP_NoEditType35 db 'Labels of LVM-Data partitions cannot be changed.', 0 69 ; Message in case the user wants to make a type 0x35 partition bootable 70 TXT_SETUP_NoBootType35 db 'LVM-Data partitions cannot be set bootable.', 0 73 ; License and source info. 74 BootEndMsg db 'This is GPLv3+ software, please visit: http://www.gnu.org/licenses/gpl.txt', 0 75 BootEndMsg2 db 'To obtain the sources, please visit: http://svn.netlabs.org/air-boot', 0 71 76 72 ;TXT_ERROR_TooManyPartitions db 'Too many partitions! -- Proper operation not guaranteed!', 0 73 74 ; Rousseau: switch around 75 BootEndMsg db 'This is GPLv3+ software, please visit: http://www.gnu.org/licenses/gpl.txt', 0 76 BootEndMsg2 db 'To obtain the sources, please visit: http://svn.netlabs.org/air-boot', 0 77 78 AuxInitMsg db 'Initializing Serial Communications on COM',0 79 80 CheckID_MBR db 'AiRBOOT' 81 BrokenHDD db ' (HDDx)', 0 77 ; Bugger... 78 CheckID_MBR db 'AiRBOOT' 79 BrokenHDD db ' (HDDx)', 0 82 80 83 81 ; Colors for special words hard-coded. Keep all 0s. … … 88 86 db 'Contact via e-mail: ', 0, 'airboot@ecomstation.com', 0 89 87 88 ; Table that points to BIOS device names. 89 ContinueBIOSbootTable dw offset TXT_SETUP_MAGIC_CDROM 90 dw offset TXT_SETUP_MAGIC_Network 91 dw offset TXT_SETUP_MAGIC_ZIPLS 92 dw 0 93 94 ; Com-port debugging header. 95 AuxInitMsg db 'Initializing Serial Communications on COM',0 96 97 ; LVM protection messages; should be translated and moved to lang-files. 98 TXT_SETUP_NoEditType35 db 'Labels of LVM-Data partitions cannot be changed', 0 99 TXT_SETUP_NoBootType35 db 'LVM-Data partitions cannot be set bootable', 0 100 TXT_BootMenuPowerOff db 'DEL to Power Off', 0 101 TXT_NoINT13XSupport db 'This BIOS does not support Extended INT13h Functions', 0 102 ;~ TXT_ERROR_TooManyPartitions db 'Too many partitions! -- Proper operation not guaranteed!', 0 103 104 ; MBR protection; should also be translated and moved. 105 NonMBRwrite db 'AiR-BOOT TRIED TO WRITE A non-MBR TO DISK !!',0 106 NonMBRwrite_rep db 'Please report this at airboot@ecomstation.com',0 107 SystemHalted db 'System Halted',0 108 90 109 ; Build Information string. 91 build_info 92 jwasm_txt 93 masm_txt 94 wasm_txt 95 tasm_txt 96 unknown_txt 110 build_info db 'Build Date: ',0 111 jwasm_txt db 'JWasm',0 112 masm_txt db 'Masm',0 113 wasm_txt db 'Wasm',0 114 tasm_txt db 'Tasm',0 115 unknown_txt db '????',0 97 116 98 ContinueBIOSbootTable dw offset TXT_SETUP_MAGIC_CDROM99 dw offset TXT_SETUP_MAGIC_Network100 dw offset TXT_SETUP_MAGIC_ZIPLS101 dw 0 -
trunk/BOOTCODE/REGULAR/TIMER.ASM
r30 r51 20 20 ;--------------------------------------------------------------------------- 21 21 22 IFDEF ModuleNames22 IFDEF MODULE_NAMES 23 23 DB 'TIMER',0 24 24 ENDIF -
trunk/BOOTCODE/REGULAR/VIDEOIO.ASM
r46 r51 20 20 ;--------------------------------------------------------------------------- 21 21 22 IFDEF ModuleNames22 IFDEF MODULE_NAMES 23 23 DB 'VIDEOIO',0 24 24 ENDIF … … 126 126 ; In: SI - String to Print (EOS is 0) 127 127 ; Destroyed: SI 128 VideoIO_Print Proc Near Uses es di128 VideoIO_Print Proc Near Uses ax es di 129 129 call VideoIO_Internal_SetRegs 130 130 VIOP_Loop: … … 171 171 mov es:[di+1], ah 172 172 add di, 2 173 inc TextPosX173 inc [TextPosX] 174 174 dec cl 175 175 jnz VIOFP_Loop … … 672 672 673 673 ; Copy assembler specification. 674 IFDEF JWASM674 IFDEF JWASM 675 675 mov al,'[' 676 676 stosb 677 677 mov si,offset jwasm_txt 678 ELSEIFDEF TASM678 ELSEIFDEF TASM 679 679 mov al,' ' 680 680 stosb … … 683 683 mov si,offset tasm_txt 684 684 685 ELSEIFDEF WASM685 ELSEIFDEF WASM 686 686 mov al,' ' 687 687 stosb … … 689 689 stosb 690 690 mov si,offset wasm_txt 691 ELSEIFDEF MASM691 ELSEIFDEF MASM 692 692 mov al,' ' 693 693 stosb … … 695 695 stosb 696 696 mov si,offset masm_txt 697 ELSE697 ELSE 698 698 mov al,' ' 699 699 stosb … … 701 701 stosb 702 702 mov si,offset unknown_txt 703 ENDIF 703 ENDIF 704 704 705 VideoIO_PrintBuildInfo_a1: 705 706 lodsb … … 758 759 VideoIO_DumpDiskInfo Proc Near uses ax bx cx dx 759 760 760 VideoIO_DumpDiskInfo_next_disk:761 pushdx762 xorax,ax763 moval,[TextPosY]764 pushax765 766 movax,21767 movdh,dl768 anddh,01111111b769 muldh770 movdh,al771 772 mov[TextPosX],dh773 774 mov si, offset Disk775 callVideoIO_Print776 moval,dl777 778 ; NIET GOED, GAAT FOUT > 9, HEX PRINT GEBRUIKEN !!779 shral,4780 addal,'0'781 callVideoIO_PrintSingleChar782 moval,dl783 andal,01111111b784 addal,'0'785 callVideoIO_PrintSingleChar786 moval,'h'787 callVideoIO_PrintSingleChar788 789 inc[TextPosY]790 mov[TextPosX],dh791 792 moval,'-'793 movcl,17794 callVideoIO_PrintSingleMultiChar795 796 ; inc[TextPosY]797 ; mov[TextPosX],dh798 ; movsi, offset BiosCyls799 ; callVideoIO_Print800 801 ; pushdx802 ; movbx,offset BIOS_Cyls803 ; xordh,dh804 ; anddl,01111111b805 ; shldx,1806 ; shldx,1807 ; addbx,dx808 ; movax,[bx]809 ; movdx,[bx+02]810 ; callVideoIO_PrintHexDWord811 ; popdx812 813 inc[TextPosY]814 mov[TextPosX],dh815 movsi, offset BiosHeads816 callVideoIO_Print817 818 pushdx819 movbx,offset BIOS_Heads820 xordh,dh821 anddl,01111111b822 shldx,1823 shldx,1824 addbx,dx825 movax,[bx]826 movdx,[bx+02]827 callVideoIO_PrintHexDWord828 popdx829 830 inc[TextPosY]831 mov[TextPosX],dh832 movsi, offset BiosSecs833 callVideoIO_Print834 835 pushdx836 movbx,offset BIOS_Secs837 xordh,dh838 anddl,01111111b839 shldx,1840 shldx,1841 addbx,dx842 movax,[bx]843 movdx,[bx+02]844 callVideoIO_PrintHexDWord845 popdx846 847 inc[TextPosY]848 mov[TextPosX],dh849 movsi, offset LvmSecs850 callVideoIO_Print851 852 pushdx853 ; Offset of array containing LVM SPT values for each disk found854 movbx,offset TrueSecs855 ; DX to index856 xordh,dh857 anddl,01111111b858 shldx,1859 shldx,1860 addbx,dx861 ; Get LVM SPT862 movax,[bx]863 movdx,[bx+02]864 callVideoIO_PrintHexDWord865 popdx866 867 inc[TextPosY]868 mov[TextPosX],dh869 movsi, offset BiosLBA870 callVideoIO_Print871 872 pushdx873 movbx,offset BIOS_TotalSecs874 xordh,dh875 anddl,01111111b876 shldx,1877 shldx,1878 shldx,1879 addbx,dx880 movax,[bx]881 movdx,[bx+02]882 callVideoIO_PrintHexDWord883 popdx884 885 inc[TextPosY]886 mov[TextPosX],dh887 888 popax889 mov[TextPosY],al890 popdx891 892 incdl893 moval,dl894 andal,01111111b895 cmpal,[TotalHarddiscs]896 jaeVideoIO_DumpDiskInfo_end897 jmpVideoIO_DumpDiskInfo_next_disk898 899 VideoIO_DumpDiskInfo_end:900 mov[TextPosX],0901 add[TextPosY],6902 ret761 VideoIO_DumpDiskInfo_next_disk: 762 push dx 763 xor ax,ax 764 mov al,[TextPosY] 765 push ax 766 767 mov ax,21 768 mov dh,dl 769 and dh,01111111b 770 mul dh 771 mov dh,al 772 773 mov [TextPosX],dh 774 775 mov si, offset [Disk] 776 call VideoIO_Print 777 mov al,dl 778 779 ; NIET GOED, GAAT FOUT > 9, HEX PRINT GEBRUIKEN !! 780 shr al,4 781 add al,'0' 782 call VideoIO_PrintSingleChar 783 mov al,dl 784 and al,01111111b 785 add al,'0' 786 call VideoIO_PrintSingleChar 787 mov al,'h' 788 call VideoIO_PrintSingleChar 789 790 inc [TextPosY] 791 mov [TextPosX],dh 792 793 mov al,'-' 794 mov cl,17 795 call VideoIO_PrintSingleMultiChar 796 797 ;~ inc [TextPosY] 798 ;~ mov [TextPosX],dh 799 ;~ mov si, offset BiosCyls 800 ;~ call VideoIO_Print 801 802 ;~ push dx 803 ;~ mov bx,offset BIOS_Cyls 804 ;~ xor dh,dh 805 ;~ and dl,01111111b 806 ;~ shl dx,1 807 ;~ shl dx,1 808 ;~ add bx,dx 809 ;~ mov ax,[bx] 810 ;~ mov dx,[bx+02] 811 ;~ call VideoIO_PrintHexDWord 812 ;~ pop dx 813 814 inc [TextPosY] 815 mov [TextPosX],dh 816 mov si, offset BiosHeads 817 call VideoIO_Print 818 819 push dx 820 mov bx,offset BIOS_Heads 821 xor dh,dh 822 and dl,01111111b 823 shl dx,1 824 shl dx,1 825 add bx,dx 826 mov ax,[bx] 827 mov dx,[bx+02] 828 call VideoIO_PrintHexDWord 829 pop dx 830 831 inc [TextPosY] 832 mov [TextPosX],dh 833 mov si, offset BiosSecs 834 call VideoIO_Print 835 836 push dx 837 mov bx,offset BIOS_Secs 838 xor dh,dh 839 and dl,01111111b 840 shl dx,1 841 shl dx,1 842 add bx,dx 843 mov ax,[bx] 844 mov dx,[bx+02] 845 call VideoIO_PrintHexDWord 846 pop dx 847 848 inc [TextPosY] 849 mov [TextPosX],dh 850 mov si, offset LvmSecs 851 call VideoIO_Print 852 853 push dx 854 ; Offset of array containing LVM SPT values for each disk found 855 mov bx,offset TrueSecs 856 ; DX to index 857 xor dh,dh 858 and dl,01111111b 859 shl dx,1 860 shl dx,1 861 add bx,dx 862 ; Get LVM SPT 863 mov ax,[bx] 864 mov dx,[bx+02] 865 call VideoIO_PrintHexDWord 866 pop dx 867 868 inc [TextPosY] 869 mov [TextPosX],dh 870 mov si, offset BiosLBA 871 call VideoIO_Print 872 873 push dx 874 mov bx,offset BIOS_TotalSecs 875 xor dh,dh 876 and dl,01111111b 877 shl dx,1 878 shl dx,1 879 shl dx,1 880 add bx,dx 881 mov ax,[bx] 882 mov dx,[bx+02] 883 call VideoIO_PrintHexDWord 884 pop dx 885 886 inc [TextPosY] 887 mov [TextPosX],dh 888 889 pop ax 890 mov [TextPosY],al 891 pop dx 892 893 inc dl 894 mov al,dl 895 and al,01111111b 896 cmp al,[TotalHarddiscs] 897 jae VideoIO_DumpDiskInfo_end 898 jmp VideoIO_DumpDiskInfo_next_disk 899 900 VideoIO_DumpDiskInfo_end: 901 mov [TextPosX],0 902 add [TextPosY],6 903 ret 903 904 VideoIO_DumpDiskInfo EndP 905 906 907 ; 908 ; Set position to teletype cursor 909 ; 910 VideoIO_ShowWaitDots Proc 911 pusha 912 ; Color white on black 913 mov ch,7 914 mov cl,0 915 call VideoIO_Color 916 ; Locate cursor for output of debug-info 917 mov ch,8 918 mov cl,1 919 call VideoIO_Locate 920 921 ; Print dots with interval. 922 mov cx,10 923 VideoIO_ShowWaitDots_next_dot: 924 mov al,'.' 925 call VideoIO_PrintSingleChar 926 ; Value 30 is about 1.5 seconds 927 mov al,1 928 call TIMER_WaitTicCount 929 loop VideoIO_ShowWaitDots_next_dot 930 popa 931 ret 932 VideoIO_ShowWaitDots EndP 904 933 905 934 … … 927 956 Yes db "YES",0 928 957 No db "NO",0 929 On db "ON",0930 Off db "OFF",0931 None db "NONE",0932 Active db "ACTIVE",0958 ;~ On db "ON",0 959 ;~ Off db "OFF",0 960 ;~ None db "NONE",0 961 ;~ Active db "ACTIVE",0 933 962 NotActive db "NOT ACTIVE",0 934 963 -
trunk/BOOTCODE/SETUP/MAIN.ASM
r46 r51 20 20 ;--------------------------------------------------------------------------- 21 21 22 IFDEF ModuleNames22 IFDEF MODULE_NAMES 23 23 DB 'MAIN',0 24 24 ENDIF … … 71 71 SETUP_CheckEnterSETUP Proc Near 72 72 73 74 75 73 ; Rousseau: added 76 74 ;mov SETUP_ExitEvent, 0 … … 108 106 call PART_CalculateStraightPartPointers 109 107 110 call FX_StartScreen ; Start of new screen... 108 IFDEF FX_ENABLED 109 call FX_StartScreen ; Start of new screen... 110 ENDIF 111 111 112 call SETUP_DrawMenuBase 112 113 mov bp, offset SETUP_MainMenu … … 131 132 cmp ax, offset TXT_SETUPHELP_Main ; ask only in main-menu... 132 133 jne SMT_NotMainMenu 133 call FX_EndScreenLeft ; Do FX, if requested... 134 135 IFDEF FX_ENABLED 136 call FX_EndScreenLeft ; Do FX, if requested... 137 ENDIF 138 134 139 test byte ptr [CFG_PasswordSetup], 1 135 140 jz SMT_NotMainMenu … … 147 152 int 16h 148 153 pop dx 154 155 ;! 156 ;! DEBUG_PROBE 157 ;! 158 IFDEF AUX_DEBUGx 159 push 1234h 160 call DEBUG_Probe 161 call DEBUG_DumpIPT 162 call DEBUG_DumpRegisters 163 ENDIF 164 165 166 149 167 cmp ah, Keys_Up 150 168 je SMT_KeyUp … … 280 298 281 299 SMT_SaveAndExitNOW: ; Direct HackIn 300 301 ;! 302 ;! DEBUG_PROBE 303 ;! 304 IFDEF AUX_DEBUGx 305 push 1235h 306 call DEBUG_Probe 307 ENDIF 308 282 309 mov ax, offset SETUP_EnterMenu_SaveAndExitSetup 283 310 jmp SMT_DirectExecute 284 311 285 312 SMT_ExitWithoutSaving: ; Direct HackIn 313 ;! 314 ;! DEBUG_PROBE 315 ;! 316 IFDEF AUX_DEBUGx 317 push 1236h 318 call DEBUG_Probe 319 ENDIF 320 286 321 mov ax, offset SETUP_EnterMenu_ExitWithoutSaving 287 322 jmp SMT_DirectExecute … … 389 424 call VideoIO_Print ; ...and print it. 390 425 SDIOS_Name_NoItemName: 391 mov w ptr TextColorFore, dx426 mov word ptr [TextColorFore], dx 392 427 ret 393 428 … … 586 621 call VideoIO_Color 587 622 call VideoIO_Print ; white - 'contact via e-mail'... 588 mov cx, 0 800h623 mov cx, 0700h 589 624 call VideoIO_Color 590 625 call VideoIO_Print ; and finally the e-mail adress … … 1151 1186 SETUPMAGIC_InternalCopyTillNUL Proc Near Uses ax cx 1152 1187 SMICTN_Loop: 1188 1189 ;! 1190 ;! DEBUG_PROBE 1191 ;! 1192 IFDEF AUX_DEBUGx 1193 push 1239h 1194 call DEBUG_Probe 1195 call DEBUG_DumpRegisters 1196 call DEBUG_DumpIPT 1197 ENDIF 1198 1153 1199 lodsb 1154 1200 stosb … … 1173 1219 ; Cur Value in DL, Maximum Value in DH. Add/Sub in CL 1174 1220 SETUPMAGIC_InternalCheckUp Proc Near 1221 ;! 1222 ;! DEBUG_PROBE 1223 ;! 1224 IFDEF AUX_DEBUGx 1225 push 1238h 1226 call DEBUG_Probe 1227 call DEBUG_DumpRegisters 1228 ENDIF 1229 1175 1230 or cl, cl ; CL==0? -> Decrease 1176 1231 jz SMICU_Substract ; otherwise -> Increase … … 1579 1634 1580 1635 SETUPMAGIC_ChangeBIOSbootSeq Proc Near Uses ax bx cx dx si di 1636 ;! 1637 ;! DEBUG_PROBE 1638 ;! 1639 IFDEF AUX_DEBUGx 1640 push 1237h 1641 call DEBUG_Probe 1642 call DEBUG_DumpRegisters 1643 ENDIF 1644 1581 1645 mov di, si 1582 1646 mov dl, ds:[bx] ; Cur Timed-Key-Handling … … 1602 1666 1603 1667 shl bx, 1 1604 mov si, w ptr [ContinueBIOSbootTable+bx]1668 mov si, word ptr [ContinueBIOSbootTable+bx] 1605 1669 SMCBBS_CopyThiz: 1606 1670 add di, LocMENU_ItemPack ; DI points to ItemPack... -
trunk/BOOTCODE/SETUP/MENUS.ASM
r50 r51 55 55 ; 56 56 57 IFDEF ModuleNames57 IFDEF MODULE_NAMES 58 58 DB 'MENUS',0 59 59 ENDIF … … 85 85 dw offset SETUP_EnterMenu_ExtendedOptions, 0 86 86 dw offset TXT_SETUP_ExtOptions, offset TXT_SETUPHELP_ExtOptions 87 87 88 ; The Menu-Items of the right side start here... 88 89 dw offset SETUP_EnterMenu_DefineMasterPassword, 0 … … 132 133 dw offset TXT_SETUP_IncludeFloppy, offset TXT_SETUPHELP_IncludeFloppy 133 134 dw 6 dup (0) 134 dw 0, 0 135 dw 0, 0 135 136 ; Show LVM Drive Letters or not 137 dw offset SETUPMAGIC_EnableDisable, offset CFG_MiscFlags 138 dw offset TXT_SETUP_ShowLVMDriveLetters, offset TXT_SETUPHELP_ShowLVMDriveLetters 139 dw 6 dup (0) 140 141 ;~ dw 0, 0 142 ;~ dw 0, 0 143 144 136 145 dw offset SETUPMAGIC_EnableDisable, offset CFG_ProtectMBR 137 146 dw offset TXT_SETUP_MbrProtection, offset TXT_SETUPHELP_MbrProtection -
trunk/BOOTCODE/SETUP/PART_SET.ASM
r49 r51 20 20 ;--------------------------------------------------------------------------- 21 21 22 IFDEF ModuleNames22 IFDEF MODULE_NAMES 23 23 DB 'PART_SET',0 24 24 ENDIF … … 41 41 int 16h 42 42 pop dx 43 44 ; 45 ; INSERT DEBUG KEYHANDLER HERE ? 46 ; 47 43 48 cmp ah, Keys_Up 44 49 je PSM_KeyUp … … 143 148 mov [si+LocIPT_Flags], al 144 149 xor ax, ax 145 mov w ptr [si+LocIPT_BootRecordCRC], ax150 mov word ptr [si+LocIPT_BootRecordCRC], ax 146 151 call PARTSETUP_DrawPartitionInfo 147 152 call PARTSETUP_BuildChoiceBar -
trunk/BOOTCODE/SPECIAL/APM.ASM
r30 r51 20 20 ;--------------------------------------------------------------------------- 21 21 22 IFDEF ModuleNames22 IFDEF MODULE_NAMES 23 23 DB 'APM',0 24 24 ENDIF -
trunk/BOOTCODE/SPECIAL/CHARSET.ASM
r45 r51 62 62 jmp DecodeLoop 63 63 DecodeDone: 64 call FX_WaitRetrace ; Wait for retrace to reduce flickering 64 IFDEF FX_ENABLED 65 call FX_WaitRetrace ; Wait for retrace to reduce flickering 66 ENDIF 65 67 mov ax, 1110h 66 68 mov bh, 16 -
trunk/BOOTCODE/SPECIAL/F00K/BILLSUXX.ASM
r46 r51 28 28 ; on the partition's P-flag including the overall M$hack-Enable Flag. 29 29 30 IFDEF ModuleNames30 IFDEF MODULE_NAMES 31 31 DB 'BILLSUXX',0 32 32 ENDIF -
trunk/BOOTCODE/SPECIAL/FAT16.ASM
r46 r51 20 20 ;--------------------------------------------------------------------------- 21 21 22 IFDEF ModuleNames22 IFDEF MODULE_NAMES 23 23 DB 'FAT16',0 24 24 ENDIF -
trunk/BOOTCODE/SPECIAL/FX.ASM
r46 r51 20 20 ;--------------------------------------------------------------------------- 21 21 22 IFDEF ModuleNames22 IFDEF MODULE_NAMES 23 23 DB 'FX',0 24 24 ENDIF -
trunk/BOOTCODE/SPECIAL/FXTABLES.ASM
r30 r51 20 20 ;--------------------------------------------------------------------------- 21 21 22 IFDEF ModuleNames22 IFDEF MODULE_NAMES 23 23 DB 'FXTABLES',0 24 24 ENDIF -
trunk/BOOTCODE/SPECIAL/LINUX.ASM
r40 r51 44 44 ; have done it as well as fat16.asm. 45 45 46 IFDEF ModuleNames46 IFDEF MODULE_NAMES 47 47 DB 'LINUX',0 48 48 ENDIF -
trunk/BOOTCODE/SPECIAL/LVM.ASM
r50 r51 20 20 ;--------------------------------------------------------------------------- 21 21 22 IFDEF ModuleNames22 IFDEF MODULE_NAMES 23 23 DB 'LVM',0 24 24 ENDIF 25 25 26 26 LVM_InitCRCTable Proc Near 27 ; Initializes our LVM-CRC-Table 28 xor cl, cl 29 mov di, offset LVM_CRCTable 30 LVM_ICRCT_Loop: 31 ;movzx ax, cl 32 mov al,cl 33 mov ah,0 34 35 xor dx, dx ; DX:AX - CRC-Value 36 mov ch, 8 37 LVM_ICRCT_Loop2: 38 shr dx, 1 39 rcr ax, 1 ; Shift value 1 to the right 40 jnc LVM_ICRCT_NoXOR 41 xor dx, 0EDB8h 42 xor ax, 8320h 43 LVM_ICRCT_NoXOR: 44 dec ch 45 jnz LVM_ICRCT_Loop2 46 mov wptr [di+0], ax 47 mov wptr [di+2], dx 48 add di, 4 49 add cl, 1 50 jnc LVM_ICRCT_Loop 51 ret 27 ; Initializes our LVM-CRC-Table 28 xor cl, cl 29 mov di, offset [LVM_CRCTable] 30 LVM_ICRCT_Loop: 31 ;movzx ax, cl 32 mov al,cl 33 mov ah,0 34 xor dx, dx ; DX:AX - CRC-Value 35 mov ch, 8 36 LVM_ICRCT_Loop2: 37 shr dx, 1 38 rcr ax, 1 ; Shift value 1 to the right 39 jnc LVM_ICRCT_NoXOR 40 xor dx, 0EDB8h 41 xor ax, 8320h 42 LVM_ICRCT_NoXOR: 43 dec ch 44 jnz LVM_ICRCT_Loop2 45 mov wptr [di+0], ax 46 mov wptr [di+2], dx 47 add di, 4 48 add cl, 1 49 jnc LVM_ICRCT_Loop 50 ret 52 51 LVM_InitCRCTable EndP 53 52 … … 57 56 ; Destroyed: None 58 57 LVM_GetSectorCRC Proc Near Uses bx cx 59 push wptr [si+LocLVM_CRC]60 push wptr [si+LocLVM_CRC+2]61 pushsi62 mov wptr [si+LocLVM_CRC], 063 mov wptr [si+LocLVM_CRC+2], 064 movax, -165 movdx, -166 movcx, 51267 68 xorbh, bh69 movbl, al ; Save last byte to BL70 moval, ah71 movah, dl72 movdl, dh73 xordh, dh ; SHR DX:AX, 874 xorbl, [si]75 incsi ; XOR last byte with [data]76 shlbx, 177 shlbx, 178 xor ax, wptr [LVM_CRCTable+bx+0]79 xor dx, wptr [LVM_CRCTable+bx+2] ; XOR with CRC-Table80 loopLVM_GSCRC_Loop81 popsi82 pop wptr [si+LocLVM_CRC+2]83 pop wptr [si+LocLVM_CRC]84 ret58 push word ptr [si+LocLVM_CRC+00] 59 push word ptr [si+LocLVM_CRC+02] 60 push si 61 mov word ptr [si+LocLVM_CRC], 0 62 mov word ptr [si+LocLVM_CRC+2], 0 63 mov ax, -1 64 mov dx, -1 65 mov cx, 512 66 LVM_GSCRC_Loop: 67 xor bh, bh 68 mov bl, al ; Save last byte to BL 69 mov al, ah 70 mov ah, dl 71 mov dl, dh 72 xor dh, dh ; SHR DX:AX, 8 73 xor bl, [si] 74 inc si ; XOR last byte with [data] 75 shl bx, 1 76 shl bx, 1 77 xor ax, word ptr [LVM_CRCTable+bx+0] 78 xor dx, word ptr [LVM_CRCTable+bx+2] ; XOR with CRC-Table 79 loop LVM_GSCRC_Loop 80 pop si 81 pop word ptr [si+LocLVM_CRC+2] 82 pop word ptr [si+LocLVM_CRC] 83 ret 85 84 LVM_GetSectorCRC EndP 86 85 … … 91 90 ; Destroyed: None 92 91 LVM_CheckSectorSignature Proc Near 93 test byte ptr [CFG_IgnoreLVM], 1; We are supposed to ignore LVM, so94 jnz LVMCSS_InvalidSignature; any sector is bad!95 cmp word ptr [si+LocLVM_SignatureStart], 5202h ; Rousseau: identify LVM sector96 jne LVMCSS_InvalidSignature97 cmp word ptr [si+LocLVM_SignatureStart+2], 'BM'98 jne LVMCSS_InvalidSignature99 cmp word ptr [si+LocLVM_SignatureStart+4], 'MP'100 jne LVMCSS_InvalidSignature101 cmp word ptr [si+LocLVM_SignatureStart+6], 'DF'102 jne LVMCSS_InvalidSignature103 stc104 ret105 LVMCSS_InvalidSignature:106 clc107 ret92 test byte ptr [CFG_IgnoreLVM], 1 ; We are supposed to ignore LVM, so 93 jnz LVMCSS_InvalidSignature ; any sector is bad! 94 cmp word ptr [si+LocLVM_SignatureStart], 5202h 95 jne LVMCSS_InvalidSignature 96 cmp word ptr [si+LocLVM_SignatureStart+2], 'BM' 97 jne LVMCSS_InvalidSignature 98 cmp word ptr [si+LocLVM_SignatureStart+4], 'MP' 99 jne LVMCSS_InvalidSignature 100 cmp word ptr [si+LocLVM_SignatureStart+6], 'DF' 101 jne LVMCSS_InvalidSignature 102 stc 103 ret 104 LVMCSS_InvalidSignature: 105 clc 106 ret 108 107 LVM_CheckSectorSignature EndP 109 108 … … 114 113 ; Destroyed: None 115 114 LVM_CheckSectorCRC Proc Near Uses ax dx 116 call LVM_GetSectorCRC117 cmp ax, word ptr [si+LocLVM_CRC]118 jne LVMCSCRC_BadCRC119 cmp dx, word ptr [si+LocLVM_CRC+2]120 jne LVMCSCRC_BadCRC121 stc122 ret123 LVMCSCRC_BadCRC:124 clc125 ret115 call LVM_GetSectorCRC 116 cmp ax, word ptr [si+LocLVM_CRC] 117 jne LVMCSCRC_BadCRC 118 cmp dx, word ptr [si+LocLVM_CRC+2] 119 jne LVMCSCRC_BadCRC 120 stc 121 ret 122 LVMCSCRC_BadCRC: 123 clc 124 ret 126 125 LVM_CheckSectorCRC EndP 127 126 … … 132 131 ; Destroyed: None 133 132 LVM_UpdateSectorCRC Proc Near Uses ax dx 134 call LVM_GetSectorCRC135 mov word ptr [si+LocLVM_CRC], ax136 mov word ptr [si+LocLVM_CRC+2], dx137 ret133 call LVM_GetSectorCRC 134 mov word ptr [si+LocLVM_CRC], ax 135 mov word ptr [si+LocLVM_CRC+2], dx 136 ret 138 137 LVM_UpdateSectorCRC EndP 139 138 … … 146 145 ; Destroyed: None 147 146 LVM_SearchForPartition Proc Near Uses cx 148 cmp bptr [si+LocLVM_SignatureStart], LocLVM_SignatureByte0149 jne LVMSFP_NotFound ; Quick Check, if LVM sector there150 add si, LocLVM_StartOfEntries151 mov cl, LocLVM_MaxEntries152 LVMSFP_Loop:153 cmp ax, [si+LocLVM_PartitionStart]154 jne LVMSFP_NextEntry155 cmp dx, [si+LocLVM_PartitionStart+2]156 je LVMSFP_FoundIt157 158 add si, LocLVM_LenOfEntry159 dec cl160 jnz LVMSFP_Loop161 LVMSFP_NotFound:162 clc163 ret164 LVMSFP_FoundIt:165 stc166 ret147 cmp byte ptr [si+LocLVM_SignatureStart], LocLVM_SignatureByte0 148 jne LVMSFP_NotFound ; Quick Check, if LVM sector there 149 add si, LocLVM_StartOfEntries 150 mov cl, LocLVM_MaxEntries 151 LVMSFP_Loop: 152 cmp ax, [si+LocLVM_PartitionStart] 153 jne LVMSFP_NextEntry 154 cmp dx, [si+LocLVM_PartitionStart+2] 155 je LVMSFP_FoundIt 156 LVMSFP_NextEntry: 157 add si, LocLVM_LenOfEntry 158 dec cl 159 jnz LVMSFP_Loop 160 LVMSFP_NotFound: 161 clc 162 ret 163 LVMSFP_FoundIt: 164 stc 165 ret 167 166 LVM_SearchForPartition EndP 168 167 … … 171 170 ; In: BX:CX - LBA starting sector of partition to be searched 172 171 ; DL = Physical Disk in BIOS notation. (80h+) 173 ; Out: C arry set, if LVM-info found174 ; AL - drive-letter from LVM-info 175 172 ; Out: CY=1 if LVM-info found, 0 if no LVM-info. 173 ; AL - drive-letter from LVM-info or zero if no drive-letter 174 ; assigned or no LVM-info. 176 175 LVM_GetDriveLetter Proc Near Uses bx cx dx si di ds es 177 176 ; For primary partitions this information is stored in the last … … 222 221 mov si,offset [LVMSector] 223 222 mov di,ds 224 call DriveIO_LoadSectorLBA 223 call DriveIO_LoadSectorLBA ; Change this to normal IO-routine !!!!!! 225 224 pop di 226 225 pop si … … 238 237 jz LVM_GetDriveLetter_is_not_pri 239 238 239 ; 240 240 ; It's a PRI so we use the special locator function. 241 241 ; This locator takes care of extended eCS geometry should that be used 242 ; 242 243 call DriveIO_LoadMasterLVMSector 243 244 … … 261 262 call LVM_SearchForPartition 262 263 mov bx,si ; BX now points to LVM entry 263 mov dx,0 ; Setup null driveletter264 mov dx,0 264 265 pop si 265 266 266 mov al,0 267 mov al,0 ; Setup null driveletter 267 268 ; Oops, no valid LVM record was used so we have a null driveletter. 268 269 jnc LVM_GetDriveLetter_null_lvm_dl … … 273 274 ; 274 275 mov al,[bx+LocLVM_VolumeLetter] 275 ; Clear CY if 0276 ; Test for zero dtive-letter. 276 277 test al,al 278 ; Preset CY in case drive-letter is zero. 277 279 clc 278 280 jz LVM_GetDriveLetter_null_lvm_dl 281 282 ; We have a non-zero drive-letter, so set CY. 279 283 stc 280 284 … … 282 286 ret 283 287 LVM_GetDriveLetter EndP 288 289 290 291 ; Sets a drive-letter in the LVM-info of a partition. (if it exists) 292 ; In: BX:CX - LBA starting sector of partition to be searched 293 ; DL = Physical Disk in BIOS notation. (80h+) 294 ; AL = DriveLetter to set (can be zero to hide partition from LVM) 295 ; Out: CY=1 if LVM-info found, 0 if no LVM-info. 296 LVM_SetDriveLetter Proc Near Uses bx cx dx si di ds es 297 local disk:byte 298 local drive_letter:byte 299 local pri_ind:byte 300 local lvm_log_high:word 301 local lvm_log_low:word 302 ; For primary partitions this information is stored in the last 303 ; sector of track0; for all four partition entries in case they 304 ; they are all primary ones. 305 ; 306 ; LVM DLAT info for logical partitions is stored in the sector 307 ; preceding the start of the partition. 308 ; 309 ; Because the LVM info of a logical partition is the easiest to find, 310 ; we do that first. The LVM info for primary partitions is located 311 ; dependent on the geometry in use, so we use a special locater 312 ; call for that. Also, since the LVM info for primaries contains 313 ; info on all 4 entries, we need the partition index to obtain the 314 ; correct drive-letter. 315 ; 316 317 mov [disk], dl 318 319 ; Store the drive-letter for later use 320 mov [drive_letter], al 321 322 323 ; See if this is a primary partition 324 ; CY will be set if it is and AL will contain the 0-based 325 ; index in the P-table. 326 ; If it's a logical partition, CY will be clear and AL 327 ; will be set to 0ffh indicating an invalid index. 328 call PART_IsPrimaryPartition 329 mov al,0 330 rcl al,1 ; CY if primary 331 mov dh,al ; Save PRI or LOG 332 mov [pri_ind],al 333 334 ; Save PRI/LOG indicator for later use 335 push dx 336 337 ; Load *possible* LVM sector 338 ; This load is only valid if the partition is logical, in which case 339 ; the LVM sector is below the start of the partition. 340 ; If primary, the LVM sector is at a location that 341 ; DriveIO_LoadMasterLVMSector will find out. 342 343 ; Push LBA address 344 push bx 345 push cx 346 347 ; Adjust for logical LVM-sector 348 sub cx,1 349 sbb bx,0 350 351 ; Store LBA address of LVM-sector 352 mov [lvm_log_low],cx 353 mov [lvm_log_high],bx 354 355 ; Load the LVM sector 356 push si 357 push di 358 mov si,offset [LVMSector] 359 mov di,ds 360 call DriveIO_LoadSectorLBA ; Change this to normal IO-routine !!!!!! 361 pop di 362 pop si 363 364 ; Restore LBA address 365 pop cx 366 pop bx 367 368 ; Restore PRI/LOG partition indicator in DH 369 pop dx 370 371 ; Test PRI or not 372 test dh,dh 373 ; It's not a PRI so we can use the previously loaded LVM sector 374 jz LVM_SetDriveLetter_is_not_pri 375 376 ; 377 ; It's a PRI so we use the special locator function. 378 ; This locator takes care of extended eCS geometry should that be used 379 ; 380 call DriveIO_LoadMasterLVMSector 381 jnc LVM_SetDriveLetter_null_lvm_dl 382 383 mov ax, word ptr [MasterLVMLBA] ; ARRAY VAN MAKEN ! 384 mov [lvm_log_low], ax 385 mov [lvm_log_high], 0 386 387 LVM_SetDriveLetter_is_not_pri: 388 389 ; 390 ; At this stage the LVM-info sector has been loaded at [LVMSector]. 391 ; From here we look for an LVM entry for the partition. 392 ; If one is found, based on it's LBA-start, it's driveletter is used 393 ; in case byte 25h in the BPB is zero. 394 ; 395 396 ; Search for the partition in the LVM info. 397 ; If found, CY is set and SI points to LVM entry. 398 push si 399 mov ax,cx 400 mov dx,bx 401 mov si,offset [LVMSector] 402 call LVM_SearchForPartition 403 mov bx,si ; BX now points to LVM entry 404 pop si 405 406 mov al,0 ; Setup null driveletter 407 ; Oops, no valid LVM record was used so we have a null driveletter. 408 jnc LVM_SetDriveLetter_null_lvm_dl 409 410 ; 411 ; At this point BX points to the LVM-entry related to the 412 ; partition, whether it was a logical or a primary one. 413 ; 414 mov al, [drive_letter] 415 mov [bx+LocLVM_VolumeLetter],al 416 417 mov si, offset [LVMSector] 418 call LVM_UpdateSectorCRC 419 420 mov dl, [disk] 421 mov bx, [lvm_log_high] 422 mov ax, [lvm_log_low] 423 424 call DriveIO_SaveSector 425 426 LVM_SetDriveLetter_null_lvm_dl: 427 ret 428 LVM_SetDriveLetter EndP 429 284 430 285 431 … … 290 436 ; Destroyed: None 291 437 LVM_RemoveVolLetterFromSector Proc Near Uses cx 292 cmp bptr [si+LocLVM_SignatureStart], LocLVM_SignatureByte0293 jne LVMRVLFS_Done ; Quick Check, if LVM sector there294 push si295 add si, LocLVM_StartOfEntries296 mov cl, LocLVM_MaxEntries297 298 299 300 301 mov bptr [si+LocLVM_VolumeLetter], 0302 303 304 dec cl305 jnz LVMRVLFS_Loop306 pop si307 call LVM_UpdateSectorCRC308 LVMRVLFS_Done:309 ret438 cmp bptr [si+LocLVM_SignatureStart], LocLVM_SignatureByte0 439 jne LVMRVLFS_Done ; Quick Check, if LVM sector there 440 push si 441 add si, LocLVM_StartOfEntries 442 mov cl, LocLVM_MaxEntries 443 LVMRVLFS_Loop: 444 cmp ch, [si+LocLVM_VolumeLetter] 445 jne LVMRVLFS_NextEntry 446 ; Reset drive-letter, if matched 447 mov bptr [si+LocLVM_VolumeLetter], 0 ; ASSIGN NEXT FREE HERE... (DOET DUBBEL ALS ZELFDE DL ALS SYS) 448 LVMRVLFS_NextEntry: 449 add si, LocLVM_LenOfEntry 450 dec cl 451 jnz LVMRVLFS_Loop 452 pop si 453 call LVM_UpdateSectorCRC 454 LVMRVLFS_Done: 455 ret 310 456 LVM_RemoveVolLetterFromSector EndP 311 457 … … 317 463 ; Out: None 318 464 ; Destroyed: AX 465 319 466 LVM_DoLetterReassignment Proc Near Uses bx cx dx si di 320 mov di, si ; Save SI in DI (Partition-pointer) 321 mov ch, al ; and AL in CH (drive-letter) 322 xor bx, bx 323 mov cl, CFG_Partitions 324 or cl, cl 325 jz LVMDLR_SkipRemove 326 327 LVMDLR_RemoveLoop: 328 cmp bptr [PartitionVolumeLetters+bx], ch 329 jne LVMDLR_NextPartition 330 ; One volume that has our wanted drive-letter, so remove it! 331 mov dl, bl 332 call PART_GetPartitionPointer ; DL - partition -> SI 333 ; Now set CurPartition_Location for the DriveIO-functions to work 334 mov ax, wptr [si+LocIPT_AbsolutePartTable] 335 mov wptr [CurPartition_Location+0], ax 336 mov ax, wptr [si+LocIPT_AbsolutePartTable+2] 337 mov wptr [CurPartition_Location+2], ax 338 mov ax, wptr [si+LocIPT_LocationPartTable+1] 339 mov wptr [CurPartition_Location+6], ax 340 mov ah, bptr [si+LocIPT_LocationPartTable+0] 341 mov al, [si+LocIPT_Drive] 342 mov wptr [CurPartition_Location+4], ax 343 call DriveIO_LoadLVMSector ; SI points now to LVM-Sector 344 call LVM_RemoveVolLetterFromSector 345 IFDEF ReleaseCode 346 call DriveIO_SaveLVMSector ; Save sector 347 ENDIF 348 LVMDLR_NextPartition: 349 inc bx 350 dec cl 351 jnz LVMDLR_RemoveLoop 352 353 LVMDLR_SkipRemove: 354 ; Set CurPartition_Location information of destination partition 355 mov ax, wptr [di+LocIPT_AbsolutePartTable] 356 mov wptr [CurPartition_Location+0], ax 357 mov ax, wptr [di+LocIPT_AbsolutePartTable+2] 358 mov wptr [CurPartition_Location+2], ax 359 mov ah, bptr [di+LocIPT_LocationPartTable+0] 360 mov al, [di+LocIPT_Drive] 361 mov wptr [CurPartition_Location+4], ax 362 mov ax, wptr [di+LocIPT_LocationPartTable+1] 363 mov wptr [CurPartition_Location+6], ax 364 call DriveIO_LoadLVMSector ; SI points now to LVM-Sector 365 mov ax, wptr [di+LocIPT_AbsoluteBegin] 366 mov dx, wptr [di+LocIPT_AbsoluteBegin+2] 367 mov di, si ; Save SI in DI 368 call LVM_SearchForPartition 369 jnc LVMDLR_DestPartNotFound 370 ; Set new volume letter 371 mov bptr [si+LocLVM_VolumeLetter], ch 372 mov si, di ; SI - LVM Sector again 373 call LVM_UpdateSectorCRC ; Update LVM-CRC now 374 IFDEF ReleaseCode 375 call DriveIO_SaveLVMSector ; Save sector 376 ENDIF 377 LVMDLR_DestPartNotFound: 378 ; This here is done for safety, because we misuse CurPartition_Location 379 xor ax, ax 380 mov di, offset CurPartition_Location 381 mov cx, 4 382 rep stosw ; NUL out CurPartition_Location 383 ret 467 468 IFDEF AUX_DEBUG 469 pusha 470 mov si, offset dlra 471 call AuxIO_Print 472 call AuxIO_Teletype 473 call AuxIO_TeletypeNL 474 popa 475 ENDIF 476 477 mov di, si ; Save SI in DI (Partition-pointer) 478 mov ch, al ; and AL in CH (drive-letter) 479 xor bx, bx 480 mov cl, CFG_Partitions 481 or cl, cl 482 jz LVMDLR_SkipRemove 483 484 LVMDLR_RemoveLoop: 485 cmp bptr [PartitionVolumeLetters+bx], ch 486 jne LVMDLR_NextPartition 487 ; One volume that has our wanted drive-letter, so remove it! 488 mov dl, bl 489 call PART_GetPartitionPointer ; DL - partition -> SI 490 ; Now set CurPartition_Location for the DriveIO-functions to work 491 mov ax, wptr [si+LocIPT_AbsolutePartTable] 492 mov wptr [CurPartition_Location+0], ax 493 mov ax, wptr [si+LocIPT_AbsolutePartTable+2] 494 mov wptr [CurPartition_Location+2], ax 495 mov ax, wptr [si+LocIPT_LocationPartTable+1] 496 mov wptr [CurPartition_Location+6], ax 497 mov ah, bptr [si+LocIPT_LocationPartTable+0] 498 mov al, [si+LocIPT_Drive] 499 mov wptr [CurPartition_Location+4], ax 500 call DriveIO_LoadLVMSector ; SI points now to LVM-Sector 501 call LVM_RemoveVolLetterFromSector 502 503 IFDEF ReleaseCode 504 call DriveIO_SaveLVMSector ; Save sector 505 ENDIF 506 LVMDLR_NextPartition: 507 inc bx 508 dec cl 509 jnz LVMDLR_RemoveLoop 510 511 LVMDLR_SkipRemove: 512 ; Set CurPartition_Location information of destination partition 513 mov ax, wptr [di+LocIPT_AbsolutePartTable] 514 mov wptr [CurPartition_Location+0], ax 515 mov ax, wptr [di+LocIPT_AbsolutePartTable+2] 516 mov wptr [CurPartition_Location+2], ax 517 mov ah, bptr [di+LocIPT_LocationPartTable+0] 518 mov al, [di+LocIPT_Drive] 519 mov wptr [CurPartition_Location+4], ax 520 mov ax, wptr [di+LocIPT_LocationPartTable+1] 521 mov wptr [CurPartition_Location+6], ax 522 call DriveIO_LoadLVMSector ; SI points now to LVM-Sector 523 mov ax, wptr [di+LocIPT_AbsoluteBegin] 524 mov dx, wptr [di+LocIPT_AbsoluteBegin+2] 525 mov di, si ; Save SI in DI 526 call LVM_SearchForPartition 527 jnc LVMDLR_DestPartNotFound 528 ; Set new volume letter 529 mov bptr [si+LocLVM_VolumeLetter], ch 530 mov si, di ; SI - LVM Sector again 531 call LVM_UpdateSectorCRC ; Update LVM-CRC now 532 533 IFDEF ReleaseCode 534 call DriveIO_SaveLVMSector ; Save sector 535 ENDIF 536 537 LVMDLR_DestPartNotFound: 538 ; This here is done for safety, because we misuse CurPartition_Location 539 xor ax, ax 540 mov di, offset CurPartition_Location 541 mov cx, 4 542 rep stosw ; NUL out CurPartition_Location 543 ret 384 544 LVM_DoLetterReassignment EndP 545 546 547 ; This walks the IPT and for each partition it obtains the LVM drive-letter 548 ; if available. This drive-letter is then marked as in-use in the Map. 549 ; The FreeDriveletterMap is used by the drive-letter reassignment function 550 ; to assign a new drive to a data-partition when a system-partition is booted 551 ; with the same drive-letter. The original drive-letter for the data-partition 552 ; is saved so it can be restored later when a system is booted that does not 553 ; use the drive-letter. Note that there can be multiple system-partitions 554 ; using the same drive-letter and data-partitions can become system-partition 555 ; by making them bootable. (and vice versa) 556 LVM_ComposeFreeDriveletterMap Proc 557 558 ; get nr of partitions in IPT 559 ; for each partition get LVM drive-letter and reset bit in map. 560 561 LVM_ComposeFreeDriveletterMap EndP 562 -
trunk/BOOTCODE/SPECIAL/SOUND.ASM
r46 r51 20 20 ;--------------------------------------------------------------------------- 21 21 22 IFDEF ModuleNames22 IFDEF MODULE_NAMES 23 23 DB 'SOUND',0 24 24 ENDIF -
trunk/BOOTCODE/SPECIAL/VIRUS.ASM
r40 r51 24 24 ; Segment Registers preserved 25 25 26 IFDEF ModuleNames26 IFDEF MODULE_NAMES 27 27 DB 'VIRUS',0 28 28 ENDIF -
trunk/BOOTCODE/TEXT/DE/MENUS.ASM
r37 r51 53 53 TXT_SETUP_RememberTimedBoot db 'Zeit-Boot-Part. merken', 0 54 54 TXT_SETUP_IncludeFloppy db 'Disk-LW hinzufgen', 0 55 TXT_SETUP_ShowLVMDriveLetters db 'Show LVM Drive Letters',0 55 56 TXT_SETUP_MbrProtection db 'MBR Schutz', 0 56 57 TXT_SETUP_IgnoreMbrWrites db '-> Ignoriere Schreiben', 0 … … 82 83 ;TXT_SETUP_DefLinuxCmd db 'DEFINIERE LINUX KOMMANDOZEILE', 0 83 84 TXT_SETUP_IgnoreLVM db 'Ignoriere LVM Daten', 0 84 TXT_SETUP_ForceLBAUsage db 'Erzwinge BIOS-LBA', 085 ;~ TXT_SETUP_ForceLBAUsage db 'Erzwinge BIOS-LBA', 0 85 86 TXT_SETUP_ExtPartMShack db 'Erw-Part MS Workaround', 0 86 87 … … 211 212 db 'Booten von Laufwerk A:', 0 212 213 db 0 214 TXT_SETUPHELP_ShowLVMDriveLetters db 'AiR-BOOT will show', 0 215 db 'LVM Drive Letters', 0 216 db 'in the menu.', 0 217 db 0 213 218 TXT_SETUPHELP_MbrProtection db 'Beschtzt Ihren MBR', 0 214 219 db 'durch residenten Code.', 0 … … 299 304 db 'LVM Informationen.', 0 300 305 db 0 301 TXT_SETUPHELP_ForceLBAUsage db 'Erzwingt Bentzung der', 0302 db 'BIOS LBA APIs anstatt', 0303 db 'gemischter Verwendung', 0304 db 'von CHS und LBA.', 0305 db 0306 ;~ TXT_SETUPHELP_ForceLBAUsage db 'Erzwingt Bentzung der', 0 307 ;~ db 'BIOS LBA APIs anstatt', 0 308 ;~ db 'gemischter Verwendung', 0 309 ;~ db 'von CHS und LBA.', 0 310 ;~ db 0 306 311 TXT_SETUPHELP_ExtPartMShack db 'Aktiviert dynamisches', 0 307 312 db 'ndern des erweiterten', 0 -
trunk/BOOTCODE/TEXT/EN/MENUS.ASM
r37 r51 53 53 TXT_SETUP_RememberTimedBoot db 'Remember Timed Boot', 0 54 54 TXT_SETUP_IncludeFloppy db 'Include Floppy Drive', 0 55 TXT_SETUP_ShowLVMDriveLetters db 'Show LVM Drive Letters',0 55 56 TXT_SETUP_MbrProtection db 'MBR Protection', 0 56 57 TXT_SETUP_IgnoreMbrWrites db '-> Ignore MBR Writes', 0 … … 82 83 ;TXT_SETUP_DefLinuxCmd db 'DEFINE COMMAND LINE FOR LINUX', 0 83 84 TXT_SETUP_IgnoreLVM db 'Ignore LVM information', 0 84 TXT_SETUP_ForceLBAUsage db 'Force BIOS-LBA Usage', 085 ;~ TXT_SETUP_ForceLBAUsage db 'Force BIOS-LBA Usage', 0 85 86 TXT_SETUP_ExtPartMShack db 'Ext-Part MS Workaround', 0 86 87 … … 212 213 db 'menu.', 0 213 214 db 0 215 TXT_SETUPHELP_ShowLVMDriveLetters db 'AiR-BOOT will show', 0 216 db 'LVM Drive Letters', 0 217 db 'in the menu.', 0 218 db 0 214 219 TXT_SETUPHELP_MbrProtection db 'Protects your MBR via', 0 215 220 db 'resident code. Needs', 0 … … 301 306 db 'LVM information.', 0 302 307 db 0 303 TXT_SETUPHELP_ForceLBAUsage db 'Forces the usage of', 0304 db 'BIOS LBA APIs instead', 0305 db 'of mixed usage of CHS', 0306 db 'and LBA.', 0307 db 0308 ;~ TXT_SETUPHELP_ForceLBAUsage db 'Forces the usage of', 0 309 ;~ db 'BIOS LBA APIs instead', 0 310 ;~ db 'of mixed usage of CHS', 0 311 ;~ db 'and LBA.', 0 312 ;~ db 0 308 313 TXT_SETUPHELP_ExtPartMShack db 'Enables dynamic change', 0 309 314 db 'of the ext. partition', 0 -
trunk/BOOTCODE/TEXT/FR/MENUS.ASM
r37 r51 53 53 TXT_SETUP_RememberTimedBoot db 'Mmoriser Amorce Tempo.', 0 54 54 TXT_SETUP_IncludeFloppy db 'Incl. Lecteur Disquette', 0 55 TXT_SETUP_ShowLVMDriveLetters db 'Show LVM Drive Letters',0 55 56 TXT_SETUP_MbrProtection db 'Protection MBR', 0 56 57 TXT_SETUP_IgnoreMbrWrites db '-> Ignorer criture MBR', 0 … … 82 83 ;TXT_SETUP_DefLinuxCmd db 'DFINIR LIGNE DE COMMANDE LINUX', 0 83 84 TXT_SETUP_IgnoreLVM db 'Ignorer Information LVM', 0 84 TXT_SETUP_ForceLBAUsage db 'Force usage du BIOS-LBA', 085 ;~ TXT_SETUP_ForceLBAUsage db 'Force usage du BIOS-LBA', 0 85 86 TXT_SETUP_ExtPartMShack db 't-Part MS Workaround', 0 86 87 … … 216 217 db 'menu.', 0 217 218 db 0 219 TXT_SETUPHELP_ShowLVMDriveLetters db 'AiR-BOOT will show', 0 220 db 'LVM Drive Letters', 0 221 db 'in the menu.', 0 222 db 0 218 223 TXT_SETUPHELP_MbrProtection db 'Protge MBR par code', 0 219 224 db 'rsidant. Ncessite', 0 … … 310 315 db 'LVM.', 0 311 316 db 0 312 TXT_SETUPHELP_ForceLBAUsage db 'Forcer l''usage de', 0313 db 'l''API BIOS LBA au lieu', 0314 db 'd''un amalgame de', 0315 db 'CHS et LBA.', 0316 db 0317 ;~ TXT_SETUPHELP_ForceLBAUsage db 'Forcer l''usage de', 0 318 ;~ db 'l''API BIOS LBA au lieu', 0 319 ;~ db 'd''un amalgame de', 0 320 ;~ db 'CHS et LBA.', 0 321 ;~ db 0 317 322 TXT_SETUPHELP_ExtPartMShack db 'Changement dynamique', 0 318 323 db 'du type id (standard', 0 -
trunk/BOOTCODE/TEXT/IT/MENUS.ASM
r37 r51 54 54 TXT_SETUP_RememberTimedBoot db 'Ricorda Avvio Temporiz.', 0 55 55 TXT_SETUP_IncludeFloppy db 'Includi Avvio da Floppy', 0 56 TXT_SETUP_ShowLVMDriveLetters db 'Show LVM Drive Letters',0 56 57 TXT_SETUP_MbrProtection db 'Proteggi MBR', 0 57 58 TXT_SETUP_IgnoreMbrWrites db '->Ignora modifiche MBR', 0 … … 83 84 ;TXT_SETUP_DefLinuxCmd db 'DEFINIRE LINEA DI COMANDO LINUX', 0 84 85 TXT_SETUP_IgnoreLVM db 'Ignorare LVM info.', 0 85 TXT_SETUP_ForceLBAUsage db 'Forza uso LBA del BIOS', 086 ;~ TXT_SETUP_ForceLBAUsage db 'Forza uso LBA del BIOS', 0 86 87 TXT_SETUP_ExtPartMShack db 'Est-Part MS Workaround', 0 87 88 … … 217 218 db 'tramite il menu', 0 218 219 db 0 220 TXT_SETUPHELP_ShowLVMDriveLetters db 'AiR-BOOT will show', 0 221 db 'LVM Drive Letters', 0 222 db 'in the menu.', 0 223 db 0 219 224 TXT_SETUPHELP_MbrProtection db 'Protegge il MBR con un', 0 220 225 db 'programma residente.', 0 … … 314 319 db 'informazione.', 0 315 320 db 0 316 TXT_SETUPHELP_ForceLBAUsage db 'Forza l''uso delle API', 0317 db 'LBA del BIOS invece', 0318 db 'dell''uso misto di CHS', 0319 db 'ed LBA.', 0320 db 0321 ;~ TXT_SETUPHELP_ForceLBAUsage db 'Forza l''uso delle API', 0 322 ;~ db 'LBA del BIOS invece', 0 323 ;~ db 'dell''uso misto di CHS', 0 324 ;~ db 'ed LBA.', 0 325 ;~ db 0 321 326 TXT_SETUPHELP_ExtPartMShack db 'Abilita il cambiamento', 0 322 327 db 'dinamico della partiz.', 0 -
trunk/BOOTCODE/TEXT/NL/MENUS.ASM
r37 r51 53 53 TXT_SETUP_RememberTimedBoot db 'Vorige keuze/wachttijd', 0 54 54 TXT_SETUP_IncludeFloppy db 'Inclusief station A:', 0 55 TXT_SETUP_ShowLVMDriveLetters db 'Toon LVM Drive Letters',0 55 56 TXT_SETUP_MbrProtection db 'MBR beveiligen', 0 56 57 TXT_SETUP_IgnoreMbrWrites db '-> MBR niet beveiligen', 0 … … 82 83 ;TXT_SETUP_DefLinuxCmd db 'Opdrachtenreeks voor Linux', 0 83 84 TXT_SETUP_IgnoreLVM db 'LVM-gegevens negeren', 0 84 TXT_SETUP_ForceLBAUsage db 'Enkel BIOS-LBA', 085 ;~ TXT_SETUP_ForceLBAUsage db 'Enkel BIOS-LBA', 0 85 86 TXT_SETUP_ExtPartMShack db 'Ext-Part MS Workaround', 0 86 87 ;----------------------------------|---------------------|------------------ … … 217 218 db 'starten werd gekozen.' ,0 218 219 db 0 219 TXT_SETUPHELP_IncludeFloppy db 'U k anvan A: opstarten', 0220 TXT_SETUPHELP_IncludeFloppy db 'U kunt van A: opstarten', 0 220 221 db 'via het AiR-BOOTmenu.', 0 221 222 db 0 223 TXT_SETUPHELP_ShowLVMDriveLetters db 'AiR-BOOT will show', 0 224 db 'LVM Drive Letters', 0 225 db 'in the menu.', 0 226 db 0 222 227 TXT_SETUPHELP_MbrProtection db 'Beveiligt het MBR via', 0 223 228 db 'een residente code.', 0 … … 318 323 db 'onbestaande beschouwd.', 0 319 324 db 0 320 TXT_SETUPHELP_ForceLBAUsage db 'Uitschakelen van de', 0321 db 'combinatie van LBA', 0322 db 'en CHS. Er wordt dan', 0323 db 'ENKEL gebruik gemaakt', 0324 db 'van de BIOS LBA API''s.', 0325 db 0325 ;~ TXT_SETUPHELP_ForceLBAUsage db 'Uitschakelen van de', 0 326 ;~ db 'combinatie van LBA', 0 327 ;~ db 'en CHS. Er wordt dan', 0 328 ;~ db 'ENKEL gebruik gemaakt', 0 329 ;~ db 'van de BIOS LBA API''s.', 0 330 ;~ db 0 326 331 TXT_SETUPHELP_ExtPartMShack db 'Schakelt dynamische', 0 327 332 db 'wijziging van ext.', 0 -
trunk/BOOTCODE/TEXT/RU/MENUS.ASM
r37 r51 60 60 TXT_SETUP_RememberTimedBoot db '®¬šâì ¢ ¢â®§ £à㧪¥', 0 61 61 TXT_SETUP_IncludeFloppy db '®¡ ¢šâì €šáª®¢®€', 0 62 TXT_SETUP_ShowLVMDriveLetters db 'Show LVM Drive Letters',0 62 63 TXT_SETUP_MbrProtection db ' éšâ MBR', 0 63 64 TXT_SETUP_IgnoreMbrWrites db '-> ¥ ¬¥ïâì MBR', 0 … … 90 91 LINUX', 0 91 92 TXT_SETUP_IgnoreLVM db '£®àšà®¢ âì € ë¥ LVM', 0 92 TXT_SETUP_ForceLBAUsage db 'ᯮ«ì§®¢ âì BIOS-LBA', 093 ;~ TXT_SETUP_ForceLBAUsage db 'ᯮ«ì§®¢ âì BIOS-LBA', 0 93 94 TXT_SETUP_ExtPartMShack db ' §€¥«ë €«ï MS-ášá⥬', 0 94 95 … … 222 223 db 'ç¥à¥§ ¬¥î.', 0 223 224 db 0 225 TXT_SETUPHELP_ShowLVMDriveLetters db 'AiR-BOOT will show', 0 226 db 'LVM Drive Letters', 0 227 db 'in the menu.', 0 228 db 0 224 229 TXT_SETUPHELP_MbrProtection db ' éšé ¥â MBR ç¥à¥§', 0 225 230 db '१š€¥âë© ª®€. ㊮', 0 … … 309 314 db 'šä®à¬ æšî LVM', 0 310 315 db 0 311 TXT_SETUPHELP_ForceLBAUsage db 'ॡ〥⠚ᯮ«ì§®¢ š¥', 0312 db 'BIOS LBA API ¢¬¥áâ®', 0313 db 'ª®¬¡ššà®¢ ®£® - CHS', 0314 db 'š LBA.', 0315 db 0316 ;~ TXT_SETUPHELP_ForceLBAUsage db 'ॡ〥⠚ᯮ«ì§®¢ š¥', 0 317 ;~ db 'BIOS LBA API ¢¬¥áâ®', 0 318 ;~ db 'ª®¬¡ššà®¢ ®£® - CHS', 0 319 ;~ db 'š LBA.', 0 320 ;~ db 0 316 321 TXT_SETUPHELP_ExtPartMShack db 'ª«îç ¥â €š ¬šç¥áªãî', 0 317 322 db 'ᬥã ⚯ à áèšà¥ëå', 0 -
trunk/BOOTCODE/TEXT/SW/MENUS.ASM
r37 r51 53 53 TXT_SETUP_RememberTimedBoot db 'Kom Ihg Tids Boot', 0 54 54 TXT_SETUP_IncludeFloppy db 'Inkludera Diskettenhet', 0 55 TXT_SETUP_ShowLVMDriveLetters db 'Show LVM Drive Letters',0 55 56 TXT_SETUP_MbrProtection db 'MBR Skydd', 0 56 57 TXT_SETUP_IgnoreMbrWrites db '-> Ignorera MBR Skriv', 0 … … 83 84 TXT_SETUP_IgnoreLVM db 'Ignore LVM information', 0 84 85 ; ### 85 TXT_SETUP_ForceLBAUsage db 'Forc BIOS-LBA Anvndn.', 086 ;~ TXT_SETUP_ForceLBAUsage db 'Forc BIOS-LBA Anvndn.', 0 86 87 TXT_SETUP_ExtPartMShack db 'Ext-Part MS Workaround', 0 87 88 … … 227 228 db 'frn A: via menyn.', 0 228 229 db 0 230 TXT_SETUPHELP_ShowLVMDriveLetters db 'AiR-BOOT will show', 0 231 db 'LVM Drive Letters', 0 232 db 'in the menu.', 0 233 db 0 229 234 TXT_SETUPHELP_MbrProtection db 'Skydda din MBR via', 0 230 235 db 'resident kod. Behver', 0 … … 325 330 db 0 326 331 ; ### 327 TXT_SETUPHELP_ForceLBAUsage db 'Forc. anvndning av', 0328 db 'BIOS LBA APIs', 0329 db 'istllet fr mixad anv.', 0330 db 'av CHS och LBA.', 0331 db 0332 ;~ TXT_SETUPHELP_ForceLBAUsage db 'Forc. anvndning av', 0 333 ;~ db 'BIOS LBA APIs', 0 334 ;~ db 'istllet fr mixad anv.', 0 335 ;~ db 'av CHS och LBA.', 0 336 ;~ db 0 332 337 TXT_SETUPHELP_ExtPartMShack db 'Aktiverar dyn. ndring', 0 333 338 db 'av den utkade part.,', 0 -
trunk/BOOTCODE/VERSION.INC
r50 r51 1 ; 2 ; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz 3 ; 4 ; This file is part of AiR-BOOT 5 ; 6 ; AiR-BOOT is free software: you can redistribute it and/or modify it under 7 ; the terms of the GNU General Public License as published by the Free 8 ; Software Foundation, either version 3 of the License, or (at your option) 9 ; any later version. 10 ; 11 ; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY 12 ; WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS 13 ; FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 14 ; details. 15 ; 16 ; You should have received a copy of the GNU General Public License along with 17 ; AiR-BOOT. If not, see <http://www.gnu.org/licenses/>. 18 ; 19 20 1 21 ; 2 22 ; AiR-BOOT Version Information. … … 16 36 ; The Year, Month and Day in BCD so we can easily extract nibbles. 17 37 AB_YEAR EQU 2012h 18 AB_MONTH EQU 0 5h19 AB_DAY EQU 14h38 AB_MONTH EQU 09h 39 AB_DAY EQU 09h 20 40 21 41 ; The Hours, Minutes and Seconds, again in BCD for easy manipulation. 22 AB_HOURS EQU 22h23 AB_MINUTES EQU 21h24 AB_SECONDS EQU 0 0h42 AB_HOURS EQU 09h 43 AB_MINUTES EQU 09h 44 AB_SECONDS EQU 09h 25 45 26 46 ; The AiR-BOOT signature uses big-endian so we shuffle some bits around. -
trunk/INCLUDE/ASM.INC
r46 r51 119 119 ; Use this value to fill the gap between the new origin and the last 120 120 ; emitted code or data. 121 fillchar = '0' 121 IFDEF AUX_DEBUG 122 fillchar = '#' 123 ELSE 124 fillchar = 0 125 ENDIF 122 126 123 127 ; Mark the location of the last emitted code or data. … … 142 146 ; Masm can also do db 0 dup (0), and it does calculate correctly 143 147 ; but cannot find the after label. 144 ; Same issue as with JWasm but the db construct does not solve it for masm.148 ; Same issue as with JWasm but the db construct does not solve it for Masm. 145 149 ; The label-values show-up to be correct in the listing though. 146 150 ; Currently overlap-checking is disabled when assembling with Masm ! … … 199 203 IF image_size EQ image_size_60secs 200 204 ; Maximum number of partitions supported in pre v1.07. 201 partition_countequ 30205 max_partitions equ 30 202 206 ELSE 203 207 ; Maximum number of partitions supported in post v1.06. 204 partition_countequ 45208 max_partitions equ 45 205 209 ENDIF -
trunk/INSTALL/C/INSTALL.C
r50 r51 1056 1056 } 1057 1057 Status_Config = STATUS_INSTALLEDMGU; 1058 1059 // Abort if unknown installed config version. 1060 if ((Installed_ConfigVersion > 0x108)) { 1061 if (!Option_CID) { 1062 printf("\n"); 1063 printf("Configuration version of installed AiR-BOOT not supported by this installer !\n"); 1064 printf("\n"); 1065 } 1066 exit(1); 1067 } 1068 1069 // Abort if unknown to-install config version. 1070 if ((Bootcode_ConfigVersion > 0x108)) { 1071 if (!Option_CID) { 1072 printf("\n"); 1073 printf("Configuration version of new AiR-BOOT.BIN not supported by this installer !\n"); 1074 printf("\n"); 1075 } 1076 exit(1); 1077 } 1078 1079 1058 1080 // Those upgrades will copy useful configuration data to the image config 1059 1081 // If new configuration data was added, those spaces are not overwritten … … 1115 1137 /* 1116 1138 // Convert v1.06 hideparttable (30x30) to the v1.07 (30x45) format. 1139 // Also copy drive-letters to either v1.07 or v1.0.8 location. 1117 1140 */ 1118 1141 if ((Installed_ConfigVersion == 0x102) && (Bootcode_ConfigVersion >= 0x107)) { … … 1120 1143 char c; 1121 1144 //printf("Converting 1.06 -> 1.07 hidepart"); 1145 // Copy old hide-part table to new location. 1122 1146 memcpy(&Bootcode[0x7400], &Track0[0x7200], 900); 1147 // Setup temporary table. 1123 1148 memset(TempHidPartTable, 0xff, 45 * 34); 1149 // Copy old hide-part table to temporary table. 1124 1150 for (i=0; i<30; i++) { 1125 1151 for (j=0; j<30; j++) { … … 1128 1154 } 1129 1155 } 1156 // Copy temporary table to final v1.07 location. 1130 1157 memcpy(&Bootcode[0x7400], TempHidPartTable, 30 * 45); 1158 1159 // Clear drive-letters if version being installed is v1.07. 1160 if (Bootcode_ConfigVersion == 0x107) { 1161 memset(&Bootcode[0x7946], 0, 45); 1162 } 1163 1164 // Copy over drive-letters from v1.06 location to v1.08 location. 1165 if (Bootcode_ConfigVersion == 0x108) { 1166 memset(&Bootcode[0x6cb0], 0, 45); 1167 memcpy(&Bootcode[0x6cb0], &Track0[0x7584], 30); 1168 } 1131 1169 } 1132 1170 … … 1134 1172 // Convert v1.07 hideparttable (30x45) to a packed v1.0.8+ (45x45) format. 1135 1173 */ 1136 if ((Installed_ConfigVersion < 0x108) && (Bootcode_ConfigVersion >= 0x108)) {1174 if ((Installed_ConfigVersion < 0x108) && (Bootcode_ConfigVersion == 0x108)) { 1137 1175 int i,j; 1138 1176 char c; 1139 1177 //printf("Converting to 1.08 packed hidepart"); 1178 // Setup temporary table. 1140 1179 memset(TempHidPartTable, 0xff, 45 * 34); 1180 1181 // Copy old hide-part table to temporary table. 1141 1182 // Unpacked table is 30 rows with 45 columns per row. 1142 1183 // Packed table is 45 rows with 45 columns per row packed in 34 bytes. … … 1147 1188 } 1148 1189 } 1190 // Copy temporary table to final v1.0.8 location (packed format) 1149 1191 memcpy(&Bootcode[0x7400], TempHidPartTable, 45 * 34); 1192 // Show LVM Drive Letters. 1193 Bootcode[0x6c17] = 1; 1150 1194 } 1151 1195 -
trunk/INSTALL/C/INSTALL.H
r48 r51 1 /* INSTALL.H */ 2 1 // AiR-BOOT (c) Copyright 1998-2009 M. Kiewitz 2 // 3 // This file is part of AiR-BOOT 4 // 5 // AiR-BOOT is free software: you can redistribute it and/or modify it under 6 // the terms of the GNU General Public License as published by the Free 7 // Software Foundation, either version 3 of the License, or (at your option) 8 // any later version. 9 // 10 // AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY 11 // WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS 12 // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 13 // details. 14 // 15 // You should have received a copy of the GNU General Public License along with 16 // AiR-BOOT. If not, see <http://www.gnu.org/licenses/>. 17 // 3 18 4 19 … … 14 29 // Build date 15 30 #define BLDLVL_YEAR "2012" 16 #define BLDLVL_MONTH "0 4"17 #define BLDLVL_DAY " 23"31 #define BLDLVL_MONTH "09" 32 #define BLDLVL_DAY "09" 18 33 // Build time 19 #define BLDLVL_HOURS " 19"20 #define BLDLVL_MINUTES " 41"21 #define BLDLVL_SECONDS "0 0"34 #define BLDLVL_HOURS "09" 35 #define BLDLVL_MINUTES "09" 36 #define BLDLVL_SECONDS "09" 22 37 // Build machine 23 38 //#define BLDLVL_MACHINE "ecs-devbox" -
trunk/INSTALL/DOS/Makefile
r46 r51 63 63 #ASM=masm 64 64 #ASM=alp 65 ASM=tasm65 #ASM=tasm 66 66 #ASM=wasm 67 #ASM=jwasm67 ASM=jwasm 68 68 69 69 # -
trunk/TOOLS/INTERNAL/FIXCODE
r46 r51 15 15 # 16 16 # This script is now obsolete. 17 # Don't use since the MBR Protaction Image has moved !! 17 18 # 18 19 exit 1; -
trunk/TOOLS/INTERNAL/FIXCODE.C
r47 r51 83 83 84 84 /* File buffers */ 85 char BootCode[IMAGE_SIZE]; // Buffer for boot-image86 char MBRProtection[ 1024]; // Buffer for protection-image85 char BootCode[IMAGE_SIZE]; // Buffer for boot-image 86 char MBRProtection[MBRPROT_SIZE]; // Buffer for protection-image 87 87 88 88 … … 163 163 // AIR-BOOT.COM image. 164 164 */ 165 for (i=0; i<55; i++) { 166 if (!memcmp(MBRProtectionSignature, &BootCode[i*SECSIZE], strlen(MBRProtectionSignature))) { 165 //~ for (i=0; i<55; i++) { 166 for (i=0; i<110; i++) { 167 if (!memcmp(MBRProtectionSignature, &BootCode[i*PAGESIZE], strlen(MBRProtectionSignature))) { 167 168 found = 1; 168 169 break; … … 182 183 // Merge Protection Image. 183 184 */ 184 memcpy(&BootCode[i*SECSIZE], MBRProtection, MBRPROT_SIZE); 185 //~ memcpy(&BootCode[i*SECSIZE], MBRProtection, MBRPROT_SIZE); 186 memcpy(&BootCode[i*PAGESIZE], MBRProtection, MBRPROT_SIZE); 185 187 printf("%s", Okay); 186 188 -
trunk/TOOLS/INTERNAL/FIXCODE.H
r46 r51 22 22 23 23 #define IMAGE_SIZE 31744 24 #define MBRPROT_SIZE 1024 24 //~ #define MBRPROT_SIZE 1024 25 #define MBRPROT_SIZE 768 25 26 #define SECSIZE 512 27 #define PAGESIZE 256 26 28 27 29 #endif -
trunk/TOOLS/OS2/SETABOOT/Makefile
r46 r51 289 289 @if exist *.o $(RM) *.o 290 290 291 # ----------------------------------------------------------------------------- 292 # DISTRIBUTE TO RELEASE SPACE 293 # ----------------------------------------------------------------------------- 294 # This distributes all .BIN files to BOOTCODE. 295 # Then it installs the English version to RELEASES as AIRBOOT.BIN. 296 # ----------------------------------------------------------------------------- 297 dist: .SYMBOLIC 298 @if exist *.EXE $(CP) *.EXE ..$(DS)..$(DS)..$(DS)RELEASE$(DS)OS2 299 291 300 # 292 301 # Help on using this Makefile. -
trunk/TOOLS/OS2/SETABOOT/SETABOOT.H
r48 r51 15 15 // Build date 16 16 #define BLDLVL_YEAR "2012" 17 #define BLDLVL_MONTH "0 4"18 #define BLDLVL_DAY " 23"17 #define BLDLVL_MONTH "09" 18 #define BLDLVL_DAY "09" 19 19 // Build time 20 #define BLDLVL_HOURS " 19"21 #define BLDLVL_MINUTES " 41"22 #define BLDLVL_SECONDS "0 0"20 #define BLDLVL_HOURS "09" 21 #define BLDLVL_MINUTES "09" 22 #define BLDLVL_SECONDS "09" 23 23 // Build machine 24 24 //#define BLDLVL_MACHINE "ecs-devbox"
Note:
See TracChangeset
for help on using the changeset viewer.