X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: "Rod Pemberton" Newsgroups: comp.os.msdos.djgpp Subject: Re: Mmap() and modify_ldt() in DOS Date: Mon, 11 Mar 2013 04:27:17 -0400 Organization: Aioe.org NNTP Server Lines: 42 Message-ID: References: <858e8912-407b-4b7b-843a-8dff31d35068 AT googlegroups DOT com> NNTP-Posting-Host: CNsg4fVcCsvs3UaOgZtQCw.user.speranza.aioe.org X-Complaints-To: abuse AT aioe DOT org X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.2001 X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: Microsoft Outlook Express 6.00.2800.2001 X-Priority: 3 X-MSMail-Priority: Normal Bytes: 2601 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "Napoleon80386" wrote in message news:858e8912-407b-4b7b-843a-8dff31d35068 AT googlegroups DOT com... > I guess that problem is mmap() and modify_ldt(), [...] > They wrote that it is nesessary to implement mmap() and ldt. I don't know whether implementing mmap() for DJGPP is easy or difficult. Whether mmap() is actually necessary or not for porting WINE to DOS depends on what they used mmap() to do. Robert Riebisch and I both came up with solutions to replace mmap() in DOS port's of the dmidecode application. However, dmidecode didn't use most of mmap()'s functionality. I do know that I replaced the use of mmap() in a personal port of the dmidecode application's memory allocation routine with compiler specific code for both DJGPP and OpenWatcom. I did that using nearptr's for DJGPP. The DJGPP routine used malloc(), memcpy(), __dpmi_get_segment_base_address(), _my_cs(), and __djgpp_nearptr_enable(). OpenWatcom just needed malloc() and memcpy(). As mentioned in the post to your friend, Robert Riebisch also came up with a different solution for dmidecode. Robert created a filesystem for DJGPP called "/dev/mem". That should allow you to open, read, write, or close memory as if it's a regular text or binary file. In general, I'd think that functionality is about the closest thing to mmap() for DJGPP. His solution is in his port of dmidecode on his webpage. The link is in the other post. Of course, Robert's "dev/mem" is a DJGPP only solution. It won't work with EMX. So, you might first determine what they use mmap() to do. Are they using an mmap() only feature or not? Or, can the functionality be replaced with standard C functions? Or, can compiler specific C functions replace the use of mmap()? Rod Pemberton