# FreeBSD on the PowerMac - problems with X



## kasumi (Nov 2, 2013)

Hello there 

I plan to use this PowerMac 7,3 as my desktop computer, therefore I need Xorg to run correctly. I was actually surprised that installing FreeBSD was THAT easy, even fan control and CPU temperature monitoring work out of the box - 44.5Â°C  But I just can't get Xorg running ...

Here's some basic information:

```
powerpcroot@asturias:~ # uname -a
FreeBSD asturias 9.2-RELEASE FreeBSD 9.2-RELEASE #0 r255898: Fri Sep 27 02:57:14 UTC 2013     root@snap.freebsd.org:/usr/obj/powerpc.powerpc64/usr/src/sys/GENERIC64  powerpc
```

I installed FreeBSD the binary way from CD, and then every single piece of software by ports - so x11/xorg, x11/xdm, x11-drivers/xf86-video-fbdev and a few on. The first error I got when entering startx was that the Module fbdev failed to load. After replacing "radeonhd" with "vesa" at the Driver point in Section screen, (I've read at http://149.20.54.209/showthread.php?t=30472 that my only option is to use vesa driver, what I actually don't have a problem with) I get the following:


```
root@asturias:~ # startx
xauth:  file /root/.serverauth.1326 does not exist
xauth: (argv):1:  bad display name "asturias:0" in "list" command
xauth: (stdin):1:  bad display name "asturias:0" in "add" command


X.Org X Server 1.7.7
Release Date: 2010-05-04
X Protocol Version 11, Revision 0
Build Operating System: FreeBSD 9.2-RELEASE powerpc 
Current Operating System: FreeBSD asturias 9.2-RELEASE FreeBSD 9.2-RELEASE #0 r255898: Fri Sep 27 02:57:14 UTC 2013     root@snap.freebsd.org:/usr/obj/powerpc.powerpc64/usr/src/sys/GENERIC64 powerpc
Build Date: 01 November 2013  11:21:34PM
 
Current version of pixman: 0.30.0
	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Sat Nov  2 11:55:08 2013
(==) Using config file: "/etc/X11/xorg.conf"
(EE) Screen(s) found, but none have a usable configuration.

Fatal server error:
no screens found

Please consult the The X.Org Foundation support 
	 at http://wiki.x.org
 for help. 
Please also check the log file at "/var/log/Xorg.0.log" for additional information.
#/* Here's a delay of about 5 seconds */
xinit: giving up
xinit: unable to connect to X server: Connection refused
xinit: server error
xauth: (argv):1:  bad display name "asturias:0" in "remove" command
```

I actually do not know what to do. My graphics card is a ATI Radeon 9600. I forgot to mention, I'm using the xorg.conf that X -configure generated. Should I upload it?

Any help would be great 

Cheers


----------



## xibo (Nov 2, 2013)

Run make deinstall in ${PORTSDIR}/x11-drivers and get rid of the /etc/X11 directory and it's contents, then reconfigure x11-drivers/xorg-drivers to build only vesa, mouse and keyboard, and install it.
The X11 settings should be stored in /usr/local/etc/X11 anyway (instead of /etc/X11), but you don't need an xorg.conf unless you need to manually edit it.

If it fails to start, post the output of X -configure and your ${HOME}/.xinitrc file.


----------



## kasumi (Nov 2, 2013)

Worked easily so far. But I had an idea: Can I use other graphics cards, e.g. my Nvidia 9500GT in the PowerMac? Normally it does not work, but is it the hardware or the software not supporting such cards on MacOS X?

I did everything you recommended, but without success:


