Path: utzoo!utgpu!water!watmath!clyde!rutgers!ames!amdahl!dlb!plx!slvblc!dick From: dick@slvblc.UUCP (Dick Flanagan) Newsgroups: comp.sys.ibm.pc,att.sys.pc6300 Subject: Re: DMA BOUNDARY Summary: The track buffer cannot cross a PHYSICAL 64K boundary Keywords: BIOS Message-ID: <343@slvblc.UUCP> Date: 31 Jan 88 00:17:20 GMT References: <1236@mtuxo.UUCP> Sender: uupc@slvblc.UUCP Reply-To: dick@slvblc.UUCP (Dick Flanagan) Organization: SLV Systems Group, Ben Lomond, CA Lines: 36 Disclaimer: none In article <1236@mtuxo.UUCP> rayii@mtuxo.UUCP (XMRJ4-R.HAYES) writes: > I am currently writing a program that uses interrupt 13h function 05h. > format track. At home i use a IBM PC/XT. After coding the proper values > for all the registers and executing the program everything works fine. > BUT when i execute the same code on pc6300 (at work) i receive an error > 09h DMA BOUNDARY ERROR OCCURRED DATA DOES NOT RESIDE ON 64K BYTE DMA AREA The track buffer you are writing to/from must not cross a *PHYSICAL* 64Kb boundary within the 20-bit address space. Because the pc6300 has a different resident environment (smaller/larger OS, more/fewer BUFFERS, etc), your program's buffer happened to fall across one of those boundaries when it was loaded on that particular machine. One solution is to dynamically allocate (e.g., malloc()) the buffer and then test to see if it crosses a 20-bit 64Kb boundary. If it does, calculate where that boundary is within the buffer, and then how much larger the buffer would have to be if your I/O buffer were to start AT that 64Kb boundary. Finally, release the buffer you just allocated and allocate another one the size you just calculated would be large enough--taking care to adjust your I/O buffer to start AT the physical 64Kb boundary, not somewhere in front of it. In a static, single-user system like DOS, this should be sufficient. In a system where the memory you get from an allocation may not be the most recent memory you released, the test would need to be repeated and/or refined. Good luck--and welcome to the world of the classic "Gotcha's!" Dick -- Dick Flanagan, W6OLD GEnie: FLANAGAN UUCP: ...!sun!plx!slvblc!dick Voice: +1 408 336 3481 USPO: PO Box 155, Ben Lomond, CA 95005 LORAN: N37 05.5 W122 05.2 --