Subject: Re: Xmac68k_color and grf ioctl's
To: David P. Reese Jr. <>
From: Frederick Bruckman <>
List: port-mac68k
Date: 01/04/2004 09:35:33
On Sun, 4 Jan 2004, David P. Reese Jr. wrote:

> On Sat, Jan 03, 2004 at 10:38:10PM -0600, Frederick Bruckman wrote:
> > On Sat, 3 Jan 2004, David P. Reese Jr. wrote:
> >
> > > Where did the ioctl's in grfioctl_extra.h come from?  I can't find anything
> > > like GRFIOCSETMODE1 in the kernel source.  It seems like Xmac68k_color
> > > was written with the intent of expanding the grf interface.
> >
> > At one time, there were patches floating around, but they were never
> > pulled in for some reason or another. The new cool thing is wscons(4)
> > and wsdisplay(9)..., but I can't see a trivial API to get the address
> > of the frame buffer. [rasops(9)?]
> I think moving to wscons in the long run would be a good idea.  We should
> just be able to mmap /dev/ttyE0 for the first macfb.  In order to obtain
> the offset, we could add a MACFBIO_GCONF to macfb_ioctl() that would
> return some interesting stuff about the frame buffer.  This is how the
> hpcfb works.

Sounds like you have a plan!

> > Probably best to stick to what you see in <mac68k/grfioctl.h> -- in
> > other words, GRFIOCGMODE, as undocumented as it is.
> It's not completely undocumented.  I have the source. :)
> I'll try to pull in the color support code from Xmac68k_color without
> any of the mode switching stuff.  Mode switching won't work without
> some kernel work on grf and those mentioned patches.  If I ever find
> them, I'll try to adapt them to the wscons framework as it probably has
> a bit more life in it than grf.

I was thinking of Paul Goyette's SLOTMAN kernels. Take a look here:

The details are probably only useful on Mac II's, and you're free to
suggest any changes you like to the interface. [It probably seems odd
that you'd need both a custom kernel *and* an LKM, but LKM's have come
a long way -- until recently, they weren't able to add new ioctls.]

The mode switching was never advertised as working. Ken Nakata
originally named it "OSFA", for "one size fits all", because it "just
worked" on all Macs, in contrast with the i386 server, which requires
a different driver for each possible video card. The name was opaque
to everyone else, however, while I think the "_color" thing expresses
the point well enough.