Well, first off, I wish you the best of luck, and hope you've done some kernel hackin' before, 'cuz it ain't easy
With that out of the way, however, I'm not quite sure what you're trying to accomplish. Gnome and KDE aren't windowing systems, but rather user interfaces build on top of X11.
Are you looking to rewrite a windowing system (aka X11, or Berlin) or are you looking to create a new user interface (aka KDE, Gnome). Either one's a daunting task, and will take one person years to complete...
My web site (
www.neuraldk.org) has tutorials on X11 programming, if that's what windowing system you'd like to use, or, if you're looking to rewrite the entire thing, you can take a look at my 'Smoke' application, which is a windowing system I developed to run under 'Petal' (a graphics library I wrote that runs on X11 and DOS). Both applications are old, but the techniques haven't changed.
Lastly, however, both the KDE and Gnome allow you to write your own custom interface as is... they're both very customizeable. You might be better off writting new interfaces for either and therefore maintain the entire application bases of each project (seeing as though they have thousands of apps already written for them...!)
And, there's also already an alternative windowing system project existing for Linux called Berlin. It's aim is to replace X11 on Linux... I have no idea if the project still exists... I haven't heard much about it in a while, but you might consider taking a look at it, as well.
Cheers,
Jeff