Mail Archives: djgpp/1998/10/01/19:34:19
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 -