Welcome to Linux Forums!

With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.

Linux Forum ArticlesLinux ForumsLinux Forum DownloadsLinux Hosts
Home|Register|FAQ|Member List|Calendar|Unanswered Posts|Forum Rules|Today's Posts|Advanced Search|
SEARCH FOR IN
Go Back   Linux Forums > Linux Resources > Linux Tutorials, HOWTO's & Reference Material
Reload this Page XF86Config tutorial
Linux Forums
Linux Forums
Welcome To The Linux Forums!
Welcome to Linux Forums. We pride ourselves in being one of the largest Linux communities on the web, we encourage you to REGISTER on our forums and participate in the community. There are over 150,000 members ready to answer your questions. JOINING US today will allow you to make new posts, get support, send messages to other members and submit downloads to our downloads directory and many other great features!

Linux Tutorials, HOWTO's & Reference Material A useful collection of tutorials, guides and reviews compiled here for easy reference purposes.

 
 
Thread Tools Display Modes
Old 05-21-2004   #1 (permalink)
ooop
Linux Newbie
 
Join Date: Apr 2004
Location: Stockholm, Sweden
Posts: 130
Send a message via ICQ to ooop
XF86Config tutorial

NOTE: if you read the tutorial and are still experiencing difficulties and would like help, you are asked to start a new topic on the forums.
Please do NOT reply to this thread to ask a technical question. Replies to THIS thread should be corrections and enhancements on the tutorial/howto only.
Thanks in advance for your co-operation.
LinuxForums.org

------------------------------------------

XFree86Config

After having answered/noticed quite a few questions concerning setup of XFree86 (or X.org), I thought I'd write a short tutorial on how to manually write your own XF86Config. This guide is by no means complete, and is only written so that the most basic problems may be resolved. There are a _LOT_ of options you could put in your XF86Config, and most of them will not be covered in this tutorial. If you want to know try man XF86Config, man X and all the other man:s. And don't forget : most distros come with an XF86Config.example or similar, that is often worth checking out.

The XF86Config file is divided into different Sections. The main outline is this
Code:
Section "foo"
	Option "bar"
	Option "bore"
	Option "snore"
EndSection
Sometimes there may also be a subsection stuck in there, which works in the same way.

First out is the files section:
Code:
Section "Files"
	RgbPath		"/usr/X11R6/lib/X11/rgb"
	FontPath 	"/usr/X11R6/lib/X11/fonts/local"
	FontPath 	"/usr/X11R6/lib/X11/fonts/misc"
	FontPath 	"/usr/X11R6/lib/X11/fonts/100dpi"
	FontPath 	"/usr/X11R6/lib/X11/fonts/75dpi"
	FontPath 	"/usr/X11R6/lib/X11/fonts/truetype"
	FontPath 	"/usr/X11R6/lib/X11/fonts/TTF"
	ModulePath	"/usr/X11R6/lib/modules"
EndSection
In this section you specify where your rgb, fonts and modules reside respectively. The rgb setting will probably never need to be changed. For fonts you can add however many fontpaths you want, in case you installed them somewhere unusual. Finally, modulepath, which most often isn't needed either, since if you don't specify, it assumes /usr/X11R6/lib/modules. If you have some weird X module lying around somewhere else than /usr/X11R6/lib/modules, feel free to add the directory path like this.

Next section is Module:

Code:
Section "Module"
	Load "extmod"
	Load "type1"
	Load "freetype"
	Load "dbe"
	Load "glx"
	...
	...
EndSection
Here, you specify all modules you want the Xserver to load. "type1" and "freetype" are modules that add support for fonts, "glx" adds support for the glx graphics extension, "extmod" is a general extension module and there can also go a lot of other mysterious things here. Just make sure you have the modules available in your module directory.

Movin on, here comes keyboard stuff :
Code:
Section "InputDevice"
	Identifier	"Keyboard0"
	Driver 		"keyboard"
	Option		"autorepeat"	"500 5"
	Option 		"CoreKeyboard"
	Option		"XkbModel"	"pc102"
	Option		"XkbLayout"	"se"
EndSection
This section is REALLY important, although fortunately, most people don't seem to have much problem with it. Identifier can be whatever you want to call your keyboard, driver will exclusively be "keyboard", and the rest is optional:

autorepeat sets the keyboard autorepeat rate
CoreKeyboard if this it the main keyboard of the computer(probably is) then use this option
XkbModel the keyboard model
XkbLayout the keyboard layout, usually your country code

If you are really interested you could always check /usr/X11R6/lib/X11/doc/README.xkb for more keyboard info. (for even more pointless reading, check out the /usr/X11R6/lib/X11/xkb directory, for complete listings of different keyboard layouts and such, the rest of us usually just go for "pc102" or "pc104" or "p105")

Here goes mouse!
Code:
Section "InputDevice"
	Identifier	"Mouse0"
	Driver		"mouse"
	Option		"Protocol"	"PS/2"
	Option		"Device"	"/dev/psaux"
	Buttons		"5"
	Option		"ZAxisMapping"  "5" "6"
	Option		"CorePointer"
EndSection
The first two require no explanation. Identifier is whatever you like, Driver is always mouse. And now, for the options:

Protocol "PS/2" or "auto" or "IMPS/2" or "usb" or "IntelliMouse"

