Inheritance: Mosa.Kernel.x86.Smbios.SmbiosStructure
示例#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();
        }
示例#2
0
文件: Boot.cs 项目: tea/MOSA-Project
        /// <summary>
        /// Mains this instance.
        /// </summary>
        public static void Main()
        {
            Mosa.Kernel.x86.Kernel.Setup();

            IDT.SetInterruptHandler(ProcessInterrupt);

            Screen.GotoTop();
            Screen.Color = Colors.Yellow;

            Screen.Write(@"MOSA OS Version 1.0 '");
            Screen.Color = Colors.Red;
            Screen.Write(@"Titan");
            Screen.Color = Colors.Yellow;
            Screen.Write(@"'                                Copyright 2008-2011");
            Screen.NextLine();

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

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

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

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

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

            Screen.NextLine();

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

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

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

                Screen.Color = Colors.Yellow;
                Screen.Write(@"[Bios]");
                Screen.Color = Colors.White;
                Screen.NextLine();

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

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

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

            Screen.Goto(17, 0);

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

            Screen.NextLine();

            CpuInfo cpuInfo = new CpuInfo();

            #region Vendor

            Screen.Color = Colors.Green;
            Screen.Write(@"Vendor:   ");
            Screen.Color = Colors.White;

            cpuInfo.PrintVendorString();

            Screen.NextLine();

            #endregion Vendor

            #region Brand

            Screen.Color = Colors.Green;
            Screen.Write(@"Brand:    ");
            Screen.Color = Colors.White;
            cpuInfo.PrintBrandString();
            Screen.NextLine();

            #endregion Brand

            #region Stepping

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

            #endregion Stepping

            #region Model

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

            #endregion Model

            #region Family

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

            #endregion Family

            #region Type

            Screen.Color = Colors.Green;
            Screen.Write(@" Type: ");
            Screen.Color = Colors.White;

            Screen.Write(cpuInfo.Type, 16, 2);
            Screen.NextLine();
            Screen.Color = Colors.Green;
            Screen.Write(@"Cores:    ");
            Screen.Color = Colors.White;
            Screen.Write(cpuInfo.NumberOfCores, 16, 2);

            #endregion Type

            //Multiboot.Dump(4,53);

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

            for (uint index = 2; index < 23; index++)
            {
                Screen.Column = 60;
                Screen.Row = index;

                Screen.Color = Colors.White;
                if (index == 6)
                    Screen.Write((char)185);
                else if (index == 17)
                    Screen.Write((char)185);
                else if (index == 22)
                    Screen.Write((char)202);
                else
                    Screen.Write((char)186);
            }

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

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

            CMOS cmos = new CMOS();

            KernelTest.RunTests();

            while (true)
            {
                cmos.Dump(2, 65);
                DisplayTime(cmos);
            }
        }
示例#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();
            }
        }
示例#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);
            }
        }
示例#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();
            }
        }