delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2014/07/18/01:36:41

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Recipient: djgpp AT delorie DOT com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20120113;
h=mime-version:in-reply-to:references:date:message-id:subject:from:to
:content-type;
bh=fzlOE8aWvMvp2/AKf8+4OyQfeYxiGwY+1zdCNsLBjeU=;
b=gZalaHCp6LiYc2J3l8FFT4soH7NAWMZH4YEMFLseXaLvUYtiarpQagkxMLHlVaDSj9
SJsdMQdajnCTd2Q1Yo/TBv5+rRzKwESiSXJze63WD9cLl3AFAuIOOCE1hvuqkZc2LVmr
BHbstGoiNZr8hKCSuRH5aS5TrZP5PSex7VbGLl5NjKC2kyrHWuWAeRB55J8iNrsmEmTq
yovXbT8rz8MIN0URprhSZEjh91aXbind4hFlNtj0r4f+cemEEyOyq9Biixkye8QcT5v5
mOp/AxRhDMC8Qh2E0yTnBxI6/m+7Z2OrmkJLTW/5EZTGIJjHI4v4q0iE6Fq+ZjytRFwH
gioQ==
MIME-Version: 1.0
X-Received: by 10.52.246.101 with SMTP id xv5mr1560850vdc.73.1405661779417;
Thu, 17 Jul 2014 22:36:19 -0700 (PDT)
In-Reply-To: <201407180331.s6I3VKGq031144@envy.delorie.com>
References: <82286315-4f2d-4699-8c58-97fb7bdf08cc AT googlegroups DOT com>
<201407180331 DOT s6I3VKGq031144 AT envy DOT delorie DOT com>
Date: Thu, 17 Jul 2014 22:36:19 -0700
Message-ID: <CAB9Rao8aNpxTp4iakWWrfkDbOdZAfEer+tC12wz4zHjH1JveUg@mail.gmail.com>
Subject: Re: question about implementation,usage of _dosmemput*
From: Louis Santillan <lpsantil AT gmail DOT com>
To: "djgpp AT delorie DOT com" <djgpp AT delorie DOT com>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

--001a1136028c096f7404fe7123c2
Content-Type: text/plain; charset=UTF-8

DJ: FYI, the examples on dosmemputl & dosmemputb (
http://www.delorie.com/djgpp/doc/libc-2.02/libc_172.html and
http://www.delorie.com/djgpp/doc/libc-2.02/libc_170.html) don't match the
signature (the examples appear to be wrong) nor does it match the
order/signature of dosmemputw.  I wonder how thousands of eyeballs missed
that.

Jim: If you're looking to do EDD/LBA, see this older thread (
http://www.delorie.com/djgpp//mail-archives/thread.cgi?msg=djgpp/2003/04/12/08:15:18&mode=frames
)


On Thu, Jul 17, 2014 at 8:31 PM, DJ Delorie <dj AT delorie DOT com> wrote:

>
> > an example that includes an actual variable that'w wider than 1 byte
> > to put into memory would be very very helpful.
>
> The dosmemputw example puts a "variable" (the array) which is 4,000
> bytes long.  The _go32_dpmi_allocate_dos_memory() example moves
> want_size bytes at a time.
>
> > if buffer is the target as it's described, where do I put the
> > source? no argument for this I can find.
>
> The dosmemputw et al function have three different arguments.  Only
> one is a pointer.  One is documented as a physical address.  The
> documentation says "from the program's virtual address space" so the
> pointer argument is the source, and "to MS-DOS's conventional memory
> space" with the math for computing that using offset, which is the
> destination.  It then says "and buffer is a pointer to somwhere
> ... where the data will come from."
>
> I'm not sure how this is confusing.
>
> >     const uint16_t key=0xb055;
> > _dosmemputw(__tb+0,1,info.rm_segment*16);
> >
> > where do I put the address for key?
>
> In this case, __tb is the physical address, and &key is the virtual
> address of your data.
>
> _dosmemputw(&key, 1, __tb+0);
>
> If you allocate *more* dos memory, you now have two physical addresses
> for two buffers (the transfer buffer, __tb; and the new buffer,
> address in info (seg*16+ofs)).
>