PS/2 means a ps2 mouse. Always try this first. You can also try setting it to "auto" which is most often supported. For USB-mice, you may want to set it to "IMPS/2" or "usb". For IntelliMice, use "IntelliMouse" For more options, check /usr/X11R6/lib/X11/doc/README.mouse

Device "/dev/mouse" or "dev/psaux" or ...

/dev/mouse for PS/2 mice, usually /dev/psaux for USB-mice.

Buttons "2" or "3" or "4" or "5" or "6" ot ...

One guess what this means. Don't forget that the mousewheel sometimes counts as three buttons, one for when you press it, and one for each direction.

ZAxisMapping "3" "4" or "4" "5" or ...

The two "mouse buttons" that make up the mouse-wheel. If it doesn't work, try changing it around for a bit, but for a three-button mouse(with either a separate third button or clickable wheel), the usual answer is "4" "5".
This should cover most of the situations in which might find yourself in.
Worth noticing is also, of course, that a USB Mouse won't work without USB-support.
Check your kernel-config for usbcore, usb-uhci(or ohci, or ehci) and hid.

CorePointer Means this is the main pointing device.

On to the Monitors:
Code:
Section "Monitor"
	Identifier 	"Monitor0"
	VendorName 	"MonitorCorp."
	ModelName  	"SuperMonitor 2000"
	HorizSync  	30.0 - 70.0
	VertRefresh	50.0 - 160,0
EndSection
VendorName and Modelname are highly irrelevant. HorizSync and VertRefresh should be checked in you monitor manual.
(the values in this example are fairly common for 17" monitors)

And on to the graphics card:
Code:
Section "Device"
	Identifier	"Card0"
	Driver		"nvidia"
	BoardName	"Geforce2 GTS"
	BusID		"PCI:1:0:0"
EndSection
Driver "nv" or "nvidia" or "ati" or "ativga" or ...

Driver can be set to a few different things here. As far as I know, for nvidia cards there is either "nvidia" or "nv". "nv" is the default XFree86 nvidia driver, while "nvidia" is nVidias own driver. For ATI cards, the default value is "ati", the XFree86 ATI driver. "ativga" will do the same, except without graphics acceleration.

BusID should be set to whatever PCI bus(or AGP bus) your card is located at. Most often it is PCI:1:0:0. (mine is on AGP, but the AGP is actually "PCI:1:0:0")

Last section(screen):
Code:
Section "Screen"
	Device 	"Card0"
	Monitor	"Monitor0"
this section should start of with the ID:s of the card and monitor you have specified higher up (you can of course have multiple screens if you have multiple cards and monitors.

continuing...
Code:
	DefaultDepth 24
	SubSection "Display"
		Depth		8
		Modes		"800x600" "640x480"
	EndSubSection
	SubSection "Display"
		Depth		24
		Modes		"1600x1200" "1152x864" "1024x768"
	EndSubSection
EndSection
This really isn't that tricky. DefaultDepth tells the Xserver what color depth to start at. The different "Display"-subsections tells the server what capabilities your card/monitor configuration has. You do not _NEED_ to specify all capabilites of your card/monitor. I usually just specify the highest colordepth and a few of the highest resolutions, and then one emergency mode with colordepth 8 and modes 800x600 and 64x480.

These values are legal for Depth (and DefaultDepth):
1, 2, 4, 8, 15, 16, 24, (32)
although I have read that 32 is just pseudo for 24. Anyway, your graphics card might not support all these, so be sure to check
your manual which of these combinations of resolution and color-depth are legal. Oh, and I forgot, you can if you absolutely haven't got anything better to do, insert these kind of "Display"-subsections in the Monitor section as well.

There are two more Sections that I won't talk about("ServerFlags and "ServerLayout"), because if you have gotten this far, your Xserver should be up and running, and you can find it out for your self. Google!
ooop is offline  
Old 07-07-2004   #2 (permalink)
configurationspace
Just Joined!
 
Join Date: Jul 2004
Location: Oregon
Posts: 3
I have an XF86Config-4 file, but not an XF86Config file. What's going on with that? Is there some difference, is the -4 there for some reason?
configurationspace is offline  
Old 07-07-2004   #3 (permalink)
Dolda2000
Linux Guru
 
Join Date: Oct 2001
Location: Täby, Sweden
Posts: 7,575
In the beginning of XFree86 version 4, many distributions shipped with both version 4 and an older version 3.3 for video cards that did not yet have drivers in version 4.

In order for their config files not to be mistaken for each other, XFree86 version 4 was made to prefer the XF86Config-4 file, if it existed (it uses XF86Config if there is no XF86Config-4), while version 3.3 always used the XF86Config file.

Now that no distros ship version 3 anymore, you can still name the config file XF86Config-4, and some distros still do for unknown reasons, but you can equally well name it XF86Config. It's the same now.

XFree86 4 tries many other config file names as well. See the XF86Config manpage to see all the file names it tries.
Dolda2000 is offline  
Old 10-31-2004   #4 (permalink)
rodbutcher
Just Joined!
 
Join Date: Oct 2004
Location: Sydney, Oz
Posts: 2
For x.org 6.8.1 you'll need to change the driver for keyboard to kbd or you won't load a keyborad. i.e.
Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
Option "autorepeat" "500 5"
Option "CoreKeyboard"
Option "XkbModel" "pc102"
Option "XkbLayout" "se"
EndSection

In fact, that's the only change I had to make from xfree86 to x.org.
rodbutcher is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT. The time now is 02:06 PM.




© 2000 - 2008 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.0.0