From: James Deuchar Newsgroups: comp.os.msdos.djgpp Subject: Using Vitual DMA Services...help ! Date: 1 Feb 1999 15:50:16 GMT Organization: University of Durham, Durham, UK. Lines: 60 Message-ID: <01be4dfb$0d10fde0$f2cfea81@secom144.dur.ac.uk> NNTP-Posting-Host: secs246.dur.ac.uk X-Newsreader: Microsoft Internet News 4.70.1161 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Help.....! I'm still trying to get my DMA to work so I need to get the actual phy mem address. The VDS method is preferable to copying data into a buffer below the 1M mark and dmaing that because speed is a factor. What's wrong with my code (or right with it)........I always get some sort of error code back...often in reserved registers...please help! struct DMA_DESCR_STR { DWORD size; DWORD offset; WORD segsel; WORD buffID; DWORD phy_addr; }; DWORD get_phy_addr( DWORD offset_addr, DWORD size ) { DWORD dds_addr; struct DMA_DESCR_STR dds; __dpmi_regs InRegs; //check for VDS at bit 5 of mem 0x0040:007b ---- HOW CAN I CHECK THIS BIT???? dds.size = size; dds.segsel = (WORD)_my_ds(); //returns an int dds.offset = offset_addr ; // lock dma region - Clear register structure */ memset( &InRegs, 0, sizeof( __dpmi_regs ) ); InRegs.h.ah = 0x81 ; InRegs.h.al = 0x03 ; //specifies VDS lock dma region InRegs.x.dx = 0x3c ; // do remap and don't allocate buffer dds_addr = (DWORD)&dds; InRegs.x.es =(WORD)(dds_addr >> 16); // upper 16 bits InRegs.x.di = (WORD)((DWORD)0xffff & dds_addr); // lower 16 bits if ((__dpmi_int (0x4b, &InRegs)) == -1) { printf("get_phy_addr : dpmi_int error..."); return 0; } if (InRegs.x.flags & 1) { /* is carry flag set? */ printf("\nget_phy_addr - Call to VDS lock dma region failed...\n"); printf("Error Code AL = %x\n",InRegs.h.al); return ( FALSE ); } else { return dds.phy_addr; } } Thanks!!! -- J DOT A DOT Deuchar AT dur DOT ac DOT uk Dept. of Engineering Durham University United Kingdom