public override void Execute() { Console.WriteLine("Enter string to be hashed using SHA256"); string hash = StringExtensions.SHA256(Console.ReadLine()); Console.WriteLine(hash); KernelExtensions.PressAnyKey(); }
public static void Panic() { AConsole.Clear(); AConsole.Fill(ConsoleColor.Red); AConsole.CursorTop = 2; AConsole.WriteLineEx("KERNEL PANIC", ConsoleColor.White, ConsoleColor.Red, true); AConsole.WriteLine("\n"); string message = "CRITICAL KERNEL EXCEPTION\nPLEASE CONTACT YOUR SOFTWARE MANUFACTURER"; AConsole.WriteLineEx(message, ConsoleColor.White, ConsoleColor.Red, true); // Enter an infinite loop while (true) { } }
/// <summary> /// Kernel Panic /// </summary> public static void Panic(string err, string desc, string lka, ref Cosmos.Core.INTs.IRQContext aContext) { AConsole.Clear(); AConsole.Fill(ConsoleColor.Black); AConsole.CursorTop = 2; AConsole.WriteLineEx("kpanic occurred at :" + lka, ConsoleColor.Black, ConsoleColor.White); AConsole.WriteLineEx("Error: " + err, ConsoleColor.Black, ConsoleColor.White); AConsole.WriteLineEx("Description: " + desc, ConsoleColor.Black, ConsoleColor.White); AConsole.WriteLine("\n"); AConsole.WriteLine("Debug info:"); AConsole.WriteLine("\n"); AConsole.WriteLine("eip: " + aContext.EIP); AConsole.WriteLine("eax: " + aContext.EAX + " edx: " + aContext.EDX + " ecx: " + aContext.ECX + " ebx: " + aContext.EBX); AConsole.WriteLine("esi: " + aContext.ESI + " edi: " + aContext.EDI + " ebp: " + aContext.EBP + " esp: " + aContext.ESP); // Enter an infinite loop while (true) { } }
/// <summary> /// INFO: MaxValue is 100 and MinValue is 0. /// </summary> public void Draw() { AConsole.WriteLine(); string buffer = "[ ]"; AConsole.Write(buffer); AConsole.CursorLeft = CL + 1; string __buffer = ""; for (int i = 0; i < this.value; i++) { __buffer += "="; } AConsole.Write(__buffer); AConsole.CursorLeft = CL + 14; AConsole.Write(this.value.ToString() + "0%"); AConsole.CursorTop = CT; AConsole.CursorLeft = CL; }
public override void Execute() { Console.Clear(); KernelExtensions.PressAnyKey("Press any key to start a test Stop Error"); Console.WriteLine(breakme().ToString()); }
public static void WriteLine(string text) { AConsole.WriteLine("[!] ERROR: " + text.ToUpper(), ConsoleColor.Red); }
/// <summary> /// Shows the BootScreen and a specified effect /// </summary> /// <param name="OSname"></param> /// <param name="efx"></param> /// <param name="color"></param> /// <param name="ms_sleep"></param> public static void Show(string OSname, Effect efx, ConsoleColor color, int ms_sleep) { debugger.Send("Bootscreen.Show"); if (ms_sleep % 2 == 1) { ms_sleep++; } switch (efx) { case Effect.SlideFromLeft: debugger.Send("slide-from-left"); for (int i = 0; i < ((AConsole.WindowWidth / 2) - (OSname.Length / 2)); i++) { AConsole.Clear(); AConsole.CursorLeft = i; string fill = ""; for (int x = 0; x < i; x++) { fill += " "; } AConsole.Write(fill); AConsole.Write(OSname, color, false, true); RTC.Sleep(ms_sleep); } break; case Effect.SlideFromRight: debugger.Send("slide-from-right"); for (int i = (AConsole.WindowWidth - OSname.Length); i > ((AConsole.WindowWidth / 2) - (OSname.Length / 2)); i--) { AConsole.Clear(); AConsole.CursorLeft = i; AConsole.Write(OSname, color, false, true); RTC.Sleep(ms_sleep); } break; case Effect.SlideFromTop: debugger.Send("slide-from-top"); for (int i = 0; i < (AConsole.WindowHeight / 2); i++) { AConsole.Clear(); AConsole.CursorTop = i; AConsole.WriteLine(OSname, color, true, false); RTC.Sleep(ms_sleep); } break; case Effect.SlideFromBottom: debugger.Send("slide-from-bottom"); for (int i = (AConsole.WindowHeight - 1); i > (AConsole.WindowHeight / 2); i--) { AConsole.Clear(); AConsole.CursorTop = i; AConsole.WriteLine(OSname, color, true, false); RTC.Sleep(ms_sleep); } break; case Effect.Typewriter: debugger.Send("typewriter"); AConsole.CursorLeft = ((AConsole.WindowWidth / 2) - (OSname.Length / 2)); foreach (char chr in OSname) { AConsole.Write(chr.ToString(), color, false, true); RTC.Sleep(ms_sleep); } break; case Effect.Matrix: debugger.Send("matrix"); int sec1 = AIC.Hardware.RTC.Now.Second; int sec2 = sec1; do { sec2 = AIC.Hardware.RTC.Now.Second; } while (sec1 == sec2); int sec3; if (sec2 <= 56) { sec3 = sec2 + 3; } else if (sec2 == 57) { sec3 = 1; } else if (sec2 == 58) { sec3 = 2; } else if (sec2 == 59) { sec3 = 3; } else { sec3 = 3; } int tmr = 0; int tmrx = 0; for (int i = 0; i < 10; i++) { for (int ih = 0; ih < AConsole.WindowHeight; ih++) { for (int iw = 0; iw < AConsole.WindowWidth; iw++) { if (tmr == 11) { tmr = 0; } if (tmrx == 4) { tmrx = 0; } tmr++; if (tmr == 0) { AConsole.Write("#", ConsoleColor.Magenta); } if (tmrx == 3) { AConsole.Write("*", ConsoleColor.Green); } if (tmr == 2) { AConsole.Write(";", ConsoleColor.Red); ++tmrx; } if (tmrx == 1) { AConsole.Write("+", ConsoleColor.Yellow); } if (tmr == 4) { AConsole.Write("~", ConsoleColor.Blue); ++tmrx; } if (tmrx == 2) { AConsole.Write("&", ConsoleColor.Cyan); } AConsole.Write(OSname, ConsoleColor.White, true, true); } } } break; } }