I am trying to learn how to design a gui for a linux kernal. Is there any tutorials on how a gui works on an operating system? I am not completely sure where to start.

The only other thing is that I can think of doing is getting the source code for KDE or GNOME and looking at that.

I don't know much about creating a whole GUI for an operating system, but I know a little bit about QT4 which allows you to create GUI programs with C++, which I'm assuming you're going to be using as your primary programming language.

The above link is their official documentation.

The download link can be found here and the installation instructions can be found here for linux.

I hope this helps!

Thanks for the information, but what I am looking at is how a gui works behind the scenes. How it interacts with the Kernel, file system, etc. But that would be for most of it.

A great place to start (particularly if you're looking for implementation details) is http://www.x.org/wiki/

There are loads of other sites that can give you specific info on XLib in C++