Xref: news2.mv.net comp.os.msdos.djgpp:3309 From: Charles Sandmann Newsgroups: comp.os.msdos.djgpp Subject: Re: Yet about MK_FP, pokeb, and peekb Date: Tue, 30 Apr 1996 09:51:26 CDT Organization: Rice University, Houston, Texas Lines: 21 Message-ID: <318628ee.sandmann@clio.rice.edu> References: Reply-To: sandmann AT clio DOT rice DOT edu NNTP-Posting-Host: clio.rice.edu To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp > Guys, sorry if I seem to insist at the same point (about > MK_FP). What I'd like to have is the facility of refering to a memory > position using a pointer, instead of a function (like dosmemput/get). On > the Borland version of a program of mine I had: > char far *screen = MK_FP(0xb800,0); 1) write a function MK_FP 2) have it include sys/nearptr.h 3) enable near pointers 4) Compute the "near" address from __djgpp_conventional_base + arg1*16 + arg2 5) return this value This might actually be a somewhat useful porting function to others. I have one someplace that was written just for the above porting reasons, but I can't access it for several weeks. > but I got a SIGSEGV singal at the execution of the mprotect > function. Sorry about my ignorance but why didn't it work ?! Don't mess with mprotect. It's there really only for making regions of memory read only or no-access.