Changeset 152 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src
- Timestamp:
- May 1, 2011, 10:42:58 AM (14 years ago)
- google:author:
- aitotat
- Location:
- trunk/XTIDE_Universal_BIOS/Src
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Device/Device.asm
r150 r152 76 76 ALIGN JUMP_ALIGN 77 77 Device_OutputCommandWithParameters: 78 call IdeIrq_SetInServiceDPTandClearTaskFlag79 78 test WORD [di+DPT.wFlags], FLG_DPT_SERIAL_DEVICE 80 79 jnz SHORT .OutputCommandToSerialPort -
trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeCommand.asm
r150 r152 114 114 mov dl, DEVICE_CONTROL_REGISTER_out 115 115 mov al, [bp+IDEPACK.bDeviceControl] 116 test al, FLG_DEVCONTROL_nIEN 117 jnz SHORT .DoNotSetInterruptInServiceFlag 118 or WORD [di+DPT.wFlags], FLG_DPT_INTERRUPT_IN_SERVICE 119 push ds 120 LOAD_BDA_SEGMENT_TO ds, cx, ! ; Also zero CX 121 mov [BDA.bHDTaskFlg], al 122 pop ds 123 .DoNotSetInterruptInServiceFlag: 116 124 call Device_OutputALtoIdeControlBlockRegisterInDL 117 125 -
trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeIrq.asm
r150 r152 50 50 51 51 ;-------------------------------------------------------------------- 52 ; IdeIrq_SetInServiceDPTandClearTaskFlag53 ; Parameters:54 ; DS:DI: Ptr to DPT (in RAMVARS segment)55 ; Returns:56 ; Nothing57 ; Corrupts registers:58 ; AX59 ;--------------------------------------------------------------------60 ALIGN JUMP_ALIGN61 IdeIrq_SetInServiceDPTandClearTaskFlag:62 mov [RAMVARS.pInServiceDPT], di63 push ds64 LOAD_BDA_SEGMENT_TO ds, ax, ! ; Also zero AX65 mov [BDA.bHDTaskFlg], al66 pop ds67 ret68 69 70 ;--------------------------------------------------------------------71 52 ; IDE Interrupt Service Routines. 72 53 ; … … 86 67 call AcknowledgeIdeInterruptAndSetTaskFlag 87 68 88 mov al, C MD_END_OF_INTERRUPT69 mov al, COMMAND_END_OF_INTERRUPT 89 70 jmp SHORT AcknowledgeMasterInterruptController 90 71 … … 96 77 call AcknowledgeIdeInterruptAndSetTaskFlag 97 78 98 mov al, C MD_END_OF_INTERRUPT ; Load EOI command to AL99 out WPORT_8259SL_COMMAND, al ; Acknowledge Slave 825979 mov al, COMMAND_END_OF_INTERRUPT 80 out SLAVE_8259_COMMAND_out, al ; Acknowledge Slave 8259 100 81 AcknowledgeMasterInterruptController: 101 out WPORT_8259MA_COMMAND, al ; Acknowledge Master 825982 out MASTER_8259_COMMAND_out, al ; Acknowledge Master 8259 102 83 103 84 ; Issue Int 15h, function AX=9100h (Interrupt ready) … … 122 103 AcknowledgeIdeInterruptAndSetTaskFlag: 123 104 push ds 105 push si 124 106 push dx 125 107 push bx … … 127 109 ; Reading Status Register acknowledges IDE interrupt 128 110 call RamVars_GetSegmentToDS 129 mov di, [RAMVARS.pInServiceDPT] ; DS:DI now points to DPT111 call FindDPT_ToDSDIforInterruptInService 130 112 mov dl, STATUS_REGISTER_in 131 113 call Device_InputToALfromIdeRegisterInDL 114 115 ; Clear Interrupt In-Service Flag from DPT 116 and WORD [di+DPT.wFlags], ~FLG_DPT_INTERRUPT_IN_SERVICE 132 117 133 118 ; Set Task Flag … … 137 122 pop bx 138 123 pop dx 124 pop si 139 125 pop ds 140 126 ret -
trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm
r150 r152 213 213 214 214 ;-------------------------------------------------------------------- 215 ; DualByteRead Dual port 8-bit XTIDE PIO read transfer 216 ; WordRead Normal 16-bit IDE PIO read transfer 217 ; DWordRead VLB/PCI 32-bit IDE PIO read transfer 218 ; SingleByteRead Single port 8-bit PIO read transfer 215 ; DualByteReadForXtide Dual port 8-bit XTIDE PIO read transfer 216 ; SingleByteRead Single port 8-bit PIO read transfer 217 ; WordReadForXTIDEmod 8088/8086 compatible 16-bit IDE PIO read transfer 218 ; WordReadForXTplusAndAT Normal 16-bit IDE PIO read transfer 219 ; DWordRead VLB/PCI 32-bit IDE PIO read transfer 219 220 ; Parameters: 220 221 ; CX: Block size in WORDs … … 227 228 ;-------------------------------------------------------------------- 228 229 ALIGN JUMP_ALIGN 229 DualByteRead :230 times 2 shr cx, 1 231 mov bx, 8 230 DualByteReadForXtide: 231 times 2 shr cx, 1 ; Loop unrolling 232 mov bx, 8 ; Bit mask for toggling data low/high reg 232 233 ALIGN JUMP_ALIGN 233 234 .InswLoop: 234 eDUAL_BYTE_PORT_INSW235 eDUAL_BYTE_PORT_INSW236 eDUAL_BYTE_PORT_INSW237 eDUAL_BYTE_PORT_INSW235 XTIDE_INSW 236 XTIDE_INSW 237 XTIDE_INSW 238 XTIDE_INSW 238 239 loop .InswLoop 239 240 ret 240 241 241 ALIGN JUMP_ALIGN 242 WordRead: 243 rep 244 db 6Dh ; INSW 245 ret 246 247 ALIGN JUMP_ALIGN 248 DWordRead: 249 shr cx, 1 ; WORD count to DWORD count 250 rep 251 db 66h ; Override operand size to 32-bit 252 db 6Dh ; INSW/INSD 253 ret 254 242 ;---- 255 243 ALIGN JUMP_ALIGN 256 244 SingleByteRead: 257 245 %ifdef USE_186 ; INS instruction available 258 shl cx, 1 246 shl cx, 1 ; WORD count to BYTE count 259 247 rep insb 260 248 %else ; If 8088/8086 261 shr cx, 1 249 shr cx, 1 ; WORD count to DWORD count 262 250 ALIGN JUMP_ALIGN 263 251 .InsdLoop: 264 252 in al, dx 265 stosb 253 stosb ; Store to [ES:DI] 266 254 in al, dx 267 255 stosb … … 274 262 ret 275 263 276 277 ;-------------------------------------------------------------------- 278 ; DualByteWrite Dual port 8-bit XTIDE PIO write transfer 279 ; WordWrite Normal 16-bit IDE PIO write transfer 280 ; DWordWrite VLB/PCI 32-bit IDE PIO write transfer 281 ; SingleByteWrite Single port 8-bit PIO write transfer 264 ;---- 265 %ifndef USE_186 266 ALIGN JUMP_ALIGN 267 WordReadForXTIDEmod: 268 times 2 shr cx, 1 ; WORD count to QWORD count 269 ALIGN JUMP_ALIGN 270 .ReadNextQword: 271 in ax, dx ; Read 1st WORD 272 stosw ; Store 1st WORD to [ES:DI] 273 in ax, dx 274 stosw ; 2nd 275 in ax, dx 276 stosw ; 3rd 277 in ax, dx 278 stosw ; 4th 279 loop .ReadNextQword 280 ret 281 %endif 282 283 ;---- 284 ALIGN JUMP_ALIGN 285 WordReadForXTplusAndAT: 286 rep 287 db 6Dh ; INSW (we want this in XT build) 288 ret 289 290 ;---- 291 ALIGN JUMP_ALIGN 292 DWordRead: 293 shr cx, 1 ; WORD count to DWORD count 294 rep 295 db 66h ; Override operand size to 32-bit 296 db 6Dh ; INSW/INSD 297 ret 298 299 300 ;-------------------------------------------------------------------- 301 ; DualByteWriteForXtide Dual port 8-bit XTIDE PIO write transfer 302 ; SingleByteWrite Single port 8-bit PIO write transfer 303 ; WordWriteForXTIDEmod 8088/8086 compatible 16-bit IDE PIO read transfer 304 ; WordWrite Normal 16-bit IDE PIO write transfer 305 ; DWordWrite VLB/PCI 32-bit IDE PIO write transfer 282 306 ; Parameters: 283 307 ; CX: Block size in WORDs … … 290 314 ;-------------------------------------------------------------------- 291 315 ALIGN JUMP_ALIGN 292 DualByteWrite :316 DualByteWriteForXtide: 293 317 push ds 294 318 push bx 295 times 2 shr cx, 1 296 mov bx, 8 297 push es 298 pop ds 319 times 2 shr cx, 1 ; Loop unrolling 320 mov bx, 8 ; Bit mask for toggling data low/high reg 321 push es ; Copy ES... 322 pop ds ; ...to DS 299 323 ALIGN JUMP_ALIGN 300 324 .OutswLoop: 301 eDUAL_BYTE_PORT_OUTSW302 eDUAL_BYTE_PORT_OUTSW303 eDUAL_BYTE_PORT_OUTSW304 eDUAL_BYTE_PORT_OUTSW325 XTIDE_OUTSW 326 XTIDE_OUTSW 327 XTIDE_OUTSW 328 XTIDE_OUTSW 305 329 loop .OutswLoop 306 330 pop bx … … 308 332 ret 309 333 310 ALIGN JUMP_ALIGN 311 WordWrite: 312 eSEG es ; Source is ES segment 313 rep 314 db 6Fh ; OUTSW 315 ret 316 317 ALIGN JUMP_ALIGN 318 DWordWrite: 319 shr cx, 1 ; WORD count to DWORD count 320 eSEG es ; Source is ES segment 321 rep 322 db 66h ; Override operand size to 32-bit 323 db 6Fh ; OUTSW/OUTSD 324 ret 325 334 ;---- 326 335 ALIGN JUMP_ALIGN 327 336 SingleByteWrite: 328 337 %ifdef USE_186 ; OUTS instruction available 329 shl cx, 1 330 eSEG es 338 shl cx, 1 ; WORD count to BYTE count 339 eSEG es ; Source is ES segment 331 340 rep outsb 332 341 %else ; If 8088/8086 333 shr cx, 1 334 push ds 335 push es 336 pop ds 342 shr cx, 1 ; WORD count to DWORD count 343 push ds ; Store DS 344 push es ; Copy ES... 345 pop ds ; ...to DS 337 346 ALIGN JUMP_ALIGN 338 347 .OutsdLoop: 339 lodsb 348 lodsb ; Load from [DS:SI] to AL 340 349 out dx, al 341 350 lodsb … … 346 355 out dx, al 347 356 loop .OutsdLoop 348 pop ds ; Restore DS 349 %endif 350 ret 357 pop ds ; Restore DS 358 %endif 359 ret 360 361 ;--- 362 ALIGN JUMP_ALIGN 363 WordWriteForXTIDEmod: 364 push ds 365 times 2 shr cx, 1 ; Loop unrolling 366 push es ; Copy ES... 367 pop ds ; ...to DS 368 ALIGN JUMP_ALIGN 369 .WriteNextQword: 370 XTIDE_MOD_OUTSW 371 XTIDE_MOD_OUTSW 372 XTIDE_MOD_OUTSW 373 XTIDE_MOD_OUTSW 374 loop .WriteNextQword 375 pop ds 376 ret 377 378 ;---- 379 ALIGN JUMP_ALIGN 380 WordWrite: 381 eSEG es ; Source is ES segment 382 rep 383 db 6Fh ; OUTSW 384 ret 385 386 ALIGN JUMP_ALIGN 387 DWordWrite: 388 shr cx, 1 ; WORD count to DWORD count 389 eSEG es ; Source is ES segment 390 rep 391 db 66h ; Override operand size to 32-bit 392 db 6Fh ; OUTSW/OUTSD 393 ret 394 351 395 352 396 … … 354 398 ALIGN WORD_ALIGN 355 399 g_rgfnPioRead: 356 dw DualByteRead ; DEVICE_8BIT_DUAL_PORT_XTIDE 357 dw NULL ; DEVICE_XTIDE_WITH_REVERSED_A3_AND_A0 358 dw SingleByteRead ; DEVICE_8BIT_SINGLE_PORT 359 dw WordRead ; DEVICE_16BIT_ATA 360 dw DWordRead ; DEVICE_32BIT_ATA 400 dw DualByteReadForXtide ; DEVICE_8BIT_DUAL_PORT_XTIDE 401 %ifdef USE_186 402 dw WordReadForXTplusAndAT ; DEVICE_XTIDE_WITH_REVERSED_A3_AND_A0 403 %else 404 dw WordReadForXTIDEmod 405 %endif 406 dw SingleByteRead ; DEVICE_8BIT_SINGLE_PORT 407 dw WordReadForXTplusAndAT ; DEVICE_16BIT_ATA 408 dw DWordRead ; DEVICE_32BIT_ATA 409 361 410 g_rgfnPioWrite: 362 dw DualByteWrite 363 dw NULL; DEVICE_XTIDE_WITH_REVERSED_A3_AND_A0364 dw SingleByteWrite ; DEVICE_8BIT_SINGLE_PORT365 dw WordWrite ; DEVICE_16BIT_ATA366 dw DWordWrite ; DEVICE_32BIT_ATA411 dw DualByteWriteForXtide ; DEVICE_8BIT_DUAL_PORT_XTIDE 412 dw WordWriteForXTIDEmod ; DEVICE_XTIDE_WITH_REVERSED_A3_AND_A0 413 dw SingleByteWrite ; DEVICE_8BIT_SINGLE_PORT 414 dw WordWrite ; DEVICE_16BIT_ATA 415 dw DWordWrite ; DEVICE_32BIT_ATA -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH0h_HReset.asm
r150 r152 161 161 xor bx, bx 162 162 call FindDPT_ForDriveNumber 163 jnc SHORT .DptNotFound164 163 mov bl, [di+DPT.bIdevarsOffset] 165 164 mov bx, [cs:bx+IDEVARS.wPort] 166 .DptNotFound:167 165 xchg bx, cx 168 166 ret -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19hLate.asm
r90 r152 16 16 ALIGN JUMP_ALIGN 17 17 Int19hLate_InitializeInt19h: 18 mov bx, INTV_BOOTSTRAP18 mov bx, BIOS_BOOT_LOADER_INTERRUPT_19h 19 19 mov si, HandlerForLateInitialization 20 20 jmp Interrupts_InstallHandlerToVectorInBXFromCSSI … … 31 31 HandlerForLateInitialization: 32 32 LOAD_BDA_SEGMENT_TO es, ax 33 call Initialize_ShouldSkip ; Skip initialization?33 call Initialize_ShouldSkip ; Skip initialization? 34 34 jnz SHORT .SkipInitialization 35 call Initialize_AndDetectDrives ; Installs boot menu loader36 int INTV_BOOTSTRAP35 call Initialize_AndDetectDrives ; Installs boot menu loader 36 int BIOS_BOOT_LOADER_INTERRUPT_19h 37 37 .SkipInitialization: 38 call RamVars_Initialize ; RAMVARS must be initialized even for simple boot loader39 int INTV_BOOTSTRAP; Call default system boot loader38 call RamVars_Initialize ; RAMVARS must be initialized even for simple boot loader 39 int BIOS_BOOT_LOADER_INTERRUPT_19h ; Call default system boot loader -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19hMenu.asm
r143 r152 85 85 SWITCH_BACK_TO_POST_STACK 86 86 call ClearSegmentsForBoot 87 int INTV_BOOT_FAILURE; Never returns87 int BIOS_BOOT_FAILURE_INTERRUPT_18h ; Never returns 88 88 89 89 -
trunk/XTIDE_Universal_BIOS/Src/Initialization/FloppyDrive.asm
r124 r152 19 19 ;-------------------------------------------------------------------- 20 20 FloppyDrive_IsInt40hInstalled: 21 cmp WORD [es: INTV_FLOPPY_FUNC*4+2], 0C000h ; Any ROM segment?21 cmp WORD [es:BIOS_DISKETTE_INTERRUPT_40h*4+2], 0C000h ; Any ROM segment? 22 22 %ifdef USE_AT ; No need to verify on XT systems. 23 23 jb SHORT .Int40hHandlerIsNotInstalled … … 45 45 46 46 call .LoadInt40hVerifyParameters 47 int INTV_DISK_FUNC47 int BIOS_DISK_INTERRUPT_13h 48 48 jc SHORT .Int40hIsInstalled ; Maybe there are not any floppy drives at all 49 49 push es … … 51 51 52 52 call .LoadInt40hVerifyParameters 53 int INTV_FLOPPY_FUNC53 int BIOS_DISKETTE_INTERRUPT_40h 54 54 55 55 pop dx … … 113 113 mov ah, 08h ; Get Drive Parameters 114 114 xor bx, bx ; FLOPPY_TYPE_525_OR_35_DD when function not supported 115 int INTV_FLOPPY_FUNC115 int BIOS_DISKETTE_INTERRUPT_40h 116 116 ret 117 117 … … 167 167 mov ah, 08h ; Get Drive Parameters 168 168 cwd ; Floppy Drive 00h 169 int INTV_FLOPPY_FUNC169 int BIOS_DISKETTE_INTERRUPT_40h 170 170 mov cl, dl ; Number of Floppy Drives to CL 171 171 -
trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm
r150 r152 89 89 .StoreDptPointersToIntVectors: 90 90 mov dl, 80h 91 call RamVars_IsDriveHandledByThisBIOS 92 jnc SHORT .FindForDrive81h ; Store nothing if not our drive 91 93 call FindDPT_ForDriveNumber ; DPT to DS:DI 92 jnc SHORT .FindForDrive81h ; Store nothing if not our drive 93 mov [es:INTV_HD0DPT*4], di 94 mov [es:INTV_HD0DPT*4+2], ds 94 mov [es:HD0_DPT_POINTER_41h*4], di 95 mov [es:HD0_DPT_POINTER_41h*4+2], ds 95 96 .FindForDrive81h: 96 97 inc dx 98 call RamVars_IsDriveHandledByThisBIOS 99 jnc SHORT .ResetDetectedDrives 97 100 call FindDPT_ForDriveNumber 98 jnc SHORT .ResetDetectedDrives 99 mov [es:INTV_HD1DPT*4], di 100 mov [es:INTV_HD1DPT*4+2], ds 101 mov [es:HD1_DPT_POINTER_46h*4], di 102 mov [es:HD1_DPT_POINTER_46h*4+2], ds 101 103 ; Fall to .ResetDetectedDrives 102 104 -
trunk/XTIDE_Universal_BIOS/Src/Initialization/Interrupts.asm
r150 r152 29 29 ;-------------------------------------------------------------------- 30 30 .InitializeInt13hAnd40h: 31 mov ax, [es: INTV_DISK_FUNC*4]; Load old INT 13h offset32 mov dx, [es: INTV_DISK_FUNC*4+2]; Load old INT 13h segment31 mov ax, [es:BIOS_DISK_INTERRUPT_13h*4] ; Load old INT 13h offset 32 mov dx, [es:BIOS_DISK_INTERRUPT_13h*4+2]; Load old INT 13h segment 33 33 mov [RAMVARS.fpOldI13h], ax ; Store old INT 13h offset 34 34 mov [RAMVARS.fpOldI13h+2], dx ; Store old INT 13h segment 35 mov bx, INTV_DISK_FUNC; INT 13h interrupt vector offset35 mov bx, BIOS_DISK_INTERRUPT_13h ; INT 13h interrupt vector offset 36 36 mov si, Int13h_DiskFunctionsHandler ; Interrupt handler offset 37 37 call Interrupts_InstallHandlerToVectorInBXFromCSSI … … 42 42 call FloppyDrive_IsInt40hInstalled 43 43 jc SHORT .InitializeInt19h 44 mov [es: INTV_FLOPPY_FUNC*4], ax ; Store old INT 13h offset45 mov [es: INTV_FLOPPY_FUNC*4+2], dx ; Store old INT 13h segment44 mov [es:BIOS_DISKETTE_INTERRUPT_40h*4], ax ; Store old INT 13h offset 45 mov [es:BIOS_DISKETTE_INTERRUPT_40h*4+2], dx ; Store old INT 13h segment 46 46 ; Fall to .InitializeInt19h 47 47 … … 57 57 ;-------------------------------------------------------------------- 58 58 .InitializeInt19h: 59 mov bx, INTV_BOOTSTRAP59 mov bx, BIOS_BOOT_LOADER_INTERRUPT_19h 60 60 mov si, Int19hMenu_BootLoader 61 61 call Interrupts_InstallHandlerToVectorInBXFromCSSI … … 110 110 ;-------------------------------------------------------------------- 111 111 .InstallHighIrqHandler: 112 add bx, BYTE INTV_IRQ8 - 8; Interrupt vector number112 add bx, BYTE HARDWARE_IRQ_8_INTERRUPT_70h - 8 ; Interrupt vector number 113 113 mov si, IdeIrq_InterruptServiceRoutineForIrqs8to15 114 114 jmp SHORT Interrupts_InstallHandlerToVectorInBXFromCSSI … … 125 125 ;-------------------------------------------------------------------- 126 126 .InstallLowIrqHandler: 127 add bx, BYTE INTV_IRQ0; Interrupt vector number127 add bx, BYTE HARDWARE_IRQ_0_INTERRUPT_08h ; Interrupt vector number 128 128 mov si, IdeIrq_InterruptServiceRoutineForIrqs2to7 129 129 ; Fall to Interrupts_InstallHandlerToVectorInBXFromCSSI … … 177 177 .UnmaskHighIrqController: 178 178 sub al, 8 ; Slave interrupt number 179 mov dx, PORT_8259SL_IMR ; Load Slave Mask Register address179 mov dx, SLAVE_8259_IMR 180 180 call .ClearBitFrom8259MaskRegister 181 181 mov al, 2 ; Master IRQ 2 to allow slave IRQs … … 192 192 ;-------------------------------------------------------------------- 193 193 .UnmaskLowIrqController: 194 mov dx, PORT_8259MA_IMR ; Load Mask Register address194 mov dx, MASTER_8259_IMR 195 195 ; Fall to .ClearBitFrom8259MaskRegister 196 196 -
trunk/XTIDE_Universal_BIOS/Src/Main.asm
r150 r152 15 15 ; Included .inc files 16 16 %include "AssemblyLibrary.inc" ; Assembly Library. Must be included first! 17 %include "Int errupts.inc" ; For interruptequates17 %include "IntController.inc" ; For Interrupt Controller equates 18 18 %include "ATA_ID.inc" ; For ATA Drive Information structs 19 19 %include "IdeRegisters.inc" ; For ATA Registers, flags and commands -
trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/FindDPT.asm
r150 r152 71 71 ALIGN JUMP_ALIGN 72 72 FindDPT_ToDSDIForIdeMasterAtPortDX: 73 mov si, FindDPT_IterateToMasterAtPortCallback73 mov si, IterateToMasterAtPortCallback 74 74 jmp SHORT IterateAllDPTs 75 75 76 76 ALIGN JUMP_ALIGN 77 77 FindDPT_ToDSDIForIdeSlaveAtPortDX: 78 mov si, FindDPT_IterateToSlaveAtPortCallback78 mov si, IterateToSlaveAtPortCallback 79 79 jmp SHORT IterateAllDPTs 80 80 … … 83 83 ; IDE base port for Master or Slave drive. 84 84 ; 85 ; FindDPT_IterateToSlaveAtPortCallback86 ; FindDPT_IterateToMasterAtPortCallback85 ; IterateToSlaveAtPortCallback 86 ; IterateToMasterAtPortCallback 87 87 ; Parameters: 88 88 ; CH: Drive number … … 97 97 ;-------------------------------------------------------------------- 98 98 ALIGN JUMP_ALIGN 99 FindDPT_IterateToSlaveAtPortCallback:99 IterateToSlaveAtPortCallback: 100 100 test BYTE [di+DPT.wFlags], FLG_DPT_SLAVE ; Clears CF 101 101 jnz SHORT CompareBasePortAddress … … 103 103 104 104 ALIGN JUMP_ALIGN 105 FindDPT_IterateToMasterAtPortCallback:105 IterateToMasterAtPortCallback: 106 106 test BYTE [di+DPT.wFlags], FLG_DPT_SLAVE 107 107 jnz SHORT ReturnWrongDPT ; Return if slave drive … … 116 116 stc ; Set CF since wanted DPT 117 117 ret 118 119 120 ;-------------------------------------------------------------------- 121 ; FindDPT_ToDSDIforInterruptInService 122 ; Parameters: 123 ; DS: RAMVARS segment 124 ; Returns: 125 ; DS:DI: Ptr to DPT 126 ; CF: Set if wanted DPT found 127 ; Cleared if DPT not found 128 ; Corrupts registers: 129 ; SI 130 ;-------------------------------------------------------------------- 131 ALIGN JUMP_ALIGN 132 FindDPT_ToDSDIforInterruptInService: 133 mov si, IterateToDptWithInterruptInServiceFlagSet 134 jmp SHORT IterateAllDPTs 135 136 ;-------------------------------------------------------------------- 137 ; IterateToDptWithInterruptInServiceFlagSet 138 ; Parameters: 139 ; DS:DI: Ptr to DPT to examine 140 ; Returns: 141 ; CF: Set if wanted DPT found 142 ; Cleared if wrong DPT 143 ; Corrupts registers: 144 ; Nothing 145 ;-------------------------------------------------------------------- 146 ALIGN JUMP_ALIGN 147 IterateToDptWithInterruptInServiceFlagSet: 148 test WORD [di+DPT.wFlags], FLG_DPT_INTERRUPT_IN_SERVICE 149 jz SHORT ReturnWrongDPT 150 stc ; Set CF since wanted DPT 151 ret 118 152 ReturnWrongDPT: 119 clc 153 clc ; Clear CF since wrong DPT 120 154 ret 121 155 … … 126 160 ; IterateAllDPTs 127 161 ; Parameters: 128 ; BX,DX: Parameters to callback function129 ; CS:SI: Ptr to callback function130 ; DS: RAMVARS segment162 ; AX,BX,DX: Parameters to callback function 163 ; CS:SI: Ptr to callback function 164 ; DS: RAMVARS segment 131 165 ; Returns: 132 ; DS:DI: Ptr to wanted DPT (if found)133 ; CF: Set if wanted DPT found134 ; Cleared if DPT not found166 ; DS:DI: Ptr to wanted DPT (if found) 167 ; CF: Set if wanted DPT found 168 ; Cleared if DPT not found 135 169 ; Corrupts registers: 136 170 ; Nothing unless corrupted by callback function … … 141 175 mov cx, [RAMVARS.wDrvCntAndFirst] 142 176 jcxz .AllDptsIterated ; Return if no drives 143 call FindDPT_PointToFirstDPT; Point DS:DI to first DPT177 mov di, RAMVARS_size ; Point DS:DI to first DPT 144 178 ALIGN JUMP_ALIGN 145 179 .LoopWhileDPTsLeft: … … 155 189 pop cx 156 190 ret 157 158 159 ;--------------------------------------------------------------------160 ; Sets DI to point to first Disk Parameter Table.161 ;162 ; FindDPT_PointToFirstDPT163 ; Parameters:164 ; Nothing165 ; Returns:166 ; DI: Offset to first DPT (even if unused)167 ; Corrupts registers:168 ; Nothing169 ;--------------------------------------------------------------------170 ALIGN JUMP_ALIGN171 FindDPT_PointToFirstDPT:172 mov di, RAMVARS_size173 ret
Note:
See TracChangeset
for help on using the changeset viewer.