Re: [AD] Porting Allegro to the PS2

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Friday 07 June 2002 04:41, Joshua Walker wrote:
[snip]
> It's linking against my X libs first of all (Bad thing, first of all
> even if it did work, the overhead of running X will not be benifical
> in making real games. I need a console driver as close to the metal
> as possible)

Run your configure script with `--without-x'. (Remember to make clean 
first!)

> and something is now amiss in my liballeg-4.0.1

Hmm... it seems that the 'iopl()' (I/O privilege level) call is not 
available on PS/2 linux. Presumably they have some other call instead. 
But I think these iopl() calls are only used in the VGA/ModeX type 
things again. As a quick fix, I have attached a patch which should 
(hopefully) stop all calls to iopl(). I can't test it though.

In the long run, these bits need to be wrapped in an autoconf test and 
not compiled if Allegro is compiled without VGA (ie. `--disable-vga'). 
The patch should be trivial; only I don't know how autoconf works. 
(Presumably it defines a preprocessor macro if VGA is required?).

Bye for now,
- - - -- 
Laurence Withers,  lwithers@xxxxxxxxxx
(GnuPG 04A646EA) http://www.lwithers.demon.co.uk/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9AHUDUdhclgSmRuoRAoi4AJ9bWhkhv53a1stIk3QlKTgh9QZ1ZwCggWsv
U1oR8WyGyPbMWlRhSPFGo/I=
=19bc
-----END PGP SIGNATURE-----
diff -rub allegro/src/linux/lsystem.c allegro-tmp/src/linux/lsystem.c
--- allegro/src/linux/lsystem.c	Fri May 17 17:12:02 2002
+++ allegro-tmp/src/linux/lsystem.c	Fri Jun  7 09:50:18 2002
@@ -165,16 +165,6 @@
 	_read_os_type();
 	if (os_type != OSTYPE_LINUX) return -1; /* FWIW */
 
-	/* This is the only bit that needs root privileges.  First
-	 * we attempt to set our euid to 0, in case this is the
-	 * second time we've been called. */
-	__al_linux_have_ioperms  = !seteuid (0);
-	__al_linux_have_ioperms &= !iopl (3);
-	__al_linux_have_ioperms &= !__al_linux_init_memory();
-
-	/* At this stage we can drop the root privileges. */
-	seteuid (getuid());
-
 	/* Initialise dynamic driver lists */
 	_unix_driver_lists_init();
 	if (_unix_gfx_driver_list)
@@ -186,10 +176,6 @@
 	/* Initialise the console subsystem */
 	if (__al_linux_init_console()) return -1;
 
-	/* Initialise VGA helpers */
-	if (__al_linux_have_ioperms)
-		if (__al_linux_init_vga_helpers()) return -1;
-
 	/* Install emergency-exit signal handlers */
 	old_sig_abrt = signal(SIGABRT, signal_handler);
 	old_sig_fpe  = signal(SIGFPE,  signal_handler);
@@ -250,9 +236,6 @@
 
 	/* free dynamic driver lists */
 	_unix_driver_lists_shutdown();
-
-	__al_linux_shutdown_memory();
-	iopl (0);
 }
 
 
diff -rub allegro/src/unix/uptimer.c allegro-tmp/src/unix/uptimer.c
--- allegro/src/unix/uptimer.c	Thu Mar 28 12:21:22 2002
+++ allegro-tmp/src/unix/uptimer.c	Fri Jun  7 09:44:57 2002
@@ -89,20 +89,6 @@
 
    block_all_signals();
 
-#ifdef ALLEGRO_LINUX
-   /* privileges hack for Linux:
-    *  One of the jobs of the timer thread is to update the mouse pointer
-    *  on screen.  When using the Mode-X driver under Linux console, this
-    *  involves selecting different planes (in modexgfx.s), which requires
-    *  special priviledges.
-    */
-   if ((system_driver == &system_linux) && (__al_linux_have_ioperms)) {
-      seteuid(0);
-      iopl(3);
-      seteuid(getuid());
-   }
-#endif
-
 #ifdef ALLEGRO_QNX
    /* thread priority adjustment for QNX:
     *  The timer thread is set to the highest relative priority.


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/