```
root@asturias:~ # X -configure

X.Org X Server 1.7.7
Release Date: 2010-05-04
X Protocol Version 11, Revision 0
Build Operating System: FreeBSD 9.2-RELEASE powerpc 
Current Operating System: FreeBSD asturias 9.2-RELEASE FreeBSD 9.2-RELEASE #0 r255898: Fri Sep 27 02:57:14 UTC 2013     root@snap.freebsd.org:/usr/obj/powerpc.powerpc64/usr/src/sys/GENERIC64 powerpc
Build Date: 01 November 2013  11:21:34PM
 
Current version of pixman: 0.30.0
	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Sat Nov  2 17:42:10 2013
List of video drivers:
	vesa
(++) Using config file: "/root/xorg.conf.new"


Xorg detected your mouse at device /dev/sysmouse.
Please check your config if the mouse is still not
operational, as by default Xorg tries to autodetect
the protocol.

Your xorg.conf file is /root/xorg.conf.new

To test the server, run 'X -config /root/xorg.conf.new'
```


```
root@asturias:~ # cat /home/666/.xinitrc 
#!/bin/sh
exec /usr/local/bin/fluxbox
```

But still ...


```
root@asturias:~ # startx
xauth:  file /root/.serverauth.90167 does not exist
xauth: (argv):1:  bad display name "asturias:0" in "list" command
xauth: (stdin):1:  bad display name "asturias:0" in "add" command


X.Org X Server 1.7.7
Release Date: 2010-05-04
X Protocol Version 11, Revision 0
Build Operating System: FreeBSD 9.2-RELEASE powerpc 
Current Operating System: FreeBSD asturias 9.2-RELEASE FreeBSD 9.2-RELEASE #0 r255898: Fri Sep 27 02:57:14 UTC 2013     root@snap.freebsd.org:/usr/obj/powerpc.powerpc64/usr/src/sys/GENERIC64 powerpc
Build Date: 01 November 2013  11:21:34PM
 
Current version of pixman: 0.30.0
	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Sat Nov  2 17:44:15 2013
(==) Using config file: "/usr/local/etc/X11/xorg.conf"
(EE) Screen(s) found, but none have a usable configuration.

Fatal server error:
no screens found

Please consult the The X.Org Foundation support 
	 at http://wiki.x.org
 for help. 
Please also check the log file at "/var/log/Xorg.0.log" for additional information.

^Cxinit: giving up
xinit: unable to connect to X server: Connection refused
xinit: unexpected signal 2
xauth: (argv):1:  bad display name "asturias:0" in "remove" command
```

The same error, no matter who's executing it. Please have a look at my xorg.conf I left unconfigured so far:


```
root@asturias:~ # cat /usr/local/etc/X11/xorg.conf 
Section "ServerLayout"
	Identifier     "X.org Configured"
	Screen      0  "Screen0" 0 0
	InputDevice    "Mouse0" "CorePointer"
	InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
	ModulePath   "/usr/local/lib/xorg/modules"
	FontPath     "/usr/local/lib/X11/fonts/misc/"
	FontPath     "/usr/local/lib/X11/fonts/TTF/"
	FontPath     "/usr/local/lib/X11/fonts/OTF"
	FontPath     "/usr/local/lib/X11/fonts/Type1/"
	FontPath     "/usr/local/lib/X11/fonts/100dpi/"
	FontPath     "/usr/local/lib/X11/fonts/75dpi/"
EndSection

Section "Module"
	Load  "extmod"
	Load  "record"
	Load  "dbe"
	Load  "dri"
	Load  "dri2"
	Load  "glx"
EndSection

Section "InputDevice"
	Identifier  "Keyboard0"
	Driver      "kbd"
EndSection

Section "InputDevice"
	Identifier  "Mouse0"
	Driver      "mouse"
	Option	    "Protocol" "auto"
	Option	    "Device" "/dev/sysmouse"
	Option	    "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
	Identifier   "Monitor0"
	VendorName   "Monitor Vendor"
	ModelName    "Monitor Model"
EndSection

Section "Device"
        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz"
        ### [arg]: arg optional
        #Option     "ShadowFB"           	# [<bool>]
        #Option     "DefaultRefresh"     	# [<bool>]
        #Option     "ModeSetClearScreen" 	# [<bool>]
	Identifier  "Card0"
	Driver      "vesa"
	VendorName  "Advanced Micro Devices, Inc. [AMD/ATI]"
	BoardName   "RV350 [Radeon 9550/9600/X1050 Series]"
	BusID       "PCI:0:16:0"
EndSection

Section "Screen"
	Identifier "Screen0"
	Device     "Card0"
	Monitor    "Monitor0"
	SubSection "Display"
		Viewport   0 0
		Depth     1
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     4
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     8
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     15
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     16
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     24
	EndSubSection
EndSection
```

