Changeset 421 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Initialization
- Timestamp:
- May 9, 2012, 7:12:53 PM (13 years ago)
- google:author:
- aitotat@gmail.com
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Initialization/AtaID.asm
r411 r421 21 21 ; Section containing code 22 22 SECTION .text 23 24 ;--------------------------------------------------------------------25 ; AtaID_GetPCHStoAXBLBHfromAtaInfoInESSI26 ; Parameters:27 ; ES:SI: Ptr to 512-byte ATA information read from the drive28 ; Returns:29 ; AX: Number of user specified P-CHS cylinders30 ; BH: Number of user specified P-CHS sectors per track31 ; BL: Number of user specified P-CHS heads32 ; Corrupts registers:33 ; Nothing34 ;--------------------------------------------------------------------35 AtaID_GetPCHStoAXBLBHfromAtaInfoInESSI:36 mov ax, [es:si+ATA1.wCylCnt] ; Cylinders (1...16383)37 mov bl, [es:si+ATA1.wHeadCnt] ; Heads (1...16)38 mov bh, [es:si+ATA1.wSPT] ; Sectors per Track (1...63)39 ret40 41 42 ;--------------------------------------------------------------------43 ; AtaID_GetTotalSectorCountToBXDXAXfromAtaInfoInESSI44 ; Parameters:45 ; ES:SI: Ptr to 512-byte ATA information read from the drive46 ; Returns:47 ; BX:DX:AX: 48-bit sector count48 ; Corrupts registers:49 ; Nothing50 ;--------------------------------------------------------------------51 AtaID_GetTotalSectorCountToBXDXAXfromAtaInfoInESSI:52 mov bx, Registers_ExchangeDSSIwithESDI53 call bx ; ATA info now in DS:DI54 push bx ; We will return via Registers_ExchangeDSSIwithESDI55 xor bx, bx56 test BYTE [di+ATA1.wCaps+1], A1_wCaps_LBA>>857 jz SHORT .GetChsSectorCount58 ; Fall to .GetLbaSectorCount59 60 ;--------------------------------------------------------------------61 ; .GetLbaSectorCount62 ; .GetLba28SectorCount63 ; .GetChsSectorCount64 ; Parameters:65 ; BX: Zero66 ; DS:DI: Ptr to 512-byte ATA information read from the drive67 ; Returns:68 ; BX:DX:AX: 48-bit sector count69 ; Corrupts registers:70 ; Nothing71 ;--------------------------------------------------------------------72 .GetLbaSectorCount:73 %ifdef MODULE_EBIOS74 test BYTE [di+ATA6.wSetSup83+1], A6_wSetSup83_LBA48>>875 jz SHORT .GetLba28SectorCount76 77 ; Get LBA48 sector count78 mov ax, [di+ATA6.qwLBACnt]79 mov dx, [di+ATA6.qwLBACnt+2]80 mov bx, [di+ATA6.qwLBACnt+4]81 ret82 %endif83 84 .GetLba28SectorCount:85 mov ax, [di+ATA1.dwLBACnt]86 mov dx, [di+ATA1.dwLBACnt+2]87 ret88 89 .GetChsSectorCount:90 mov al, [di+ATA1.wSPT] ; AL=Sectors per track91 mul BYTE [di+ATA1.wHeadCnt] ; AX=Sectors per track * number of heads92 mul WORD [di+ATA1.wCylCnt] ; DX:AX=Sectors per track * number of heads * number of cylinders93 ret94 95 23 96 24 %ifdef MODULE_ADVANCED_ATA
Note:
See TracChangeset
for help on using the changeset viewer.