TIP: Click on subject to list as thread! ANSI
echo: aust_c_here
to: andrew clarke
from: david nugent
date: 1996-04-07 19:18:56
subject: Direct memory access using emx/gcc

ac> Hi folks.  How do I directly access memory in a DOS
 ac> application (ie. _osmode == DOS_MODE) compiled with EMX
 ac> 0.9b / GCC 2.7.2?  Specifically, I want to access areas
 ac> such as 0040:004AH (current screen width), B800:0000H
 ac> (color screen text display), and so forth.  Thanks.

You have to use the dpmi translate functions to allocate a selector with
32-bit visibility. I have no idea how the emx/rsx interface works here;
with djgcc it is easy (dj's extender uses a simple MK_FP macro :-)), but
whatever method you use depends on what functions the extender provides.
Altneratively, you can call DPMI functions directly, although with emx
running without rsx, you may not have a dpmi host.

However - to be more specific with your problem - i think there *are* some
selectors automatically created to access areas of memory often accessed by
the library, including the MSDOS data area at 0x40:0 and screen at
0xb800:0. How you get at them, I have no idea anymore (sorry).

--- MaltEd/2 1.0.b6
* Origin: Unique Computing Pty Limited (3:632/348)
SEEN-BY: 50/99 78/0 620/243 623/630 632/103 348 360 998 633/371 634/384 388
SEEN-BY: 634/396 635/301 502 503 544 639/252 711/401 409 410 413 430 808 809
SEEN-BY: 711/932 934 712/515 713/888 714/906 800/1 7877/2809
@PATH: 632/348 635/503 50/99 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™.