What about the AllowEmptyInput option? If at all, where do I have to add this line?


----------



## xibo (Nov 2, 2013)

kasumi said:
			
		

> Worked easily so far. But I had an idea: Can I use other graphics cards, e.g. my Nvidia 9500GT in the PowerMac? Normally it does not work, but is it the hardware or the software not supporting such cards on MacOS X?



No idea, but on FreeBSD, nvidia currently works best. You'll have to install x11/nvidia-driver (it's not pulled by x11-drivers/xorg-drivers and also needs to be rebuilt/updated after every FreeBSD update), kldload nvidia and rerun X -configure to get an nvidia config.

Eventually you can drop the kldload part for X -configure, but you definitely need it to run the X server.



			
				kasumi said:
			
		

> I did everything you recommended, but without success:
> 
> 
> ```
> ...


Does it work if you delete the xorg.conf, i.e. force it to run the autodetection on X11 server startup instead of providing one?



			
				kasumi said:
			
		

> What about the AllowEmptyInput option? If at all, where do I have to add this line?


It goes into the *ServerLayout* Section of the xorg.conf file, but on FreeBSD you can avoid using that by rebuilding x11-servers/xorg-server with the HAL option turned off. AllowEmptyInput is used if X11 doesn't load your mouse and/or keyboard, though I doubt it will effect the screen.


----------



## kasumi (Nov 2, 2013)

When removing xorg.conf, I get almost the same error:


```
(==) Log file: "/var/log/Xorg.0.log", Time: Sat Nov  2 18:59:38 2013
Primary device is not PCI
(==) Using default built-in configuration (12 lines)
(EE) Failed to load module "fbdev" (module does not exist, 0)
(EE) No drivers available.

Fatal server error:
no screens found
```

AllowEmptyInput did not work either.

One question. How do I reconfigure and rebuild the port correctly?

EDIT: Rebuilt it without HAL support - same result ...


----------



## sossego (Nov 2, 2013)

There is a thread available for Xorg and related items to the PowerMac : http://forums.freebsd.org/showthread.php?t=13827 .
You must use the 
	
	



```
-retro
```
 flag when using `# Xorg -configure` .
Is the device a 32 or 64 bit PowerPC ?
If the error is not solved, please ask for assistance on the freebsd-ppc@freebsd.org list.

What model is it? Someone on here or on the mailing list may have an xorg.conf that you could import.


----------



## kasumi (Nov 3, 2013)

Still the same error ... But I do not know how to rebuild and reinstall a port including all its dependencies.

hw.machine: powerpc
hw.model: IBM PowerPC 970FX
hw.ncpu: 2
I tried to install everything as 64-bit as possible.
hw.machine_arch: powerpc64
Here you go 

Guess I'll write a mail then. Thanks for your help though.


----------



## sossego (Nov 4, 2013)

You have a PowerMac G5. Definitely go to the mailing list on that one. 
You need to do a `pkg help delete` to see the flags for deleting dependencies. Although that may not be the case.
Apologies.


----------



## kasumi (Nov 4, 2013)

Just got the first bunch of mail, seems great!

The first thing I can say by now is that trying VESA didn't help in my case. VESA can only be used if there's a PC BIOS on the card. I installed xf86-video-ati via ports and replaced vesa by radeon in xorg.conf. It finally worked after changing the DVI connector my monitor is plugged into. 800x600. Big deal.

Thank you so very much and good luck to all visitors


----------

