One of the most wanted things people want in Cosmos is a GUI for their operating system. People ask on the Cosmos discussion page and yet no matter how much or meanly they ask, their responses are all but complete. This tutorial is one of the few tutorials that actually exist that will tell you how to get a truly good GUI operating system, because as always, CosLabs wants you to have a good OS. So, lets get started.

Step 1 - Guess what, new project.
Obviously, so lets use JoshDOS, to save us the problem of getting a copy for Cosmos.Hardware and wasting 5 seconds of our lives.

Step 2 - Get rid of command prompts
We don't want to have a command prompter anymore! Since this OS will be fully GUI, we will not need to have a textural user interface. So delete everything in the Init() method of your main file but xBoot. Now your main file looks like so:
using System;
using Cosmos.Compiler.Builder;
using screen = Cosmos.Hardware.VGAScreen;
using Cosmos.Hardware;

namespace GUI_Test
{
    class Program
    {
        #region Cosmos Builder logic
        // Most users wont touch this. This will call the Cosmos Build tool
        [STAThread]
        static void Main(string[] args)
        {
            BuildUI.Run();
        }
        #endregion

        // Main entry point of the kernel
        public static void Init()
        {
            var xBoot = new Cosmos.Sys.Boot();
            xBoot.Execute();
        }
    }
}

Last edited Feb 7, 2011 at 9:51 PM by joshbeitler, version 2

Comments

No comments yet.