Ejemplo n.º 1
0
        /// <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);
            }
        }
Ejemplo n.º 2
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);
            }
        }