delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/01/09/01:00:18

Message-ID: <32D4842D.72A3@rangenet.com>
Date: Wed, 08 Jan 1997 23:37:49 -0600
From: Dan Hedlund <markiv AT rangenet DOT com>
Reply-To: markiv AT rangenet DOT com
Organization: Range Net
MIME-Version: 1.0
To: Charles Sandmann <sandmann AT clio DOT rice DOT edu>, djgpp AT delorie DOT com
Subject: Re: WinSock in Dos with WIn95
References: <9701082250 DOT AA14883 AT clio DOT rice DOT edu>

Charles Sandmann wrote:
> 
> > > > Is there any way I can get AS to produce a 16bit section?
> > > I don't think so.  AFAIK, the 16bitness/32bitness of the DPMI client is
> > > something that you cannot change while the program runs.  But please ask
> > > Charles Sandmann <sandmann AT clio DOT rice DOT edu> about this, he knows much more
> > > about DPMI than I do (he is the author of cwsdpmi).  I suggest you also
> > > tell him a bit about your problem, since he is very much swamped these
> > > days and doesn't always read the DJGPP news group.
> 
> Just because you are in a 32-bit client, it doesn't prevent you from running
> in a 16-bit segement (if you do the transfers properly).  You can call the
> PM vesa mode switch calls, for example.  The stack is probably the biggest
> thing to make sure you have right.  The intel prog ref has hints on how
> to mix the two and stay sane.
> 
> Oh - and I do try to scan subjects in the newsgroup for things that look
> like only I could answer, but that is only every day or so.  And when I am
> travelling I don't even get to email for a week at a time or so.
> 
> My company just bought another company to integrate, so it's only going to
> get worse for a while :-/
> 
> > Right know I have 3 allocated 64k 16bit data segments in the program,
> > and I think it eliminated some problems.  I was thinking of creating a
> > 16bit section using .code16 and .section, but I'm not sure how it will
> > relocated in the coff file.
> 
> I'd like to know the answer to that myself :-) I doubt our stub loader
> would handle it properly if it's a completely different section.
> 
> > I've cleaned up the main c++ file (tcpip.cc), and most of the functions
> > are just like the winsock functions.
> 
> I wish I had a chance to help you, but I've got 12 months of work to get
> done in the next 5 months ;-P

I tried using a totally new section (not in .text or .data) and adding a
section to .text, and they both loaded corectly.  But the linker didn't
fix up the refrences corectly.  All the address were relative to the
begining of the file, not the section.  Right now, I'm alocating a 16bit
code segment, and manually putting far jumps into the section.

Also, I think as long as you have the big bit set in the stack's LDT
entry, push's and pop's will work.  The problem is when you call a 16bit
function wirh a 32 bit stack, it might use [sp + 4] or something.  Do
you think call gates could solve this problem?  Is that intel prog
refrence availiable on the internet?

Thanks, Dan

- Raw text -


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