Beispiel #1
0
 protected override void BeforeRun()
 {
     Console.Clear();
     Bootscreen.Show("AIC Demo!", Bootscreen.Effect.Matrix, ConsoleColor.Green, 3);
     Console.Clear();
     menu.Reset();
 }
Beispiel #2
0
 public override void Execute()
 {
     Console.Clear();
     Console.WriteLine("Hello World!");
     KernelExtensions.PressAnyKey();
     // Place the code that should be executed here
 }
Beispiel #3
0
        public override void Execute()
        {
            Console.WriteLine("Enter string to be hashed using SHA256");
            string hash = StringExtensions.SHA256(Console.ReadLine());

            Console.WriteLine(hash);
            KernelExtensions.PressAnyKey();
        }
Beispiel #4
0
 public static void RollDown(uint mspause)
 {
     for (int i = 0; i < 26; i++)
     {
         for (int j = 0; j < 81; j++)
         {
             AConsole.Write(" ");
             AIC.Core.PIT.SleepMilliseconds(mspause);
         }
     }
     AConsole.Clear();
 }
Beispiel #5
0
 /// <summary>
 /// Initiates a Bluescreen.
 /// </summary>
 /// <param name="error">Error title or exception name</param>
 /// <param name="description">Error description</param>
 /// <param name="critical">Critical error?</param>
 public static void Init(
     string error       = "Something went wrong!",
     string description = "Unknown exception",
     bool critical      = false)
 {
     DrawOOPS();
     if (description.Length + 33 < System.Console.WindowHeight)
     {
         System.Console.CursorTop = 2; System.Console.CursorLeft = 33;
         ConsoleColor errcolor = ConsoleColor.White;
         if (critical)
         {
             errcolor = ConsoleColor.Red;
         }
         AConsole.WriteLineEx(error, errcolor, ConsoleColor.Blue);
         AConsole.CursorTop = 4; AConsole.CursorLeft = 70;
         AConsole.WriteLineEx(description, ConsoleColor.White, ConsoleColor.Blue);
     }
     else
     {
         AConsole.CursorTop = 12; AConsole.CursorLeft = 2;
         ConsoleColor errcolor = ConsoleColor.White;
         if (critical)
         {
             errcolor = ConsoleColor.Red;
         }
         AConsole.WriteLineEx(error, errcolor, ConsoleColor.Blue);
         AConsole.CursorTop = 14; AConsole.CursorLeft = 2;
         AConsole.WriteLineEx(description, ConsoleColor.White, ConsoleColor.Blue);
     }
     if (!critical)
     {
         AConsole.CursorTop = AConsole.WindowHeight - 1;
         AConsole.WriteEx("Press the [Enter]-key to resume", ConsoleColor.White, ConsoleColor.Blue);
         AConsole.CursorTop++;
         AConsole.ReadLine();
         AConsole.Clear();
     }
     else
     {
         AConsole.CursorTop = AConsole.WindowHeight - 4;
         AConsole.WriteLineEx("Press the [Enter]-key to shutdown", ConsoleColor.White, ConsoleColor.Blue);
         AConsole.CursorTop++;
         AConsole.WriteLineEx("If it doesn't work, press the RESET-button on your computer.", ConsoleColor.White, ConsoleColor.Blue);
         AConsole.CursorTop++;
         AConsole.ReadLine();
         ACPI.Shutdown();
     }
 }
Beispiel #6
0
        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)
            {
            }
        }
