Mail Archives: djgpp/2000/12/04/13:04:58
From: | "Alex Oleynikov" <alex AT compuweigh DOT com>
|
To: | "DJGPP Mail List" <djgpp AT delorie DOT com>
|
Subject: | Mapping a data structure into DOS memory space
|
Date: | Mon, 4 Dec 2000 13:01:46 -0500
|
Message-ID: | <NEBBKABEDKFPFBKEMBFOCEEFCAAA.alex@compuweigh.com>
|
MIME-Version: | 1.0
|
X-Priority: | 3 (Normal)
|
X-MSMail-Priority: | Normal
|
X-Mailer: | Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
|
X-MimeOLE: | Produced By Microsoft MimeOLE V5.50.4522.1200
|
Importance: | Normal
|
Reply-To: | djgpp AT delorie DOT com
|
Hi everybody!
I am developing a controller (DOS+DJGPP) and the technical specs require
that some crucial data have to be kept in the non-volatile memory (NVRAM)
all the time while it's running.
For that matter I will use a 128K NVRAM chip, which is mapped into a UMB
memory space through a 32K frame. The data I have to store there is
organized as a set of structures.
Now I have a problem - how can I neatly access that data from my program? As
far as I understand, there is no way to tell the linker to use the physical
address for relocation of the data structures, since it is below the 1MB
limit. I have investigated different possibilities of accessing that data
( through _farX functions, or using "Fat DS" trick ), but they all
effectively limit my ability to use trivial "dot-style" variable access
within the structures. Now I have to play with the offsets of my elements
off the structure's starting address, which complicates the code and
decreases its readability.
Is there any other possible variant, which would allow me to still use
simple access to the data structures' elements?
I would greatly appreciate any advises on this matter.
Thank you
Alex Oleynikov
- Raw text -