Sender: nate AT cartsys DOT com Message-ID: <36140ECF.38CDBFE@cartsys.com> Date: Thu, 01 Oct 1998 16:22:55 -0700 From: Nate Eldredge X-Mailer: Mozilla 4.05 [en] (X11; I; Linux 2.0.35 i486) MIME-Version: 1.0 To: "Miles F. Bintz Ii" CC: djgpp AT delorie DOT com Subject: Re: Access phys. mem above 1 meg References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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