Clear() public method

Clears this instance.
public Clear ( ) : void
return void
Exemplo n.º 1
0
        /// <summary>
        /// Main
        /// </summary>
        public static void Main()
        {
            Mosa.Kernel.x86.Kernel.Setup();

            Console = ConsoleManager.Controller.Boot;

            Console.Clear();

            IDT.SetInterruptHandler(ProcessInterrupt);

            Console.Color = Colors.White;
            Console.BackgroundColor = Colors.Green;

            Console.Write(@"                   MOSA OS Version 1.3 - Compiler Version 1.3");
            FillLine();
            Console.Color = Colors.White;
            Console.BackgroundColor = Colors.Black;

            if (SmbiosManager.IsAvailable)
            {
                BiosInformationStructure biosInfo = new BiosInformationStructure();
                CpuStructure cpuInfo = new CpuStructure();

                Console.WriteLine("> Checking BIOS...");
                BulletPoint(); Console.Write("Vendor  "); InBrackets(biosInfo.BiosVendor, Colors.White, Colors.LightBlue); Console.WriteLine();
                BulletPoint(); Console.Write("Version "); InBrackets(biosInfo.BiosVersion, Colors.White, Colors.LightBlue); Console.WriteLine();

                Console.WriteLine("> Checking CPU...");
                BulletPoint(); Console.Write("Vendor  "); InBrackets(cpuInfo.Vendor, Colors.White, Colors.LightBlue); Console.WriteLine();
                BulletPoint(); Console.Write("Version "); InBrackets(cpuInfo.Version, Colors.White, Colors.LightBlue); Console.WriteLine();
            }
            else
            {
                Console.WriteLine("> No SMBIOS available!");
            }

            Console.WriteLine("> Initializing hardware abstraction layer...");
            Setup.Initialize();

            Console.WriteLine("> Adding hardware devices...");
            Setup.Start();

            Console.WriteLine("> System ready");
            Console.WriteLine();
            Console.Goto(24, 0);
            Console.Color = Colors.White;
            Console.BackgroundColor = Colors.Green;
            Console.Write("          Copyright (C) 2008-2014 [Managed Operating System Alliance]");
            FillLine();

            Process();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Main
        /// </summary>
        public static unsafe void Main()
        {
            Kernel.x86.Kernel.Setup();

            Console = ConsoleManager.Controller.Boot;
            Debug = ConsoleManager.Controller.Boot;

            Console.Clear();

            Console.ScrollRow = 23;

            IDT.SetInterruptHandler(ProcessInterrupt);

            Console.Color = Colors.White;
            Console.BackgroundColor = Colors.Green;

            Console.Write(@"                   MOSA OS Version 1.4 - Compiler Version 1.4");
            FillLine();
            Console.Color = Colors.White;
            Console.BackgroundColor = Colors.Black;

            Console.WriteLine("> Initializing hardware abstraction layer...");
            Setup.Initialize();

            Console.WriteLine("> Adding hardware devices...");
            Setup.Start();

            Console.Color = Colors.White;
            Console.WriteLine();

            Debug = ConsoleManager.Controller.Debug;

            // setup keymap
            var keymap = new US();

            // setup keyboard (state machine)
            var keyboard = new Mosa.DeviceSystem.Keyboard(Setup.StandardKeyboard, keymap);

            // setup app manager
            var manager = new AppManager(Console, keyboard);

            IDT.SetInterruptHandler(manager.ProcessInterrupt);

            manager.Start();
        }
Exemplo n.º 3
0
        /// <summary>
        /// Main
        /// </summary>
        public static void Main()
        {
            Mosa.Kernel.x86.Kernel.Setup();

            Console = ConsoleManager.Controller.Boot;

            Console.Clear();

            IDT.SetInterruptHandler(ProcessInterrupt);

            Console.Color = Colors.White;

            Console.Goto(0, 0);

            Console.Color = Colors.Yellow;
            Console.BackgroundColor = Colors.Black;

            Console.Write("MOSA OS Version 1.4 '");
            Console.Color = Colors.Red;
            Console.Write("Neptune");
            Console.Color = Colors.Yellow;
            Console.Write("'                                Copyright 2008-2015");

            Console.Color = 0x0F;
            Console.Write(new String((char)205, 60));
            Console.Write((char)203);
            Console.Write(new String((char)205, 19));
            Console.WriteLine();

            Console.Goto(2, 0);
            Console.Color = Colors.Green;
            Console.Write("Multibootaddress: ");
            Console.Color = Colors.Gray;
            unsafe
            {
                Console.Write((uint)Multiboot.MultiBootInfo, 16, 8);
            }

            Console.WriteLine();
            Console.Color = Colors.Green;
            Console.Write("Multiboot-Flags:  ");
            Console.Color = Colors.Gray;
            Console.Write(Multiboot.Flags, 2, 32);
            Console.WriteLine();
            Console.WriteLine();

            Console.Color = Colors.Green;
            Console.Write("Size of Memory:   ");
            Console.Color = Colors.Gray;
            Console.Write((Multiboot.MemoryLower + Multiboot.MemoryUpper) / 1024, 10, -1);
            Console.Write(" MB (");
            Console.Write(Multiboot.MemoryLower + Multiboot.MemoryUpper, 10, -1);
            Console.Write(" KB)");
            Console.WriteLine();

            Console.Color = Colors.White;
            for (uint index = 0; index < 60; index++)
                Console.Write((char)205);

            Console.WriteLine();

            //Console.Color = Colors.Green;
            //Console.Write("Memory-Map:");
            //Console.WriteLine();

            //for (uint index = 0; index < Multiboot.MemoryMapCount; index++)
            //{
            //	Console.Color = Colors.White;
            //	Console.Write(Multiboot.GetMemoryMapBase(index), 16, 10);
            //	Console.Write(" - ");
            //	Console.Write(Multiboot.GetMemoryMapBase(index) + Multiboot.GetMemoryMapLength(index) - 1, 16, 10);
            //	Console.Write(" (");
            //	Console.Color = Colors.Gray;
            //	Console.Write(Multiboot.GetMemoryMapLength(index), 16, 10);
            //	Console.Color = Colors.White;
            //	Console.Write(") ");
            //	Console.Color = Colors.Gray;
            //	Console.Write("Type: ");
            //	Console.Write(Multiboot.GetMemoryMapType(index), 16, 1);
            //	Console.WriteLine();
            //}
            //Console.WriteLine();
            //Console.WriteLine();
            Console.Color = Colors.Green;
            Console.Write("Smbios Info: ");
            if (SmbiosManager.IsAvailable)
            {
                Console.Color = Colors.White;
                Console.Write("[");
                Console.Color = Colors.Gray;
                Console.Write("Version ");
                Console.Write(SmbiosManager.MajorVersion, 10, -1);
                Console.Write(".");
                Console.Write(SmbiosManager.MinorVersion, 10, -1);
                Console.Color = Colors.White;
                Console.Write("]");
                Console.WriteLine();

                Console.Color = Colors.Yellow;
                Console.Write("[Bios]");
                Console.Color = Colors.White;
                Console.WriteLine();

                BiosInformationStructure biosInformation = new BiosInformationStructure();
                Console.Color = Colors.White;
                Console.Write("Vendor: ");
                Console.Color = Colors.Gray;
                Console.Write(biosInformation.BiosVendor);
                Console.WriteLine();
                Console.Color = Colors.White;
                Console.Write("Version: ");
                Console.Color = Colors.Gray;
                Console.Write(biosInformation.BiosVersion);
                Console.WriteLine();
                Console.Color = Colors.White;
                Console.Write("Date: ");
                Console.Color = Colors.Gray;
                Console.Write(biosInformation.BiosDate);

                Console.Color = Colors.Yellow;
                Console.Row = 8;
                Console.Column = 35;
                Console.Write("[Cpu]");
                Console.Color = Colors.White;
                Console.WriteLine();
                Console.Column = 35;

                CpuStructure cpuStructure = new CpuStructure();
                Console.Color = Colors.White;
                Console.Write("Vendor: ");
                Console.Color = Colors.Gray;
                Console.Write(cpuStructure.Vendor);
                Console.WriteLine();
                Console.Column = 35;
                Console.Color = Colors.White;
                Console.Write("Version: ");
                Console.Color = Colors.Gray;
                Console.Write(cpuStructure.Version);
                Console.WriteLine();
                Console.Column = 35;
                Console.Color = Colors.White;
                Console.Write("Socket: ");
                Console.Color = Colors.Gray;
                Console.Write(cpuStructure.Socket);
                Console.Write(" MHz");
                Console.WriteLine();
                Console.Column = 35;
                Console.Color = Colors.White;
                Console.Write("Cur. Speed: ");
                Console.Color = Colors.Gray;
                Console.Write(cpuStructure.MaxSpeed, 10, -1);
                Console.Write(" MHz");
                Console.WriteLine();
                Console.Column = 35;
            }
            else
            {
                Console.Color = Colors.Red;
                Console.Write("No SMBIOS available on this system!");
            }

            Console.Goto(14, 0);

            Console.Color = 0x0F;
            for (uint index = 0; index < 60; index++)
                Console.Write((char)205);

            Console.WriteLine();

            //CpuInfo cpuInfo = new CpuInfo();

            //#region Vendor

            //Console.Color = Colors.Green;
            //Console.Write("Vendor:   ");
            //Console.Color = Colors.White;

            //cpuInfo.PrintVendorString(Console);

            //Console.WriteLine();

            //#endregion Vendor

            //#region Brand

            //Console.Color = Colors.Green;
            //Console.Write("Brand:    ");
            //Console.Color = Colors.White;
            //cpuInfo.PrintBrandString(Console);
            //Console.WriteLine();

            //#endregion Brand

            //#region Stepping

            //Console.Color = Colors.Green;
            //Console.Write("Stepping: ");
            //Console.Color = Colors.White;
            //Console.Write(cpuInfo.Stepping, 16, 2);

            //#endregion Stepping

            //#region Model

            //Console.Color = Colors.Green;
            //Console.Write(" Model: ");
            //Console.Color = Colors.White;
            //Console.Write(cpuInfo.Model, 16, 2);

            //#endregion Model

            //#region Family

            //Console.Color = Colors.Green;
            //Console.Write(" Family: ");
            //Console.Color = Colors.White;
            //Console.Write(cpuInfo.Family, 16, 2);

            //#endregion Family

            //#region Type

            //Console.Color = Colors.Green;
            //Console.Write(" Type: ");
            //Console.Color = Colors.White;

            //Console.Write(cpuInfo.Type, 16, 2);
            //Console.WriteLine();
            //Console.Color = Colors.Green;
            //Console.Write("Cores:    ");
            //Console.Color = Colors.White;
            //Console.Write(cpuInfo.NumberOfCores, 16, 2);

            //#endregion Type

            Console.Row = 19;
            for (uint index = 0; index < 80; index++)
            {
                Console.Column = index;
                Console.Write((char)205);
            }

            Console.Row = 23;
            for (uint index = 0; index < 80; index++)
            {
                Console.Column = index;
                Console.Write((char)205);
            }

            for (uint index = 2; index < 20; index++)
            {
                Console.Column = 60;
                Console.Row = index;

                Console.Color = Colors.White;
                if (index == 6)
                    Console.Write((char)185);
                else if (index == 14)
                    Console.Write((char)185);
                else if (index == 19)
                    Console.Write((char)202);
                else
                    Console.Write((char)186);
            }

            Console.Goto(24, 29);
            Console.Color = Colors.Yellow;

            Console.Write("www.mosa-project.org");

            Console.Goto(12, 0);

            byte last = 0;

            while (true)
            {
                DisplayCMOS();
                DisplayTime();

                byte second = CMOS.Second;

                if (second % 10 != 5 & last != second)
                {
                    last = CMOS.Second;
                    DebugClient.SendAlive();
                }

                Native.Hlt();
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Mains this instance.
        /// </summary>
        public static void Main()
        {
            Mosa.Kernel.x86.Kernel.Setup();

            IDT.SetInterruptHandler(ProcessInterrupt);

            Console = ConsoleManager.Controller.Boot;

            Console.Clear();
            Console.Color = Colors.Yellow;
            Console.BackgroundColor = Colors.Black;

            Console.Write(@"MOSA OS Version 1.0 '");
            Console.Color = Colors.Red;
            Console.Write(@"Zaphod");
            Console.Color = Colors.Yellow;
            Console.Write(@"'                                Copyright 2008-2012");
            Console.WriteLine();

            Console.Color = 0x0F;
            Console.Write(new String((char)205, 60));
            Console.Write((char)203);
            Console.Write(new String((char)205, 19));
            Console.WriteLine();

            Console.Goto(2, 0);
            Console.Color = Colors.Green;
            Console.Write(@"Multibootaddress: ");
            Console.Color = Colors.Gray;
            Console.Write(Multiboot.MultibootStructure, 16, 8);

            Console.WriteLine();
            Console.Color = Colors.Green;
            Console.Write(@"Multiboot-Flags:  ");
            Console.Color = Colors.Gray;
            Console.Write(Multiboot.Flags, 2, 32);
            Console.WriteLine();
            Console.WriteLine();

            Console.Color = Colors.Green;
            Console.Write(@"Size of Memory:   ");
            Console.Color = Colors.Gray;
            Console.Write((Multiboot.MemoryLower + Multiboot.MemoryUpper) / 1024, 10, -1);
            Console.Write(@" MB (");
            Console.Write(Multiboot.MemoryLower + Multiboot.MemoryUpper, 10, -1);
            Console.Write(@" KB)");
            Console.WriteLine();

            Console.Color = Colors.White;
            for (uint index = 0; index < 60; index++)
                Console.Write((char)205);

            Console.WriteLine();

            /*Console.Color = Colors.Green;
            Console.Write(@"Memory-Map:");
            Console.WriteLine();

            for (uint index = 0; index < Multiboot.MemoryMapCount; index++)
            {
                Console.Color = Colors.White;
                Console.Write(Multiboot.GetMemoryMapBase(index), 16, 10);
                Console.Write(@" - ");
                Console.Write(Multiboot.GetMemoryMapBase(index) + Multiboot.GetMemoryMapLength(index) - 1, 16, 10);
                Console.Write(@" (");
                Console.Color = Colors.Gray;
                Console.Write(Multiboot.GetMemoryMapLength(index), 16, 10);
                Console.Color = Colors.White;
                Console.Write(@") ");
                Console.Color = Colors.Gray;
                Console.Write(@"Type: ");
                Console.Write(Multiboot.GetMemoryMapType(index), 16, 1);
                Console.WriteLine();
            }*/

            Console.Color = Colors.Green;
            Console.Write(@"Smbios Info: ");
            if (SmbiosManager.IsAvailable)
            {
                Console.Color = Colors.White;
                Console.Write(@"[");
                Console.Color = Colors.Gray;
                Console.Write(@"Version ");
                Console.Write(SmbiosManager.MajorVersion, 10, -1);
                Console.Write(@".");
                Console.Write(SmbiosManager.MinorVersion, 10, -1);
                Console.Color = Colors.White;
                Console.Write(@"]");
                Console.WriteLine();

                Console.Color = Colors.Yellow;
                Console.Write(@"[Bios]");
                Console.Color = Colors.White;
                Console.WriteLine();

                BiosInformationStructure biosInformation = new BiosInformationStructure();
                Console.Color = Colors.White;
                Console.Write(@"Vendor: ");
                Console.Color = Colors.Gray;
                Console.Write(biosInformation.BiosVendor);
                Console.WriteLine();
                Console.Color = Colors.White;
                Console.Write(@"Version: ");
                Console.Color = Colors.Gray;
                Console.Write(biosInformation.BiosVersion);
                Console.WriteLine();
                Console.Color = Colors.White;
                Console.Write(@"Date: ");
                Console.Color = Colors.Gray;
                Console.Write(biosInformation.BiosDate);

                Console.Color = Colors.Yellow;
                Console.Row = 8;
                Console.Column = 35;
                Console.Write(@"[Cpu]");
                Console.Color = Colors.White;
                Console.WriteLine();
                Console.Column = 35;

                CpuStructure cpuStructure = new CpuStructure();
                Console.Color = Colors.White;
                Console.Write(@"Vendor: ");
                Console.Color = Colors.Gray;
                Console.Write(cpuStructure.Vendor);
                Console.WriteLine();
                Console.Column = 35;
                Console.Color = Colors.White;
                Console.Write(@"Version: ");
                Console.Color = Colors.Gray;
                Console.Write(cpuStructure.Version);
                Console.WriteLine();
                Console.Column = 35;
                Console.Color = Colors.White;
                Console.Write(@"Socket: ");
                Console.Color = Colors.Gray;
                Console.Write(cpuStructure.Socket);
                Console.Write(@" MHz");
                Console.WriteLine();
                Console.Column = 35;
                Console.Color = Colors.White;
                Console.Write(@"Cur. Speed: ");
                Console.Color = Colors.Gray;
                Console.Write(cpuStructure.MaxSpeed, 10, -1);
                Console.Write(@" MHz");
                Console.WriteLine();
                Console.Column = 35;
            }
            else
            {
                Console.Color = Colors.Red;
                Console.Write(@"No SMBIOS available on this system!");
            }

            Console.Goto(14, 0);

            Console.Color = 0x0F;
            for (uint index = 0; index < 60; index++)
                Console.Write((char)205);

            Console.WriteLine();

            CpuInfo cpuInfo = new CpuInfo();

            #region Vendor
            Console.Color = Colors.Green;
            Console.Write(@"Vendor:   ");
            Console.Color = Colors.White;

            cpuInfo.PrintVendorString(Console);

            Console.WriteLine();
            #endregion

            #region Brand
            Console.Color = Colors.Green;
            Console.Write(@"Brand:    ");
            Console.Color = Colors.White;
            cpuInfo.PrintBrandString(Console);
            Console.WriteLine();
            #endregion

            #region Stepping
            Console.Color = Colors.Green;
            Console.Write(@"Stepping: ");
            Console.Color = Colors.White;
            Console.Write(cpuInfo.Stepping, 16, 2);
            #endregion

            #region Model
            Console.Color = Colors.Green;
            Console.Write(@" Model: ");
            Console.Color = Colors.White;
            Console.Write(cpuInfo.Model, 16, 2);
            #endregion

            #region Family
            Console.Color = Colors.Green;
            Console.Write(@" Family: ");
            Console.Color = Colors.White;
            Console.Write(cpuInfo.Family, 16, 2);
            #endregion

            #region Type
            Console.Color = Colors.Green;
            Console.Write(@" Type: ");
            Console.Color = Colors.White;

            Console.Write(cpuInfo.Type, 16, 2);
            Console.WriteLine();
            Console.Color = Colors.Green;
            Console.Write(@"Cores:    ");
            Console.Color = Colors.White;
            Console.Write(cpuInfo.NumberOfCores, 16, 2);
            #endregion

            Console.Row = 19;
            for (uint index = 0; index < 80; index++)
            {
                Console.Column = index;
                Console.Write((char)205);
            }

            Console.Row = 23;
            for (uint index = 0; index < 80; index++)
            {
                Console.Column = index;
                Console.Write((char)205);
            }

            for (uint index = 2; index < 20; index++)
            {
                Console.Column = 60;
                Console.Row = index;

                Console.Color = Colors.White;
                if (index == 6)
                    Console.Write((char)185);
                else if (index == 14)
                    Console.Write((char)185);
                else if (index == 19)
                    Console.Write((char)202);
                else
                    Console.Write((char)186);
            }

            Console.Goto(24, 29);
            Console.Color = Colors.Yellow;

            Console.Write(@"www.mosa-project.org");

            CMOS cmos = new CMOS();

            KernelTest.RunTests();

            while (true)
            {
                DisplayCMOS(cmos);
                DisplayTime(cmos);
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// Main
        /// </summary>
        public static void Main()
        {
            Mosa.Kernel.x86.Kernel.Setup();
            DebugClient.Setup(Serial.COM1);
            IDT.SetInterruptHandler(ProcessInterrupt);

            Console = ConsoleManager.Controller.Boot;

            Console.Clear();
            Console.Color = Colors.White;
            Console.BackgroundColor = Colors.Green;

            Console.Write(@"                   MOSA OS Version 1.2 - Compiler Version 1.2");
            FillLine();
            Console.Color = Colors.White;
            Console.BackgroundColor = Colors.Black;

            BiosInformationStructure biosInfo = new BiosInformationStructure();
            CpuStructure cpuInfo = new CpuStructure();

            Console.WriteLine("> Checking BIOS...");
            BulletPoint(); Console.Write("Vendor  "); InBrackets(biosInfo.BiosVendor, Colors.White, Colors.LightBlue); Console.WriteLine();
            BulletPoint(); Console.Write("Version "); InBrackets(biosInfo.BiosVersion, Colors.White, Colors.LightBlue); Console.WriteLine();

            Console.WriteLine("> Checking CPU...");
            BulletPoint(); Console.Write("Vendor  "); InBrackets(cpuInfo.Vendor, Colors.White, Colors.LightBlue); Console.WriteLine();
            BulletPoint(); Console.Write("Version "); InBrackets(cpuInfo.Version, Colors.White, Colors.LightBlue); Console.WriteLine();

            Console.WriteLine("> Initializing hardware abstraction layer...");
            Setup.Initialize();

            Console.WriteLine("> Adding hardware devices...");
            Setup.Start();

            Console.WriteLine("> System ready");
            Console.WriteLine();
            Console.Goto(24, 0);
            Console.Color = Colors.White;
            Console.BackgroundColor = Colors.Green;
            Console.Write("          Copyright (C) 2008-2001 [Managed Operating System Alliance]");
            FillLine();

            Console.BackgroundColor = Colors.Black;
            Console.Goto(15, 0);
            Console.Color = Colors.Green;
            Console.Write("> ");
            Console.Color = Colors.Yellow;

            Mosa.DeviceDrivers.ScanCodeMap.US KBDMAP = new DeviceDrivers.ScanCodeMap.US();
            int lastSecond = -1;

            while (true)
            {
                byte scancode = Setup.Keyboard.GetScanCode();

                if (scancode != 0)
                {
                    Debug.Trace("Main.Main Key Scan Code: " + scancode.ToString());

                    KeyEvent keyevent = KBDMAP.ConvertScanCode(scancode);

                    Debug.Trace("Main.Main Key Character: " + keyevent.Character.ToString());

                    if (keyevent.KeyPress == KeyEvent.Press.Make)
                    {
                        if (keyevent.Character != 0)
                            Console.Write(keyevent.Character);

                        if (keyevent.KeyType == KeyType.F1)
                            ConsoleManager.Controller.Active = ConsoleManager.Controller.Boot;
                        else if (keyevent.KeyType == KeyType.F2)
                            ConsoleManager.Controller.Active = ConsoleManager.Controller.Debug;
                    }
                    Debug.Trace("Main.Main Key Character: " + ((uint)keyevent.Character).ToString());
                }

                if (Setup.CMOS.Second != lastSecond)
                {
                    DebugClient.SendAlive();
                    lastSecond = Setup.CMOS.Second;
                    Debug.Trace("Main.Main Ping Alive");
                }

                DebugClient.Process();
                Native.Hlt();
            }
        }