Beispiel #7
0
 public static void Init(Exception ex, bool critical = false)
 {
     DrawOOPS();
     if (ex.Message.Length + 33 < AConsole.WindowHeight)
     {
         AConsole.CursorTop = 2; AConsole.CursorLeft = 33;
         ConsoleColor errcolor = ConsoleColor.White;
         if (critical)
         {
             errcolor = ConsoleColor.Red;
         }
         //AConsole.WriteLineEx(ex.Source, errcolor, ConsoleColor.Blue);
         AConsole.CursorTop = 3; AConsole.CursorLeft = 70;
         AConsole.WriteLineEx(ex.Message, ConsoleColor.White, ConsoleColor.Blue);
     }
     else
     {
         AConsole.CursorTop = 12; AConsole.CursorLeft = 2;
         ConsoleColor errcolor = ConsoleColor.White;
         if (critical)
         {
             errcolor = ConsoleColor.Red;
         }
         //AConsole.WriteLineEx(ex.Source, errcolor, ConsoleColor.Blue);
         AConsole.CursorTop = 13; AConsole.CursorLeft = 2;
         AConsole.WriteLineEx(ex.Message, ConsoleColor.White, ConsoleColor.Blue);
     }
     if (!critical)
     {
         AConsole.CursorTop = AConsole.WindowHeight - 3;
         AConsole.WriteEx("Press the [Enter]-key to resume", ConsoleColor.White, ConsoleColor.Blue);
         AConsole.CursorTop++;
         AConsole.ReadLine();
         AConsole.Clear();
     }
     else
     {
         AConsole.CursorTop = AConsole.WindowHeight - 4;
         AConsole.WriteEx("Press the [Enter]-key to shutdown", ConsoleColor.White, ConsoleColor.Blue);
         AConsole.CursorTop++;
         AConsole.WriteEx("If it doesn't work, press the RESET-button on your computer.", ConsoleColor.White, ConsoleColor.Blue);
         AConsole.CursorTop++;
         AConsole.ReadLine();
         ACPI.Shutdown();
     }
 }
Beispiel #8
0
 private static void DrawOOPS()
 {
     AConsole.Fill(ConsoleColor.Blue);
     string[] arrOOPS = new string[] {
         "=====  =====   =====   =====  =====   |",
         "=      =    =  =    =  =   =  =    =  |",
         "=====  ======  ======  =   =  ======  |",
         "=      =    =  =    =  =   =  =    =  |",
         "=====  =    =  =    =  =====  =    =  O"
     };
     AConsole.CursorTop = 2;
     foreach (string str in arrOOPS)
     {
         AConsole.CursorLeft = 2;
         AConsole.WriteLineEx(str, ConsoleColor.White, ConsoleColor.Blue);
     }
 }
Beispiel #9
0
        /// <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;
            }
Beispiel #11
0
 public override void Execute()
 {
     Console.Clear();
     KernelExtensions.PressAnyKey("Press any key to start a test Stop Error");
     Console.WriteLine(breakme().ToString());
 }
Beispiel #12
0
 public override void Execute()
 {
     Bootscreen.Show("AIC Demo!", Bootscreen.Effect.Matrix, ConsoleColor.Green, 2);
     Console.Clear();
 }
Beispiel #13
0
 public override void Execute()
 {
     Bootscreen.Show("AIC Demo!", Bootscreen.Effect.SlideFromLeft, ConsoleColor.Green, 1);
     Console.Clear();
 }
Beispiel #14
0
 public static void WriteLine(string text)
 {
     AConsole.WriteLine("[!] ERROR: " + text.ToUpper(), ConsoleColor.Red);
 }
Beispiel #15
0
 private static void ShowEntryMenu()
 {
     for (int i = 10 - (cat[itemcat].entries.Count / 2); i < 11 + cat.Count; i++)
     {
         string buffer = "";
         AConsole.CursorTop = i;
         for (int j = 10; j <= 70; j++)
         {
             buffer += " ";
         }
         AConsole.CursorLeft = 10;
         AConsole.WriteEx(buffer, background, background);
     }
     AConsole.CursorTop = 11 - (cat[itemcat].entries.Count / 2);
     for (int i = 0; i < cat[itemcat].entries.Count; i++)
     {
         if (i == item)
         {
             WriteEx(cat[itemcat].entries[i].text, highlighted, background, true);
             CursorLeft = 69;
             WriteLineEx(">", arrow, background);
         }
         else
         {
             WriteLineEx(cat[itemcat].entries[i].text, normal, background, true);
         }
     }
     while (true)
     {
         ConsoleKey key = AConsole.ReadKey().Key;
         if (key == ConsoleKey.UpArrow)
         {
             if (item > 0)
             {
                 item--;
             }
             else
             {
                 item = cat[itemcat].entries.Count - 1;
             }
             break;
         }
         else if (key == ConsoleKey.DownArrow)
         {
             if (item < cat[itemcat].entries.Count - 1)
             {
                 item++;
             }
             else
             {
                 item = 0;
             }
             break;
         }
         else if (key == ConsoleKey.Enter || key == ConsoleKey.RightArrow)
         {
             cat[itemcat].entries[item].Execute();
             break;
         }
     }
 }
Beispiel #16
0
        /// <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;
            }
        }