Changeset 150 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Inc
- Timestamp:
- Apr 29, 2011, 7:04:13 PM (14 years ago)
- google:author:
- aitotat
- Location:
- trunk/XTIDE_Universal_BIOS/Inc
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Inc/CustomDPT.inc
r99 r150 5 5 %define CUSTOMDPT_INC 6 6 7 ; Base DPT for all device types 8 struc DPT ; 8 bytes 9 ; General Disk Parameter Table related 10 .wFlags resb 2 11 .bIdevarsOffset resb 1 ; Offset to IDEVARS for this drive 7 12 8 ; Base Disk Parameter Table for all hard disk drives. 9 ; DPT might have extensions for specific functions. 10 struc DPT 11 ; General Disk Parameter Table related 12 .bSize resb 1 ; Size of DPT (with extensions) in bytes 13 .wDrvNumAndFlags: 14 .bDrvNum resb 1 ; Drive number 15 .bFlags resb 1 ; DPT and Drive related flags 16 .bReset resb 1 ; Drive reset status (for debugging) 17 .bIdeOff resb 1 ; Offset to IDEVARS for this drive 13 ; L-CHS to P-CHS and L-CHS to LBA28 conversion related 14 .bLchsHeads resb 1 ; Number of L-CHS Heads (1...255) 18 15 19 ; Lookup values for L-CHS to P-CHS and L-CHS to LBA28 conversions 20 .bShLtoP resb 1 ; Bit shift count for L-CHS to P-CHS conversion 21 .wLHeads resb 2 ; Number of L-CHS Heads (1...256) 22 23 ; IDE related 24 .wPCyls resb 2 ; Number of P-CHS (IDE) Cylinders (1...16383) 25 .wHeadsAndSectors: 26 .bPHeads resb 1 ; Number of P-CHS (IDE) Heads (1...16) 27 .bPSect resb 1 ; Number of P-CHS (IDE) Sectors per Track (1...63) 28 .bDrvSel resb 1 ; Drive Selection byte for Device/Head Register 29 .bDrvCtrl resb 1 ; Drive Control byte for Device Control Register 30 31 ; Related to Block Mode transfers. 32 ; Block size is specified in sectors (1, 2, 4, 8, 16, 32, 64 or 128). 33 .wSetAndMaxBlock: 34 .bSetBlock resb 1 ; Currect block size (at least 1) 35 .bMaxBlock resb 1 ; Maximum block size, 0 = block mode not supported 16 ; IDE Drive related 17 .wPchsCylinders resb 2 ; Number of P-CHS (IDE) Cylinders (1...16383) 18 .wPchsHeadsAndSectors: 19 .bPchsHeads resb 1 ; Number of P-CHS (IDE) Heads (1...16) 20 .bPchsSectors resb 1 ; Number of P-CHS (IDE) Sectors per Track (1...63) 36 21 endstruc 37 22 38 ; Bit definitions for DPT.bFlags 39 MASK_DPT_ADDR EQU 110b ; Bits 1..2, Addressing Mode 40 FLG_DPT_EBIOS EQU (1<<0) ; EBIOS functions supported for this drive 41 FLG_DPT_FIRSTPART EQU (1<<3) ; First BIOS Partition of the drive (drive reset allowed) 42 FLG_DPT_PARTITION EQU (1<<4) ; BIOS Partition 43 FLG_DPT_USERCHS EQU (1<<5) ; User has specified P-CHS parameters 23 ; DPT for ATA devices 24 struc DPT_ATA ; 8 + 2 bytes = 10 bytes 25 .dpt resb DPT_size 44 26 45 ; Values for different addressing modes (MASK_DPT_ADDR for DPT.bFlags) 46 ADDR_DPT_LCHS EQU 0 ; L-CHS Addressing Mode (NORMAL in many other BIOSes) 47 ADDR_DPT_PCHS EQU 1 ; P-CHS Addressing Mode (LARGE in many other BIOSes) 48 ADDR_DPT_LBA28 EQU 2 ; 28-bit LBA Addressing Mode 49 ADDR_DPT_LBA48 EQU 3 ; 48-bit LBA Addressing Mode 27 ; Block size is specified in sectors (1, 2, 4, 8, 16, 32 or 64). 28 ; 128 is not allowed to prevent offset overflow during data transfer. 29 .wSetAndMaxBlock: 30 .bSetBlock resb 1 ; Current block size (at least 1) 31 .bMaxBlock resb 1 ; Maximum block size, 0 = block mode not supported 32 endstruc 50 33 51 ; Bit definitions for DPT.bReset (inverted) 52 FLG_RESET_nDRDY EQU (1<<0) ; Drive ready to accept commands 53 FLG_RESET_nINITPRMS EQU (1<<1) ; Initialize Device Parameters successfull 54 FLG_RESET_nRECALIBRATE EQU (1<<2) ; Recalibrate successfull 55 FLG_RESET_nSETBLOCK EQU (1<<3) ; Initialize Block Mode successfull 56 MASK_RESET_ALL EQU (FLG_RESET_nDRDY | FLG_RESET_nINITPRMS | FLG_RESET_nRECALIBRATE | FLG_RESET_nSETBLOCK) 34 LARGEST_DPT_SIZE EQU DPT_ATA_size 57 35 58 36 59 ; Extended DPT for XTIDE Universal BIOS partitioned drive. 60 ; This struct cannot exist with EDPT (EBIOS support). 61 struc PART_DPT 62 .dpt resb DPT_size 63 .dwStartLBA: 64 .twStartLBA resb 6 ; Starting 28- or 48-bit LBA for BIOS partition 65 endstruc 37 ; Bit definitions for DPT.wFlags 38 MASK_DPT_CHS_SHIFT_COUNT EQU (7<<0) ; Bits 0...3, P-CHS to L-CHS bit shift count (0...4) 39 FLG_DPT_SLAVE EQU FLG_DRVNHEAD_DRV ; (1<<4), Drive is slave drive 40 MASK_DPT_ADDRESSING_MODE EQU (3<<5) ; Bits 5..6, Addressing Mode (bit 6 == FLG_DRVNHEAD_LBA) 41 FLG_DPT_ENABLE_IRQ EQU (1<<7) 42 FLG_DPT_REVERSED_A0_AND_A3 EQU (1<<8) ; XTIDE mod, Address lines 0 and 3 reversed 43 FLG_DPT_SERIAL_DEVICE EQU (1<<9) ; Serial Port Device 44 FLG_DPT_BLOCK_MODE_SUPPORTED EQU (1<<10) ; Use block transfer commands 66 45 46 FLG_DPT_RESET_nDRDY EQU (1<<12) ; Drive ready to accept commands 47 FLG_DPT_RESET_nINITPRMS EQU (1<<13) ; Initialize Device Parameters successfull 48 FLG_DPT_RESET_nRECALIBRATE EQU (1<<14) ; Recalibrate successfull 49 FLG_DPT_RESET_nSETBLOCK EQU (1<<15) ; Initialize Block Mode successfull 50 MASK_DPT_RESET EQU 0F000h 67 51 68 ; Extended DPT for EBIOS support. 69 ; This struct cannot exist with PDPT (XTIDE Universal BIOS partitioned drive). 70 struc EBDPT 71 .dpt resb DPT_size 72 .dwCapacity: 73 .twCapacity resb 6 ; Total drive capacity in sectors 74 endstruc 52 ; Addressing modes for DPT.wFlags 53 ADDRESSING_MODE_FIELD_POSITION EQU 5 54 ADDRESSING_MODE_LCHS EQU 0 ; L-CHS Addressing Mode (NORMAL in many other BIOSes) 55 ADDRESSING_MODE_PCHS EQU 1 ; P-CHS Addressing Mode (LARGE in many other BIOSes) 56 ADDRESSING_MODE_LBA28 EQU 2 ; 28-bit LBA Addressing Mode 57 ADDRESSING_MODE_LBA48 EQU 3 ; 48-bit LBA Addressing Mode 75 58 76 59 -
trunk/XTIDE_Universal_BIOS/Inc/IDE_8bit.inc
r3 r150 1 ; File name : IDE_8bit.inc 2 ; Project name : IDE BIOS 3 ; Created date : 4.4.2010 4 ; Last update : 13.4.2010 5 ; Author : Tomi Tilli 1 ; Project name : XTIDE Universal BIOS 6 2 ; Description : Macros for accessing data port(s) on 8-bit 7 3 ; IDE controllers. 8 4 %ifndef IDE_8BIT_INC 9 5 %define IDE_8BIT_INC 10 11 ;--------------------------------------------------------------------12 ; Emulates REP INSW for XTIDE dual (8-bit) data port.13 ;14 ; eREP_DUAL_BYTE_PORT_INSW15 ; Parameters:16 ; CX: Loop count17 ; DX: Port address (must be IDE Data Register)18 ; ES:DI: Ptr to destination buffer19 ; Returns:20 ; CX: Zero21 ; DI: Incremented/decremented22 ; Corrupts registers:23 ; AX, FLAGS24 ;--------------------------------------------------------------------25 %macro eREP_DUAL_BYTE_PORT_INSW 026 push bx27 times 2 shr cx, 1 ; Loop unrolling28 mov bx, 8 ; Bit mask for toggling data low/high reg29 ALIGN JUMP_ALIGN30 %%InswLoop:31 eDUAL_BYTE_PORT_INSW32 eDUAL_BYTE_PORT_INSW33 eDUAL_BYTE_PORT_INSW34 eDUAL_BYTE_PORT_INSW35 loop %%InswLoop36 pop bx37 %endmacro38 6 39 7 ;-------------------------------------------------------------------- … … 66 34 %endmacro 67 35 68 69 ;--------------------------------------------------------------------70 ; Emulates REP OUTSW for XTIDE dual (8-bit) data port.71 ;72 ; eREP_DUAL_BYTE_PORT_OUTSW73 ; Parameters:74 ; CX: Loop count75 ; DX: Port address (must be IDE Data Register)76 ; ES:SI: Ptr to source buffer77 ; Returns:78 ; SI: Incremented/decremented79 ; Corrupts registers:80 ; AX, CX81 ;--------------------------------------------------------------------82 %macro eREP_DUAL_BYTE_PORT_OUTSW 083 push ds84 push bx85 times 2 shr cx, 1 ; Loop unrolling86 mov bx, 8 ; Bit mask for toggling data low/high reg87 push es ; Copy ES...88 pop ds ; ...to DS89 ALIGN JUMP_ALIGN90 %%OutswLoop:91 eDUAL_BYTE_PORT_OUTSW92 eDUAL_BYTE_PORT_OUTSW93 eDUAL_BYTE_PORT_OUTSW94 eDUAL_BYTE_PORT_OUTSW95 loop %%OutswLoop96 pop bx97 pop ds98 %endmacro99 36 100 37 ;-------------------------------------------------------------------- … … 130 67 131 68 132 ;--------------------------------------------------------------------133 ; Emulates REP INSW for IDE controllers with single 8-bit Data Port.134 ;135 ; eREP_SINGLE_BYTE_PORT_INSW136 ; Parameters:137 ; CX: Number of WORDs to transfer138 ; DX: IDE Data Port address139 ; ES:DI: Ptr to destination buffer140 ; Returns:141 ; DI: Incremented/decremented142 ; Corrupts registers:143 ; AL, CX144 ;--------------------------------------------------------------------145 %macro eREP_SINGLE_BYTE_PORT_INSW 0146 %ifdef USE_186 ; INS instruction available147 shl cx, 1 ; WORD count to BYTE count148 rep insb149 %else ; If 8088/8086150 shr cx, 1 ; WORD count to DWORD count151 ALIGN JUMP_ALIGN152 %%InsdLoop:153 in al, dx154 stosb ; Store to [ES:DI]155 in al, dx156 stosb157 in al, dx158 stosb159 in al, dx160 stosb161 loop %%InsdLoop162 %endif163 %endmacro164 165 166 ;--------------------------------------------------------------------167 ; Emulates REP OUTSW for IDE controllers with single 8-bit Data Port.168 ;169 ; eREP_SINGLE_BYTE_PORT_OUTSW170 ; Parameters:171 ; CX: Number of WORDs to transfer172 ; DX: IDE Data Port address173 ; ES:SI: Ptr to source buffer174 ; Returns:175 ; SI: Incremented/decremented176 ; Corrupts registers:177 ; AL, CX178 ;--------------------------------------------------------------------179 %macro eREP_SINGLE_BYTE_PORT_OUTSW 0180 %ifdef USE_186 ; OUTS instruction available181 shl cx, 1 ; WORD count to BYTE count182 eSEG es ; Source is ES segment183 rep outsb184 %else ; If 8088/8086185 shr cx, 1 ; WORD count to DWORD count186 push ds ; Store DS187 push es ; Copy ES...188 pop ds ; ...to DS189 ALIGN JUMP_ALIGN190 %%OutsdLoop:191 lodsb ; Load from [DS:SI] to AL192 out dx, al193 lodsb194 out dx, al195 lodsb196 out dx, al197 lodsb198 out dx, al199 loop %%OutsdLoop200 pop ds ; Restore DS201 %endif202 %endmacro203 204 205 69 %endif ; IDE_8BIT_INC -
trunk/XTIDE_Universal_BIOS/Inc/IdeRegisters.inc
r3 r150 1 ; File name : IdeRegisters.inc 2 ; Project name : IDE BIOS 3 ; Created date : 23.3.2010 4 ; Last update : 23.3.2010 5 ; Author : Tomi Tilli 1 ; Project name : XTIDE Universal BIOS 6 2 ; Description : Equates for IDE registers, flags and commands. 7 3 %ifndef IDEREGISTERS_INC … … 9 5 10 6 ; IDE Register offsets from Command Block base port 11 REG_IDE_DATA EQU 0 ; Data Register 12 REGR_IDE_ERROR EQU 1 ; Error Register 13 REGW_IDE_FEAT EQU 1 ; Features Register (ATA1+) 14 ; REGW_IDE_WRPC EQU 1 ; Write Precompensation Register (obsolete on ATA1+)15 REG_IDE_CNT EQU 2 ; Sector Count Register 16 REG_IDE_SECT EQU 3 ; Sector Number Register (LBA 7...0) 17 REG_IDE_LBA_LOW EQU 3 ; LBA LowRegister18 REG_IDE_LOCYL EQU 4 ; Low Cylinder Register (LBA 15...8) 19 REG_IDE_LBA_MID EQU 4 ; LBA Mid Register 20 REG_IDE_HICYL EQU 5 ; High Cylinder Register (LBA 23...16) 21 REG_IDE_LBA_HIGH EQU 5 ; LBA High Register 22 REG_IDE_DRVHD EQU 6 ; Drive and Head Register (LBA 27...24) 23 REGR_IDE_ST EQU 7 ; Status Register 24 REGW_IDE_CMD EQU 7 ; Command Register 25 REG_IDE_HIDATA EQU 8 ; XTIDE Data High Register(actually first Control Block reg)7 DATA_REGISTER EQU 0 8 ERROR_REGISTER_in EQU 1 ; Read only 9 FEATURES_REGISTER_out EQU 1 ; Write only, ATA1+ 10 ;WRITE_PRECOMPENSATION_out EQU 1 ; Write only, Obsolete on ATA1+ 11 SECTOR_COUNT_REGISTER EQU 2 12 SECTOR_NUMBER_REGISTER EQU 3 ; LBA Low Register 13 LOW_CYLINDER_REGISTER EQU 4 ; LBA Middle Register 14 HIGH_CYLINDER_REGISTER EQU 5 ; LBA High Register 15 LBA_LOW_REGISTER EQU 3 ; LBA 7...0, LBA48 31...24 16 LBA_MIDDLE_REGISTER EQU 4 ; LBA 15...8, LBA48 39...32 17 LBA_HIGH_REGISTER EQU 5 ; LBA 23...16, LBA48 47...40 18 DRIVE_AND_HEAD_SELECT_REGISTER EQU 6 ; LBA28 27...24 19 STATUS_REGISTER_in EQU 7 ; Read only 20 COMMAND_REGISTER_out EQU 7 ; Write only 21 XTIDE_DATA_HIGH_REGISTER EQU 8 ; Non-standard (actually first Control Block reg) 26 22 27 23 ; IDE Register offsets from Control Block base port 28 24 ; (usually Command Block base port + 200h) 29 REGR_IDEC_AST EQU 6 ; Alternate Status Register 30 REGW_IDEC_CTRL EQU 6 ; Device Control Register 31 ; REGR_IDEC_ADDR EQU 7 ; Drive Address Register (obsolete on ATA2+)25 ALTERNATE_STATUS_REGISTER_in EQU 6 ; Read only 26 DEVICE_CONTROL_REGISTER_out EQU 6 ; Write only 27 ;DRIVE_ADDRESS_REGISTER EQU 7 ; Obsolete on ATA2+ 32 28 29 ; Bit mask for XTIDE mod with reversed A0 and A3 address lines 30 MASK_A3_AND_A0_ADDRESS_LINES EQU ((1<<3) | (1<<0)) 33 31 34 32 ; Bit definitions for IDE Error Register 35 FLG_ IDE_ERR_BBK EQU (1<<7) ; Bad Block Detected (reserved on ATA2+, command dependent on ATA4+)36 FLG_ IDE_ERR_UNC EQU (1<<6) ; Uncorrectable Data Error (command dependent on ATA4+)37 FLG_ IDE_ERR_MC EQU (1<<5) ; Media Changed (command dependent on ATA4+)38 FLG_ IDE_ERR_IDNFEQU (1<<4) ; ID Not Found (command dependent on ATA4+)39 FLG_ IDE_ERR_MCR EQU (1<<3) ; Media Change Request (command dependent on ATA4+)40 FLG_ IDE_ERR_ABRTEQU (1<<2) ; Command Aborted41 FLG_ IDE_ERR_TK0NFEQU (1<<1) ; Track 0 Not Found (command dependent on ATA4+)42 FLG_ IDE_ERR_AMNFEQU (1<<0) ; Address Mark Not Found (command dependent on ATA4+)33 FLG_ERROR_BBK EQU (1<<7) ; Bad Block Detected (reserved on ATA2+, command dependent on ATA4+) 34 FLG_ERROR_UNC EQU (1<<6) ; Uncorrectable Data Error (command dependent on ATA4+) 35 FLG_ERROR_MC EQU (1<<5) ; Media Changed (command dependent on ATA4+) 36 FLG_ERROR_IDNF EQU (1<<4) ; ID Not Found (command dependent on ATA4+) 37 FLG_ERROR_MCR EQU (1<<3) ; Media Change Request (command dependent on ATA4+) 38 FLG_ERROR_ABRT EQU (1<<2) ; Command Aborted 39 FLG_ERROR_TK0NF EQU (1<<1) ; Track 0 Not Found (command dependent on ATA4+) 40 FLG_ERROR_AMNF EQU (1<<0) ; Address Mark Not Found (command dependent on ATA4+) 43 41 44 42 ; Bit definitions for IDE Drive and Head Select Register 45 FLG_ IDE_DRVHD_LBA EQU (1<<6) ; LBA Addressing enabled (instead of CHS)46 FLG_ IDE_DRVHD_DRV EQU (1<<4) ; Drive Select (0=Master, 1=Slave)47 MASK_ IDE_DRVHD_HEAD EQU 0Fh ; Head select bits (bits 0...3)48 MASK_ IDE_DRVHD_SET EQU 0A0h ; Bits that must be set to 1 on ATA1 (reserved on ATA2+)43 FLG_DRVNHEAD_LBA EQU (1<<6) ; LBA Addressing enabled (instead of CHS) 44 FLG_DRVNHEAD_DRV EQU (1<<4) ; Drive Select (0=Master, 1=Slave) 45 MASK_DRVNHEAD_HEAD EQU 0Fh ; Head select bits (bits 0...3) 46 MASK_DRVNHEAD_SET EQU 0A0h ; Bits that must be set to 1 on ATA1 (reserved on ATA2+) 49 47 50 48 ; Bit definitions for IDE Status Register 51 FLG_ IDE_ST_BSY EQU (1<<7) ; Busy (other flags undefined when set)52 FLG_ IDE_ST_DRDY EQU (1<<6) ; Device Ready53 FLG_ IDE_ST_DF EQU (1<<5) ; Device Fault (command dependent on ATA4+)54 FLG_ IDE_ST_DSC EQU (1<<4) ; Device Seek Complete (command dependent on ATA4+)55 FLG_ IDE_ST_DRQ EQU (1<<3) ; Data Request56 FLG_ IDE_ST_CORR EQU (1<<2) ; Corrected Data (obsolete on ATA4+)57 FLG_ IDE_ST_IDX EQU (1<<1) ; Index (vendor specific on ATA2+, obsolete on ATA4+)58 FLG_ IDE_ST_ERR EQU (1<<0) ; Error49 FLG_STATUS_BSY EQU (1<<7) ; Busy (other flags undefined when set) 50 FLG_STATUS_DRDY EQU (1<<6) ; Device Ready 51 FLG_STATUS_DF EQU (1<<5) ; Device Fault (command dependent on ATA4+) 52 FLG_STATUS_DSC EQU (1<<4) ; Device Seek Complete (command dependent on ATA4+) 53 FLG_STATUS_DRQ EQU (1<<3) ; Data Request 54 FLG_STATUS_CORR EQU (1<<2) ; Corrected Data (obsolete on ATA4+) 55 FLG_STATUS_IDX EQU (1<<1) ; Index (vendor specific on ATA2+, obsolete on ATA4+) 56 FLG_STATUS_ERR EQU (1<<0) ; Error 59 57 60 58 ; Bit definitions for IDE Device Control Register 61 59 ; Bit 0 must be zero, unlisted bits are reserved. 62 FLG_ IDE_CTRL_O8H EQU (1<<3) ; Drive has more than 8 heads (pre-ATA only, 1 on ATA1, reserved on ATA2+)63 FLG_IDE_CTRL_SRST EQU (1<<2) ; Software Reset 64 FLG_ IDE_CTRL_nIEN EQU (1<<1) ; Negated Interrupt Enable (IRQ disabled when set)65 60 FLG_DEVCONTROL_HOB EQU (1<<7) ; High Order Byte (ATA6+) 61 ;FLG_DEVCONTROL_O8H EQU (1<<3) ; Drive has more than 8 heads (pre-ATA only, 1 on ATA1, reserved on ATA2+) 62 FLG_DEVCONTROL_SRST EQU (1<<2) ; Software Reset 63 FLG_DEVCONTROL_nIEN EQU (1<<1) ; Negated Interrupt Enable (IRQ disabled when set) 66 64 67 65 ; Commands for IDE Controller 68 ;HCMD_RECALIBRATE EQU 10h ; Recalibrate 69 HCMD_READ_SECT EQU 20h ; Read Sectors (with retries) 70 HCMD_WRITE_SECT EQU 30h ; Write Sectors (with retries) 71 HCMD_VERIFY_SECT EQU 40h ; Read Verify Sectors (with retries) 72 ;HCMD_FORMAT EQU 50h ; Format track 73 HCMD_SEEK EQU 70h ; Seek 74 ;HCMD_DIAGNOSTIC EQU 90h ; Execute Device Diagnostic 75 HCMD_INIT_DEV EQU 91h ; Initialize Device Parameters 76 HCMD_READ_MUL EQU 0C4h ; Read Multiple (=block) 77 HCMD_WRITE_MUL EQU 0C5h ; Write Multiple (=block) 78 HCMD_SET_MUL EQU 0C6h ; Set Multiple Mode (=block size) 79 HCMD_ID_DEV EQU 0ECh ; Identify Device 80 HCMD_SET_FEAT EQU 0EFh ; Set Features 81 82 ; Set Features subcommands 83 HFEAT_SET_XFER_MODE EQU 03h ; Set transfer mode based on value in Sector Count register 66 COMMAND_READ_SECTORS EQU 20h 67 COMMAND_READ_SECTORS_EXT EQU 24h ; LBA48 68 COMMAND_WRITE_SECTORS EQU 30h 69 COMMAND_WRITE_SECTORS_EXT EQU 34h ; LBA48 70 COMMAND_VERIFY_SECTORS EQU 40h 71 COMMAND_VERIFY_SECTORS_EXT EQU 42h ; LBA48 72 COMMAND_SEEK EQU 70h 73 COMMAND_INITIALIZE_DEVICE_PARAMETERS EQU 91h 74 COMMAND_SET_MULTIPLE_MODE EQU 0C6h ; Block mode 75 COMMAND_READ_MULTIPLE EQU 0C4h ; Block mode 76 COMMAND_READ_MULTIPLE_EXT EQU 29h ; LBA48, Block mode 77 COMMAND_WRITE_MULTIPLE EQU 0C5h ; Block mode 78 COMMAND_WRITE_MULTIPLE_EXT EQU 39h ; LBA48, Block mode 79 COMMAND_IDENTIFY_DEVICE EQU 0ECh 80 COMMAND_SET_FEATURES EQU 0EFh 84 81 85 82 -
trunk/XTIDE_Universal_BIOS/Inc/Int13h.inc
r28 r150 1 ; File name : Int13h.inc 2 ; Project name : IDE BIOS 3 ; Created date : 23.3.2010 4 ; Last update : 29.7.2010 5 ; Author : Tomi Tilli 1 ; Project name : XTIDE Universal BIOS 6 2 ; Description : Equates used in INT 13h functions. 7 3 %ifndef INT13H_INC … … 40 36 41 37 42 ; Timeout values for IDE controller timeout43 ; 255 is the maximum value. Zero means immediate timeout.44 B_TIMEOUT_BSY EQU (1000/55) ; 1000 ms45 B_TIMEOUT_RDY EQU (1000/55) ; 1000 ms46 B_TIMEOUT_DRQ EQU 255 ; 14 s (some CF cards occasionally have long write delays)47 B_TIMEOUT_DRVINFO EQU (500/55) ; 500 ms48 B_TIMEOUT_RESET EQU 255 ; 14 s49 50 51 52 38 ; Floppy Drive types returned by INT 13h, AH=08h 53 39 FLOPPY_TYPE_525_OR_35_DD EQU 0 … … 59 45 60 46 47 MAX_SUPPORTED_BLOCK_SIZE_IN_SECTORS EQU 64 48 49 %define TIMEOUT_AND_STATUS_TO_WAIT(timeout, status) (((timeout)<<8) | (status)) 50 51 61 52 %endif ; INT13H_INC -
trunk/XTIDE_Universal_BIOS/Inc/RamVars.inc
r148 r150 5 5 6 6 ; Segment when RAMVARS is stored to top of interrupt vectors. 7 SEGMENT_RAMVARS_TOP_OF_INTERRUPT_VECTORSEQU 30h7 LITE_MODE_RAMVARS_SEGMENT EQU 30h 8 8 9 9 … … 21 21 struc RAMVARS 22 22 .fpOldI13h resb 4 ; Far pointer to old INT 13h handler 23 .wIdeBase resb 2 ; Base port address for currently handled controller24 23 .wTimeoutCounter resb 2 24 .pInServiceDPT resb 2 ; Ptr to DPT for drive waiting for interrupt 25 .wSignature resb 2 ; Sign for finding stolen 1 kiB 25 26 26 27 .wDrvCntAndFirst: … … 32 33 endstruc 33 34 34 ; Full mode RAM variables. 35 struc FULLRAMVARS 36 .ramVars resb RAMVARS_size 37 .wSign resb 2 ; FULLRAMVARS signature for finding segment 35 RAMVARS_SIGNATURE EQU "Xu" ; RAMVARS signature for .wSignature 36 37 38 struc IDEPACK 39 .bDrvAndHead resb 1 ; LBA28 27...24 40 .bFeatures resb 1 41 42 .wSectorCountAndLbaLow: 43 .bSectorCount resb 1 44 .bSectorNumber: 45 .bLbaLow resb 1 ; LBA 7...0 46 47 .wCylinder: 48 .wLbaMiddleAndHigh: 49 .bLbaMiddle resb 1 ; LBA 15...8 50 .bLbaHigh resb 1 ; LBA 23...16 51 52 .bCommand resb 1 53 .bDeviceControl resb 1 ; Offset 7 shared with PIOVARS 54 55 ; Parameters for 48-bit LBA 56 .wSectorCountHighAndLbaLowExt: 57 .bSectorCountHighExt resb 1 ; LBA48 Sector Count 15...8 58 .bLbaLowExt resb 1 ; LBA48 31...24 59 60 .wLbaMiddleAndHighExt: 61 .bLbaMiddleExt resb 1 ; LBA48 39...32 62 .bLbaHighExt resb 1 ; LBA48 47...40 63 64 .intpack resb INTPACK_size 38 65 endstruc 39 66 40 W_SIGN_FULLRAMVARS EQU "fR" ; FULLRAMVARS signature 67 EXTRA_WORDS_TO_RESERVE_FOR_INTPACK EQU ((IDEPACK_size - INTPACK_size) / 2) 41 68 42 69 -
trunk/XTIDE_Universal_BIOS/Inc/RomVars.inc
r143 r150 41 41 .wPort resb 2 ; IDE Base Port for Command Block (usual) Registers 42 42 .wPortCtrl resb 2 ; IDE Base Port for Control Block Registers 43 .b BusType resb 1 ; Bustype43 .bDevice resb 1 ; Device type 44 44 .bIRQ resb 1 ; Interrupt Request Number 45 45 .drvParamsMaster resb DRVPARAMS_size … … 47 47 endstruc 48 48 49 ; Bus types for IDEVARS.bBusType 50 BUS_TYPE_8_DUAL EQU (0<<1) ; XTIDE transfers with two 8-bit data ports 51 BUS_TYPE_16 EQU (1<<1) ; Normal 16-bit AT-IDE transfers 52 BUS_TYPE_32 EQU (2<<1) ; 32-bit VLB and PCI transfers 53 BUS_TYPE_8_SINGLE EQU (3<<1) ; 8-bit transfers with single 8-bit data port 49 ; Device types for IDEVARS.bDeviceType 50 DEVICE_8BIT_DUAL_PORT_XTIDE EQU (0<<1) 51 DEVICE_XTIDE_WITH_REVERSED_A3_AND_A0 EQU (1<<1) 52 DEVICE_8BIT_SINGLE_PORT EQU (2<<1) 53 DEVICE_16BIT_ATA EQU (3<<1) 54 DEVICE_32BIT_ATA EQU (4<<1) 55 DEVICE_SERIAL_PORT EQU (5<<1) 54 56 55 57
Note:
See TracChangeset
for help on using the changeset viewer.