Changeset 150 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH15h_HSize.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/AH15h_HSize.asm
r148 r150 12 12 ; DL: Translated Drive number 13 13 ; DS:DI: Ptr to DPT (in RAMVARS segment) 14 ; SS:BP: Ptr to I NTPACK15 ; Returns with INTPACK in SS:BP:14 ; SS:BP: Ptr to IDEPACK 15 ; Returns with INTPACK: 16 16 ; If succesfull: 17 17 ; AH: 3 (Hard disk accessible) … … 25 25 ALIGN JUMP_ALIGN 26 26 AH15h_HandlerForReadDiskDriveSize: 27 call HCapacity_GetSectorCountFromOurAH08h ; Sector count to DX:AX28 mov [bp+I NTPACK.cx], dx; HIWORD to CX29 mov [bp+I NTPACK.dx], ax; LOWORD to DX27 call AH15h_GetSectorCountToDXAX 28 mov [bp+IDEPACK.intpack+INTPACK.cx], dx ; HIWORD to CX 29 mov [bp+IDEPACK.intpack+INTPACK.dx], ax ; LOWORD to DX 30 30 31 31 xor ah, ah 32 call HError_SetErrorCodeToIntpackInSSBPfromAH ; Store success to BDA and CF33 mov BYTE [bp+I NTPACK.ah], 3; Type code = Hard disk32 call Int13h_SetErrorCodeToIntpackInSSBPfromAH ; Store success to BDA and CF 33 mov BYTE [bp+IDEPACK.intpack+INTPACK.ah], 3 ; Type code = Hard disk 34 34 jmp Int13h_ReturnFromHandlerWithoutStoringErrorCode 35 36 37 ;-------------------------------------------------------------------- 38 ; AH15h_GetSectorCountFromForeignDriveToDXAX: 39 ; AH15h_GetSectorCountToDXAX: 40 ; Parameters: 41 ; DL: Drive number 42 ; DS: RAMVARS segment 43 ; DS:DI: Ptr to DPT (AH15h_GetSectorCount only) 44 ; Returns: 45 ; DX:AX: Total sector count 46 ; BX: Zero 47 ; Corrupts registers: 48 ; CX 49 ;-------------------------------------------------------------------- 50 AH15h_GetSectorCountFromForeignDriveToDXAX: 51 mov ah, GET_DRIVE_PARAMETERS 52 call Int13h_CallPreviousInt13hHandler 53 jmp SHORT ConvertAH08hReturnValuesToSectorCount 54 55 ALIGN JUMP_ALIGN 56 AH15h_GetSectorCountToDXAX: 57 call AH8h_GetDriveParameters 58 ; Fall to ConvertAH08hReturnValuesToSectorCount 59 60 ConvertAH08hReturnValuesToSectorCount: 61 call HAddress_ExtractLCHSparametersFromOldInt13hAddress 62 xor ax, ax ; Zero AX 63 inc cx ; Max cylinder number to cylinder count 64 xchg al, bh ; AX=Max head number, BX=Sectors per track 65 inc ax ; AX=Head count 66 mul bx ; AX=Head count * Sectors per track 67 mul cx ; DX:AX = Total sector count 68 xor bx, bx ; Zero BX for 48-bit sector count (and clear CF) 69 ret
Note:
See TracChangeset
for help on using the changeset viewer.