Mail Archives: djgpp/1997/08/20/22:05:35
Wojciech Galazka <wgalazka AT chem DOT uw DOT edu DOT pl> wrote:
> > And if you have a correct structure definition, you can compute
> > the size of the structure, can't you?
> This is not always correct. Taking the previous example
> struct foo {
> short size;
> struct {
> short min;
> short max;
> } * minmax;
> }
> This the definition of the structure. What
> I get referenced to is however
> struct true_foo {
> short size;
> struct {
> short min;
> short max;
> } minmax[size];
> }
> I cannot just copy the entire structure by dosmemget because I
> don't know the value of 'size' So the procedure would be.
> 1 farpeekw() the value of size
> 2 dosmemget(0 size number of minmax structures.
Right, sorry, I didn't pay attention to the definition before. (Stupid me!)
> But the whole problem of all this thread is that I try
> to avoid copying at all. Why I'm forced to copy some data.
> when this data has already had its place somewhere under 1 MB?
> Copying is a time-consuming task.
> > So you want to read the data -without- copying it to protected mode? AFAIK,
> > this is not possible.
> Oh no, that sounds incredible to me :)))
> And if so then my answer is why ?
Well, AFAICS, your only option, then, is to enable near pointers with the
macro __djgpp_nearptr_toggle (or is it _enable?) and work with that...
> > I couldn't find __dpmi_map_physical_memory but you mentioned
> > __dpmi_map_conventional_memory_in_memory_block in a previous post, so I
> > assume that's what you mean. The description for this function in the libc
> > docs says:
> >
> > "This function maps conventional memory (even when virtualized) to
> > virtual memory. Pass the handle, offset, and number of pages."
> >
> > Anyway, I
> > fail to see how this remapped memory is used; does a correct call make
> > ES:DI a valid pointer? I'll test this later.
> >
>
> The proper use if __dpmi_map_conventional_memory_in_memory_block
> is still a mystery to me. And what;s worse it requires DPMI 1.0
> (Imagine, Microsoft's DPMI servers don't support it and claim they won't
> it in the future either)
That's bad if you want your program to run on as many machines as possible...
BTW, any DPMI gurus out there who can explain the function..?
> > To the point: I fail to see why dosmemget cannot be used here.
> To avoid copying.
Okay, I see that now. I (incorrectly) assumed you just wanted to access it,
didn't think -how- made a difference. :)
- Raw text -