TIP: Click on subject to list as thread! ANSI
echo: aust_c_here
to: Paul Edwards
from: David Hare-Scott
date: 1995-10-19 09:40:00
subject: Physical add. in Windows

DH> selectors , linear and physical memory etc etc.  I 
DH> have a MS Knowledgebase 
DH> article Q105643 that gives two methods of doing 
DH> this but i cannot work the 
DH> code fragments into something that does the job 
DH> using my compiler (Borland 
DH> 3.0).

 PE> Is the above code in C?  Someone may be able to translate MS C
 PE> into Borland C.  BTW, do you really need to do this under Windows,
 PE> or is a dos box under Windows good enough?  You may be able to
 PE> use GNU/EMX in combination with RSX to be able to run your program.
 PE> BFN.  Paul.

Hi Paul
Yes it is in C, MS compiler (I think).  And yes I do need to do it from
Windows, from a DLL actually, as the larger objective is to do I/O with
this device from MS Access.

Here is one method from the MS KB article. >

Method 1: Exported Selectors (Preferred)
----------------------------------------

The Windows 3.0 and 3.1 Kernels export several selectors that should
be used by applications that require access to physical memory located
below the 1 megabyte (MB) boundary. The exported selectors are:

   __0000h, __0040h, __A000h, __B000h, __B800h, __C000h, __D000h,
   __E000h, and __F000h

To use one of these selectors, place it onto a segment register and
access the memory or create a long pointer. Here are examples using
the Microsoft Macro Assembler (MASM) and Microsoft C:

   In ASM:       externA  __0040h
                 ...
                 mov ax, __0040h
                 mov es, ax


   In C:         extern   WORD _0040h;
                 LPSTR    lpBIOSDataArea;
                 ...
                 /* Note the & and single underscore */
                 lpBIOSDataArea = (LPSTR)MAKELONG(0, &_0040h);

>
My compiler knows nothing about the symbols __0040, _0040, _0040h etc
The second method is much longer and more complex.
regards
David


--- Maximus/2 2.02
* Origin: Sydney PC Users Group Mail Exchange (3:712/505)
SEEN-BY: 50/99 620/243 623/630 711/401 409 410 413 430 510 807 808 809 932
SEEN-BY: 711/934 712/218 401 404 407 411 416 505 506 515 517 616 619 623 704
SEEN-BY: 712/816 848 713/306 888 714/906 800/1 7877/2809
@PATH: 712/505 704 515 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.