Subject: NuBus color kernels + sources
To: None <port-mac68k@NetBSD.ORG>
From: Taras Ivanenko <ivanenko@ctpa03.mit.edu>
List: port-mac68k
Date: 10/21/1996 22:54:12
I put my Nubus color test code to ctpa01.mit.edu:/pub/ivanenko/macbsd
My original sources were supped on Oct. 18, I looked briefly at the
last SUP, the changes there seems to be small.

Here is the list of the files there:

netbsd.GENERIC.color.gz --- the GENERIC kernel with the NuBus driver
		code compiled in 
netbsd.TARAS.gz --- my own kernel. It works on IIcx without Ether and
		boot/swap hardcoded to sd1
TARAS --- the configuration file for the kernel above
macbsd_video.961018.tar.gz -- the sources for the kernels (only
		changed files, of course) 
macbsd_video.961018.diff.gz -- diff to the Oct.18 -current sources
new-files -- the list of changed files
grftest1.c --- small test program to see how the kernel works,
		compile it and run from single-user mode
		it should display the stripes on half-screen (1-bit
		mode) then nice palette in 8-bit mode and then switch
		back to 1-bit mode.
grftest.c --- more extensive testing program, if grftest1 works, it
		should work too.


How it works:
  On boot the grf (NetBSD) driver tries to load the video driver from the
card's ROMand call it's open routine. If this operation fails, it uses
the old very restricted driver. If open is successfull, the grf driver
uses driver functions for ioctl; calls. So if the initial open() does
not hang your machine, you should have at least some ability to work.
The kernel tries to guess the correct video mode from videobitdepth
variable passed from the Booter. Only after mode change the driver
"knows for sure" what is the current video mode. 

When the device /dev/grf? is closed, the driver switches back to 1-bit
B/W mode. As a side effect, you can switch to this mode at any time
after boot by 
echo -n "" >/dev/grf0
or
cat </dev/grf0>/dev/null

One an the only Xserver which gives color X is the colorkit server
from puma. It works fine for me (thanks to COMPAT_11 option?)

If those kernel do not work with your hardware, send me a note. It may
be just a matter of adding few Slot Manager routines.

I put comments in the sources where I found some tricks.

Enjoy!
		Taras Ivanenko <ivanenko@ctpa03.mit.edu>