delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/06/21/04:18:52

From: wilsonl AT sfu DOT ca (Wilson Wang Shun Leung)
Newsgroups: comp.os.msdos.djgpp
Subject: "far" pointer question
Date: 14 Jun 1997 06:34:52 GMT
Organization: Simon Fraser University
Lines: 34
Message-ID: <5nte2c$e61$1@morgoth.sfu.ca>
NNTP-Posting-Host: fraser.sfu.ca
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hi there,
I am a newbie in protected mode programming and I am
currently writting some s/w for accessing a very 
high physical address (0xF8000000).  I followed the
FAQ which tells me to:
   allocate a LDT
   find the linear address from the physical one
   lock that linear address
   assign it to the segment base address of the LDT
   assign the limit of the LDT

These are all done in those dpmi.h wrapper functions.
But now my question is how I can convert the information
I have to a pointer which I can actually use for
read/write data.  What I now have is a selector (the
content that goes to segment register) and a offset of
zero.  Can I just use the real mode calculation like
this one:
   int *port;
   port = ((DWORD)selector) * 16  + offset

where DWORD is 32 bit wide and selector is 16 bit.

My specific questions are
  Is the pointer I defined (port) 32 bit wide?
  What if my offset is 32 bit wide? Then the above
  calculation should be all wrong. 

Am I missing something? 
Thanks. 

---
A Confused hardware designer

- Raw text -


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