Changeset 227 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h
- Timestamp:
- Jan 29, 2012, 1:33:44 PM (13 years ago)
- google:author:
- aitotat@gmail.com
- Location:
- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH15h_HSize.asm
r155 r227 53 53 jmp SHORT ConvertAH08hReturnValuesToSectorCount 54 54 55 ALIGN JUMP_ALIGN56 55 AH15h_GetSectorCountToDXAX: 57 56 call AH8h_GetDriveParameters … … 60 59 ConvertAH08hReturnValuesToSectorCount: 61 60 call Address_ExtractLCHSparametersFromOldInt13hAddress 62 x or ax, ax ; Zero AX63 inc cx ; Max cylinder number to cylinder count64 xchg al, bh ; AX=Max head number, BX=Sectors per track 65 inc ax ; AX=Head count66 mul bx ; AX=Head count * Sectors per track67 mul cx ; DX:AX = Total sector count68 xor bx, bx ; Zero BX for 48-bit sector count (and clear CF)61 xchg ax, cx 62 inc ax ; Max cylinder number to cylinder count 63 .MultiplyChsInAXBLBHtoBXDXAX: 64 xchg bx, ax 65 mul ah ; Multiply heads and sectors 66 mul bx ; Multiply with cylinders 67 xor bx, bx 69 68 ret -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH8h_HParams.asm
r173 r227 22 22 ; CF: 0 if successfull, 1 if error 23 23 ;-------------------------------------------------------------------- 24 ALIGN JUMP_ALIGN25 24 AH8h_HandlerForReadDiskDriveParameters: 26 25 call RamVars_IsDriveHandledByThisBIOS … … 56 55 ; AX, BX 57 56 ;-------------------------------------------------------------------- 58 ALIGN JUMP_ALIGN59 57 AH8h_GetDriveParameters: 60 call AccessDPT_GetLCHS ; AX=sectors, BX=cylinders, DX=heads58 call AccessDPT_GetLCHStoAXBLBH 61 59 ; Fall to .PackReturnValues 62 60 … … 66 64 ; .PackReturnValues 67 65 ; Parameters: 68 ; AX: Number of L-CHS sectors per track (1...63)69 ; B X: Number of L-CHS cylinders available (1...1024)70 ; DX: Number of L-CHS heads (1...256)66 ; AX: Number of L-CHS cylinders available (1...1024) 67 ; BL: Number of L-CHS heads (1...256) 68 ; BH: Number of L-CHS sectors per track (1...63) 71 69 ; DS: RAMVARS segment 72 70 ; Returns: … … 80 78 ;-------------------------------------------------------------------- 81 79 .PackReturnValues: 82 dec bx ; Cylinder count tolast cylinder83 dec dx ; Head count to max head number84 mov dh, dl ; Max head number to DH85 mov ch, bl ; Cylinder bits 7...0 to CH86 mov cl, bh ; Cylinder bits 9...8 to CL87 eROR_IM cl, 2 ; Cylinder bits 9...8 to CL bits 7...688 or cl, al ; Sectors per track to CL bits 5...080 dec ax ; AX = Number of last cylinder 81 dec bx ; BL = Number of last head 82 xchg cx, ax 83 xchg cl, ch ; CH = Last cylinder bits 0...7 84 eROR_IM cl, 2 ; CL bits 6...7 = Last cylinder bits 8...9 85 or cl, bh ; CL bits 0...5 = Sectors per track 86 mov dh, bl ; DH = Maximum head number 89 87 jmp RamVars_GetCountOfKnownDrivesToDL -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm
r173 r227 17 17 ; CF: 0 if succesfull, 1 if error 18 18 ;-------------------------------------------------------------------- 19 ALIGN JUMP_ALIGN20 19 AH9h_HandlerForInitializeDriveParameters: 21 20 %ifndef USE_186 … … 41 40 ; AL, BX, DX 42 41 ;-------------------------------------------------------------------- 43 ;ALIGN JUMP_ALIGN44 42 AH9h_InitializeDriveForUse: 45 43 push cx … … 87 85 ; AL, BX, CX, DX 88 86 ;-------------------------------------------------------------------- 89 ALIGN JUMP_ALIGN90 87 InitializeDeviceParameters: 91 88 ; No need to initialize CHS parameters if LBA mode enabled … … 94 91 95 92 ; Initialize Logical Sectors per Track and Max Head number 96 mov ah, [di+DPT.b Heads]93 mov ah, [di+DPT.bPchsHeads] 97 94 dec ah ; Max Head number 98 mov dl, [di+DPT.b Sectors]; Sectors per Track95 mov dl, [di+DPT.bPchsSectors] ; Sectors per Track 99 96 mov al, COMMAND_INITIALIZE_DEVICE_PARAMETERS 100 97 mov bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_BSY, FLG_STATUS_BSY) … … 113 110 ; AL, BX, CX, DX 114 111 ;-------------------------------------------------------------------- 115 ALIGN JUMP_ALIGN116 112 InitializeBlockMode: 117 113 test BYTE [di+DPT.bFlagsHigh], FLGH_DPT_BLOCK_MODE_SUPPORTED ; Clear CF -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH48h_GetExtendedDriveParameters.asm
r221 r227 21 21 ; CF: 0 if succesfull, 1 if error 22 22 ;-------------------------------------------------------------------- 23 ALIGN JUMP_ALIGN24 23 AH48h_HandlerForGetExtendedDriveParameters: 25 ; Get our buffer to ES:SI 26 push di 27 call FindDPT_ForNewDriveToDSDI 28 lea si, [di+LARGEST_DPT_SIZE] ; IdeCommand.asm required fake DPT 29 pop di 30 push ds 31 pop es 24 call AccessDPT_GetLbaSectorCountToBXDXAX 32 25 33 ; Get Drive ID and total sector count from it 34 call AH25h_GetDriveInformationToBufferInESSI 35 jc SHORT .ReturnWithError 36 37 ; Point DS:DI to Destination buffer 38 mov di, [bp+IDEPACK.intpack+INTPACK.si] 26 ; Point DS:SI to Extended Drive Information Table to fill 39 27 mov ds, [bp+IDEPACK.intpack+INTPACK.ds] 40 mov ax, MINIMUM_EDRIVEINFO_SIZE41 cmp [ di+EDRIVE_INFO.wSize], ax28 mov cx, MINIMUM_EDRIVEINFO_SIZE 29 cmp [si+EDRIVE_INFO.wSize], cx 42 30 jb SHORT Prepare_ReturnFromInt13hWithInvalidFunctionError 43 31 je SHORT .SkipEddConfigurationParameters 44 32 45 33 ; We do not support EDD Configuration Parameters so set to FFFF:FFFFh 46 mov ax, -1 ; AX =FFFFh47 mov [ di+EDRIVE_INFO.fpEDDparams], ax48 mov [ di+EDRIVE_INFO.fpEDDparams+2], ax49 mov ax, EDRIVE_INFO_size34 mov cx, -1 ; FFFFh 35 mov [si+EDRIVE_INFO.fpEDDparams], cx 36 mov [si+EDRIVE_INFO.fpEDDparams+2], cx 37 mov cx, EDRIVE_INFO_size 50 38 51 ; Fill Extended Drive Information Table in DS: DI39 ; Fill Extended Drive Information Table in DS:SI 52 40 .SkipEddConfigurationParameters: 53 mov [ di+EDRIVE_INFO.wSize], ax54 mov WORD [ di+EDRIVE_INFO.wFlags], FLG_DMA_BOUNDARY_ERRORS_HANDLED_BY_BIOS | FLG_CHS_INFORMATION_IS_VALID41 mov [si+EDRIVE_INFO.wSize], cx 42 mov WORD [si+EDRIVE_INFO.wFlags], FLG_DMA_BOUNDARY_ERRORS_HANDLED_BY_BIOS 55 43 56 call AtaID_GetPCHStoAXBLBHfromAtaInfoInESSI57 xor cx, cx58 mov [di+EDRIVE_INFO.dwCylinders], ax59 mov [di+EDRIVE_INFO.dwCylinders+2], cx60 eMOVZX ax, bl61 mov [di+EDRIVE_INFO.dwHeads], ax62 mov [di+EDRIVE_INFO.dwHeads+2], cx63 mov al, bh64 mov [di+EDRIVE_INFO.dwSectorsPerTrack], ax65 mov [di+EDRIVE_INFO.dwSectorsPerTrack+2], cx66 67 call AtaID_GetTotalSectorCountToBXDXAXfromAtaInfoInESSI68 44 mov [di+EDRIVE_INFO.qwTotalSectors], ax 45 xor ax, ax ; Return with success 69 46 mov [di+EDRIVE_INFO.qwTotalSectors+2], dx 70 47 mov [di+EDRIVE_INFO.qwTotalSectors+4], bx 71 mov [di+EDRIVE_INFO.qwTotalSectors+6], cx 72 48 mov [di+EDRIVE_INFO.qwTotalSectors+6], ax 73 49 mov WORD [di+EDRIVE_INFO.wSectorSize], 512 74 50 75 ; Return with success76 xor ah, ah77 51 .ReturnWithError: 78 52 jmp Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/Address.asm
r200 r227 53 53 ; LHead / PHeadCount and LHead % PHeadCount 54 54 eMOVZX ax, bh ; Copy L-CHS Head number to AX 55 div BYTE [di+DPT.b Heads]; AL = LHead / PHeadCount, AH = LHead % PHeadCount55 div BYTE [di+DPT.bPchsHeads]; AL = LHead / PHeadCount, AH = LHead % PHeadCount 56 56 mov bh, ah ; Copy P-CHS Head number to BH 57 57 xor ah, ah ; AX = LHead / PHeadCount … … 129 129 ; cylToSeek*headsPerCyl (18-bit result) 130 130 mov ax, cx ; Copy Cylinder number to AX 131 eMOVZX dx, BYTE [di+DPT.b Heads]131 eMOVZX dx, BYTE [di+DPT.bLbaHeads] 132 132 mul dx ; DX:AX = cylToSeek*headsPerCyl 133 133
Note:
See TracChangeset
for help on using the changeset viewer.