Subject: Re: the 8600 lives!
To: Brian Hechinger <wonko@4amlunch.net>
From: ML <macallan18@earthlink.net>
List: port-macppc
Date: 08/19/2004 16:05:45
This is a multi-part message in MIME format.

--Multipart=_Thu__19_Aug_2004_16_05_45_-0400_PApL/_snxfMrMz3B
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

Hello,

> > Riccardo apparently has a ROM image that works ( mine doesn't )
> > Then I need to clean up the code and put it somewhere so you can 
> > download it.
> ok, so i need to figure out how to get that ROM image into my card.
Boot MacOS, use the Matrox flasher ( comes with the driver package on matrox.com ) - it writes anything into the card's ROM, even PC BIOSes.

> > After that you apply the patches, recompile the kernel and the Xserver 
> > and that's it. I could send you my X binaries but they are compiled for 
> > 2.0G and a G3, I doubt they would run on anything older.
> i have 2.0 BETA and a G3, is that close enough?
Probably, I use a 20_BETA userland. You still need to patch the kernel though.

> > If you use the ROM image from matrox.com it will work fine under MacOS 
> > ( although it doesn't like my G3 ) but nut as OF console ( at least not 
> > for me - S900 / OF 1.0.5. If your OF version is different it may just 
> > work )
> ahh, ok.  nope, 1.0.5 here as well.
Then we need this other ROM image...
Btw. since I upgraded to a G3 processor the finder crashes at boot when the Matrox driver is active - do you have that too? It worked fine with the 604e I had before. Not too important since the Voodoo3 driver doesn't have this problem but I'd like to know it the Matrox driver generally dislikes G3s or if my CPU card is just weird.

> > Currently yes, because XFree tries to map the framebuffer and so on 
> > through wscons. If wsdisplay doesn't attach to your graphics board it 
> > won't work.
> ahh, ok, so need to solve that issue then.
It works as a secondary card though - with another hack that removes some mmap() restrictions from ofb. Awkward and uglu but it works.

> > What's wrong with the onboard video? I have no clue about it but does 
> > it work as OF console? I guess the Matrox would be the better choice 
> > but it might be easier to get that working first.
> 
> i want to use both, so i'm not opposed to getting the onboard video working.
All the patch needs is /some/ graphical wsdisplay...

> it works fine as an OF console.  what do i need to know to get XFree86
> configured to use it? 
No idea, I don't have an OldWorld Mac with onboard video.

> also, how to i emulate more than 1 button on my mouse
> until my replacement ADB mouse shows up?
No idea again, but it should be in the macppc FAQ somewhere. I use an OHCI card and a USB trackball which has all the buttons I want and even the scroll wheel works just fine :)

The kernel patch is attached to this mail, apply it in src/sys/macppc/dev, it changes ofb.c and ofbvar.h to allow access to the graphics board's IO registers.
Add the following things to your kernel config:

option OFB_FAKE_VGA_FB
allows vgahw to map something resembling the VGA framebuffer ( we just redirect 0xa0000 to the beginning of the framebuffer ) - use only if you get an error message like 'cannot map video RAM ( 0xa0000, 0x10000 )' or something similar from XFree.

option OFB_ALLOW_OTHERS
ugly hack that allows to map other PCI cards through ofb - this enables you to use more than one graphics card even if the 2nd one didn't attach to anything. 
All this may NOT work if the 2nd card is on another PCI bus ( worked for me with a Voodoo3 at pci0 and a Millennium at pci1 ), it WILL NOT work if the 2nd card is on another PCI bus controlled by another bandit because each bandit has a separate IO space. XFree should really open different files for different framebuffers... it does on other OSes but under NetBSD it apparently uses only wscons0.

Get the XFree binaries from http://macallan.homeunix.org:6704/stuff/BSD/XFree86_ml.tar.bz2 - this archive contains only the XFree86 binary and the modules directory, I'm pretty sure that's all you need, the full XFree directory would be pretty large.

good luck
Michael

--Multipart=_Thu__19_Aug_2004_16_05_45_-0400_PApL/_snxfMrMz3B
Content-Type: application/octet-stream;
 name="ofb.patch"
Content-Disposition: attachment;
 filename="ofb.patch"
Content-Transfer-Encoding: base64

SW5kZXg6IG9mYi5jCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT0KUkNTIGZpbGU6IC9jdnNyb290L3NyYy9zeXMvYXJjaC9t
YWNwcGMvZGV2L29mYi5jLHYKcmV0cmlldmluZyByZXZpc2lvbiAxLjM5CmRpZmYgLWMgLWIgLUIg
LXIxLjM5IG9mYi5jCioqKiBvZmIuYwkyNCBBcHIgMjAwNCAxNTo0OTowMCAtMDAwMAkxLjM5Ci0t
LSBvZmIuYwkxOSBBdWcgMjAwNCAxOTozNjo1OCAtMDAwMA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