Changeset 541 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS
- Timestamp:
- Apr 14, 2013, 5:04:32 PM (12 years ago)
- google:author:
- aitotat@gmail.com
- Location:
- trunk/XTIDE_Universal_BIOS
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Inc/EBIOS.inc
r536 r541 57 57 58 58 59 ; Device Parameter Table Extension60 struc DPTE61 .wBasePort resb 2 ; 0, Command Block Base Port Address62 .wControlBlockPort resb 2 ; 2, Control Block Base Port Address63 .bDrvnhead resb 1 ; 4, Drive and Head Select Register upper nibble64 .bBiosVendor resb 1 ; 5, BIOS Vendor Specific65 .bIRQ resb 1 ; 6, IRQ for this device66 .bBlockSize resb 1 ; 7, Current block size in sectors67 .bDmaChannelAndType resb 1 ; 8, DMA information68 .bPioMode resb 1 ; 9, PIO mode69 .wFlags resb 2 ; 10, BIOS selected hardware specific option flags70 .wReserved resb 2 ; 12, Reserved. Must be zero.71 .bRevision resb 1 ; 14, Revision level of this table (11h)72 .bChecksum resb 1 ; 15, Checksum, 2's complement of the sum of bytes 0-1473 endstruc74 75 ; Flags for DPTE.wFlags76 FLG_FAST_PIO_ENABLED EQU (1<<0) ; Set if using PIO mode 1 or above (DPTE.bPioMode is valid when set)77 FLG_DMA_ENABLED EQU (1<<1) ; Set if DMA enabled (DPTE.bDmaChannelAndType is valid when set)78 FLG_BLOCK_MODE_ENABLED EQU (1<<2) ; Set if Block Mode transfers are enabled (DPTE.bBlockSize is valid when set)79 FLG_CHS_TRANSLATION_ENABLED EQU (1<<3) ; Set for drives with more than 1024 cylinders80 FLG_LBA_TRANSLATION_ENABLED EQU (1<<4) ; Set when LBA addresses from DAP are passed directly to the drive81 FLG_REMOVABLE_MEDIA EQU (1<<5)82 FLG_ATAPI_DEVICE EQU (1<<6)83 FLG_32BIT_XFER_MODE EQU (1<<7) ; Set when using 32-bit data transfers84 FLG_ATAPI_USES_IRQ EQU (1<<8) ; ATAPI Device uses IRQ for data transfers85 ; L-CHS translation type for old INT 13h (when FLG_CHS_TRANSLATION_ENABLED is set)86 MASK_CHS_TRANSLATION_TYPE EQU (3<<TRANSLATION_TYPE_FIELD_POSITION)87 TRANSLATION_TYPE_FIELD_POSITION EQU 988 BIT_SHIFT_TRANSLATION EQU 0 ; LARGE89 LBA_ASSISTED_TRANSLATION EQU 1 ; Assisted LBA90 ; 2 = reserved91 VENDOR_SPECIFIC_TRANSLATION EQU 392 93 94 DPTE_REVISION EQU 11h95 96 97 59 ; Disk Address Packet for read, write and verify functions 98 60 struc DAP -
trunk/XTIDE_Universal_BIOS/Inc/IdeRegisters.inc
r526 r541 76 76 ; Bit 0 must be zero, unlisted bits are reserved. 77 77 ;FLG_DEVCONTROL_HOB EQU (1<<7) ; High Order Byte (ATA6+) 78 ;FLG_DEVCONTROL_O8H EQU (1<<3) ; Drive has more than 8 heads (pre-ATA only, 1 on ATA1, reserved on ATA2+)78 FLG_DEVCONTROL_O8H EQU (1<<3) ; Drive has more than 8 heads (pre-ATA only, 1 on ATA1, reserved on ATA2+) 79 79 FLG_DEVCONTROL_SRST EQU (1<<2) ; Software Reset 80 80 FLG_DEVCONTROL_nIEN EQU (1<<1) ; Negated Interrupt Enable (IRQ disabled when set) -
trunk/XTIDE_Universal_BIOS/Inc/ModuleDependency.inc
r536 r541 52 52 %ifdef MODULE_EBIOS 53 53 %include "EBIOS.inc" ; Equates for EBIOS functions 54 %ifdef CREATE_COMPATIBLE_DPT 55 %include "CompatibleDPT.inc" 56 %endif 54 57 %endif 55 58 -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH41h_CheckIfExtensionsPresent.asm
r535 r541 44 44 mov WORD [bp+IDEPACK.intpack+INTPACK.bx], 0AA55h 45 45 46 %ifdef RETURN_DPTE_ON_AH48H46 %ifdef CREATE_COMPATIBLE_DPT 47 47 call AH41h_GetSupportBitsToCX 48 48 mov [bp+IDEPACK.intpack+INTPACK.cx], cx … … 57 57 58 58 59 %ifdef RETURN_DPTE_ON_AH48H59 %ifdef CREATE_COMPATIBLE_DPT 60 60 ;-------------------------------------------------------------------- 61 61 ; AH41h_GetSupportBitsToCX … … 87 87 ret 88 88 89 %endif ; RETURN_DPTE_ON_AH48H89 %endif ; CREATE_COMPATIBLE_DPT -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH48h_GetExtendedDriveParameters.asm
r535 r541 84 84 85 85 ; Create DPTE (hardware information for device drivers) 86 %ifdef RETURN_DPTE_ON_AH48H86 %ifdef CREATE_COMPATIBLE_DPT 87 87 call AH41h_GetSupportBitsToCX 88 88 test cl, ENHANCED_DISK_DRIVE_SUPPORT 89 89 jz SHORT .DoNotCreateDPTE 90 call C reateDeviceParameterTableExtensionToESBXfromDPTinDSSI90 call CompatibleDPT_CreateDeviceParameterTableExtensionToESBXfromDPTinDSSI 91 91 .DoNotCreateDPTE: 92 92 %endif … … 110 110 ; Store DPTE for standard controllers only, 111 111 ; FFFF:FFFF for non standard controllers 112 %ifdef RETURN_DPTE_ON_AH48H112 %ifdef CREATE_COMPATIBLE_DPT 113 113 mov [di+EDRIVE_INFO.fpDPTE], bx 114 114 mov [di+EDRIVE_INFO.fpDPTE+2], es … … 161 161 .ReturnWithError: 162 162 jmp Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH 163 164 165 %ifdef RETURN_DPTE_ON_AH48H166 ;--------------------------------------------------------------------167 ; CreateDeviceParameterTableExtensionToESBXfromDPTinDSSI168 ; Parameters:169 ; DS:SI: Ptr to DPT (in RAMVARS segment)170 ; ES: RAMVARS segment171 ; Returns:172 ; ES:BX: Ptr to Device Parameter Table Extension (DPTE)173 ; Corrupts registers:174 ; AX, CX, DX, DI175 ;--------------------------------------------------------------------176 CreateDeviceParameterTableExtensionToESBXfromDPTinDSSI:177 ; Point ES:DI to DPTE buffer (valid until next AH=48h call)178 mov di, [cs:ROMVARS.bStealSize]179 eSHL_IM di, 10 ; DI = RAMVARS size in bytes180 sub di, BYTE DPTE_size ; DI = Offset to DPTE181 xor dx, dx ; Clear for checksum182 183 ; Set 32-bit flag for 32-bit controllers184 mov cx, FLG_LBA_TRANSLATION_ENABLED ; DPTE.wFlags185 cmp BYTE [si+DPT_ATA.bDevice], DEVICE_32BIT_ATA186 eCMOVE cl, FLG_LBA_TRANSLATION_ENABLED | FLG_32BIT_XFER_MODE187 188 ; DPTE.wBasePort189 mov ax, [si+DPT.wBasePort]190 call StoswThenAddALandAHtoDL ; Bytes 0 and 1191 192 ; DPTE.wControlBlockPort193 eMOVZX bx, BYTE [si+DPT.bIdevarsOffset]194 mov ax, [cs:bx+IDEVARS.wControlBlockPort]195 call StoswThenAddALandAHtoDL ; Bytes 2 and 3196 197 ; DPTE.bDrvnhead and DPTE.bBiosVendor198 xchg di, si199 call AccessDPT_GetDriveSelectByteForEbiosToAL200 xchg si, di201 call StoswThenAddALandAHtoDL ; Bytes 4 and 5202 203 ; DPTE.bIRQ and DPTE.bBlockSize204 mov al, [cs:bx+IDEVARS.bIRQ] ; No way to define that we might not use IRQ205 mov ah, [si+DPT_ATA.bBlockSize]206 cmp ah, 1207 jbe SHORT .DoNotSetBlockModeFlag208 or cl, FLG_BLOCK_MODE_ENABLED209 .DoNotSetBlockModeFlag:210 call StoswThenAddALandAHtoDL ; Bytes 6 and 7211 212 ; DPTE.bDmaChannelAndType and DPTE.bPioMode213 xor ax, ax214 %ifdef MODULE_ADVANCED_ATA215 or ah, [si+DPT_ADVANCED_ATA.bPioMode]216 jz SHORT .NoDotSetFastPioFlag217 cmp WORD [si+DPT_ADVANCED_ATA.wControllerID], BYTE 0218 je SHORT .NoDotSetFastPioFlag219 inc cx ; FLG_FAST_PIO_ENABLED220 .NoDotSetFastPioFlag:221 %endif222 call StoswThenAddALandAHtoDL ; Bytes 8 and 9223 224 ; Set CHS translation flags and store DPTE.wFlags225 mov al, [si+DPT.bFlagsLow]226 and al, MASKL_DPT_TRANSLATEMODE227 jz SHORT .NoChsTranslationOrBitShiftTranslationSet228 or cl, FLG_CHS_TRANSLATION_ENABLED229 test al, FLGL_DPT_ASSISTED_LBA230 jz SHORT .NoChsTranslationOrBitShiftTranslationSet231 or cx, LBA_ASSISTED_TRANSLATION << TRANSLATION_TYPE_FIELD_POSITION232 .NoChsTranslationOrBitShiftTranslationSet:233 xchg ax, cx234 call StoswThenAddALandAHtoDL ; Bytes 10 and 11235 236 ; DPTE.wReserved (must be zero)237 xor ax, ax238 call StoswThenAddALandAHtoDL ; Bytes 12 and 13239 240 ; DPTE.bRevision and DPTE.bChecksum241 mov ax, DPTE_REVISION | (DPTE_REVISION<<8)242 add ah, dl243 neg ah244 stosw245 lea bx, [di-DPTE_size]246 ret247 248 249 ;--------------------------------------------------------------------250 ; StoswThenAddALandAHtoDL251 ; Parameters:252 ; AX: WORD to store253 ; ES:DI: Ptr to where to store AX254 ; DL: Checksum byte255 ; Returns:256 ; DL: Checksum byte257 ; DI: Incremented by 2258 ; Corrupts registers:259 ; Nothing260 ;--------------------------------------------------------------------261 StoswThenAddALandAHtoDL:262 stosw263 add dl, al264 add dl, ah265 ret266 267 %endif ; RETURN_DPTE_ON_AH48H -
trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm
r526 r541 80 80 call DetectDrives_FromAllIDEControllers 81 81 call Interrupts_InitializeInterruptVectors 82 ; Fall to .StoreDptPointersToIntVectors 83 84 85 %ifdef CREATE_COMPATIBLE_DPT 86 ;-------------------------------------------------------------------- 87 ; .StoreDptPointersToIntVectors 88 ; Parameters: 89 ; DS: RAMVARS segment 90 ; ES: BDA and interrupt vector segment (zero) 91 ; Returns: 92 ; Nothing 93 ; Corrupts registers: 94 ; AX, CX, DX, SI, DI 95 ;-------------------------------------------------------------------- 96 .StoreDptPointersToIntVectors: 97 mov dl, 80h 98 call FindDPT_ForDriveNumberInDL ; DPT to DS:DI 99 jc SHORT .FindForDrive81h ; Store nothing if not our drive 100 101 call CompatibleDPT_CreateToAXSIforDriveDL 102 mov [es:HD0_DPT_POINTER_41h*4], si 103 mov [es:HD0_DPT_POINTER_41h*4+2], ax 104 105 .FindForDrive81h: 106 mov dl, 81h 107 call FindDPT_ForDriveNumberInDL 108 jc SHORT .CompatibleDPTsCreated 109 110 call CompatibleDPT_CreateToAXSIforDriveDL 111 mov [es:HD1_DPT_POINTER_46h*4], si 112 mov [es:HD1_DPT_POINTER_46h*4+2], ax 113 .CompatibleDPTsCreated: 82 114 ; Fall to .ResetDetectedDrives 115 %endif ; CREATE_COMPATIBLE_DPT 116 83 117 84 118 ;-------------------------------------------------------------------- -
trunk/XTIDE_Universal_BIOS/Src/Main.asm
r536 r541 282 282 %include "AH48h_GetExtendedDriveParameters.asm" 283 283 %include "AH41h_CheckIfExtensionsPresent.asm" 284 %endif 284 %ifdef CREATE_COMPATIBLE_DPT 285 %include "CompatibleDPT.asm" 286 %endif 287 %endif -
trunk/XTIDE_Universal_BIOS/makefile
r535 r541 32 32 # RELOCATE_INT13H_STACK ** Relocates INT 13h stack to beginning of stolen conventional memory # 33 33 # RESERVE_DIAGNOSTIC_CYLINDER Reserve one L-CHS cylinder for compatibility with old BIOSes # 34 # RETURN_DPTE_ON_AH48H Returns extra hardware related information on AH=48h for OS drivers#34 # CREATE_COMPATIBLE_DPT Presents compatible DPTs for ill behaving applications # 35 35 # USE_186 Use instructions supported by 80188/80186 and V20/V30 and later # 36 36 # USE_286 Use instructions supported by 286 and later (defines USE_UNDOC_INTEL)# … … 100 100 ################################################################# 101 101 DEFINES_COMMON = MODULE_STRINGS_COMPRESSED MODULE_HOTKEYS MODULE_8BIT_IDE MODULE_SERIAL MODULE_SERIAL_FLOPPY MODULE_EBIOS MODULE_FEATURE_SETS RESERVE_DIAGNOSTIC_CYLINDER 102 DEFINES_COMMON_LARGE = MODULE_BOOT_MENU MODULE_8BIT_IDE_ADVANCED 102 DEFINES_COMMON_LARGE = MODULE_BOOT_MENU MODULE_8BIT_IDE_ADVANCED CREATE_COMPATIBLE_DPT 103 103 104 104 DEFINES_XT = $(DEFINES_COMMON) ELIMINATE_CGA_SNOW MODULE_8BIT_IDE_ADVANCED … … 111 111 112 112 DEFINES_XT_TINY = MODULE_STRINGS_COMPRESSED MODULE_8BIT_IDE 113 DEFINES_386_8K = $(DEFINES_AT) USE_386 RETURN_DPTE_ON_AH48H113 DEFINES_386_8K = $(DEFINES_AT) USE_386 CREATE_COMPATIBLE_DPT 114 114 115 115 DEFINES_ALL_FEATURES = MODULE_8BIT_IDE MODULE_8BIT_IDE_ADVANCED MODULE_ADVANCED_ATA MODULE_EBIOS MODULE_BOOT_MENU MODULE_HOTKEYS MODULE_IRQ MODULE_SERIAL MODULE_SERIAL_FLOPPY MODULE_STRINGS_COMPRESSED MODULE_FEATURE_SETS
Note:
See TracChangeset
for help on using the changeset viewer.