delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/10/01/19:34:19

Sender: nate AT cartsys DOT com
Message-ID: <36140ECF.38CDBFE@cartsys.com>
Date: Thu, 01 Oct 1998 16:22:55 -0700
From: Nate Eldredge <nate AT cartsys DOT com>
X-Mailer: Mozilla 4.05 [en] (X11; I; Linux 2.0.35 i486)
MIME-Version: 1.0
To: "Miles F. Bintz Ii" <bintzimf AT clarkson DOT edu>
CC: djgpp AT delorie DOT com
Subject: Re: Access phys. mem above 1 meg
References: <Pine DOT A41 DOT 3 DOT 96 DOT 981001110642 DOT 79082A-100000 AT polaris DOT clarkson DOT edu>

Miles F. Bintz Ii wrote:
> 
> I've read the FAQs but I still seem to be missing a piece of
> information...
> 
> I want to access physical address 0xDA000000.
> 
> I do the following:

[snip]

> And so now I have a selector to my physical address at DA000000 right?
> Well, what do I do with a selector?  I don't want to use the near/far ptr
> hacks.

You have to; they're the only ways (from C) to access memory outside
your data segment.  IMHO, _far* and movedata are not all *that*
painful.  Otherwise, you can write an assembler routine, load the
selector into a segment register of your choice, and use segment
overrides to your instructions as needed.
 
> I would like to be able to say
> 
>  char *myptr = 0xda000000
>  myptr[0] = 0xab;
> 
> for example.

Well, you can't.

> If I cant do what I stated above, can someone explain what happens
> "behind the scenes" for a piece of data to get out to memory via a
> selector?

It works the same as with any other memory reference; the standard DS
segment is accessed the same as the rest.  It's a fairly complicated
process that I quite frankly don't feel like explaining right now; read
a book or online document about an x86 processor.

> Performance will be an issue futher down the road so I would like the
> knowledge on how everything is working here in case I need to optimize
> something.....

`movedata' is about as fast as you're likely to get for block moves, and
the `_farns' stuff could work well if you need to peek/poke individual
bytes/words.
-- 

Nate Eldredge
nate AT cartsys DOT com

- Raw text -


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