コード例 #1
0
        public static void HandleException(uint aEIP, string aDescription, string aName, ref IRQContext ctx, uint LastKnownAddressValue = 0)
        {
            string       error = ctx.Interrupt.ToString();
            const string xHex  = "0123456789ABCDEF";

            string ctxinterrupt = "";

            ctxinterrupt = ctxinterrupt + xHex[(int)((ctx.Interrupt >> 4) & 0xF)];
            ctxinterrupt = ctxinterrupt + xHex[(int)(ctx.Interrupt & 0xF)];

            string LastKnownAddress = "";

            if (LastKnownAddressValue != 0)
            {
                LastKnownAddress = LastKnownAddress + xHex[(int)((LastKnownAddressValue >> 28) & 0xF)];
                LastKnownAddress = LastKnownAddress + xHex[(int)((LastKnownAddressValue >> 24) & 0xF)];
                LastKnownAddress = LastKnownAddress + xHex[(int)((LastKnownAddressValue >> 20) & 0xF)];
                LastKnownAddress = LastKnownAddress + xHex[(int)((LastKnownAddressValue >> 16) & 0xF)];
                LastKnownAddress = LastKnownAddress + xHex[(int)((LastKnownAddressValue >> 12) & 0xF)];
                LastKnownAddress = LastKnownAddress + xHex[(int)((LastKnownAddressValue >> 8) & 0xF)];
                LastKnownAddress = LastKnownAddress + xHex[(int)((LastKnownAddressValue >> 4) & 0xF)];
                LastKnownAddress = LastKnownAddress + xHex[(int)(LastKnownAddressValue & 0xF)];
            }
            Bluescreen.Panic(aName, aDescription, LastKnownAddress, ref ctx);
        }
コード例 #2
0
        /// <summary>
        /// Main installer method, choose colour of installer, choose desired username and reports if a FAT error occurs
        /// </summary>
        public static void Main()
        {
            ScreenSetup();
            WriteLine("Welcome to the Medli installer.");
            PressAnyKey();

            try
            {
                Accounts.InitNewUser(); Done();

                WriteLine("Enter the root password: "******"Writing root password...");
                MEnvironment.WriteRootPass(); Done();
            }
            catch (Exception ex)
            {
                Bluescreen.Init(ex, true);
                Console.ReadKey(true);
            }

            WriteLine("Please enter a machine name:");
            Kernel.pcname = ReadLine();

            try
            {
                WritePrefix("Creating machineinfo file...    "); File.Create(Kernel.pcinfo).Dispose(); Done();
                WritePrefix("Writing machineinfo to file...  "); File.WriteAllText(Kernel.pcinfo, Kernel.pcname); Done();
            }
            catch
            {
                WriteLine("OOOPS!");
                PressAnyKey("Press any key to view the stop error: ");
                ErrorHandler.BlueScreen.Init(5, @"The Installer was unable to create the user directory and other files. 
This may be due to a failing hard drive or other internal error", "FAT Error");
            }

            WriteLine("Awesome - you're all set!");
            PressAnyKey("Press any key to start Medli!");
            Console.Clear();
        }
コード例 #3
0
 /// <summary>
 /// Removes the char at position [string[index]]
 /// </summary>
 /// <param name="str"></param>
 /// <param name="null_based_index"></param>
 /// <returns></returns>
 public static string _RemoveCharAt(this string str, int null_based_index)
 {
     if (null_based_index < str.Length)
     {
         string _str = "";
         for (int i = 0; i < null_based_index; i++)
         {
             _str += str[i];
         }
         for (int i = null_based_index + 1; i < str.Length; i++)
         {
             _str += str[i];
         }
         return(_str);
     }
     else
     {
         Bluescreen.Init("string._GetCharAt", "null_based_index must be >= 0 and <= the length of the string");
         return(str);
     }
 }