From: dwex@cbnewsj.cb.att.com (david.e.wexelblat)
Subject: Re: X and a Realtek RTVGA Adapter
Organization: AT&T
Date: Tue, 15 Dec 1992 13:37:27 GMT

In article <1geg37INN5s5@usenet.INS.CWRU.Edu> sdh@po.CWRU.Edu (Scott D. Heavner) writes:
> 
> 
> 	I am currently running Linux on my 486 and would like to
> get X running in color.  Currently I am only able to run the generic
> monochrome server.  What I would like to know is:
> 
> 	1) Has anyone else gotten an RTVGA adapter working
> 

Not that I'm aware of.  What chipset does it use?

> 	2) What will I have to do to create my own driver?  Do I
> 	   just create my own driver in the vga256/drivers directory with
> 	   driver.c and banks.s and if so, which would be the best 
> 	   driver to build from (i.e. should I modify a trident original
> 	   or one of the Tseng cards?

You need the programmer's reference/tech manual/whatever for the chipset
(to get details on the extended register definitions).  Once you have that,
study up on what you need to do to handle:

	1) Clock selection
	2) Bank switching
	3) Extended mode/timing parameters, if any

You then generate a driver.c and bank.s file as appropriate for your
chipset.  You need a probe function that can identify your chipset,
and save/restore functions that handle any extended registers that you
will be manipulating in your other functions.  Each driver specifies
the same functions, beginning with a tag, all in uppercase (e.g.
ET4000Probe, TVGA8900Ident, etc).

Which driver to use as a model depends on a few factors:

	1) If your chipset only supports one bank register, follow
	   the Trident example.
	2) If identifying your chipset requires you look for a
	   signature in the BIOS, look at the probe functions for the
	   PVGA1 and GVGA drivers.
	3) Otherwise, look at the ET3000 driver.  The ET4000 driver has
	   a few complications that are unnecessary for other chipsets.
	4) Avoid the ATI driver (:->).  It is quite different from the
	   others in several respects.

To link in your new driver, you add the name of your subdirectory under
drivers to Vga256Drivers (or whatever that is - I don't have it in front
of me) in the site.def file under mit/config.  Run 'make Makefiles' in
mit/config, then go to mit/server, run 'make Makefile' followed by 
'make Makefiles depend all'.  This will cause your new driver to be 
located and compiled in.

If this is the first time you've ever hacked SVGA register definitions,
expect things to not work.  Be prepared for it:

	1) If at all possible, have an additional terminal hooked up,
	   because you will likely lose your console display.
	2) Be sure to 'sync' before starting the server, because you
	   may get into a state where the system locks up, and you need
	   to hard-reset.
	3) Work incrementally, keeping track of what changes you make in
	   wach iteration.

Don't get frustrated by failures.  This type of programming is not something
a lot of people do.  The Trident driver, for example, took several weeks of
work for two people.

> 
> 
> 
> 				Scott Heavner
> 
> -- 
> HELP! I'm being held prisoner in a .sig file factory.

Most important of all (:->) when you get working code, send it to 
xfree86@physics.su.oz.au, so that we can integrate it into the main release.
Anyone who is contemplating this type of development should join our
beta group, if they haven't already.  Send email to the above address to
join.

--
David Wexelblat <dwex@mtgzfs3.att.com>  (908) 957-5871
AT&T Bell Laboratories, 200 Laurel Ave - 3F-428, Middletown, NJ  07748

"The meaning of life?  That's simple.  Try to be happy, try not to hurt
 other people, and hope to fall in love."  -- Mallory Keaton
Newsgroups: comp.windows.x.i386unix