Subject: xsrc/25036: Fatal server error on PowerBook
To: None <>
From: None <>
List: netbsd-bugs
Date: 04/03/2004 12:39:01
>Number:         25036
>Category:       xsrc
>Synopsis:       Fatal server error on PowerBook
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    xsrc-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Apr 03 12:40:01 UTC 2004
>Originator:     Krister Walfridsson
>Release:        NetBSD 1.6ZL
NetBSD macppc 1.6ZL NetBSD 1.6ZL (KWA) #0: Tue Mar 30 00:15:02 CEST 2004  cato@pc:/usr/local/tmp/nbsd040328/src/sys/arch/macppc/compile/KWA macppc
Architecture: powerpc
Machine: macppc

   XFree86 -configure

on my PowerBook fails with the error

   Fatal server error:
   xf86MapVidMem: could not mmap screen [s=40000,a=c0000] (Invalid argument)

   When reporting a problem related to a server crash, please send
   the full server output, not just the last messages.
   This can be found in the log file "/var/log/XFree86.0.log".
   Please report problems to

That is, it tries to map a frame buffer at the address 0xc0000, which
according to a comment in the code is the legacy V_BIOS range on the
ISA bus.

The code in question is protected by #ifdef _PC, and the Imakefile
does define this for i386 and amd64 only, but building from the NetBSD
src/x11 defines it for all architectures.
The patch below fix my problem (but I'm not sure if some more of our
more obscure architectures might want to define _PC too...)

Index: Makefile
RCS file: /cvsroot/src/x11/Xserver/hw/xfree86/int10/Makefile,v
retrieving revision 1.3
diff -u -r1.3 Makefile
--- Makefile	7 Feb 2004 06:52:07 -0000	1.3
+++ Makefile	3 Apr 2004 12:32:38 -0000
@@ -13,7 +13,11 @@
 	prim_ops.c sys.c
-		-D_X86EMU -D_PC
+		-D_X86EMU
+.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
 CPPFLAGS+=	-I${X11SRCDIR.xc}/programs/Xserver/hw/xfree86/common \
 		-I${X11SRCDIR.xc}/programs/Xserver/hw/xfree86/os-support \