Showing posts with label sparc. Show all posts
Showing posts with label sparc. Show all posts

Sunday, April 20, 2025

rebased cgfourteen patches from Bob Breuer

Have rebased Bob's patches for cg14, so it's possible to compile it with recent QEMU versions with with recent tooling.

The patch can be found here: https://github.com/artyom-tarasenko/qemu/commit/1b1d8b87619e613b059766e6e54687b027fb6e3f .

reset is necessary to continue

For some reason OBP doesn't detect a DBRI stub in the SBus slot E. So for now, just exclude it from the probe list:

setenv sbus-probe-list f0123

Also, unless you have a rarp/bootp server set up, you probably want to turn auto-boot off:

setenv auto-boot? false
reset

Otherwise, the QEMU monitor has to be used to send a Stop-A combination

sendkey stop-a

After reset it's possbile to boot Solaris kernel with

boot cdrom -vsb



As it turned out, Bob did a great job gathering the available infos for cg14/SX:

https://github.com/breuerr/qemu/wiki/SX

Now I finally know what does "SPAM" mean. It's Sun Pixel Arithmetic Memory.

I found the article "Pixel Processing in a Memory Controller"  from Walt Donovan et all referenced by Bob. Very interesting from the historic point of view. Looks like Sun invented the built-in in chipset graphic card some years before it appeared in the x86 World.

For instance, transpose would look like this:

-- Read in a block 12 pixels
-- by 8 pixels.
ldld(src-addr, Rblock, 12)
... seven more loads ...
-- Gather each row and store into
-- memory at dst.
gath(Rblock, 8, Rrow, 8)
stld(dst-addr, Rrow, 8)
gath(Rblock+l2, 8, Rrow, 8)
stld(dst-addr, Rrow, 8)
... ten more gath/stld ...

Of course there are no instruction codes in the article, but I think they can be deducted from the Solaris driver.

The article has also a list of acknowledgments. These people are the pioneers in the single chip MMU graphic:

"The basic conception of the SX originated with Tim Van Hook. Van Hook, Vicki Woolf, and Ray Roth were major contributors in developing the SX chip architecture and the SX instruction set. Andy Bechtolsheim identified
the market opportunity for a low-cost pixel processor.
 

We would like to thank the rest of the SX hardware and software team-Miriam Blatt, Gloria Chen, Huimei Chen, Larry Fiedler, David Gibbs, Kevin Hayes, Don
Hejna, Samuel Ho, Brad Hoffert, Jens Horstmann, Steve Howell, Alan Hsu, Steve Huang, Rick Iwamoto, Amandeep Jabbi, John Johnson, Ashvin Kamaraju,
Byung Kim, Tayfun Kocaoglu, Mark Loomis, Barry Medoff, Conan Mishler, Jamshy Mostoufi, Jasvinder Nijjar, Greg Onufer, Bill Radke, John Recker, Jean Sheu,
Shawn Storm, Richard Tom, Haiduong Vo, John Watkins, Jung Wu, and David Yen-for their efforts in designing and implementing the SX and the target workstation
".

Sunday, December 23, 2018

BLITing overlaping regions...

... may be tricky. The following screen shot illustrates why the memmove() system call was introduced as a safe replacement for the good old memcopy() back in the days.

Overlapping BLIT

Sunday, December 9, 2018

The splash screen is done, next level

After some improvements to the cgsix emulation the boot splash screen is finally looking good:

cgsix under sun4m
On the screen above there is only one thing missing: the cursor. Unlike cgthree, the cgsix graphic adapter has hardware cursor, which I haven't implemented yet.

Well, the hardware cursor is not the only thing which is not yet implemented in general. The next screen is not as good:

The freedom statue is looking at Solaris install process

/stay tuned

Sunday, December 2, 2018

Meanwhiile in sun4m

Debugging when a program does something unexpected is easy. You just have to find the place where it starts doing it and find out the reason.

In my case though, the problem is that Solaris doesn't change the color map. But where and when is it supposed to update it? Tricky.

