FreeBSD x86-64 status?

EQ2Emulator Development forum.

Moderator: Team Members

Post Reply
bit_shifter
Posts: 6
Joined: Thu May 29, 2014 8:14 am

FreeBSD x86-64 status?

Post by bit_shifter » Fri May 30, 2014 6:38 am

My servers at home are running on 64-bit FreeBSD (one on 9.2 and one on 10.0). I saw a few FreeBSD-specific bits in the server code, but the #ifdef FREEBSD bits that I found have a date of 2003 on them, so I'm not sure the FreeBSD port has been maintained. Does anybody happen to know the status of it?

In the makefile, the architecture is i686, but is there anything preventing it from being compiled on an x86-64 platform? I changed the -march flag to -march=x86-64, added a -DFREEBSD flag in DFLAGS, added the FreeBSD-specific locations of mysql and lua in the includes, defined a few of the PTHREAD_MUTEX_*_NPs as enums that actually exist on FreeBSD (this part I have almost no knowledge about, just some google-fu), and compiled it (with gcc 4.7). The second I start it though, I get a segmentation fault. Before I dive into this any further, I just wanted to run it past you wise gentlemen to see if there was anything glaring that you notice.

If it becomes too much work, I'll just create a Linux VM and compile/run it there, since I doubt that many people would get much use from a working FreeBSD port. Is it best to have a 32-bit Linux VM if I do go that route? Any advice would be greatly appreciated.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: FreeBSD x86-64 status?

Post by John Adams » Fri May 30, 2014 9:51 am

If you are seeing anything from 2003, it is likely the base code LethalEncounter (and team) originally used that is actually EQEmu code - there's lots of that throughout the original foundation of EQ2Emu. Any and all of that could be cleaned up, updated or removed as necessary.

There is a makefile.a64 for x64 linux compiles, and it has worked fine until I got to gcc 4.8 or whatever the newest one is that supports the C++11 stuff. Not sure they are related, but I mainly run on an Ubuntu 9.04 x86 VM and have had no reason to change (yet). If you care to repair that linux effort, definitely feel free - just be sure the original makefile remains as is for x86 / Linux compiles.

bit_shifter
Posts: 6
Joined: Thu May 29, 2014 8:14 am

Re: FreeBSD x86-64 status?

Post by bit_shifter » Fri May 30, 2014 10:27 am

I actually did end up getting it to compile properly and run on FreeBSD -- the key was using mysql server 5.1 instead of FreeBSD's latest mysql 5.6. There are still a couple of outlying issues -- lua can't seem to find a file (see below), and after the World shutdown complete message I get "Bus error (core dumped)". I'm not sure if the bus error affects much at this point, I'll have to get a client running and test.

Speaking of which... what's the recommended client? Full install patched to live then patched with EQ2EmuPatcher.exe? Otherwise I only have old clients: classic, EoF, Sentinel's Fate, Kingdom of Sky.

Also, is it normal to be loading 0 records for several resources (in the eq2world log)?

Code: Select all

2014-05-30_eq2world_95785.log:15:01:00 I NPC: --Loaded 0 NPC Spell(s).
2014-05-30_eq2world_95785.log:15:01:00 I NPC: --Loaded 0 NPC Skill(s).
2014-05-30_eq2world_95785.log:15:01:00 I NPC: --Loaded 0 NPC Equipment Piece(s).
2014-05-30_eq2world_95785.log:15:01:17 I Traits: Loaded 0 Trait(s)
2014-05-30_eq2world_95785.log:15:01:18 I Guilds:        Loaded 0 Guild(s)
2014-05-30_eq2world_95785.log:15:01:18 I AA: Loaded 0 Alternate Advancement(s)
2014-05-30_eq2world_95785.log:15:01:18 I World: - Loaded 0 Race Types
Lua error message:

Code: Select all

E LUA       : Error loading cannot open Inactive (re-link or create).lua: No such file or directory (file name: 'Inactive (re-link or create).lua')
Log output: http://sprunge.us/jXQD

Also, my makefile differences:

Code: Select all

# diff makefile.a64 makefile.a64_freebsd
99c99
< DFLAGS=-DEQ2 -DWORLD
---
> DFLAGS=-DEQ2 -DWORLD -DFREEBSD
102c102
< LIB=`mysql_config --libs` -L../LUA -llua5.1
---
> LIB=`mysql_config --libs` -L../LUA -L/usr/local/lib/lua51 -llua
104c104
< LINKOPTS=-rdynamic -L. -lstdc++ -lm -lz $(LIB) -ldl
---
> LINKOPTS=-rdynamic -L. -lstdc++ -lm -lz $(LIB) -lexecinfo
Sorry for so many questions...

User avatar
xinux
Team Member
Posts: 680
Joined: Wed Mar 10, 2010 11:10 am
Location: Destroyer of Servers

Re: FreeBSD x86-64 status?

Post by xinux » Fri May 30, 2014 11:17 am

Current patched version of live and the exe from this thread and you should be fine.


http://www.eq2emulator.net/phpBB3/viewt ... 906#p28906
EQ II - Build=1360 (Orig) - Build=1360 (DoF) - Build=2654 (KoS) - Build=3375 (Classic) - Build=3554 (EoF)
EQ II - Build=4412 (RoK) - Build=5122 (TSO) - Build=6118 (SF) - Build=7628 (DoV) - Build=8295 (Aod)

