• Please review our updated Terms and Rules here

IDE Transfer DMA Code

Hi Chuck, I'm yet to find a CF card that reports block mode of more than 1 sector?

Thanks for the link - I've not come across a card with an SST controller, but even then the multi-sector mode is only 2 sectors: "SST’s CompactFlash card can support up to 2 sectors for Read Multiple or Write Multiple Commands."
 
Last edited:
It doesn't bother the soundblaster running at 22kHz anyway.

Remember that most Sound Blasters can go to 45454Hz. So 22Khz might not be a problem, but maybe 2x speed might? Just throwing it out there...

EDIT: Never mind, I read later the success you had driving all four channels at once, excellent work!
 
Thanks and that's true, but channel 2 on that test was only running the floppy at about 15KB/s!

As each 16 byte transfer takes approx. 1/50,000 of a second I guess there could be some audible distortion due to sample period skew with 44kHz audio. But anyway, the user can switch between IO-port mapped, memory-mapped, or DMA on-the-fly so it's reasonably flexible :)
 
Thanks, funny thing is that bit is quite simple, I just changed the config register on the card to be read/write, so the configuration utility just updates it and the BIOS checks it:

Code:
	; use config register to see what we're doing:
	; 0 = not set; use word-length port-IO
	; < A0 = DMA via ch.3 (and CF card must already be in byte mode)
	; > A0 = mem-mapped IO (word-length)
	; 
	
	push		dx		; we need dx later
	
	or		dl, 0x0f	; XT-CF board control register address (base + 0fh)
	in		al, dx		; get control register
	cmp		al, 0xA0	; test al against 0xA0:
	jae	.MemMapIO		; - use memory-mapped IO if >=A0h
	cmp		al, 0		; test al against 0:
	jz	.PortIO			; - use port-based IO (the default) if it was zero
					; otherwise, 0 < al < A0h, so fall to DMA mode

Some coding left to do on that - for DMA to work the utility must also switch the media to 8-bit transfer mode, so the BIOS media reset function needs to check that too (and reinstate it after a reset). But it's just a hobby, so it takes time :)
 
Last edited:
Back
Top