And then I thought: why don't I try it under sun4m? And tell you what. I've got a good and a bad news. The good news is that the RAMDAC emulation does work ok:

cg6 under sun4m
The bad news is that the reason why it doesn't perform somewhere near it when running on a sun4u is still to be found. My current educated guess is that it has to do with the interrupt processing...

Don't know yet what I'm going to attack next: fix the interrupts under sun4u, or improve some missing graphic features under sun4m. The latter has an advantage of producing some nice or ugly screen shots, and everyone likes screen shots. :-)

Sunday, November 25, 2018

The colors...

... are still not quite right:

Let's add some colors

Sunday, November 18, 2018

The moment you see the endianess is wrong

Think I fixed one bug, but this way I loose the half tones. And the endianness is definitely wrong:
The endianness is wrong
Above I treat the bytes as pixels. The endianness is definitely wrong. Fixing the endianness the picture gets better:

The endianness is correct
Not sure if the bit order in the byte is correct. And no idea why it's so contrast and monochrome. Treating the bits as pixels with the proper endianness the picture looks more interesting:
As if a bit were a pixel

The result must be somewhere in between the two above... But I'm think I'm done for this weekend.

Saturday, November 17, 2018

The moment you see you used bits instead of bytes

Trying to find out how the cg6 registers work I get some funny pictures.

When the bytes are treated as bits
Here it interprets bytes as bits. Plus some more bugs indeed...

Sunday, November 11, 2018

Fixed the cgsix colormap


Looks like the cgsix DAC is slightly different from the one used in cgthree. Fixed it and now the image doesn’t look so psychedelic anymore:
 
cgsix in the DFB mode
Now, that was the easy part. Making it work under OpenWindows is going to be trickier. There is virtually no documentation on the GPU. I guess this manual is really lost: as Sun tried to open the specs back in 2008, they failed with “Unable to locate (15-July-08)” message.

Does anyone by any chance have the book “TurboGX Reference Card” (p/n 800-5112) or any other document which describes how to program the TEC and FBC units of the TGX chip?

Saturday, November 10, 2018

The first experiments with cgsix emulation

Okay, I’ve got the first picture with a virtual cgsix under QEMU. The colors are slightly distorted, but at least the image is there:
cgsix in red

Sunday, October 21, 2018

a few more words on cgfourteen


A customer asked me if he’ll ever gets a chance to watch HD movies on an emulated SPARC machine. At first, I was going to say never ever, but then I looked at the specs of some ancient adapters and got surprised.  The SGI machines were commonly known for good graphics, but it never occurred to me that Sun machines were really powerful as well.
The cgfourteen (cg14) adapter could show Full-HD (1920x1080) pictures back in 1993!
Since the manufacturers sometimes claim just the theoretic abilities of the chipset, I wanted to check that the software has been really aware of such graphic modes in early nineties.
So, I gave a spin to the old cgfourteen patch from Bob Breuer. And here we go.
 
SPARCstation 20 OBP supports 1920x1080
Overall the cgfourteen adapter was really powerful. Michael Lorenz who added the hardware acceleration support for cgfourteen to NetBSD, wrote “SX has plenty of registers (128 - eight of them have special functions, the rest is free for all) and every instruction takes a count to operate on several subsequent registers or memory locations (ALU ops can use up to 16, memory accesses up to 32). SX supports some parallelism too - the ALUs can do up to two 16bit multiplications and two other arithmetic or logical ops per clock cycle (32bit multiplications use both ALUs).

The bad news is that Bob’s patch doesn’t implement the SX rendering engine. Also, the Solaris (or rather OpenWindows) driver is very much bound to sun4m SRMMU, so it won’t work on sun4u machines.

Would really like to have the emulation of a graphic card which would be better than cgthree, and ideally would work on both sun4m and sun4u machines, but it’s not easy.

Right now, I’m choosing between cgsix and creator ffb, but none of them has public documentation.

P.S. A funny fact about the Solaris SX driver: there are lots of symbols which have the word “SPAM” in a name. It can spamify and unspamify.  It’s really hard to google what it could mean back in nineties. “M” is probably for “Memory”.