Changeset 147
- Timestamp:
- Apr 8, 2017, 12:27:51 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bootcode/regular/driveio.asm
r146 r147 419 419 420 420 421 ; Keeps DS:SI for caller, sets carry if valid LVM sector encountered 422 DriveIO_LoadLVMSector Proc Near Uses ax bx cx dx 423 424 IFDEF AUX_DEBUG 425 IF 0 421 ;############################################################################## 422 ;# The location of LVM sectors depends on the OS/2 geometry used when the disk 423 ;# was prepared. This geometry is present in the Master LVM sector, which has 424 ;# already been located if it exists. All partitions, whether primary or 425 ;# logical, have an entry in a partition table. For primary partitions this 426 ;# table is located in the MBR, while for logical partitions this table is 427 ;# located in the EBR for that logical partition. An LVM record is located 428 ;# LVM_SPT-1 sectors above an MBR or EBR. The Master LVM record contains the 429 ;# information for all primary partitions. For logical partitions, the LVM 430 ;# sector only has one entry, because EBRs are chained. The global LVM info, 431 ;# like disk-name, sectors per track, etc. is replicated between the Master 432 ;# LVM sector and LVM sectors corresponding to logical partitions. This info 433 ;# is kept in sync by the OS/2 LVM Engine. 434 ;############################################################################## 435 ;# ACTION : Attempts to load the corresponding LVM sector for a partition 436 ;# ---------------------------------------------------------------------------- 437 ;# EFFECTS : Modifies DAP structure and fills or clears sector buffer 438 ;# ---------------------------------------------------------------------------- 439 ;# IN : None - Location info is in [CurPartition_Location] 440 ;# ---------------------------------------------------------------------------- 441 ;# OUT : CF=1 - failure, no valid LVM sector was loaded 442 ;# : SI - Points to the sector buffer ([LVMSector]) 443 ;############################################################################## 444 DriveIO_LoadLVMSector Proc Near Uses ax bx cx dx di 445 446 IFDEF AUX_DEBUG 447 IF 1 426 448 DBG_TEXT_OUT_AUX 'DriveIO_LoadLVMSector:' 449 PUSHRF 450 call DEBUG_DumpRegisters 451 ;~ call AuxIO_DumpSector 452 ;~ call AuxIO_DumpParagraph 453 ;~ call AuxIO_TeletypeNL 454 POPRF 455 ENDIF 456 ENDIF 457 458 ; Clear the sector buffer 459 mov si, offset [LVMSector] 460 call ClearSectorBuffer 461 462 ; Quit with CY if LVM is ignored in SETUP 463 test byte ptr [CFG_IgnoreLVM], 1 ; ZF=0 means ignore LVM 464 jnz DIOLLVMS_NoLVMSector ; Quit if so 465 466 ; Calculate the entry in the DISKINFO array for this disk 467 call DriveIO_CalcDiskInfoPointer 468 469 ; If the LVM_SPT is ZERO, no LVM info is present and we quit with CY 470 mov di, [bx+LocDISKINFO_LVM_Secs] ; Get LVM_SPT 471 test di, di ; See if it is 0 472 jz DIOLLVMS_NoLVMSector ; Quit if so 473 474 ; Load the location of the current partition being acted upon. 475 ; Note that this is not the actual LBA of the partition, but the 476 ; sector that has the partition table that contains the entry 477 ; for the partition. In other words, for primary partitions the LBA 478 ; address points to the MBR while for extended partitions it points 479 ; to an EBR. In both cases the LVM sector is located LVM_SPT-1 above. 480 ; Also note that the BIOS CHS values (DH and CX) below are not used, 481 ; because we explicitly use LBA sector loading. 482 mov ax, wptr cs:[CurPartition_Location+0] ; LBA lo of MBR/EBR 483 mov bx, wptr cs:[CurPartition_Location+2] ; LBA hi of MBR/EBR 484 mov dx, wptr cs:[CurPartition_Location+4] ; BIOS disk num & head 485 mov cx, wptr cs:[CurPartition_Location+6] ; BIOS cyl & sec 486 487 ; Adjust the location to point to the LVM sector 488 add ax, di ; Add the LVM sectors-per-track 489 adc bx, 0 ; Propagate LBA lo overflow to LBA hi 490 sub ax, 1 ; LVM sector is located one sector below 491 sbb bx, 0 ; Propagate borrow to LBA hi 492 493 ; Load the LVM sector into [LVMSector] 494 mov si, offset [LVMSector] ; Points to sector buffer 495 mov di, ds ; Segment of that buffer 496 call DriveIO_ReadSectorLBA ; Read the LVM sector 497 jc DIOLLVMS_NoLVMSector ; Quit on error 498 499 ; Check the validity of the LVM sector, quit with CY if invalid 500 call LVM_ValidateSector ; Check signature and CRC 501 jnc DIOLLVMS_NoLVMSector ; Quit if not valid 502 503 504 IFDEF AUX_DEBUG 505 IF 1 506 DBG_TEXT_OUT_AUX 'CurPartition' 427 507 PUSHRF 428 508 call DEBUG_DumpRegisters … … 434 514 ENDIF 435 515 436 test byte ptr [CFG_IgnoreLVM], 1 ; We are supposed to ignore LVM, so 437 jnz DIOLLVMS_NoLVMSector ; don't load but declare as bad! 438 mov ax, wptr cs:[CurPartition_Location+0] 439 mov bx, wptr cs:[CurPartition_Location+2] 440 mov dx, wptr cs:[CurPartition_Location+4] 441 mov cx, wptr cs:[CurPartition_Location+6] ; Gets cur. partition location 442 443 call DriveIO_LVMAdjustToInfoSector 444 516 ; We're done, indicate success and return 517 clc 518 jmp DIOLLVMS_Done 519 520 DIOLLVMS_NoLVMSector: 521 522 ; Clear the sector buffer 445 523 mov si, offset [LVMSector] 446 call DriveIO_LoadSector 447 448 IFDEF AUX_DEBUG 449 IF 0 450 DBG_TEXT_OUT_AUX 'lvm record ex' 451 PUSHRF 452 ;~ call AuxIO_TeletypeHexWord 453 ;~ call AuxIO_TeletypeNL 454 call DEBUG_DumpRegisters 455 ;~ call AuxIO_DumpSector 456 mov cx, 7 457 @@: 458 call AuxIO_DumpParagraph 459 call AuxIO_TeletypeNL 460 add si, 16 461 loop @B 462 POPRF 463 ENDIF 464 ENDIF 465 466 467 call LVM_CheckSectorSignature 468 jnc DIOLLVMS_NoLVMSector 469 call LVM_CheckSectorCRC 470 jnc DIOLLVMS_NoLVMSector 471 ret 472 473 ; This here is called, if an invalid (or no) LVM information sector is found 474 ; It will truncate the first byte of the sector, so all other routines 475 ; will notice it easily by just comparing the first byte. 476 DIOLLVMS_NoLVMSector: 524 call ClearSectorBuffer 477 525 mov bptr [si+LocLVM_SignatureStart], 0 526 527 ; Indicate no valid LVM sector was loaded 528 stc 529 530 DIOLLVMS_Done: 531 478 532 ret 479 533 DriveIO_LoadLVMSector EndP -
trunk/include/version.h
r130 r147 32 32 #define BLDLVL_YEAR "2017" 33 33 #define BLDLVL_MONTH "04" 34 #define BLDLVL_DAY "0 4"34 #define BLDLVL_DAY "05" 35 35 // Build time 36 36 //~ #define BLDLVL_HOURS "01" -
trunk/include/version.inc
r130 r147 70 70 AB_YEAR EQU 2017h 71 71 AB_MONTH EQU 04h 72 AB_DAY EQU 0 4h72 AB_DAY EQU 05h 73 73 74 74 ; The Hours, Minutes and Seconds, again in BCD for easy manipulation.
Note:
See TracChangeset
for help on using the changeset viewer.