Mail Archives: djgpp/2006/08/13/09:36:21
X-Authentication-Warning: | delorie.com: mail set sender to djgpp-bounces using -f
|
MIME-Version: | 1.0
|
Subject: | copy from physical memory
|
X-MimeOLE: | Produced By Microsoft Exchange V6.5
|
Date: | Sun, 13 Aug 2006 15:21:28 +0200
|
Message-ID: | <714817CA32ED3143B96B69D0D3574C5A311B64@server.oncotherm.oncotherm.org>
|
X-MS-Has-Attach: | |
X-MS-TNEF-Correlator: | |
Thread-Topic: | copy from physical memory
|
Thread-Index: | Aca+22JzLt/pLapLS7accDzAEW2g8g==
|
From: | "Szasz Oliver \(OR\)" <OliverSzasz AT oncotherm DOT org>
|
To: | <djgpp AT delorie DOT com>
|
This is a multi-part message in MIME format.
------_=_NextPart_001_01C6BEDB.6856D838
Content-Type: text/plain;
charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable
Hello everyone,
=20
I have a problem. I would like to get information from (and to) a fix
physical address in the computer. For this I have tried first to copy a
variable to an other one (Temp to Temp2), but for some reason at the end
I do not get the same value. Can anybody tell where I am doing it wrong?
=20
Thanks for helping.
=20
Oliver Szasz
=20
dword Phys;
word Temp=3D1234, Temp2=3D0;
if (__dpmi_get_segment_base_address(_my_ds(),&Phys)=3D=3D0)
{
Phys+=3D(dword)Temp;
if (Phys<0x100000)
movedata(_dos_ds,Phys,_my_ds(),(dword)&Temp2,sizeof(Temp));
else
{
__dpmi_meminfo mi;
mi.address=3DPhys;
mi.size=3Dsizeof(Temp);
__dpmi_physical_address_mapping(&mi);
word selector=3D__dpmi_allocate_ldt_descriptors(1);
if (selector!=3D0)
{
if
(__dpmi_set_segment_base_address(selector,mi.address)=3D=3D0)
{
dword Addr;
if
((__dpmi_get_segment_base_address(selector,&Addr)=3D=3D0) &&
(Addr=3Dmi.address))
if
(__dpmi_set_segment_limit(selector,mi.size-1)=3D=3D0)
{
if
(__dpmi_get_segment_limit(selector)>=3Dmi.size-1)
{
=20
movedata(selector,0,_my_ds(),(dword)&Temp2,sizeof(Temp2));
printf("T:%d %d",(_d_)Temp,(_d_)Temp2);
}
}
}
__dpmi_free_ldt_descriptor(selector);
}
__dpmi_free_physical_address_mapping(&mi);
}
}
=20
------_=_NextPart_001_01C6BEDB.6856D838
Content-Type: text/html;
charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable
<html xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns=3D"http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)">
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
{mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman";}
p
{mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman";}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:Arial;
color:windowtext;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body lang=3DEN-US link=3Dblue vlink=3Dpurple>
<div class=3DSection1>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Hello everyone,<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> I have a problem. I would like to get =
information from
(and to) a fix physical address in the computer. For this I have tried =
first to
copy a variable to an other one (Temp to Temp2), but for some reason at =
the end
I do not get the same value. Can anybody tell where I am doing it =
wrong?<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> Thanks for =
helping.<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Oliver Szasz<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> dword Phys;<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> word Temp=3D1234, =
Temp2=3D0;<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> if
(__dpmi_get_segment_base_address(_my_ds(),&Phys)=3D=3D0)<o:p></o:p></=
span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> =
{<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> =
Phys+=3D(dword)Temp;<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> if =
(Phys<0x100000)<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>
movedata(_dos_ds,Phys,_my_ds(),(dword)&Temp2,sizeof(Temp));<o:p></o:p=
></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> =
else<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> =
{<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> =
__dpmi_meminfo =
mi;<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> =
mi.address=3DPhys;<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> =
mi.size=3Dsizeof(Temp);<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> =
=
__dpmi_physical_address_mapping(&mi);<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> =
word
selector=3D__dpmi_allocate_ldt_descriptors(1);<o:p></o:p></span></font></=
p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> =
if (selector!=3D0)<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> =
{<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> =
if
(__dpmi_set_segment_base_address(selector,mi.address)=3D=3D0)<o:p></o:p><=
/span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> =
=
{<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> =
dword =
Addr;<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> =
if
((__dpmi_get_segment_base_address(selector,&Addr)=3D=3D0) &&
(Addr=3Dmi.address))<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> =
=
if =
(__dpmi_set_segment_limit(selector,mi.size-1)=3D=3D0)<o:p></o:p></span></=
font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> =
&=
nbsp; {<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> =
&=
nbsp; if
(__dpmi_get_segment_limit(selector)>=3Dmi.size-1)<o:p></o:p></span></f=
ont></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> =
&=
nbsp; {<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> =
&=
nbsp;
movedata(selector,0,_my_ds(),(dword)&Temp2,sizeof(Temp2));<o:p></o:p>=
</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>printf("T:%d =
%d",(_d_)Temp,(_d_)Temp2);<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> =
&=
nbsp; }<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> =
&=
nbsp; }<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> =
=
}<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> =
=
__dpmi_free_ldt_descriptor(selector);<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> =
}<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> =
=
__dpmi_free_physical_address_mapping(&mi);<o:p></o:p></span></font></=
p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> =
}<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> =
}<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
lang=3DHU
style=3D'font-size:12.0pt'><o:p> </o:p></span></font></p>
</div>
</body>
</html>
------_=_NextPart_001_01C6BEDB.6856D838--
- Raw text -