From: Glen Miner Newsgroups: comp.os.msdos.djgpp Subject: Re: Memory Protection Date: Sat, 16 Nov 1996 09:31:24 -0500 (EST) Organization: Newbridge Networks Corporation Lines: 40 Message-ID: NNTP-Posting-Host: 138.120.136.238 Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII To: Bill Currie In-Reply-To: <328DC8F4.3C96@blackmagic.tait.co.nz> To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp > > > For further protection, you can create a segment that covers only the > > > video memory and use that instead. > > > > How would this be done? This would be ideal; if you could setup another > > segment (a 64k window to vidoe memory), and it would be "unprotected", > > then you could just use the movedata function with that segment's > > selector, right? > > Here is a code snipet to set up the video selector (it's part of my text > lib which I'm thinking of releasing soon as it seems to be pretty stable). > > ----------------------- > > unsigned short screenSelector; /* selector to use with the various _far* > and movedata functions*/ > > void TxSetupSelector() > { > static char selectorData[8]={ > 0xff,0xff,0x00,0x80, > 0x0b,0xf3,0x40,0x00 > }; > if (screenSelector) return; > screenSelector=__dpmi_allocate_ldt_descriptors(1); > if (__dpmi_set_descriptor(screenSelector,selectorData)<0) abort(); > /* ScreenContext.buffer.selector=screenSelector;*/ > } > > ------------------------- Hmm, how would this be better than the dosmemput/get functions? (Sorry, I'm a new to pmode and this whole selector buisness is confusing) Peace ===[ Gabo / [ABC] : gaminer AT undergrad DOT math DOT uwaterloo DOT ca ]=================== Latest ABC Shogi: http://www.undergrad.math.uwaterloo.ca/~gaminer/shogi.html "What Greenpeace spends in a year General Motors spends in four hours" -Moby