[successivo] [precedente] [inizio] [fine] [indice generale] [indice ridotto] [indice analitico] [volume] [parte]


Capitolo 215.   SVGAlib

I sistemi GNU/Linux funzionanti su elaboratori con architettura x86 possono utilizzare la scheda grafica attraverso la libreria SVGAlib. Normalmente, la grafica viene utilizzata attraverso X Window System, ma sono disponibili molti programmi, spesso giochi, che non hanno bisogno di tutto l'apparato di X e si servono semplicemente di tale libreria.

La libreria SVGAlib richiede una configurazione e di solito offre alcuni programmi di servizio che comunque non sono indispensabili.

215.1   Configurazione

La libreria SVGAlib richiede la presenza di un file di configurazione, che di solito corrisponde a /etc/vga/libvga.config, nel quale occorre specificare le caratteristiche dell'adattatore grafico e del dispositivo di puntamento (il mouse). È ammissibile anche la presenza di un file di configurazione personalizzato, corrispondente a ~/.svgalibrc, oppure al file indicato nella variabile di ambiente SVGALIB_CONFIG_FILE.

In generale, il file contiene direttive secondo la forma seguente, mentre le righe vuote o bianche e il testo che appare dopo il simbolo #, vengono ignorati:

opzione valore

Di norma viene fornito un file di configurazione già predisposto in linea di massima, con le annotazioni esplicative di come si possono usare o modificare le direttive esistenti. Come accennato, le cose più importanti da specificare sono le caratteristiche dell'adattatore grafico e del mouse. Per quanto riguarda l'adattatore grafico, se ne può specificare il tipo, se non si vuole lasciare che venga individuato in modo automatico; ecco le note che si possono trovare nel file a questo proposito:

# Chipset type:
#
# Use one of the following force chipset type.
# Autodetects if no chipset is specified.
#
# If you have a PCI or AGP card, don't use chipset type forcing.
# If the card is not autodetected, its a bug, and it will probably
# not work even with forcing. Try running vgatest (with no chipset 
# line), and send to me (matan@svgalib.org) the output, a copy of
# /proc/pci (or lspci -n -vv) and whatever info you have on the card. 
#
# If a chipset driver gives trouble, try forcing VGA.

# chipset VGA           # Standard VGA
# chipset EGA           # EGA
# chipset ET3000        # Tseng ET3000
# chipset ET4000        # Tseng ET4000
# chipset Cirrus        # Cirrus Logic GD542x
# chipset TVGA          # Trident TVGA8900/9000
# chipset Oak           # Oak Technologies 037/067/077
# chipset S3            # S3 chipsets
# chipset GVGA6400      # Genoa 6400
# chipset ARK           # ARK Logic
# chipset ATI           # old ATI VGA
# chipset Mach32        # ATI Mach32
# chipset ALI           # ALI2301
# chipset Mach64        # ATI Mach64 - deprecated
# chipset ET6000        # Tseng ET6000
# chipset APM           # Alliance Technology AT 24/25/3D
# chipset NV3           # nVidia Riva 128 / TNT / GeForce
# chipset VESA          # nicely behaved Vesa Bioses
# chipset MX            # MX86251 (some Voodoo Rush boards)
# chipset PARADISE      # WD90C31
# chipset RAGE          # RagePro (and might work with some older mach64)
# chipset BANSHEE       # Banshee/V3.
# chipset SIS           # SiS 5597/6326/620/530 cards / integrated vga.
# chipset I740          # Intel i740 based cards.
# chipset NEOMAGIC
# chipset LAGUNA        # Cirrus Logic Laguna series (546X)
# chipset FBDEV         # Use kernel fbdev, instead of direct hardware.
# chipset G400          # Matrox Mystique/G100/G200/G400/G450
# chipset R128          # Ati Rage128
# chipset SAVAGE        # S3 chipsets Savage
# chipset C&T           # Chips and Technologies

Supponendo di voler forzare l'uso di un adattatore VESA, si potrebbe scrivere così:

chipset VESA

Sempre a proposito dell'adattatore grafico, si devono indicare le frequenze di scansione orizzontale e verticale:

# Only one range can be specified for the moment.  Format:
# HorizSync min_kHz max_kHz
# VertRefresh min_Hz max_Hz

# Typical Horizontal sync ranges
# (Consult your monitor manual for Vertical sync ranges)
#
# 31.5 - 31.5 kHz (Standard VGA monitor, 640x480 @ 60 Hz)
# 31.5 - 35.1 kHz (Old SVGA monitor, 800x600 @ 56 Hz)
# 31.5 - 35.5 kHz (Low-end SVGA, 8514, 1024x768 @ 43 Hz interlaced)
# 31.5 - 37.9 kHz (SVGA monitor, 800x600 @ 60 Hz, 640x480 @ 72 Hz)
# 31.5 - 48.3 kHz (SVGA non-interlaced, 800x600 @ 72 Hz, 1024x768 @ 60 Hz)
# 31.5 - 56.0 kHz (high frequency, 1024x768 @ 70 Hz)
# 31.5 - ???? kHz (1024x768 @ 72 Hz)
# 31.5 - 64.3 kHz (1280x1024 @ 60 Hz)

