delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/09/29/12:22:07

From: broeker AT acp3bf DOT knirsch DOT de (Hans-Bernhard Broeker)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: problem with far pointers
Date: 29 Sep 1999 13:17:14 +0200
Organization: RWTH Aachen, III. physikalisches Institut B
Lines: 30
Message-ID: <7sssfq$rds@acp3bf.knirsch.de>
References: <7ssgdl$pg AT cs DOT vu DOT nl>
NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de
X-Trace: nets3.rz.RWTH-Aachen.DE 938603839 9142 137.226.32.75 (29 Sep 1999 11:17:19 GMT)
X-Complaints-To: abuse AT rwth-aachen DOT de
NNTP-Posting-Date: 29 Sep 1999 11:17:19 GMT
X-Newsreader: TIN [version 1.2 PL2]
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

FokkemaDBRA wrote:
> Hi there!

> I'm new to djgpp and I'm trying to port my os (it's not finished yet) to c.
> Well, I have a problem. I built a selector for the video memory and want to
> write to the screen using this selector. How do I tell djgpp that I want to
> use that specific selector? I tried using a far pointer, but was unable to
> code something like:
> 	int far *pointer;

There is no such thing as a 'far pointer' in DJGPP. But there are specialised
functions (inline assembly, so they should be fast enough for just about
every application you can come up with), conveniently called the 'far pointer
functions'. Look up

	farpokeb()
	farpeekb()
	movedata()

and their friends in the libc documentation.

The one thing you won't get using these functions is use of the
'standard' syntax, like 'video_mem[position] = content;'. If you
insist on that, you must effectively disable memory protection using
the 'near pointer method'.

See the FAQ for more details about all of this.
-- 
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019