*BSD News Article 11410


Return to BSD News archive

Received: by minnie.vk1xwt.ampr.org with NNTP
	id AA1775 ; Tue, 23 Feb 93 14:57:38 EST
Newsgroups: comp.unix.bsd
Path: sserve!manuel.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!agate!howland.reston.ans.net!wupost!csus.edu!netcom.com!hasty
From: hasty@netcom.com (Amancio Hasty Jr)
Subject: Re: programming the VGA with 386BSD
Message-ID: <1993Feb20.164017.4400@netcom.com>
Organization: Netcom Online Communications Services (408-241-9760 login: guest)
References: <1993Feb19.231451.6605@mcshub.dcss.mcmaster.ca>
Date: Sat, 20 Feb 1993 16:40:17 GMT
Lines: 30

In article <1993Feb19.231451.6605@mcshub.dcss.mcmaster.ca> dsantry@maccs.mcmaster.ca (Doug Santry) writes:
>I was wondering if anyone knows how to program the VGA under bsd.  I
>want to change the videomode to one of my SVGA modes and then turn
>on pixels, when done return to the standard text mode.  I assume that the
>kernel wouldn't let me write bytes to my VRAM because my session doesn't
>own the memory.  I also don't know how to change the videomode since I would
>have to write to the video card's registers.  Is there anyway to get the
>card's BIOS routines to work under bsd?  I have never done any UNIX low-level
>programming before so some advice or a solution would be greatly appreciated.
>

The kernel has to give you access to the in/out instructions.
We use the pccons to enable/disable permissions to allow access
to the privilege instructions.
For a great illustration on how to program the VGA see 
the Xfree86 server code. On XS3 which is uses the same procedure
the routines are x386Init.c, x386Config.c, and ibm8514init.c.

I once took code right out of ibm8514init.c to initialize my vga and
I re-compiled it with almost no problems on my dos set-up. With it I was
able to fully initialize and perform a few graphic primitives under dos.


Amancio

-- 
This message brought to you by the letters X and S and the number 3
Amancio Hasty           |  
Home: (415) 495-3046    |  ftp-site depository of all my work:
e-mail hasty@netcom.com	|  sunvis.rtpnc.epa.gov:/pub/386bsd/incoming