HorizSync 31.5 35.5
VertRefresh 50 90

Come spiega la descrizione contenuta nel file di configurazione, la frequenza orizzontale è espressa in kilohertz (simbolo: «kHz»), mentre quella verticale in hertz (simbolo: «Hz»). L'esempio seguente si riferisce a una configurazione tipica associata a un adattatore grafico VESA:

HorizSync   30 50
VertRefresh 50 90

Per quanto riguarda il dispositivo di puntamento, occorre specificare il tipo:

# Mouse type:

# mouse Microsoft       # Microsoft
# mouse MouseSystems    # Mouse Systems
# mouse MMSeries        # Logitech MM Series
# mouse Logitech        # Logitech protocol (old, newer mice use Microsoft protocol)
# mouse Busmouse        # Bus mouse
# mouse PS2             # PS/2 mouse
# mouse MouseMan        # Logitech MouseMan
# mouse Spaceball       # Spacetec Spaceball
# mouse IntelliMouse    # Microsoft IntelliMouse or Logitech MouseMan+ on serial port
# mouse IMPS2           # Microsoft IntelliMouse or Logitech MouseMan+ on PS/2 port
# mouse pnp             # plug'n'pray
# mouse WacomGraphire   # Wacom Graphire tablet/mouse
# mouse DRMOUSE4DS      # Digital Research double-wheeled mouse
# mouse none            # None

mouse unconfigured

Supponendo di gestire il dispositivo di puntamento attraverso il demone GPM (capitolo 116), disponendo di un mouse con la rotellina centrale, si utilizza normalmente il tipo «IntelliMouse»:

mouse IntelliMouse

Infine, occorre specificare il file di dispositivo associato al mouse:

# Usually /dev/mouse will be a link to the mouse device.
# However, esp. with the Spacetec Spaceball you may
# want to specify a different device for svgalib to use

# mdev /dev/ttyS0 # mouse is at /dev/ttyS0

Sempre seguendo l'esempio di utilizzo di GPM, conviene configurare così:

mdev /dev/gpmdata

Eventualmente, se il puntatore grafico del mouse non scorre alla velocità che si desidera, occorre intervenire su alcune direttive, dove si può anche annullare del tutto l'accelerazione:

# mouse_accel_type      normal  # No acceleration while delta is less then
                                # threshold but delta is multiplied by
                                # mouse_accel_mult if more. Originally done by
                                # Mike Chapman mike@paranoia.com

mouse_accel_type        power   # The acceleration factor is a power function
                                # of delta until it reaches m_accel_mult. It
                                # starts from the coordinate 
                                # [1, 1 + m_accel_offset] and goes to
                                # [m_accel_thresh, m_accel_mult]. If delta
                                # is bigger then m_accel_thresh it is a plain
                                # constant (m_accel_mult). It is the f(delta)
                                # function with which the delta itself will be
                                # multiplied. m_accel_offset is 1 by default,
                                # so for delta = 1 the accelerated delta will
                                # remain 1 (You don't lose resolution). The
                                # starting point of the f(delta) function
                                # might be moved along the Y axis up/down with
                                # m_accel_offset thus defining the initial
                                # minimum acceleration (for delta = 1).
                                # Basically it's like the normal mode but the
                                # acceleration factor grows as you move your
                                # mouse faster and faster, not just turns in
                                # and out. Threshold is the point from where
                                # the f(delta) function gets linear.
                                # This is the one I use for *uaking... =)

# mouse_accel_type      off     # No comment...


mouse_accel_mult        60      # This is the number with which delta will
                                # be multiplied. Basically it's the number
                                # that defines how big the acceleration will
                                # be

mouse_accel_thresh      4       # This is the threshold. See description by
                                # power

mouse_accel_power       0.8     # This is the second parameter of the power
                                # function used in power mode. Used only by
                                # the power mode

mouse_accel_offset      30      # This is the offset of the starting point
                                # on the Y axis. With this you can define the
                                # number that will multiply delta = 1 so it's
                                # the initial acceleration.

# mouse_accel_maxdelta  600     # This is an upper limit for delta after
                                # the acceleration was applied

# mouse_maxdelta        30      # This is an upper limit for the delta
                                # before the acceleration. With this one you
                                # can limit the biggest valid delta that
                                # comes from the mouse.

# mouse_force                   # Force parameters even if they seem strange
                                # By default svgalib prints an error if any
                                # of the numbers are somehow out of the
                                # reasonable limit, (Like a negative mult :)
                                # and uses the default that's in vgamouse.h

Appunti di informatica libera 2007.02 --- Copyright © 2000-2007 Daniele Giacomini -- <daniele (ad) swlibero·org>


Dovrebbe essere possibile fare riferimento a questa pagina anche con il nome svgalib.htm

[successivo] [precedente] [inizio] [fine] [indice generale] [indice ridotto] [indice analitico]

Valid ISO-HTML!

CSS validator!