public static void INIT() { if (!PMFAT.Initialize()) { CLI_lite.InitializeLite(); } }
public static List <CLICommand> Commands = new List <CLICommand>(); // Создание листа с командами public static void Initialize() { try { WriteLine("Initializing command library...", ConsoleColor.Green); // Инициализация команд!!!! Commands.Add(new CLI_CLEAR()); Commands.Add(new CLI_ABOUT()); Commands.Add(new CLI_SHUTDOWN()); Commands.Add(new CLI_REBOOT()); Commands.Add(new CLI_HELP_1()); Commands.Add(new CLI_HELP_2()); Commands.Add(new CLI_HELP_3()); Commands.Add(new CLI_AUTHORS()); Commands.Add(new CLI_CTIME()); Commands.Add(new CLI_DISK_INFO()); Commands.Add(new CLI_LS()); Commands.Add(new CLI_LS_A()); Commands.Add(new CLI_READ_FILE()); Commands.Add(new CLI_EDIT_FILE()); Commands.Add(new CLI_CREATE_FILE()); Commands.Add(new CLI_CLEAR_FILE()); Commands.Add(new CLI_DELETE_FILE()); Commands.Add(new CLI_PWD()); Commands.Add(new CLI_DELETE_DIRECTORY()); Commands.Add(new OKAY()); Console.Clear(); PMFAT.Initialize(); if (!PMFAT.Initialize()) { Console.WriteLine("[FATAL ERROR] could not initialize fat driver!"); CLI_lite.InitializeLite(); } WriteLine("Welcome to doos CLI!", ConsoleColor.Blue); WriteLine("Enter 'help-1' to display the first page of commands."); } catch (Exception e) { Console.ForegroundColor = ConsoleColor.White; Console.BackgroundColor = ConsoleColor.DarkRed; Console.Clear(); Console.WriteLine("\n========================================================================"); Console.WriteLine("\nStatus: Kernel panic! "); Console.WriteLine("\n================================ "); Console.WriteLine(" Possible causes: "); Console.WriteLine(" - An Kernel Error in Doos "); Console.WriteLine(" - FileSystem Error "); Console.WriteLine(" - Unknown Error "); Console.WriteLine("================================ "); Console.WriteLine($"\nInfo: {e}"); Console.WriteLine("\n========================================================================"); Console.WriteLine("\n Press any key to restart and attempts to correct the error..."); Console.ReadKey(true); Console.WriteLine("\nRestarting..."); Cosmos.System.Power.Reboot(); throw; } }
protected override void BeforeRun() { // initialize fat driver PMFAT.Initialize(); // init shell Shell.Initialize(); // init vm Runner.Initialize(); }
protected override void BeforeRun() { CLI.Initialize(); if (!SVGA.Initialize()) { CLI.WriteLine("[FATAL ERROR] could not initialize graphics mode!", ConsoleColor.Red); } if (!PMFAT.Initialize()) { Console.WriteLine("[FATAL ERROR] could not initialize fat driver!", ConsoleColor.Red); } }