[uae] Re: netbsd emu

  • From: Richard Drummond <evilrich@xxxxxxxxxxxxxx>
  • To: uae@xxxxxxxxxxxxx
  • Date: Sat, 5 Jun 2004 13:39:35 -0500

Hi Richard

On Saturday 05 June 2004 08:56 am, carbon wrote:
> I thought on Amiga the bsdsocket.library is a virtuell library in Ram
> not in libs:

You're right. ;-)

With a real TCP stack (e.g. Miami or AmiTCP), bsdsocket.library doesn't exist 
as a disk-based library. It is created at run-time by the TCP stack when you 
go online.

WinUAE also creates a memory-resident bsdsocket.library when the bsdsocket 
emulation is enabled.

Currently, the bsdsocket emulation for Unix-like systems doesn't do that. The 
Amiga side of the emulation is a disk-resident library. This will change, 
eventually.

I'm currently pursuing two tracks of development on the bsdsocket emulation. 

Firstly, I am working on improving the existing emulation (based on Carl 
Drougge's work) and have made some progress here. This still current uses 
Carl's disk-based bsdsocket.library, however. This is really due to laziness 
or a lack of time to make it memory resident.

Secondly, Jeff Shepherd has been working on integrating Carl's existing 
emulation with the core bsdsocket emulation that WinUAE uses. Thus, this uses 
a memory-resident bsdsocket.library - just like WinUAE. I've done some work 
on this myself, and got to the point where a lot more networking apps are 
functional (or almost functional) and Jeff's just sent me a new bunch of 
patches which should improve this a whole lot more. (Some of Jeff's work is 
also applicable to the old version, so this will improve as well).

Unfortunately, this new work still has problems with some underlying 
mechanisms. For instance, it relies on being able to call Amiga code from the 
emulation and this requires some heavy voodoo to work (the stack magic code). 
This code is non-portable - it's specific to the host CPU (and to some extent 
the host OS). I've added PPC support recently, however. The current status is 
that the stack magic code works on Linux hosts on PPC and x86, but only, it 
seems, with 2.6 kernels (on 2.4 kernels, it causes all sorts of bugs with 
pthreads). It also works on OS X.

I've recently had an idea how to implement the stack magic code in a more 
portable way - or at least portable to SYSV-like systems (including Linux). 
Hopefully this may cure the problems on 2.4 Linux kernels - we'll see.

Which of these two solutions will win out remains to be decided. If the 
portability and other problems with stack magic stuff can be solved, Jeff's 
new code may be the way to go, simply because it shares more code with WinUAE 
and will be less work in the long run.

If anybody's interested in having a play with the new code, you can grab it 
from the CVS repository at http://sf.net/projects/uaedev. Use the 
--enable-bsdsock-new configure option to build Jeff's new bsdsocket 
emulation.

Cheers,
Rich

Other related posts: