[uae] Re: I wrote the horrible bsdsocket stuff

  • From: Richard Drummond <evilrich@xxxxxxxxxxxxxx>
  • To: uae@xxxxxxxxxxxxx
  • Date: Wed, 7 Apr 2004 20:13:55 -0500

Hi Jeff

On Wednesday 07 April 2004 07:20 pm, Jeff Shepherd wrote:
> I don't think that stack magic code isn't too worrysome. I grep'ed
> through the source and a bunch of other code does it too (gfxlib.c does
> a whole lot and native2amiga.c does to get at AllocMem). IMHO, we are
> emulating the Amiga, why can't we call Amiga code?

My main worry is with portability. Have a look at src/od-linux/exectasks.h. 
This stuff isn't portable - it's by definition architecture and compiler 
dependent. We'd need to provide similar stack magic support for other 
architectures (I'm not too worried about only building with GCC right now). I 
don't mind doing PPC and m68k versions myself, but I haven't a clue about 
SPARC, MIPS, ARM or any other architectures that people are using. ;-)

The stack magic stuff isn't used by the Unix versions of UAE currently. The 
gfxlib stuff isn't used, and neither is the uae_AllocMem() call.

> I did take a crack at doing a fully-native version of bsdsocket.library.

Great!

> It is a hybrid of the win32 bsdsocket code and the code in
> bsdsocket-posix.c. It does use the original bsdsocket.[ch] but the
> backend was written using the code in bsdsocket-posix.c. It does do
> signal handling so aborting a socket should work (though I haven't
> tested it yet). I am still working out the kinks but the basics work. I
> have gotten things like IBrowse and Voyager to work and I am in the
> process in testing out other programs.
>
> The code is a little rough right now but if people want to look at it I
> can zip it up and post it to the list.

I would certainly be interested in taking a look. I'm sure others would too.

Cheers,
Rich

Other related posts: