www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/20/10:49:50

From: nanotech AT hitel DOT kol DOT co DOT kr ()
Newsgroups: comp.os.msdos.djgpp
Subject: How can I access absolute address above 1MB?
Date: 19 Feb 1997 03:31:57 GMT
Organization: Korea PC Telecom Co.,Ltd.
Lines: 33
Message-ID: <5eds7d$d4t@news2.kol.co.kr>
NNTP-Posting-Host: hitel.kol.co.kr
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

I saw the following article in jdgpp's faq But I don't know how to do
that. 

Please show me a simple source code. 

Thanks. 

----------------------------------------------------------------------
18.7 Accessing absolute address above 1MB
=========================================

**Q*: How can I access memory-mapped peripheral devices (or any other
absolute address) above 1 MByte mark?*

*A* :  You should use DPMI functions to allocate an LDT descriptor, and
map it to an absolute physical address.  You can then use the functions
from <sys/farptr.h> to access that linear address.  These are the DPMI
calls that you will have to use: 

   - allocate an LDT descriptor (Int 31h/AX=0); 

   - map selector to physical address (Int 31h/AX=0800h); 

   - lock linear address (Int 31h/AX=0600h); 

   - set segment base address (Int 31h/AX=7); 

   - set segment limit (Int 31h/AX=8). 

All of these DPMI calls have `__dpmi__XXX' wrappers in the DJGPP library. 
----------------------------------------------------------------------

- Raw text -


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