--001a1136028c096f7404fe7123c2
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div><span style=3D"font-family:arial,sans-serif;font-size=
:13px">DJ: FYI, the=C2=A0</span><span style=3D"font-family:arial,sans-serif=
;font-size:13px">examples</span><span style=3D"font-size:13px;font-family:a=
rial,sans-serif">=C2=A0on dosmemputl &amp; dosmemputb (</span><font face=3D=
"arial, sans-serif"><a href=3D"http://www.delorie.com/djgpp/doc/libc-2.02/l=
ibc_172.html">http://www.delorie.com/djgpp/doc/libc-2.02/libc_172.html</a> =
and=C2=A0</font><span style=3D"font-family:arial,sans-serif"><a href=3D"htt=
p://www.delorie.com/djgpp/doc/libc-2.02/libc_170.html">http://www.delorie.c=
om/djgpp/doc/libc-2.02/libc_170.html</a></span><span style=3D"font-size:13p=
x;font-family:arial,sans-serif">) don&#39;t match the</span><span style=3D"=
font-size:13px;font-family:arial,sans-serif">=C2=A0</span><span style=3D"fo=
nt-size:13px;font-family:arial,sans-serif">signature=C2=A0</span><span styl=
e=3D"font-size:13px;font-family:arial,sans-serif">(the examples appear to b=
e wrong) nor does it match the order/signature of=C2=A0</span><span style=
=3D"font-size:13px;font-family:arial,sans-serif">dosmemputw</span><span sty=
le=3D"font-size:13px;font-family:arial,sans-serif">. =C2=A0I wonder how tho=
usands of eyeballs missed that.</span></div>
<div><br></div><div>Jim: If you&#39;re looking to do EDD/LBA, see this olde=
r thread (<a href=3D"http://www.delorie.com/djgpp//mail-archives/thread.cgi=
?msg=3Ddjgpp/2003/04/12/08:15:18&amp;mode=3Dframes">http://www.delorie.com/=
djgpp//mail-archives/thread.cgi?msg=3Ddjgpp/2003/04/12/08:15:18&amp;mode=3D=
frames</a>)</div>
</div><div class=3D"gmail_extra"><br><br><div class=3D"gmail_quote">On Thu,=
 Jul 17, 2014 at 8:31 PM, DJ Delorie <span dir=3D"ltr">&lt;<a href=3D"mailt=
o:dj AT delorie DOT com" target=3D"_blank">dj AT delorie DOT com</a>&gt;</span> wrote:<br=
><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1=
px #ccc solid;padding-left:1ex">
<br>
&gt; an example that includes an actual variable that&#39;w wider than 1 by=
te<br>
&gt; to put into memory would be very very helpful.<br>
<br>
The dosmemputw example puts a &quot;variable&quot; (the array) which is 4,0=
00<br>
bytes long. =C2=A0The _go32_dpmi_allocate_dos_memory() example moves<br>
want_size bytes at a time.<br>
<br>
&gt; if buffer is the target as it&#39;s described, where do I put the<br>
&gt; source? no argument for this I can find.<br>
<br>
The dosmemputw et al function have three different arguments. =C2=A0Only<br=
>
one is a pointer. =C2=A0One is documented as a physical address. =C2=A0The<=
br>
documentation says &quot;from the program&#39;s virtual address space&quot;=
 so the<br>
pointer argument is the source, and &quot;to MS-DOS&#39;s conventional memo=
ry<br>
space&quot; with the math for computing that using offset, which is the<br>
destination. =C2=A0It then says &quot;and buffer is a pointer to somwhere<b=
r>
... where the data will come from.&quot;<br>
<br>
I&#39;m not sure how this is confusing.<br>
<br>
&gt; =C2=A0 =C2=A0 const uint16_t key=3D0xb055;<br>
&gt; _dosmemputw(__tb+0,1,info.rm_segment*16);<br>
&gt;<br>
&gt; where do I put the address for key?<br>
<br>
In this case, __tb is the physical address, and &amp;key is the virtual<br>
address of your data.<br>
<br>
_dosmemputw(&amp;key, 1, __tb+0);<br>
<br>
If you allocate *more* dos memory, you now have two physical addresses<br>
for two buffers (the transfer buffer, __tb; and the new buffer,<br>
address in info (seg*16+ofs)).<br>
</blockquote></div><br></div>

--001a1136028c096f7404fe7123c2--

- Raw text -


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