From: s2736173 AT techst02 DOT technion DOT ac DOT il (Ohad Somjen) Newsgroups: comp.os.msdos.djgpp Subject: Re: Porting Symantec code to DJGPP Date: Sat, 09 Aug 1997 05:19:44 GMT Organization: NetVision LTD. Lines: 53 Message-ID: <33ebfdee.348033@news.netvision.net.il> References: <33DC7784 DOT 2781 AT informatik DOT uni-bonn DOT de> NNTP-Posting-Host: ts004p13.pop8a.netvision.net.il Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk On Mon, 28 Jul 1997 12:42:13 +0200, Alexander von Luenen wrote: >structure, I'd need to know a 1:1 port. >The methods are (both Symantec code): > void AMem::GetPhysPtr(long addr) ^^^^ > { > static uchar *pAllLowMem; > if(pAllLowMem == NULL) > pAllLowMem=_x386_map_physical_adress(0, 0xFFFFF); ^^^^^^^^^^^ what are these numbers represent ??? do you think that there are psychs around here ??? the nearest hit is this: if (__djgpp_map_physical_memory(void *our_addr, unsigned long num_bytes, unsigned long phys_addr) cout << "Failed to map physical addresses!" << endl; or you can use: void * MK_FP (unsigned short seg, unsigned short ofs) { if ( !(_crt0_startup_flags & _CRT0_FLAG_NEARPTR) ) if (!__djgpp_nearptr_enable ()) return (void *)0; return (void *) (seg*16 + ofs + __djgpp_conventional_base); } from djgpp FAQ by Charles Sandmann. > return(pAllLowMem+addr); how can a function returning void return long ??? > } > > ushort AMem::MallocLow(ushort size) > { > union REGS regs; > regs.h.ah=0x48; > regs.x.bx=(size+15)>>4; > int86_real(0x21, ®s, ®s); int86(0x21, ®s, ®s); > return (regs.x.ax); > } get the djhlp201.zip and READ the documentation!!!