/// <summary> /// /// </summary> public static void RunTests() { Console = Boot.Console; Console.Goto(20, 0); Console.Color = Colors.Yellow; Console.Write("["); Console.Color = Colors.White; Console.Write("Tests"); Console.Color = Colors.Yellow; Console.Write("]"); var stringTest = new StringTest(); var interfaceTest = new InterfaceTest(); var genericsTest = new GenericTest(); var generics2Test = new Generic2Test(); var isInstanceTest = new IsInstTest(); var exceptionTest = new ExceptionTest(); var plugTestTest = new PlugTestTest(); var compareTest = new ComparisonTest(); var simpleTest = new SimpleTest(); stringTest.Test(); interfaceTest.Test(); genericsTest.Test(); generics2Test.Test(); isInstanceTest.Test(); exceptionTest.Test(); plugTestTest.Test(); compareTest.Test(); simpleTest.Test(); }
/// <summary> /// /// </summary> public static void RunTests() { Console = Boot.Console; Console.Goto(2, 0); Console.Color = Colors.Yellow; Console.Write("["); Console.Color = Colors.White; Console.Write("Tests"); Console.Color = Colors.Yellow; Console.Write("]"); Console.WriteLine(); Console.WriteLine(); Console.Color = Colors.Yellow; var delegateTest = new DelegateTest(); var stringTest = new StringTest(); var interfaceTest = new InterfaceTest(); var genericsTest = new GenericTest(); var generics2Test = new Generic2Test(); var isInstanceTest = new IsInstanceTest(); var exceptionTest = new ExceptionTest(); var plugTestTest = new PlugTestTest(); var compareTest = new ComparisonTest(); var simpleTest = new OptimizationTest(); var reflectionTest = new ReflectionTest(); var arrayTest = new ArrayTest(); var int64Test = new Int64Test(); var otherTest = new OtherTest(); delegateTest.Test(); stringTest.Test(); interfaceTest.Test(); genericsTest.Test(); generics2Test.Test(); isInstanceTest.Test(); exceptionTest.Test(); plugTestTest.Test(); compareTest.Test(); simpleTest.Test(); //reflectionTest.Test(); arrayTest.Test(); int64Test.Test(); otherTest.Test(); }
public static void Start() { Screen.Color = 0x0; Screen.Clear(); Screen.GotoTop(); Screen.Color = 0x0E; Screen.Write('M'); Screen.Write('O'); Screen.Write('S'); Screen.Write('A'); Screen.Write(' '); Screen.Write('O'); Screen.Write('S'); Screen.Write("!"); Screen.Write(" "); DebugClient.Setup(Serial.COM1); Screen.Write('0'); IDT.SetInterruptHandler(null); Screen.Write('1'); Multiboot.Setup(); Screen.Write('2'); PIC.Setup(); Screen.Write('3'); GDT.Setup(); Screen.Write('4'); IDT.Setup(); Screen.Write('5'); PageFrameAllocator.Setup(); Screen.Write('6'); PageTable.Setup(); Screen.Write('7'); VirtualPageAllocator.Setup(); Screen.Write('8'); GC.Setup(); Screen.Write('9'); //Runtime.Setup(); Screen.Write('A'); IDT.SetInterruptHandler(ProcessInterrupt); Screen.Write('B'); ConsoleManager.Setup(); Screen.Write('C'); Console = ConsoleManager.Controller.Boot; Screen.Write('D'); Console.Color = 0x0E; Console.BackgroundColor = 1; Console.WriteLine(); Console.WriteLine(); Console.Write("!MOSA is alive!"); Console.WriteLine(); KernelTest.RunTests(); DumpStackTrace(); //System.Threading.SpinLock splk = new System.Threading.SpinLock(); //bool lockTaken = false; //splk.Enter(ref lockTaken); //if (splk.IsHeld) // Console.Write("Entered..."); //lockTaken = false; //splk.Enter(ref lockTaken); //Console.Write("Should have looped!!!"); Console.Goto(22, 0); Process(); }
/// <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(); } }
/// <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); } }
/// <summary> /// Main /// </summary> public static unsafe 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.4 - Compiler Version 1.4"); 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-2015 [Managed Operating System Alliance]"); FillLine(); Process(); }
/// <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(); } }