Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 May 2001 00:43:47 +0200
From:      Adriaan Rossouw <adriaan@ittc.co.za>
To:        freebsd-emulation@freebsd.org
Subject:   The sordid tale of Quake3Arena, DRI and the Linuxulator
Message-ID:  <01050400434702.02452@Insomnia.daemon.za.org>

next in thread | raw e-mail | index | archive | help
Well, the topic says it all, this is what ive been sinking my last few days into, 
and it has been a grand experiment at that. Every answer leads to more questions, 
but you'll see why in a second.

I own a matrox g450, which i bought mainly for the dual head features.
I dont really play games (QuakeC got me hooked on programming way back, 
and it all went downhill from there) , but I enjoy a fresh challenge.. 
and after several months of using this card for X (4.0.1/2 if you must know) , 
i FINALLY decided to get hardware 3d up and running 
( the challenges associated with this were numerous , before someone kindly patched the XFree86-4 port) ,
I also managed to get most of the GL ports in /usr/ports/games compiling 
(with the exception of XRacer.. kind of)

Now, i have a working install of XFree86 4.0.3 + DRI on FreeBSD 4.3-Stable
/usr/ports/games/quakeforge, compiles PERFECTLY runs as well as can be 
expected (50+fps at 1024X768X16bpp) considering i dont have a nvidia ge(nital)Force or something similiar.

Now, onto the next Experiment, i spy the quake3demo in ports, i go 
now that's a nice test. Activision requires me to have a valid credit card,
where is a 19 year old in a third world country (south africa) supposed 
to find a credit card, magically create one with a generator (yeah, right).
I go, screw this. borrow a friend's quake3arena cd. (win)
i go through the motions, as detailed in the numerous 
q3a + freebsd install faqs.  by numerous i mean 3, and all aimed at XF86 3.3.6 + Utah GLX
I cull <sp. kull?>  the neccesary info for installing, copying and upgrading quake3 to the most recent patch , etc
Now, comes the test , running it .. it requires a libGL, i link the freebsd libGL (which works) and it says wrong OS ABI.
i go "makes sense.. it is 'emulating linux'.

Off we go hunting for a rpm with the latest libGL, it takes me SEVERAL DAYS to find a rpm
(i absolutely , totally friggin HATE RPM'S , they were one of the major reasons for me
starting to use slackware (again) and then trying freebsd )
from mandrake (for 7.2) which has the neccesary file. obviously .. i dont want to install
all the files.. learn how to use rpm2cpio, copy the files.. no comprende.. needs
glibc 2.1.3 (linux_base 6.1 comes with glibc 2.1.2) , i go finding rpm's again
(did i mention that i hate rpms?) i end up getting the update rpm to RH 6.2
i try installing. unsuccessfull , some kind of cpio error. (if you want the error ill drudge it up for you)
i also manage to find a compiled version of the DRI libGL for my card (mga) on the dri site (in tgz format,
go figure)

i use rpm2cpio to extract the entire tree, copy it over /compat/linux/ , then run sbin/ldconfig (the compat one)
now!, i finally start quake3 .. seeing the intro screen .. i go YAY!, 30 second later, im still staring at the first frame.
UH OH. i get in a game (painfull, yes.. but i had t know) the space between frames gets longer.. but everything is pretty.
ive tried this with a number of different libGL.so's ... same results.

This is where i am currently, but I *think* i know what's going on. :
*DISCLAIMER, THIS IS BASED ON MY SOMEWHAT LIMITED UNDERSTANDING OF THE
FREEBSD/LINUX BINARY COMPATIBILITY LAYER*

I would love for you to prove me wrong.

Since the linuxulator is a binary compatibility layer, and the libGL.so's i found, were intended to be used via
the linux kernel modules (which dont exist , duh) , it is basically falling back on software, without knowing it does so.
It has no concept of the freebsd kernel modules (in this case mga.ko and drm.ko , and prolly agp.ko too) SO,
it will run , but not with direct hardware access,, since it can't break through the abstraction layer.

NOW, my first thought on this is, to write a wrapper library, which simply forwards all requests from quake3 (which
is written to look like libGL ) then it sends those requests to the FreeBSD libGL, but this begs the question
can one link a FreeBSD library to a Linux library (same arch however). It is doubtfull considering the state of abstraction
Now, my question to this forum is, is there such a feature/functionality in the linuxulator (possibly via the linux.ko file itself)
if not, should such code be written, because when the base does finally go to XF4 , i do see this becoming an issue.
i have no problem writing a wrapper lib , but deeper kernel module stuff is beyond me.

Yes, that's it.. ive ranted and raved long enough , any pieces of info or opinion on this subject will be appreciated.

Regards
  Adriaan Rossouw

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-emulation" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?01050400434702.02452>