Date: Sun, 7 Nov 1999 17:10:32 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Tim Updegrove cc: djgpp AT delorie DOT com Subject: Re: Allocating DOS memory in Windows In-Reply-To: <38221076.966C6FFD@lucent.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Thu, 4 Nov 1999, Tim Updegrove wrote: > As I indicated below, just allocating DOS memory (and passing the segment to > the DMA hardware and using the selector in the program) works fine when > booting into MS-DOS. The DMA hardware fetches the correct info. However, > running the same exact executable in a MS-DOS box under Windows, the DMA > hardware doesn't fetch the correct info in memory which was first written by > the program. The DMA hardware fetches the same address in both cases but, > under Windows, the data that the program wrote isn't present (but is present > when booting to MS-DOS). Perhaps you didn't program the DMA controller correctly. Windows usually works behind the scenes to make DMA work as if you were running on DOS. > That is, the selector returned from allocating DOS memory under > Windows doesn't appear to point to the same data as the returned segment. Please explain this in more detail. How exactly did you arrive at the conclusion that the selector and the segment don't point to the same memory? > As indicated below, steps 2-5 work with Windows (but don't work when booting > to MS-DOS because the memory is already mapped) but I would like one > solution to work in both environments. I think this is due to some bug. But even if not, it should be easy to find out from within the running program whether you run on Windows, and employ the appropriate solution.