Changeset 601 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Device
- Timestamp:
- Feb 14, 2019, 7:38:08 PM (6 years ago)
- Location:
- trunk/XTIDE_Universal_BIOS/Src/Device
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeIO.asm
r558 r601 59 59 60 60 %ifdef MODULE_8BIT_IDE_ADVANCED 61 je SHORT .ReverseA0andA3fromRegisterIndexInDX 61 cmp al, DEVICE_8BIT_XTIDE_REV2_OLIVETTI 62 jbe SHORT .ReverseA0andA3fromRegisterIndexInDX 62 63 63 64 eSHL_IM dx, 1 ; ADP50L and XT-CF … … 99 100 IdeIO_OutputALtoIdeControlBlockRegisterInDL: 100 101 xor dh, dh ; IDE Register index now in DX 101 102 102 mov bl, [di+DPT_ATA.bDevice] 103 103 cmp bl, DEVICE_8BIT_XTIDE_REV2 … … 105 105 106 106 %ifdef MODULE_8BIT_IDE_ADVANCED 107 je SHORT .ReverseA0andA3fromRegisterIndexInDX 107 cmp bl, DEVICE_8BIT_XTIDE_REV2_OLIVETTI 108 jbe SHORT .ReverseA0andA3fromRegisterIndexInDX 108 109 109 110 ; At this point remaining controllers (JRIDE, XTCF and ADP50L) all have a control … … 154 155 IdeIO_OutputALtoIdeRegisterInDL: 155 156 xor dh, dh ; IDE Register index now in DX 156 157 157 mov bl, [di+DPT_ATA.bDevice] 158 158 cmp bl, DEVICE_8BIT_XTIDE_REV2 … … 160 160 161 161 %ifdef MODULE_8BIT_IDE_ADVANCED 162 je SHORT .ReverseA0andA3fromRegisterIndexInDX 162 cmp bl, DEVICE_8BIT_XTIDE_REV2_OLIVETTI 163 jbe SHORT .ReverseA0andA3fromRegisterIndexInDX 163 164 164 165 cmp bl, DEVICE_8BIT_JRIDE_ISA -
trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdePioBlock.asm
r589 r601 55 55 56 56 ;-------------------------------------------------------------------- 57 ; IdePioBlock_ReadFromXtideRev2_Olivetti 58 ; Parameters: 59 ; CX: Block size in 512 byte sectors 60 ; DX: IDE Data port address 61 ; ES:DI: Normalized ptr to buffer to receive data 62 ; Returns: 63 ; Nothing 64 ; Corrupts registers: 65 ; AX, CX 66 ;-------------------------------------------------------------------- 67 ALIGN JUMP_ALIGN 68 IdePioBlock_ReadFromXtideRev2_Olivetti: 69 UNROLL_SECTORS_IN_CX_TO_OWORDS 70 ALIGN JUMP_ALIGN 71 .InswLoop: 72 %rep 8 ; WORDs 73 XTIDE_MOD_OLIVETTI_INSW 74 %endrep 75 loop .InswLoop 76 ret 77 78 79 ;-------------------------------------------------------------------- 57 80 ; 8-bit PIO from a single data port. 58 81 ; -
trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm
r589 r601 328 328 ALIGN WORD_ALIGN 329 329 g_rgfnPioRead: 330 dw IdePioBlock_ReadFrom16bitDataPort ; 0, DEVICE_16BIT_ATA330 dw IdePioBlock_ReadFrom16bitDataPort ; 0, DEVICE_16BIT_ATA 331 331 %ifdef MODULE_ADVANCED_ATA 332 dw IdePioBlock_ReadFrom32bitDataPort ; 1, DEVICE_32BIT_ATA332 dw IdePioBlock_ReadFrom32bitDataPort ; 1, DEVICE_32BIT_ATA 333 333 %elifdef MODULE_8BIT_IDE 334 334 dw NULL 335 335 %endif ; MODULE_ADVANCED_ATA 336 336 %ifdef MODULE_8BIT_IDE 337 dw IdePioBlock_ReadFrom8bitDataPort ; 2, DEVICE_8BIT_ATA 338 dw IdePioBlock_ReadFromXtideRev1 ; 3, DEVICE_8BIT_XTIDE_REV1 339 dw IdePioBlock_ReadFrom16bitDataPort ; 4, DEVICE_8BIT_XTIDE_REV2 337 dw IdePioBlock_ReadFrom8bitDataPort ; 2, DEVICE_8BIT_ATA 338 dw IdePioBlock_ReadFromXtideRev1 ; 3, DEVICE_8BIT_XTIDE_REV1 339 dw IdePioBlock_ReadFrom16bitDataPort ; 4, DEVICE_8BIT_XTIDE_REV2 340 dw IdePioBlock_ReadFromXtideRev2_Olivetti ; 5, DEVICE_8BIT_XTIDE_REV2_OLIVETTI 340 341 %ifdef MODULE_8BIT_IDE_ADVANCED 341 dw IdePioBlock_ReadFrom8bitDataPort ; 5, DEVICE_8BIT_XTCF_PIO8342 dw IdePioBlock_ReadFrom16bitDataPort ; 6, DEVICE_8BIT_XTCF_PIO8_WITH_BIU_OFFLOAD343 dw IdePioBlock_ReadFrom16bitDataPort ; 7, DEVICE_8BIT_XTCF_PIO16_WITH_BIU_OFFLOAD344 dw IdeDmaBlock_ReadFromXTCF ; 8, DEVICE_8BIT_XTCF_DMA342 dw IdePioBlock_ReadFrom8bitDataPort ; 6, DEVICE_8BIT_XTCF_PIO8 343 dw IdePioBlock_ReadFrom16bitDataPort ; 7, DEVICE_8BIT_XTCF_PIO8_WITH_BIU_OFFLOAD 344 dw IdePioBlock_ReadFrom16bitDataPort ; 8, DEVICE_8BIT_XTCF_PIO16_WITH_BIU_OFFLOAD 345 dw IdeDmaBlock_ReadFromXTCF ; 9, DEVICE_8BIT_XTCF_DMA 345 346 %endif ; MODULE_8BIT_IDE_ADVANCED 346 347 %endif ; MODULE_8BIT_IDE … … 348 349 349 350 g_rgfnPioWrite: 350 dw IdePioBlock_WriteTo16bitDataPort ; 0, DEVICE_16BIT_ATA351 dw IdePioBlock_WriteTo16bitDataPort ; 0, DEVICE_16BIT_ATA 351 352 %ifdef MODULE_ADVANCED_ATA 352 dw IdePioBlock_WriteTo32bitDataPort ; 1, DEVICE_32BIT_ATA353 dw IdePioBlock_WriteTo32bitDataPort ; 1, DEVICE_32BIT_ATA 353 354 %elifdef MODULE_8BIT_IDE 354 355 dw NULL 355 356 %endif ; MODULE_ADVANCED_ATA 356 357 %ifdef MODULE_8BIT_IDE 357 dw IdePioBlock_WriteTo8bitDataPort ; 2, DEVICE_8BIT_ATA 358 dw IdePioBlock_WriteToXtideRev1 ; 3, DEVICE_8BIT_XTIDE_REV1 359 dw IdePioBlock_WriteToXtideRev2 ; 4, DEVICE_8BIT_XTIDE_REV2 358 dw IdePioBlock_WriteTo8bitDataPort ; 2, DEVICE_8BIT_ATA 359 dw IdePioBlock_WriteToXtideRev1 ; 3, DEVICE_8BIT_XTIDE_REV1 360 dw IdePioBlock_WriteToXtideRev2 ; 4, DEVICE_8BIT_XTIDE_REV2 361 dw IdePioBlock_WriteToXtideRev2 ; 5, DEVICE_8BIT_XTIDE_REV2_OLIVETTI 360 362 %ifdef MODULE_8BIT_IDE_ADVANCED 361 dw IdePioBlock_WriteTo8bitDataPort ; 5, DEVICE_8BIT_XTCF_PIO8362 dw IdePioBlock_WriteTo16bitDataPort ; 6, DEVICE_8BIT_XTCF_PIO8_WITH_BIU_OFFLOAD363 dw IdePioBlock_WriteTo16bitDataPort ; 7, DEVICE_8BIT_XTCF_PIO16_WITH_BIU_OFFLOAD364 dw IdeDmaBlock_WriteToXTCF ; 8, DEVICE_8BIT_XTCF_DMA363 dw IdePioBlock_WriteTo8bitDataPort ; 6, DEVICE_8BIT_XTCF_PIO8 364 dw IdePioBlock_WriteTo16bitDataPort ; 7, DEVICE_8BIT_XTCF_PIO8_WITH_BIU_OFFLOAD 365 dw IdePioBlock_WriteTo16bitDataPort ; 8, DEVICE_8BIT_XTCF_PIO16_WITH_BIU_OFFLOAD 366 dw IdeDmaBlock_WriteToXTCF ; 9, DEVICE_8BIT_XTCF_DMA 365 367 %endif ; MODULE_8BIT_IDE_ADVANCED 366 368 %endif ; MODULE_8BIT_IDE -
trunk/XTIDE_Universal_BIOS/Src/Device/IDE/JrIdeTransfer.asm
r592 r601 100 100 jc SHORT ReturnWithMemoryIOtransferErrorInAH 101 101 102 mov cx, [bp+MEMPIOVARS.wSectorsInBlock] ; Clears CH103 cmp [bp+MEMPIOVARS.bSectorsLeft], cl102 mov dx, [bp+MEMPIOVARS.wSectorsInBlock] ; Clears DH 103 cmp [bp+MEMPIOVARS.bSectorsLeft], dl 104 104 jbe SHORT .ReadLastBlockFromDrive 105 105 … … 119 119 ; transferred, there will be a wait for next block but DRQ is never 120 120 ; set since all is transferred! Then we get timeout error. 121 mov cx, [bp+MEMPIOVARS.wSectorsInBlock]122 sub [bp+MEMPIOVARS.bSectorsLeft], cl123 add [bp+MEMPIOVARS.bSectorsDone], cl124 cmp [bp+MEMPIOVARS.bSectorsLeft], cl121 mov dx, [bp+MEMPIOVARS.wSectorsInBlock] 122 sub [bp+MEMPIOVARS.bSectorsLeft], dl 123 add [bp+MEMPIOVARS.bSectorsDone], dl 124 cmp [bp+MEMPIOVARS.bSectorsLeft], dl 125 125 ja SHORT .ReadNextBlockFromDrive 126 126 127 127 ALIGN JUMP_ALIGN 128 128 .ReadLastBlockFromDrive: 129 mov cl, [bp+MEMPIOVARS.bSectorsLeft]130 push cx129 mov dl, [bp+MEMPIOVARS.bSectorsLeft] 130 push dx 131 131 call ReadSingleBlockFromSectorAccessWindowInDSSItoESDI 132 132 … … 181 181 jc SHORT ReturnWithMemoryIOtransferErrorInAH 182 182 183 mov cx, [bp+MEMPIOVARS.wSectorsInBlock]184 cmp [bp+MEMPIOVARS.bSectorsLeft], cl183 mov dx, [bp+MEMPIOVARS.wSectorsInBlock] 184 cmp [bp+MEMPIOVARS.bSectorsLeft], dl 185 185 jbe SHORT .WriteLastBlockToDrive 186 186 … … 192 192 193 193 ; Increment number of successfully written WORDs 194 mov cx, [bp+MEMPIOVARS.wSectorsInBlock]195 sub [bp+MEMPIOVARS.bSectorsLeft], cl196 add [bp+MEMPIOVARS.bSectorsDone], cl197 cmp [bp+MEMPIOVARS.bSectorsLeft], cl194 mov dx, [bp+MEMPIOVARS.wSectorsInBlock] 195 sub [bp+MEMPIOVARS.bSectorsLeft], dl 196 add [bp+MEMPIOVARS.bSectorsDone], dl 197 cmp [bp+MEMPIOVARS.bSectorsLeft], dl 198 198 ja SHORT .WriteNextBlockToDrive 199 199 200 200 ALIGN JUMP_ALIGN 201 201 .WriteLastBlockToDrive: 202 mov cl, [bp+MEMPIOVARS.bSectorsLeft]203 push cx202 mov dl, [bp+MEMPIOVARS.bSectorsLeft] 203 push dx 204 204 ePUSH_T bx, CheckErrorsAfterTransferringLastMemoryMappedBlock 205 205 ; Fall to WriteSingleBlockFromDSSIToSectorAccessWindowInESDI … … 208 208 ; WriteSingleBlockFromDSSIToSectorAccessWindowInESDI 209 209 ; Parameters: 210 ; CX: Number of sectors in block210 ; DX: Number of sectors in block 211 211 ; DS:SI: Normalized ptr to source buffer 212 212 ; ES:DI: Ptr to Sector Access Window … … 220 220 WriteSingleBlockFromDSSIToSectorAccessWindowInESDI: 221 221 mov bx, di 222 mov dx, cx223 222 xor cx, cx 224 223 ALIGN JUMP_ALIGN … … 235 234 ; ReadSingleBlockFromSectorAccessWindowInDSSItoESDI 236 235 ; Parameters: 237 ; CX Number of sectors in full block or sectors in last partialblock238 ; ES:DI: Normalized ptr to buffer to receive data (destination)239 ; DS:SI: Ptr to Sector Access Window (source)236 ; DX: Number of sectors in block 237 ; ES:DI: Normalized ptr to destination buffer 238 ; DS:SI: Ptr to Sector Access Window 240 239 ; Returns: 241 240 ; CX, DX: Zero … … 247 246 ReadSingleBlockFromSectorAccessWindowInDSSItoESDI: 248 247 mov bx, si 249 mov dx, cx250 248 xor cx, cx 251 249 ALIGN JUMP_ALIGN -
trunk/XTIDE_Universal_BIOS/Src/Device/Serial/SerialCommand.asm
r567 r601 43 43 ALIGN JUMP_ALIGN 44 44 SerialCommand_OutputWithParameters: 45 mov ah, SerialServer_Command_Read 46 mov al, [bp+IDEPACK.bCommand] 45 47 46 mov ah,SerialServer_Command_Read 47 48 mov al,[bp+IDEPACK.bCommand] 49 50 cmp al,20h ; Read Sectors IDE command 51 jz .readOrWrite 52 inc ah ; now SerialServer_Protocol_Write 53 cmp al,30h ; Write Sectors IDE command 54 jz .readOrWrite 48 cmp al, 20h ; Read Sectors IDE command 49 je SHORT .readOrWrite 50 inc ah ; now SerialServer_Protocol_Write 51 cmp al, 30h ; Write Sectors IDE command 52 je SHORT .readOrWrite 55 53 56 54 ; all other commands return success 57 55 ; including function 0ech which should return drive information, this is handled with the identify functions 58 56 ; 59 xor ah,ah; also clears carry60 57 xor ah, ah ; also clears carry 58 ret 61 59 62 60 .readOrWrite: 63 mov [bp+IDEPACK.bFeatures],ah ; store protocol command61 mov [bp+IDEPACK.bFeatures], ah ; store protocol command 64 62 %ifdef USE_AT 65 63 mov dh, [bp+IDEPACK.bSectorCount] 66 64 %endif 67 65 call IdeTransfer_NormalizePointerInESSI 68 66 %ifdef USE_AT 69 70 xor cx, cx; Nothing transferred71 72 67 jnc SHORT .PointerNormalizationWasSuccessful 68 xor cx, cx ; Nothing transferred 69 stc 70 ret 73 71 .PointerNormalizationWasSuccessful: 74 72 %endif 75 73 76 mov dx, [di+DPT_SERIAL.wSerialPortAndBaud] 77 74 mov dx, [di+DPT_SERIAL.wSerialPortAndBaud] 78 75 ; fall through to SerialCommand_FallThroughToSerialServer_SendReceive 79 76 80 77 ALIGN JUMP_ALIGN 81 78 SerialCommand_FallThroughToSerialServer_SendReceive: 82 83 79 ; fall through to SerialServer_SendReceive 84 85 80 %include "SerialServer.asm" 86 81 … … 93 88 ALIGN JUMP_ALIGN 94 89 SerialCommand_ReturnError: 95 96 90 stc 91 ret 97 92 98 93 ;-------------------------------------------------------------------- … … 155 150 ; master scan. 156 151 ; 157 mov dx,[cs:bp+IDEVARS.wSerialPortAndBaud]158 xor ax,ax152 mov dx, [cs:bp+IDEVARS.wSerialPortAndBaud] 153 xor ax, ax 159 154 160 161 162 155 push si 156 call FindDPT_ToDSDIforSerialDevice 157 pop si 163 158 %ifdef MODULE_SERIAL_FLOPPY 164 jnc.founddpt159 jnc SHORT .founddpt 165 160 ; 166 161 ; If not found above with FindDPT_ToDSDIforSerialDevice, DI will point to the DPT after the last hard disk DPT 167 162 ; So, if there was a previously found floppy disk, DI will point to that DPT and we use that value for the slave. 168 163 ; 169 cmp byte[RAMVARS.xlateVars+XLATEVARS.bFlopCntAndFirst], 0170 jz.notfounddpt164 cmp BYTE [RAMVARS.xlateVars+XLATEVARS.bFlopCntAndFirst], 0 165 je SHORT .notfounddpt 171 166 .founddpt: 172 167 %else 173 jc.notfounddpt168 jc SHORT .notfounddpt 174 169 %endif 175 170 mov ax, [di+DPT_SERIAL.wSerialPortAndBaud] 176 171 .notfounddpt: 172 test bh, FLG_DRVNHEAD_DRV 173 jz SHORT .master 177 174 178 test bh, FLG_DRVNHEAD_DRV 179 jz .master 180 181 test ax,ax ; Take care of the case that is different between master and slave. 182 jz SerialCommand_ReturnError 175 test ax, ax ; Take care of the case that is different between master and slave. 176 jz SHORT SerialCommand_ReturnError 183 177 184 178 ; fall-through 185 179 .master: 186 test dx,dx187 jnz.identifyDeviceInDX180 test dx, dx 181 jnz SHORT .identifyDeviceInDX 188 182 189 xchg dx, ax; move ax to dx (move previously found serial drive to dx, could be zero)183 xchg dx, ax ; move ax to dx (move previously found serial drive to dx, could be zero) 190 184 191 185 .identifyDeviceInDX: 192 193 186 ; fall through to SerialCommand_FallThroughToSerialServerScan_ScanForServer 194 187 195 188 ALIGN JUMP_ALIGN 196 189 SerialCommand_FallThroughToSerialServerScan_ScanForServer: 197 198 190 ; fall through to SerialServerScan_ScanForServer 199 200 191 %include "SerialServerScan.asm" 201 192 … … 206 197 %endif 207 198 208 -
trunk/XTIDE_Universal_BIOS/Src/Device/Serial/SerialDPT.asm
r567 r601 33 33 ;-------------------------------------------------------------------- 34 34 SerialDPT_Finalize: 35 36 35 mov ax, [es:si+SerialServer_ATA_wPortAndBaud] 36 mov [di+DPT_SERIAL.wSerialPortAndBaud], ax 37 37 38 38 ; … … 41 41 ; if the floppy support is disabled. 42 42 ; 43 mov al, [es:si+SerialServer_ATA_wDriveFlags] 44 eSHL_IM al, 1 45 mov byte [di+DPT.bFlagsHigh], al 46 47 ret 43 mov al, [es:si+SerialServer_ATA_wDriveFlags] 44 eSHL_IM al, 1 45 mov BYTE [di+DPT.bFlagsHigh], al 46 ret 48 47 49 48 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS
Note:
See TracChangeset
for help on using the changeset viewer.