Changeset 568 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS
- Timestamp:
- Dec 21, 2014, 5:37:53 PM (10 years ago)
- google:author:
- krille_n_@hotmail.com
- Location:
- trunk/XTIDE_Universal_BIOS/Src
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Device/Device.asm
r526 r568 47 47 %ifdef MODULE_SERIAL ; IDE + Serial 48 48 Device_FinalizeDPT: 49 ; needs to check IDEVARS vs. checking the DPT as the serial bit in the DPT is set in the Finalize routine 50 CMP_USING_IDEVARS_IN_CSBP_AND_JUMP_IF DEVICE_SERIAL_PORT, .FinalizeDptForSerialPortDevice 49 ; Needs to check IDEVARS vs. checking the DPT as the serial bit in the DPT is set in the Finalize routine 50 cmp BYTE [cs:bp+IDEVARS.bDevice], DEVICE_SERIAL_PORT 51 %ifdef USE_386 52 jne IdeDPT_Finalize 53 jmp SerialDPT_Finalize 54 %else 55 je SHORT .FinalizeDptForSerialPortDevice 51 56 jmp IdeDPT_Finalize 52 57 .FinalizeDptForSerialPortDevice: 53 58 jmp SerialDPT_Finalize 59 %endif 54 60 55 61 %else ; IDE … … 94 100 %ifdef MODULE_SERIAL ; IDE + Serial 95 101 Device_IdentifyToBufferInESSIwithDriveSelectByteInBH: 96 CMP_USING_IDEVARS_IN_CSBP_AND_JUMP_IF DEVICE_SERIAL_PORT, .IdentifyDriveFromSerialPort 102 cmp BYTE [cs:bp+IDEVARS.bDevice], DEVICE_SERIAL_PORT 103 %ifdef USE_386 104 jne IdeCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH 105 jmp SerialCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH 106 %else 107 je SHORT .IdentifyDriveFromSerialPort 97 108 jmp IdeCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH 98 109 .IdentifyDriveFromSerialPort: 99 110 jmp SerialCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH 111 %endif 100 112 101 113 %else ; IDE … … 122 134 ALIGN JUMP_ALIGN 123 135 Device_OutputCommandWithParameters: 124 TEST_USING_DPT_AND_JUMP_IF_SERIAL_DEVICE .OutputCommandToSerialPort 136 test BYTE [di+DPT.bFlagsHigh], FLGH_DPT_SERIAL_DEVICE 137 %ifdef USE_386 138 jz IdeCommand_OutputWithParameters 139 jmp SerialCommand_OutputWithParameters 140 %else 141 jnz SHORT .OutputCommandToSerialPort 125 142 jmp IdeCommand_OutputWithParameters 126 143 … … 128 145 .OutputCommandToSerialPort: 129 146 jmp SerialCommand_OutputWithParameters 147 %endif 130 148 131 149 %else ; IDE … … 147 165 %ifdef MODULE_SERIAL ; IDE + Serial 148 166 Device_SelectDrive: 149 TEST_USING_DPT_AND_JUMP_IF_SERIAL_DEVICE ReturnSuccessForSerialPort 167 test BYTE [di+DPT.bFlagsHigh], FLGH_DPT_SERIAL_DEVICE 168 %ifndef USE_386 169 jnz SHORT ReturnSuccessForSerialPort 150 170 jmp IdeCommand_SelectDrive 171 %else 172 jz IdeCommand_SelectDrive 173 ; Fall to ReturnSuccessForSerialPort 174 %endif 151 175 152 176 %else ; IDE -
trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm
r567 r568 189 189 mov cl, [bp+PIOVARS.bSectorsLeft] ; CH is already zero 190 190 push cx 191 %ifdef USE_186192 push CheckErrorsAfterTransferringLastBlock193 jmp [bp+PIOVARS.fnXfer] ; Transfer possibly partial block194 %else195 191 call [bp+PIOVARS.fnXfer] ; Transfer possibly partial block 196 192 jmp SHORT CheckErrorsAfterTransferringLastBlock 197 %endif198 193 199 194 … … 241 236 242 237 ; Convert ES:SI to physical address 243 %ifdef USE_186 238 %ifdef USE_386 239 240 mov dx, es 241 xor ax, ax 242 shld ax, dx, 4 243 shl dx, 4 244 add si, dx 245 adc al, ah 246 mov es, ax 247 248 %elifdef USE_186 244 249 ; Bytes EU Cycles(286) 245 250 mov ax, es ; 2 2 -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm
r567 r568 322 322 323 323 ;-------------------------------------------------------------------- 324 ; Int13h_SetErrorCodeToBdaAndToIntpackInSSBPfromAH_ALHasDriveNumber 324 325 ; Int13h_SetErrorCodeToBdaAndToIntpackInSSBPfromAH 325 326 ; Int13h_SetErrorCodeToIntpackInSSBPfromAH … … 330 331 ; SS:BP: Ptr to IDEPACK with error condition set 331 332 ; Corrupts registers: 332 ; DS, DI333 ; DS, BX, DI 333 334 ;-------------------------------------------------------------------- 334 335 ALIGN JUMP_ALIGN -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH4h_HVerify.asm
r526 r568 38 38 ; Returns with INTPACK in SS:BP: 39 39 ; AH: Int 13h/40h floppy return status 40 ; AL: Number of sectors actually verified (only valid if CF set for some BIOSes)40 ; AL: Number of sectors actually verified (only valid if CF set for some BIOSes) 41 41 ; CF: 0 if successful, 1 if error 42 42 ;-------------------------------------------------------------------- -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH43h_ExtendedWriteSectors.asm
r526 r568 48 48 mov ah, [cs:bx+g_rgbWriteCommandLookup] 49 49 mov bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRQ, FLG_STATUS_DRQ) 50 %ifdef USE_18651 push AH42h_ReturnFromInt13hAfterStoringErrorCodeFromAHandTransferredSectorsFromCX52 jmp Idepack_ConvertDapToIdepackAndIssueCommandFromAH53 %else54 50 call Idepack_ConvertDapToIdepackAndIssueCommandFromAH 55 51 jmp SHORT AH42h_ReturnFromInt13hAfterStoringErrorCodeFromAHandTransferredSectorsFromCX 56 %endif -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH44h_ExtendedVerifySectors.asm
r526 r568 43 43 mov ah, [cs:bx+g_rgbVerifyCommandLookup] 44 44 mov bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRQ, FLG_STATUS_DRDY) 45 %ifdef USE_18646 push AH42h_ReturnFromInt13hAfterStoringErrorCodeFromAHandTransferredSectorsFromCX47 jmp Idepack_ConvertDapToIdepackAndIssueCommandFromAH48 %else49 45 call Idepack_ConvertDapToIdepackAndIssueCommandFromAH 50 46 jmp SHORT AH42h_ReturnFromInt13hAfterStoringErrorCodeFromAHandTransferredSectorsFromCX 51 %endif -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH48h_GetExtendedDriveParameters.asm
r550 r568 147 147 ; from previously scanned drive. 148 148 .DoNotSetChsFlag: 149 eMOVZX dx, BYTE[es:si+DPT.bPchsHeads]149 eMOVZX dx, [es:si+DPT.bPchsHeads] 150 150 mov [di+EDRIVE_INFO.dwHeads], dx 151 151 mov [di+EDRIVE_INFO.dwHeads+2], cx … … 159 159 mov [di+EDRIVE_INFO.dwCylinders+2], cx 160 160 161 .ReturnWithSuccess: 162 xor ax, ax 163 .ReturnWithError: 161 xor ax, ax ; Success 164 162 jmp Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/Address.asm
r542 r568 37 37 ALIGN JUMP_ALIGN 38 38 Address_ExtractLCHSparametersFromOldInt13hAddress: 39 mov bl, cl ; Copy sector number...40 and bl, 3Fh ; ...and limit to 1...6339 mov bl, 3Fh ; Load sector number mask 40 and bl, cl ; Sector number now in BL 41 41 sub cl, bl ; Remove from cylinder number high 42 42 eROL_IM cl, 2 ; High bits to beginning … … 75 75 ; (LCylinder << n) + (LHead / PHeadCount) 76 76 mov dx, cx ; Copy L-CHS Cylinder number to DX 77 mov cl, [di+DPT.bFlagsLow] ; Load shift count78 and cl, MASKL_DPT_CHS_SHIFT_COUNT77 mov cl, MASKL_DPT_CHS_SHIFT_COUNT ; Load shift count mask 78 and cl, [di+DPT.bFlagsLow] ; Shift count now in CL 79 79 shl dx, cl ; DX = LCylinder << n 80 80 add ax, dx ; AX = P-CHS Cylinder number … … 83 83 ret 84 84 85 ; *FIXME* The above function description doesn't match the code. 86 ; If CX has a maximum value of 1023 on entry then there is no way CX can be 16382 on return. 87 ; 1023 SHL 3 (MASKL_DPT_CHS_SHIFT_COUNT) is 8184. With the addition of AX (at most 255?) 88 ; the result is 8439. 85 89 86 90 ;-------------------------------------------------------------------- … … 102 106 ALIGN JUMP_ALIGN 103 107 Address_OldInt13hAddressToIdeAddress: 104 call Address_ExtractLCHSparametersFromOldInt13hAddress 105 ACCESSDPT__GET_UNSHIFTED_TRANSLATE_MODE_TO_AXZF 108 call Address_ExtractLCHSparametersFromOldInt13hAddress 109 mov al, [di+DPT.bFlagsLow] 110 and al, MASKL_DPT_TRANSLATEMODE 106 111 107 112 ;;; 0: ADDRESSING_MODE_NORMAL 108 113 jz SHORT DoNotConvertLCHS 109 114 110 115 ;;; 1: ADDRESSING_MODE_LARGE 111 112 116 test al, FLGL_DPT_ASSISTED_LBA 117 jz SHORT ConvertLargeModeLCHStoPCHS 113 118 114 119 ;;; 2: ADDRESSING_MODE_ASSISTED_LBA 115 ; Fall throughto ConvertAssistedLBAModeLCHStoLBARegisterValues120 ; Fall to ConvertAssistedLBAModeLCHStoLBARegisterValues 116 121 117 122 -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/Prepare.asm
r567 r568 46 46 ; Make sure that sector count is valid 47 47 %ifdef USE_UNDOC_INTEL 48 eSALC; Clear AL using CF (CF is cleared since JB above fell through)48 salc ; Clear AL using CF (CF is cleared since JB above fell through) 49 49 or al, [es:si+DAP.wSectorCount] 50 50 %else -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h/BootSector.asm
r528 r568 42 42 ; display error code every time user intends to boot from hard disk 43 43 ; when A then C boot order is used. 44 test dl, dl 44 45 js SHORT .PrintFailedToLoadErrorCode ; Hard Drive 45 46 cmp ah, RET_HD_TIMEOUT … … 48 49 je SHORT .ReturnWithCFclearSinceFailedToLoadBootSector 49 50 .PrintFailedToLoadErrorCode: 50 %ifdef USE_18651 push .ReturnWithCFclearSinceFailedToLoadBootSector52 jmp DetectPrint_FailedToLoadFirstSector53 %else54 51 call DetectPrint_FailedToLoadFirstSector 55 jmp .ReturnWithCFclearSinceFailedToLoadBootSector 56 %endif 52 jmp SHORT .ReturnWithCFclearSinceFailedToLoadBootSector 57 53 58 54 … … 63 59 jne SHORT .FirstHardDiskSectorNotBootable 64 60 .AlwaysBootFromFloppyDriveForBooterGames: 65 stc ; Boot Sector loaded succes fully61 stc ; Boot Sector loaded successfully 66 62 jmp SHORT Int19_JumpToBootSectorOrRomBoot 67 63 -
trunk/XTIDE_Universal_BIOS/Src/Initialization/AdvancedAta/AdvAtaInit.asm
r567 r568 136 136 mov cx, [di+DPT_ADVANCED_ATA.wMinPioCycleTime] 137 137 test si, si 138 jz SHORT .PioTimingsLoadedTo AXandCX138 jz SHORT .PioTimingsLoadedToBXandCX 139 139 MIN_U bl, [si+DPT_ADVANCED_ATA.bPioMode] 140 140 MAX_U cx, [si+DPT_ADVANCED_ATA.wMinPioCycleTime] 141 .PioTimingsLoadedTo AXandCX:141 .PioTimingsLoadedToBXandCX: 142 142 ret -
trunk/XTIDE_Universal_BIOS/Src/Initialization/AtaID.asm
r567 r568 107 107 call AccessDPT_GetPointerToDRVPARAMStoCSBX 108 108 push ds 109 110 push cs 111 pop ds 112 113 ; Load User Defined CHS or LBA to CX:AX 114 mov dx, [bx+DRVPARAMS.wFlags] 115 mov ax, [bx+DRVPARAMS.wCylinders] ; Or .dwMaximumLBA 116 mov cx, [bx+DRVPARAMS.wHeadsAndSectors] ; Or .dwMaximumLBA+2 117 109 118 push es 110 119 pop ds ; DS:SI now points to ATA information 111 112 ; Load User Defined CHS or LBA to CX:AX113 mov dx, [cs:bx+DRVPARAMS.wFlags]114 mov ax, [cs:bx+DRVPARAMS.wCylinders] ; Or .dwMaximumLBA115 mov cx, [cs:bx+DRVPARAMS.wHeadsAndSectors] ; Or .dwMaximumLBA+2116 120 117 121 ; * User defined CHS * -
trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm
r567 r568 72 72 %endif 73 73 74 mov al, [cs:ROMVARS.wFlags] ; Configurator set to always scan?75 or al, [es:BDA.bKBFlgs1] ; Or, did the user hold down the ALT key?76 and al, 8 ; 8 = alt key depressed, same as FLG_ROMVARS_SERIAL_ALWAYSDETECT74 mov al, [cs:ROMVARS.wFlags] ; Configurator set to always scan? 75 or al, [es:BDA.bKBFlgs1] ; Or, did the user hold down the ALT key? 76 and al, 8 ; 8 = alt key depressed, same as FLG_ROMVARS_SERIAL_ALWAYSDETECT 77 77 jnz .DriveDetectLoop 78 78 %endif … … 89 89 ; 90 90 mov cx, [RAMVARS.wDrvCntAndFlopCnt] ; Our count of hard disks 91 92 91 mov al, [es:BDA.bHDCount] 93 add cl, al ; Add our drives to the system count 94 mov [es:BDA.bHDCount], cl 92 add [es:BDA.bHDCount], cl ; Add our drives to the system count 95 93 or al, 80h ; Or in hard disk flag 96 94 mov [RAMVARS.bFirstDrv], al ; Store first drive number … … 118 116 inc ax ; low order bit, indicating floppy drive exists 119 117 120 mov ah, [es:BDA.wEquipment] ; Load Equipment WORD low byte121 and ah, 03eh ; Mask off drive number and drives present bit118 mov ah, 3Eh ; AND mask to AH (all bits set except floppy drive count/present) 119 and ah, [es:BDA.wEquipment] ; Load Equipment WORD low byte and mask off drive number and drives present bit 122 120 or al, ah ; Or in new values 123 121 mov [es:BDA.wEquipment], al ; and store 124 122 125 mov al, 1 eh ; BDA pointer to Floppy DPT123 mov al, 1Eh ; BDA pointer to Floppy DPT 126 124 mov si, AH8h_FloppyDPT 127 125 call Interrupts_InstallHandlerToVectorInALFromCSSI -
trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm
r567 r568 181 181 push ax 182 182 push di ; BIOS segment 183 add al, ROMVARS.szVersion - ROMVARS.szTitle183 mov al, ROMVARS.szVersion & 0FFh 184 184 push ax 185 185 %else -
trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenuPrintCfg.asm
r550 r568 56 56 ;-------------------------------------------------------------------- 57 57 .PushAddressingMode: 58 ACCESSDPT__GET_UNSHIFTED_TRANSLATE_MODE_TO_AXZF 58 mov al, [di+DPT.bFlagsLow] 59 and ax, BYTE MASKL_DPT_TRANSLATEMODE 59 60 ;; 60 61 ;; This multiply both shifts the addressing mode bits down to low order bits, and … … 107 108 eCMOVZ ah, [di+DPT_ATA.bDevice] ; DPT_ATA contains up to date device information for IDE drives 108 109 %ifdef USE_UNDOC_INTEL 109 eSALC; Clear AL using CF (from TEST above)110 salc ; Clear AL using CF (from TEST above) 110 111 eAAD g_szDeviceTypeValues_Displacement 111 112 %else -
trunk/XTIDE_Universal_BIOS/Src/Menus/HotkeyBar.asm
r567 r568 69 69 .PrintFloppyDriveHotkeys: 70 70 call FloppyDrive_GetCountToAX 71 test ax, ax ; Any Floppy Drives?72 j z SHORT.SkipFloppyDriveHotkeys71 xchg cx, ax ; Any Floppy Drives? 72 jcxz .SkipFloppyDriveHotkeys 73 73 74 74 mov ax, (ANGLE_QUOTE_RIGHT << 8) | DEFAULT_FLOPPY_DRIVE_LETTER -
trunk/XTIDE_Universal_BIOS/Src/StringsCompressed.asm
r536 r568 491 491 492 492 StringsCompressed_TranslatesAndFormats: 493 db 32; 0494 db 172; 1495 db 171; 2496 db 179; 3497 db 175; 4498 db 33; 5499 db 34; 6500 db 44; 7501 db 45; 8502 db 46; 9503 db 47; 10504 db 49; 11505 db 50; 12506 db 51; 13507 db 53; 14508 db 54; 15509 db 56; 16510 db 200; 17511 db 181; 18512 db 48; 19513 db (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_2_I); 20514 db (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_u); 21515 db (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_5_u); 22516 db (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_x); 23517 db (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_5_x); 24518 db (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_nl); 25519 db (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_2_u); 26520 db (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_A); 27521 db (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_c); 28522 db (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_s); 29523 db (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_z); 30493 db 32 ; 0 494 db 172 ; 1 495 db 171 ; 2 496 db 179 ; 3 497 db 175 ; 4 498 db 33 ; 5 499 db 34 ; 6 500 db 44 ; 7 501 db 45 ; 8 502 db 46 ; 9 503 db 47 ; 10 504 db 49 ; 11 505 db 50 ; 12 506 db 51 ; 13 507 db 53 ; 14 508 db 54 ; 15 509 db 56 ; 16 510 db 200 ; 17 511 db 181 ; 18 512 db 48 ; 19 513 db (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_2_I) ; 20 514 db (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_u) ; 21 515 db (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_5_u) ; 22 516 db (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_x) ; 23 517 db (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_5_x) ; 24 518 db (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_nl) ; 25 519 db (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_2_u) ; 26 520 db (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_A) ; 27 521 db (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_c) ; 28 522 db (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_s) ; 29 523 db (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_z) ; 30 524 524 525 525 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS … … 560 560 561 561 ;; translated usage stats 562 ;; 33:1 563 ;; 32:35 564 ;; 181:1 565 ;; 53:2 566 ;; 48:2 567 ;; 200:1 568 ;; 46:3 569 ;; 179:8 562 ;; 54:1 563 ;; 47:2 564 ;; 175:1 565 ;; 49:1 570 566 ;; 44:1 571 567 ;; 50:2 568 ;; 200:1 569 ;; 181:1 570 ;; 172:2 571 ;; 45:2 572 ;; 56:8 573 ;; 33:1 574 ;; 53:2 575 ;; 179:8 576 ;; 171:2 572 577 ;; 51:3 573 ;; 47:2574 ;; 172:2575 578 ;; 34:3 576 ;; 49:1 577 ;; 56:8 578 ;; 45:2 579 ;; 175:1 580 ;; 171:2 581 ;; 54:1 579 ;; 48:2 580 ;; 46:3 581 ;; 32:35 582 582 ;; total translated: 20 583 583 584 584 ;; format usage stats 585 ;; nl:12 586 ;; x:5 585 587 ;; A:4 588 ;; 5-x:1 586 589 ;; 2-u:1 590 ;; z:2 587 591 ;; 5-u:2 588 ;; x:5589 592 ;; s:14 590 ;; 5-x:1591 ;; nl:12592 593 ;; 2-I:1 593 594 ;; u:6 594 595 ;; c:13 595 ;; z:2596 596 ;; total format: 11 597 597 -
trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AccessDPT.asm
r567 r568 58 58 59 59 %ifdef USE_UNDOC_INTEL 60 eSALC; Clears AL using CF while preserving flags60 salc ; Clears AL using CF while preserving flags 61 61 %endif 62 62 … … 163 163 ;-------------------------------------------------------------------- 164 164 AccessDPT_GetIdevarsToCSBX: 165 eMOVZX bx, BYTE[di+DPT.bIdevarsOffset]165 eMOVZX bx, [di+DPT.bIdevarsOffset] 166 166 ret 167 167 168 169 ;--------------------------------------------------------------------170 ; ACCESSDPT__GET_UNSHIFTED_TRANSLATE_MODE_TO_AXZF171 ; Parameters:172 ; DS:DI: Ptr to Disk Parameter Table173 ; Returns:174 ; AX: Translate Mode (TRANSLATEMODE_NORMAL, TRANSLATEMODE_LARGE or TRANSLATEMODE_ASSISTED_LBA)175 ; unshifted (still shifted where it is in bFlagsLow)176 ; ZF: Set based on value in AL177 ; Corrupts registers:178 ; Nothing179 ;--------------------------------------------------------------------180 ;181 ; Converted to a macro since only called in two places, and the call/ret overhead182 ; is not worth it for these two instructions (4 bytes total)183 ;184 %macro ACCESSDPT__GET_UNSHIFTED_TRANSLATE_MODE_TO_AXZF 0185 mov al, [di+DPT.bFlagsLow]186 and ax, BYTE MASKL_DPT_TRANSLATEMODE187 %endmacro -
trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AtaGeometry.asm
r567 r568 142 142 ; GetSectorCountToDXAXfromCHSinAXBLBH 143 143 ; Parameters: 144 ; ES:SI: Ptr to 512-byte ATA information read from the drive145 144 ; AX: Number of cylinders (1...16383) 146 145 ; BL: Number of heads (1...255) … … 328 327 cmp ax, cx 329 328 jbe SHORT .NumberOfHeadsNowInCX 330 eSHL_IM c l, 1 ; Double number of heads331 j nzSHORT .CompareNextValidNumberOfHeads ; Reached 256 heads?332 dec c l; If so, limit heads to 255329 eSHL_IM cx, 1 ; Double number of heads 330 jpo SHORT .CompareNextValidNumberOfHeads ; Reached 256 heads? 331 dec cx ; If so, limit heads to 255 333 332 .NumberOfHeadsNowInCX: 334 333 mov bx, cx ; Number of heads are returned in BL -
trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/CompatibleDPT.asm
r558 r568 114 114 ;-------------------------------------------------------------------- 115 115 FillTranslatedDPTtoESDIfromDPTinDSSI: 116 xor dx, dx; Clear for checksum116 cwd ; Clear for checksum 117 117 call StoswThenAddALandAHtoDL ; Bytes 0 and 1 (Logical number of cylinders) 118 118 119 mov al, BYTE[si+DPT.bLchsHeads]119 mov al, [si+DPT.bLchsHeads] 120 120 mov ah, TRANSLATED_DPT_SIGNATURE 121 121 call StoswThenAddALandAHtoDL ; Bytes 2 (Logical number of heads) and 3 (Axh signature to indicate Translated DPT) 122 122 123 eMOVZX ax, BYTE[si+DPT.bPchsSectorsPerTrack]123 eMOVZX ax, [si+DPT.bPchsSectorsPerTrack] 124 124 call StoswThenAddALandAHtoDL ; Bytes 4 (Physical sectors per track) and 5 (Write Precompensation Cylinder low) 125 125 126 mov al, ah 127 call StoswThenAddALandAHtoDL; Bytes 6 (Write Precompensation Cylinder high) and 7128 129 xchg ax, cx ; Device Control byte to AL126 mov al, ah ; Zero AX 127 stosw ; Bytes 6 (Write Precompensation Cylinder high) and 7 128 129 xchg cx, ax ; Device Control byte to AL, zero to CX 130 130 mov ah, [si+DPT.wPchsCylinders] 131 131 call StoswThenAddALandAHtoDL ; Bytes 8 (Drive Control Byte) and 9 (Physical number of cylinders low) … … 135 135 call StoswThenAddALandAHtoDL ; Bytes 10 (Physical number of cylinders high) and 11 (Physical number of heads) 136 136 137 x or ax, ax138 call StoswThenAddALandAHtoDL; Bytes 12 and 13 (Landing Zone Cylinder)137 xchg cx, ax ; Zero to AX 138 stosw ; Bytes 12 and 13 (Landing Zone Cylinder) 139 139 140 140 mov al, [si+DPT.bLchsSectorsPerTrack] … … 158 158 ; DI: Incremented by 2 159 159 ; Corrupts registers: 160 ; Nothing160 ; AH 161 161 ;-------------------------------------------------------------------- 162 162 StoswALandChecksumFromDL: … … 182 182 FillStandardDPTtoESDIfromDPTinDSSI: 183 183 stosw ; Bytes 0 and 1 (Physical number of cylinders) 184 eMOVZX ax, BYTE[si+DPT.bLchsHeads]184 eMOVZX ax, [si+DPT.bLchsHeads] 185 185 stosw ; Bytes 2 (Physical number of heads) and 3 186 %ifdef USE_UNDOC_INTEL 187 %ifdef USE_386 188 xor al, al ; Zero AX and clear CF 189 %else 190 salc ; Zero AX (CF cleared by eMOVZX above) 191 %endif 192 %else 186 193 mov al, ah ; Zero AX 194 %endif 187 195 stosw ; Bytes 4 and 5 (Write Precompensation Cylinder low) 188 196 stosw ; Bytes 6 (Write Precompensation Cylinder high) and 7 189 197 mov al, cl ; Device control byte to AL 190 198 stosw ; Bytes 8 (Drive Control Byte) and 9 199 %ifdef USE_UNDOC_INTEL 200 salc ; Zero AX (CF cleared above) 201 %else 191 202 mov al, ah ; Zero AX 203 %endif 192 204 stosw ; Bytes 10 and 11 193 205 stosw ; Bytes 12 and 13 (Landing Zone Cylinder) … … 208 220 ; ES:BX: Ptr to Device Parameter Table Extension (DPTE) 209 221 ; Corrupts registers: 210 ; AX, CX, D X, DI222 ; AX, CX, DL, DI 211 223 ;-------------------------------------------------------------------- 212 224 CompatibleDPT_CreateDeviceParameterTableExtensionToESBXfromDPTinDSSI: 213 call GetTemporaryBufferForDPTEtoESDI ; valid until next AH=48h call225 call GetTemporaryBufferForDPTEtoESDI ; Valid until next AH=48h call 214 226 215 227 ; Set 32-bit flag for 32-bit controllers … … 218 230 eCMOVE cl, FLG_LBA_TRANSLATION_ENABLED | FLG_32BIT_XFER_MODE 219 231 232 xor dl, dl ; Clear DL for checksum 233 220 234 ; DPTE.wBasePort 221 235 mov ax, [si+DPT.wBasePort] … … 223 237 224 238 ; DPTE.wControlBlockPort 225 eMOVZX bx, BYTE[si+DPT.bIdevarsOffset]239 eMOVZX bx, [si+DPT.bIdevarsOffset] 226 240 mov ax, [cs:bx+IDEVARS.wControlBlockPort] 227 241 call StoswThenAddALandAHtoDL ; Bytes 2 and 3 … … 244 258 ; DPTE.bDmaChannelAndType and DPTE.bPioMode 245 259 xor ax, ax 246 %ifdef MODULE_ADVANCED_ATA 260 %ifndef MODULE_ADVANCED_ATA 261 stosw ; Bytes 8 and 9 262 %else 247 263 or ah, [si+DPT_ADVANCED_ATA.bPioMode] 248 264 jz SHORT .DoNotSetFastPioFlag 249 cmp WORD [si+DPT_ADVANCED_ATA.wControllerID], BYTE 0 250 je SHORT .DoNotSetFastPioFlag 251 inc cx ; FLG_FAST_PIO_ENABLED 265 cmp WORD [si+DPT_ADVANCED_ATA.wControllerID], BYTE 1 266 sbb cl, -1 ; FLG_FAST_PIO_ENABLED (if .wControllerID > 0) 252 267 .DoNotSetFastPioFlag: 253 %endif254 268 call StoswThenAddALandAHtoDL ; Bytes 8 and 9 269 %endif 255 270 256 271 ; Set CHS translation flags and store DPTE.wFlags … … 261 276 test al, FLGL_DPT_ASSISTED_LBA 262 277 jz SHORT .NoChsTranslationOrBitShiftTranslationSet 263 or c x, LBA_ASSISTED_TRANSLATION << TRANSLATION_TYPE_FIELD_POSITION278 or ch, LBA_ASSISTED_TRANSLATION << (TRANSLATION_TYPE_FIELD_POSITION - 8) 264 279 .NoChsTranslationOrBitShiftTranslationSet: 265 280 xchg ax, cx … … 268 283 ; DPTE.wReserved (must be zero) 269 284 xor ax, ax 270 call StoswThenAddALandAHtoDL; Bytes 12 and 13285 stosw ; Bytes 12 and 13 271 286 272 287 ; DPTE.bRevision and DPTE.bChecksum 273 288 mov al, DPTE_REVISION 274 call StoswALandChecksumFromDL ; Bytes 14 and 15 275 lea bx, [di-DPTE_size] 276 ret 289 lea bx, [di+2-DPTE_size] ; The +2 compensates for the last WORD yet to be stored 290 jmp StoswALandChecksumFromDL ; Bytes 14 and 15 277 291 %endif ; MODULE_EBIOS 278 292 -
trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/CreateDPT.asm
r567 r568 116 116 jnz SHORT .NothingToChange 117 117 118 .LimitHeadsForLargeAddressingMode:119 118 ; We cannot have 16 P-Heads heads in Revised ECHS mode (8193 or more cylinders) 120 119 ; but 16 heads are allowed when there are 8192 or less cylinders (ECHS). 121 120 ; Both of these are LARGE modes so do not confuse with NORMAL mode. 122 121 call AtaGeometry_IsDriveSmallEnoughForECHS 123 jc SHORT .NothingToChange 124 dec bx ; Adjust 16 P-Heads to 15 122 adc bx, -1 ; Adjust 16 P-Heads to 15 if needed 125 123 126 124 .NothingToChange:
Note:
See TracChangeset
for help on using the changeset viewer.