User avatar
thefoof
Retired
Posts: 630
Joined: Wed Nov 07, 2012 7:36 pm
Location: Florida

Re: FreeBSD x86-64 status?

Post by thefoof » Fri May 30, 2014 11:40 am

bit_shifter wrote:Also, is it normal to be loading 0 records for several resources (in the eq2world log)?

Code: Select all

2014-05-30_eq2world_95785.log:15:01:00 I NPC: --Loaded 0 NPC Spell(s).
2014-05-30_eq2world_95785.log:15:01:00 I NPC: --Loaded 0 NPC Skill(s).
2014-05-30_eq2world_95785.log:15:01:00 I NPC: --Loaded 0 NPC Equipment Piece(s).
2014-05-30_eq2world_95785.log:15:01:17 I Traits: Loaded 0 Trait(s)
2014-05-30_eq2world_95785.log:15:01:18 I Guilds:        Loaded 0 Guild(s)
2014-05-30_eq2world_95785.log:15:01:18 I AA: Loaded 0 Alternate Advancement(s)
2014-05-30_eq2world_95785.log:15:01:18 I World: - Loaded 0 Race Types
Lua error message:

Code: Select all

E LUA       : Error loading cannot open Inactive (re-link or create).lua: No such file or directory (file name: 'Inactive (re-link or create).lua')
As long as you have NPCs and such in your database no, it should be loading some of those. The LUA error message is due to a bad entry in the spells table most likely, but harmless.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: FreeBSD x86-64 status?

Post by John Adams » Fri May 30, 2014 11:48 am

thefoof wrote:As long as you have NPCs and such in your database no, it should be loading some of those.
Full dev DB, spawns, items, spells, etc is on eq2content SVN.
thefoof wrote:The LUA error message is due to a bad entry in the spells table most likely, but harmless.
I fixed this in dev, has not been committed to SVN yet.

bit_shifter
Posts: 6
Joined: Thu May 29, 2014 8:14 am

Re: FreeBSD x86-64 status?

Post by bit_shifter » Fri May 30, 2014 1:26 pm

xinux wrote:Current patched version of live and the exe from this thread and you should be fine.


http://www.eq2emulator.net/phpBB3/viewt ... 906#p28906
Thanks, I'll give that a shot. Anybody running the client in Linux under WINE? WINE app DB shows that the EQ2 client should work.
John Adams wrote:
thefoof wrote:As long as you have NPCs and such in your database no, it should be loading some of those.
Full dev DB, spawns, items, spells, etc is on eq2content SVN.
I added everything from the eq2content's dumps/eq2_* sql scripts, but I missed dev_db and items, I guess.
John Adams wrote:
thefoof wrote:The LUA error message is due to a bad entry in the spells table most likely, but harmless.
I fixed this in dev, has not been committed to SVN yet.
Sounds good.


I had an issue with getting items into the DB. I ended up having to change the max_allowed_packet option to 16M for mysql to get it to do its inserts. That caused a couple of problems, so I wiped the db and started again. Is this all I need?

Code: Select all

# bzcat eq2_tables/*.bz2 | mysql -uroot eq2
# bzcat eq2_data/*.bz2 | mysql -uroot eq2
# tar xzvfO dev_db/*.tar.gz | mysql -uroot eq2
# unzip -c items/*.zip | mysql -uroot eq2
And lastly, for now, when it tells you to type 'help' or '?' at the console at the end of starting up, neither of them will do anything when I try... Not sure on that one.

I'm documenting my journey so that if anybody else in the future wants to do a FreeBSD server, they'll at least have some guidance. Thanks for all the help so far.

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: FreeBSD x86-64 status?

Post by Jabantiz » Fri May 30, 2014 3:24 pm

bit_shifter wrote:And lastly, for now, when it tells you to type 'help' or '?' at the console at the end of starting up, neither of them will do anything when I try... Not sure on that one.
Console commands only work on windows currently, no one has gotten around to adding support for other OS.

bit_shifter
Posts: 6
Joined: Thu May 29, 2014 8:14 am

Re: FreeBSD x86-64 status?

Post by bit_shifter » Fri May 30, 2014 3:50 pm

Jabantiz wrote:
bit_shifter wrote:And lastly, for now, when it tells you to type 'help' or '?' at the console at the end of starting up, neither of them will do anything when I try... Not sure on that one.
Console commands only work on windows currently, no one has gotten around to adding support for other OS.
Good to know! I'm just trying to make sure my current FreeBSD build is functioning properly. It looks like it is now, aside from the bus error when shutting it down.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: FreeBSD x86-64 status?

Post by John Adams » Fri May 30, 2014 3:57 pm

There should be a full DB dump (EQ2DBProject_Current.sql) under the dev_db folder, so you don't have to source individual tables. Those tables/datas are only there for those custom worlds that did not want to overwrite their data.

Our auto DB Patcher needs to be re-written because it cannot handle the millions of rows of data we're shoving down for content, hence the SVN alternative.

bit_shifter
Posts: 6
Joined: Thu May 29, 2014 8:14 am

Re: FreeBSD x86-64 status?

Post by bit_shifter » Fri May 30, 2014 5:56 pm

John Adams wrote:There should be a full DB dump (EQ2DBProject_Current.sql) under the dev_db folder, so you don't have to source individual tables. Those tables/datas are only there for those custom worlds that did not want to overwrite their data.
Perfect. That makes it easier. I didn't realize the dev_db included everything.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests