View Single Post
  #1  
Old 05-08-2002, 11:20 AM
crept
Fire Beetle
 
Join Date: May 2002
Posts: 7
Default EQEmu source for FreeBSD 4.5-STABLE

So far the code base with my (very) small changes compiles and runs on these "release" platforms:

OpenBSD 3.0-RELEASE - does not exhibit the 100% cpu utilization problem that my test with FreeBSD did. I'm guessing the problem was with my particular build of FreeBSD (4.5-STABLE from 2/8/02)
FreeBSD4.x-RELEASE - Both 4.4 and 4.5 have an issue where the world and each zone server try to hog the cpu to themselves.

Does not compile on:
NetBSD 1.5.2 - The compiler used in this version (egcs 1.1.2) does not understand the -pthread option. While it still compiles, it chokes when trying to find the pthread headers.
FreeBSD3.x - The compiler used in this version (gcc 2.7.2.3) chokes on some syntax.

Please note that these are fresh installs of the respective operating systems, with mysql-client installed. No other tweaking was done (in other words, it might still be possible to get this code to compile on those platforms)

Nice work folks =)

I'll update this post as I test more platforms.

I made some modifications to the source to get it to compile on freebsd. It may compile on other UNIXes as well but I have yet to test them (I have access to FreeBSD, OpenBSD, and Solaris/SPARC 8, and can whip up a NetBSD box easily). I'll see how that goes and post an update.

Brief overview of the changes:

- Since make for Linux and BSD are different (gmake vs pmake (I think?)) A slight change had to be made to the Makefiles in world/ and zone/.
- Some headers had to be added to some of the source files. They were stdarg.h and sys/types.h.
- "_NP" had to be removed from some PTHREAD constants since they are not in FreeBSD's pthread.h.
- "#include <mysql.h>" had to be changed to "#include <mysql/mysql.h>".

To compile you need to have mysql-client from ports installed (at the minimum), for libmysqlclient.so and mysql.h.

Once you have it compiled and running, you will probably find each server process (the one world and each zone process) will try to use 100% CPU. I've been told this doesn't happen in linux. I am still narrowing down the problem, but I believe it has something to do either with the loops which call accept() to see if a connection has been made, or the Sleep(x) aka usleep(1000x) functions. I have tried changing some of the accept() loops to select() calls, and that seemed to help some although the bins seemed to become less stable as a result. This is the first time I've tried network programming, so this is sort of a crash course for me =). I'll keep banging away at it though. These changes ARE NOT in the included tarball, since they cause instability. The tarball is just the release source modified so that it compiles on FreeBSD (as well as all the carriage returns stripped out =))

I was able to log in and play with just minilogin running in windows, and the world, mysql, and zone servers running in freebsd. Everything seemed to run as well as when they were all on the windows box.

I was going to attach the entire tarball, but it is too big so I am just attaching the diff file. This diff was made against a source tree that has had all carriage returns removed (which, by default, were not stripped when I unzipped it in freebsd) so keep that in mind when trying to patch it.

Please let me know if you have any comments or suggestions =)
Reply With Quote