Hi guys.  I'm taking initiative into fixing ioquake3 on FreeBSD since
it seems to be broken in some respects.
Actually, for now I'm only interested in fixing ioq3ded, not so much
the ioquake3 client (I don't even know how badly the client is broken,
if at all).
Anyhow, I've been running some flavor of ioq3ded on FreeBSD for 3
years now.  I am attaching a patch which fixes vm_x86.c on FreeBSD PAE
kernels.

One thing that I'm still working on doing is testing the compile of a
32 bit ioq3ded on a 64 bit FreeBSD system (make ARCH=i386).  Right now
that build is broken because it can't find the correct 32 bit
libraries or something (even though they are on my system in the
"normal" location on FreeBSD).  I'm working on fixing this
cross-compile bug next.

Attached is the patch for FreeBSD PAE kernels.  The fix consists of
adding about 10 characters of text to a line of code.  However, I have
included a very long-winded comment explaining why I think this is a
safe fix for the problem.  I copied that comment below:

========================
    Rambetter's note: I'm adding the test for __FreeBSD__ in addition
to the [already
existing] test for __linux__.  Here is why.  I own a 32 bit FreeBSD
8.0 server with
a PAE kernel.  Without VM_X86_MMAP, ioq3ded segfaults shortly after
starting
(this should come as no surprise).  With VM_X86_MMAP, ioq3ded runs
very smoothly.
So, at a very minimum, we need to set VM_X86_MMAP for FreeBSD PAE
kernels.
    Now, I also happen to own a 32 bit FreeBSD 7.1 server with just
the standard kernel
(non-PAE).  I have run ioq3ded successfully on it with and without
VM_X86_MMAP for many
months.  So, in the case of non-PAE FreeBSD, we can go either way -
use VM_X86_MMAP or
not use it.  The absolute safest fix to this problem is to only set
VM_X86_MMAP on
PAE FreeBSD kernels (in addition to Linux); however, I don't know of a
way to detect
the PAE kernel easily.  Therefore, since using VM_X86_MMAP won't break
anything on
non-PAE kernels [apparently], we'll just use it all the time on
FreeBSD 32 bit.
    Now, you may ask the question: Why not change the entire test for
just __unix__?
Unfortunately I cannot say anything about this because I don't have
access to every
other system that has __unix__ defined, so I cannot possibly test all
those cases to
make sure things work.  We'll just leave it with __linux__ and
__FreeBSD__ to be safe.
If someone with a different flavor of UNIX running a PAE kernel has
this problem too,
they can report the bug and we will adjust the line below accordingly.
====================

- Rambetter
Index: code/qcommon/vm_x86.c
===================================================================
--- code/qcommon/vm_x86.c	(revision 1802)
+++ code/qcommon/vm_x86.c	(working copy)
@@ -36,7 +36,25 @@
 
 /* need this on NX enabled systems (i386 with PAE kernel or
  * noexec32=on x86_64) */
-#ifdef __linux__
+//     Rambetter's note: I'm adding the test for __FreeBSD__ in addition to the [already
+// existing] test for __linux__.  Here is why.  I own a 32 bit FreeBSD 8.0 server with
+// a PAE kernel.  Without VM_X86_MMAP, ioq3ded segfaults shortly after starting
+// (this should come as no surprise).  With VM_X86_MMAP, ioq3ded runs very smoothly.
+// So, at a very minimum, we need to set VM_X86_MMAP for FreeBSD PAE kernels.
+//     Now, I also happen to own a 32 bit FreeBSD 7.1 server with just the standard kernel
+// (non-PAE).  I have run ioq3ded successfully on it with and without VM_X86_MMAP for many
+// months.  So, in the case of non-PAE FreeBSD, we can go either way - use VM_X86_MMAP or
+// not use it.  The absolute safest fix to this problem is to only set VM_X86_MMAP on
+// PAE FreeBSD kernels (in addition to Linux); however, I don't know of a way to detect
+// the PAE kernel easily.  Therefore, since using VM_X86_MMAP won't break anything on
+// non-PAE kernels [apparently], we'll just use it all the time on FreeBSD 32 bit.
+//     Now, you may ask the question: Why not change the entire test for just __unix__?
+// Unfortunately I cannot say anything about this because I don't have access to every
+// other system that has __unix__ defined, so I cannot possibly test all those cases to
+// make sure things work.  We'll just leave it with __linux__ and __FreeBSD__ to be safe.
+// If someone with a different flavor of UNIX running a PAE kernel has this problem too,
+// they can report the bug and we will adjust the line below accordingly.
+#if defined(__linux__) || defined(__FreeBSD__)
 #define VM_X86_MMAP
 #endif
 
_______________________________________________
ioquake3 mailing list
ioquake3@lists.ioquake.org
http://lists.ioquake.org/listinfo.cgi/ioquake3-ioquake.org
By sending this message I agree to love ioquake3 and libsdl.

Reply via email to