From: Tim Updegrove Newsgroups: comp.os.msdos.djgpp Subject: Allocating DOS memory in Windows Date: Wed, 03 Nov 1999 10:59:34 -0500 Organization: Lucent Technologies Lines: 25 Message-ID: <38205BE6.B7CF872B@lucent.com> NNTP-Posting-Host: pai830tupdegrove.micro.lucent.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.61 [en] (Win95; I) X-Accept-Language: en To: djgpp AT Delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com This is a followup to a question on 10/15/99. I'm trying to get a program which allocates DOS memory for a DMA buffer to work when booting to MS-DOS and also work in a MS-DOS box under Windows 98. I can get each to work in a separate program but I'm hoping to find a solution that works both places in a single program. Here are the steps that I've found to work. Booting to MS-DOS: 1. Allocate DOS memory and use the returned segment*16 for the physical DMA address and use the returned selector with _farpeekl and _farpookl. In a MS-DOS box with Windows 98: 1. Allocate DOS memory and use the returned segment*16 for the physical DMA address. 2.Pass segment*16 into __dpmi_physical_address_mapping to obtain a linear address. 3. Create a segment selector with __dpmi_allocate_ldt_descriptors. The returned selector is used with _farpeekl and _farpookl. 4. Initialize the segment's base address & size with __dpmi_set_segment_base_address using the selector from step 3. 5. Initialize the segment's limit with __dpmi_set_segment_limit using the selector from step 3. Any help would be much appreciated.