Changeset 150 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH24h_HSetBlocks.asm
- Timestamp:
- Apr 29, 2011, 7:04:13 PM (14 years ago)
- google:author:
- aitotat
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH24h_HSetBlocks.asm
r148 r150 13 13 ; DL: Translated Drive number 14 14 ; DS:DI: Ptr to DPT (in RAMVARS segment) 15 ; SS:BP: Ptr to I NTPACK16 ; Parameters on INTPACK in SS:BP:15 ; SS:BP: Ptr to IDEPACK 16 ; Parameters on INTPACK: 17 17 ; AL: Number of Sectors per Block (1, 2, 4, 8, 16, 32, 64 or 128) 18 ; Returns with INTPACK in SS:BP:18 ; Returns with INTPACK: 19 19 ; AH: Int 13h return status 20 20 ; CF: 0 if succesfull, 1 if error … … 22 22 ALIGN JUMP_ALIGN 23 23 AH24h_HandlerForSetMultipleBlocks: 24 test WORD [di+DPT.wFlags], FLG_DPT_BLOCK_MODE_SUPPORTED 25 jnz SHORT .TryToSetBlockMode 26 stc 27 mov ah, RET_HD_INVALID 28 jmp Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH 29 30 ALIGN JUMP_ALIGN 31 .TryToSetBlockMode: 24 32 %ifndef USE_186 25 33 call AH24h_SetBlockSize … … 32 40 33 41 ;-------------------------------------------------------------------- 34 ; Sets block size for block mode transfers.35 ;36 42 ; AH24h_SetBlockSize 37 43 ; Parameters: 38 44 ; AL: Number of Sectors per Block (1, 2, 4, 8, 16, 32, 64 or 128) 39 45 ; DS:DI: Ptr to DPT (in RAMVARS segment) 46 ; SS:BP: Ptr to IDEPACK 40 47 ; Returns: 41 48 ; AH: Int 13h return status … … 46 53 ALIGN JUMP_ALIGN 47 54 AH24h_SetBlockSize: 48 ; Select Master or Slave and wait until ready 49 mov bl, al ; Backup block size 50 call HDrvSel_SelectDriveAndDisableIRQ ; Select drive and wait until ready 51 jc SHORT .ReturnWithErrorCodeInAH ; Return if error 52 53 ; Output block size and command 54 mov al, bl ; Restore block size to AL 55 mov ah, HCMD_SET_MUL ; Load command to AH 56 mov dx, [RAMVARS.wIdeBase] ; Load base port address 57 add dx, BYTE REG_IDE_CNT 58 call HCommand_OutputSectorCountAndCommand 59 call HStatus_WaitBsyDefTime ; Wait until drive not busy 55 MIN_U al, MAX_SUPPORTED_BLOCK_SIZE_IN_SECTORS 56 push ax 57 xchg dx, ax ; DL = Block size (Sector Count Register) 58 mov al, COMMAND_SET_MULTIPLE_MODE 59 mov bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRDY, FLG_STATUS_DRDY) 60 call Idepack_StoreNonExtParametersAndIssueCommandFromAL 61 pop bx 60 62 jc SHORT .DisableBlockMode 61 63 62 64 ; Store new block size to DPT and return 63 mov [di+DPT.bSetBlock], bl ; Store new block size 64 xor ah, ah ; Zero AH and CF since success 65 mov [di+DPT_ATA.bSetBlock], bl ; Store new block size 65 66 ret 66 67 .DisableBlockMode: 67 mov BYTE [di+DPT.bSetBlock], 1 ; Disable block mode 68 .ReturnWithErrorCodeInAH: 68 mov BYTE [di+DPT_ATA.bSetBlock], 1 ; Disable block mode 69 69 ret
Note:
See TracChangeset
for help on using the changeset viewer.