Changeset 276 in xtideuniversalbios
- Timestamp:
- Feb 28, 2012, 2:21:03 PM (13 years ago)
- google:author:
- aitotat@gmail.com
- Location:
- trunk/XTIDE_Universal_BIOS
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Inc/IdeRegisters.inc
r158 r276 81 81 82 82 83 ; Subcommands for COMMAND_SET_FEATURES 84 FEATURE_ENABLE_WRITE_CACHE EQU 02h 85 FEATURE_DISABLE_WRITE_CACHE EQU 82h ; Can also be used to flush cache 86 87 83 88 %endif ; IDEREGISTERS_INC -
trunk/XTIDE_Universal_BIOS/Inc/RomVars.inc
r261 r276 108 108 109 109 ; Bit defines for DRVPARAMS.wFlags 110 FLG_DRVPARAMS_USERCHS EQU (1<<0) ; User specified P-CHS values 111 FLG_DRVPARAMS_BLOCKMODE EQU (1<<1) ; Enable Block mode transfers 112 FLG_DRVPARAMS_USERLBA EQU (1<<2) ; User specified LBA values 110 MASK_DRVPARAMS_WRITECACHE EQU (3<<0) ; Drive internal write cache settings (must start at bit 0) 111 FLG_DRVPARAMS_BLOCKMODE EQU (1<<2) ; Enable Block mode transfers 112 FLG_DRVPARAMS_USERCHS EQU (1<<3) ; User specified P-CHS values 113 FLG_DRVPARAMS_USERLBA EQU (1<<4) ; User specified LBA values 114 115 ; Drive Write Cache values for DRVPARAMS.wFlags.MASK_DRVPARAMS_WRITECACHE 116 DEFAULT_WRITE_CACHE EQU 0 ; Must be 0 117 DISABLE_WRITE_CACHE EQU 1 118 ENABLE_WRITE_CACHE EQU 2 119 120 113 121 114 122 ; -
trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeCommand.asm
r267 r276 129 129 130 130 ; Output Sector Address High (only used by LBA48) 131 eMOVZX ax, BYTE [bp+IDEPACK.bLbaLowExt] 131 eMOVZX ax, BYTE [bp+IDEPACK.bLbaLowExt] ; Zero sector count 132 132 mov cx, [bp+IDEPACK.wLbaMiddleAndHighExt] 133 133 call IDEDEVICE%+OutputSectorCountAndAddress -
trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeDPT.asm
r258 r276 31 31 ;-------------------------------------------------------------------- 32 32 .StoreBlockMode: 33 mov al, 1 33 mov al, 1 ; Block mode will be enabled on AH=9h 34 34 mov ah, [es:si+ATA1.bBlckSize] ; Max block size in sectors 35 35 mov [di+DPT_ATA.wSetAndMaxBlock], ax -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm
r258 r276 41 41 ;-------------------------------------------------------------------- 42 42 AH9h_InitializeDriveForUse: 43 push si 43 44 push cx 44 45 … … 63 64 ; Initialize CHS parameters if LBA is not used 64 65 call InitializeDeviceParameters 65 jc SHORT . RecalibrateDrive66 jc SHORT .SetWriteCache 66 67 and BYTE [di+DPT.bFlagsHigh], ~FLGH_DPT_RESET_nINITPRMS 68 69 ; Enable or Disable Write Cache 70 .SetWriteCache: 71 ;call SetWriteCache 67 72 68 73 ; Recalibrate drive by seeking to cylinder 0 … … 80 85 .ReturnNotSuccessfull: 81 86 pop cx 87 pop si 82 88 ret 83 89 … … 110 116 111 117 ;-------------------------------------------------------------------- 118 ; SetWriteCache 119 ; Parameters: 120 ; DS:DI: Ptr to DPT (in RAMVARS segment) 121 ; Returns: 122 ; AH: BIOS Error code 123 ; CF: Cleared if succesfull 124 ; Set if any error 125 ; Corrupts registers: 126 ; AL, BX, CX, DX, SI 127 ;-------------------------------------------------------------------- 128 SetWriteCache: 129 call AccessDPT_GetPointerToDRVPARAMStoCSBX 130 mov bl, [cs:bx+DRVPARAMS.wFlags] 131 and bx, BYTE MASK_DRVPARAMS_WRITECACHE 132 jz SHORT ReturnSuccessSinceInitializationNotNeeded ; DEFAULT_WRITE_CACHE 133 mov si, [cs:bx+.rgbWriteCacheCommands] 134 jmp AH23h_SetControllerFeatures 135 136 .rgbWriteCacheCommands: 137 db 0 ; DEFAULT_WRITE_CACHE 138 db FEATURE_DISABLE_WRITE_CACHE ; DISABLE_WRITE_CACHE 139 db FEATURE_ENABLE_WRITE_CACHE ; ENABLE_WRITE_CACHE 140 141 142 ;-------------------------------------------------------------------- 112 143 ; InitializeBlockMode 113 144 ; Parameters: … … 124 155 jz SHORT ReturnSuccessSinceInitializationNotNeeded 125 156 126 mov al, [di+DPT_ATA.bMaxBlock] ; Load max block size, zero AH 157 call AccessDPT_GetPointerToDRVPARAMStoCSBX 158 mov al, 1 ; Disable block mode 159 test BYTE [cs:bx+DRVPARAMS.wFlags], FLG_DRVPARAMS_BLOCKMODE 160 eCMOVNZ al, [di+DPT_ATA.bMaxBlock] ; Load max block size 127 161 jmp AH24h_SetBlockSize 128 162 ReturnSuccessSinceInitializationNotNeeded: 163 xor ah, ah 129 164 ret -
trunk/XTIDE_Universal_BIOS/Src/Main.asm
r273 r276 44 44 at ROMVARS.bRomSize, db CNT_ROM_BLOCKS ; ROM size in 512B blocks 45 45 at ROMVARS.rgbJump, jmp Initialize_FromMainBiosRomSearch 46 at ROMVARS.rgbSign, db "XTIDE 120" ; Signature for flash program46 at ROMVARS.rgbSign, db "XTIDE200" ; Signature for flash program 47 47 at ROMVARS.szTitle 48 48 db "-=XTIDE Universal BIOS" … … 54 54 db " (XT)=-",NULL 55 55 %endif 56 at ROMVARS.szVersion, db "v 1.2.0_wip (",__DATE__,")",NULL56 at ROMVARS.szVersion, db "v2.0.0_wip (",__DATE__,")",NULL 57 57 58 58 ;;; For OR'ing into wFlags below … … 93 93 at ROMVARS.ideVars0+IDEVARS.bDevice, db DEVICE_16BIT_ATA 94 94 at ROMVARS.ideVars0+IDEVARS.bIRQ, db 0 95 at ROMVARS.ideVars0+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags, db FLG_DRVPARAMS_BLOCKMODE96 at ROMVARS.ideVars0+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags, db FLG_DRVPARAMS_BLOCKMODE95 at ROMVARS.ideVars0+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags, db DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE 96 at ROMVARS.ideVars0+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags, db DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE 97 97 98 98 at ROMVARS.ideVars1+IDEVARS.wPort, dw 170h ; Controller Command Block base port … … 100 100 at ROMVARS.ideVars1+IDEVARS.bDevice, db DEVICE_16BIT_ATA 101 101 at ROMVARS.ideVars1+IDEVARS.bIRQ, db 0 102 at ROMVARS.ideVars1+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags, db FLG_DRVPARAMS_BLOCKMODE103 at ROMVARS.ideVars1+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags, db FLG_DRVPARAMS_BLOCKMODE102 at ROMVARS.ideVars1+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags, db DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE 103 at ROMVARS.ideVars1+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags, db DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE 104 104 105 105 at ROMVARS.ideVars2+IDEVARS.wPort, dw DEVICE_XTIDE_DEFAULT_PORT ; Controller Command Block base port … … 107 107 at ROMVARS.ideVars2+IDEVARS.bDevice, db DEVICE_8BIT_DUAL_PORT_XTIDE 108 108 at ROMVARS.ideVars2+IDEVARS.bIRQ, db 0 109 at ROMVARS.ideVars2+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags, db FLG_DRVPARAMS_BLOCKMODE110 at ROMVARS.ideVars2+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags, db FLG_DRVPARAMS_BLOCKMODE109 at ROMVARS.ideVars2+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags, db DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE 110 at ROMVARS.ideVars2+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags, db DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE 111 111 112 112 at ROMVARS.ideVars3+IDEVARS.wPort, dw 168h ; Controller Command Block base port … … 114 114 at ROMVARS.ideVars3+IDEVARS.bDevice, db DEVICE_16BIT_ATA 115 115 at ROMVARS.ideVars3+IDEVARS.bIRQ, db 0 116 at ROMVARS.ideVars3+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags, db FLG_DRVPARAMS_BLOCKMODE117 at ROMVARS.ideVars3+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags, db FLG_DRVPARAMS_BLOCKMODE116 at ROMVARS.ideVars3+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags, db DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE 117 at ROMVARS.ideVars3+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags, db DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE 118 118 119 119 %ifdef MODULE_SERIAL … … 140 140 %endif 141 141 at ROMVARS.ideVars0+IDEVARS.bIRQ, db 0 ; IRQ 142 at ROMVARS.ideVars0+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags, db FLG_DRVPARAMS_BLOCKMODE143 at ROMVARS.ideVars0+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags, db FLG_DRVPARAMS_BLOCKMODE144 145 at ROMVARS.ideVars1+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags, db FLG_DRVPARAMS_BLOCKMODE146 at ROMVARS.ideVars1+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags, db FLG_DRVPARAMS_BLOCKMODE147 148 at ROMVARS.ideVars2+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags, db FLG_DRVPARAMS_BLOCKMODE149 at ROMVARS.ideVars2+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags, db FLG_DRVPARAMS_BLOCKMODE150 151 at ROMVARS.ideVars3+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags, db FLG_DRVPARAMS_BLOCKMODE152 at ROMVARS.ideVars3+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags, db FLG_DRVPARAMS_BLOCKMODE142 at ROMVARS.ideVars0+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags, db DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE 143 at ROMVARS.ideVars0+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags, db DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE 144 145 at ROMVARS.ideVars1+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags, db DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE 146 at ROMVARS.ideVars1+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags, db DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE 147 148 at ROMVARS.ideVars2+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags, db DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE 149 at ROMVARS.ideVars2+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags, db DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE 150 151 at ROMVARS.ideVars3+IDEVARS.drvParamsMaster+DRVPARAMS.wFlags, db DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE 152 at ROMVARS.ideVars3+IDEVARS.drvParamsSlave+DRVPARAMS.wFlags, db DISABLE_WRITE_CACHE | FLG_DRVPARAMS_BLOCKMODE 153 153 154 154 %ifdef MODULE_SERIAL
Note:
See TracChangeset
for help on using the changeset viewer.