Monday, April 20, 2009

MOVING DAY!!!

I am moving all of my blogs to a new site. Please join me at http://hackersbasement.com/

Tuesday, June 17, 2008

Graphics Patch for Singularity RDK

Graphics Patch


This is an overlay patch for Singularity RDK. It includes the required changes to turn on the S3Trio64 under Virtual PC.

2D graphics on Singularity

I remember back in high school when I would directly program the video memory for the best speed possible for graphics rendering. Now 10 years later I have started adding similar functions to Singularity. One thing I have found out is use to the SIPs and Channels you need to effectively send packets of data to the video driver. These packets do not have to be raw byte arrays that you want to render. They could simply be a collection of points and lines with simple shapes.

Also due to limitation in the isolated nature of the SIPs you need to build generic commands that can send descriptions of what you want to do instead of simply plotting points. For an example the first graphics program I write for any new platform is a Sierpinski's triangle. Plotting random points on the screen didn’t seem too slow so I moved on to the next exercise.

Typically the next graphic rendering I code is just a random mess of lines. Simple enough you just pick two points and a color and connect the dots. I quickly found a minor problem in the graphics engine. Plotting a single point and waiting for a call back caused the lines to draw out instead of just flashing on the screen. So I moved the algorithm into the driver and it worked much faster. (With all the recompiling of the video contract I really saw a compelling reason to not static compile everything)

The functions I have added to the graphics driver so far are line, rectangle, polyline, triangle, circle, ellipses. I have also added filled versions of triangle, circle, and ellipses. I plan on adding arcs, pies, Bezier curves, and possibly even adding texture mapping. Currently these are only available for the S3 driver and have only been tested on Singularity on virtual PC.

Future programs including a simple multi-threaded GUI, simple two games (such as Tetris or Breakout), and possibly even a simple polygon 3d engine.

Sunday, June 8, 2008

Too All You Open Source Geeks.

I love how the Linux and OpenSource communities enjoy bashing Microsoft about how they never listen to them. While at the same time when they are given a perfect opportunity to dig into the guts of a test platform operating system they stay away. What’s wrong with people are they too scared the Microsoft might have a good idea for once… or are they afraid of learning to like the other team. Come on everyone do you really hate that “Evil Micro$oft” so much that you can’t even say “WOW, THANKS FOR THE AWESOME TOY”.

Well Microsoft, I will stand up and scream it loud… I LOVE SINGULARITY!!! I have spent this entire weekend messing around in the code base, learning the in and outs of the SIPs and Channels. And I will admit a few things about the platform are a tad annoying, I know those are caused by it being a test platform. I also know that writing managed drivers must be the simplest and best idea I have ever seen. (Yeah folks I am a hardware guy… I did go to school for it after all…)

And to anyone reading this, if you think I am a 100% fan boy of Microsoft’s… Well you would be right. But that wasn’t always the case. Just go check out my other blog. I have made an informed decision to convert to the “dark side” and for all of you left behind… Well, your loss.

Another blog of mine... kinda helps prove a point ;)

Saturday, June 7, 2008

New favorite coding project

Seeing that I went to school for electronics I am always interested in trying to get more of a bang out of a transistor. I so far have been very impressed at what I have seen Microsoft pull off with Singularity. I know there are a lot of people complaining about how they licensed it, but the only real reason they released it for academic use is it is a test platform.

And being the geek that I am, I enjoy looking under the hoods of cars and the cases of computers. So feel free to stay tuned as I tear into the under workings.

Be warned if you get scared easily by huge technical monsters and sorting though thousands of lines of code… you might wana turn around and go the other way.

(Oh and if you love IntelliSense... you will love programming with notepad)

8oP

Helpful Build/Run Scipt (.cmd)

@ECHO OFF

IF "%1"=="D" GOTO debugIt
IF "%1"=="d" GOTO debugIt
IF "%1"=="debug" GOTO debugIt

IF "%1"=="B" GOTO buildIt
IF "%1"=="b" GOTO buildIt
IF "%1"=="build" GOTO buildIt

REM IF "%1"=="A" GOTO doneWithIt

IF NOT "%1"=="" GOTO :errorCmd

boottest.cmd mypc.vmc
GOTO doneWithIt

:buildIt
echo Build Distro\World.proj
msb Distro\World.proj
REM SHIFT /1
REM CALL %0 %1
GOTO doneWithIt

:debugIt
echo Start VM with Debugger Attached
dbg.cmd /pipe & boottest.cmd mypc.vmc
GOTO doneWithIt

:errorCmd
echo Start VM
echo "command not understood '%1'"
GOTO doneWithIt

:doneWithIt
echo Completed