Ejemplo n.º 1
0
        protected override void Run()
        {
            try
            {
                //Sys.Thread TBAR = new Sys.Thread(TaskBar);
                while (running)
                {
                    if (Logged) //If logged
                    {
                        //TBAR.Start();
                        BeforeCommand();

                        AConsole.writecommand = true;

                        var cmd = Console.ReadLine();
                        //TBAR.Stop();
                        CommandManager._CommandManger(cmd);
                        //Console.WriteLine();
                    }
                    else
                    {
                        Login.LoginForm();
                    }
                }
            }
            catch (Exception ex)
            {
                CrashHandler CH = new CrashHandler();
                CH.Whoops(ex);
            }
        }
Ejemplo n.º 2
0
        public void Startup()
        {
            try
            {
                Vcanvas = FullScreenCanvas.GetFullScreenCanvas();
                Vcanvas.Clear(Color.Black);
                //DisplayDriver.Vcanvas.DrawImage(bootmap, 0, 0); //CRASHES!!! WTF

                //Display text at the bottom of the screen or right below the logo displaying words
            }
            catch (Exception ex)
            {
                CrashHandler CH = new CrashHandler();
                CH.Whoops(ex);
            }
        }
Ejemplo n.º 3
0
        void startupchecks()
        {
            Aura_OS.System.Setup SU = new Setup();
            try
            {
                //New stuff
                //Sys.FileSystem.VFS.VFSManager.RegisterVFS(fs);
                if (ContainsVolumes())
                {
                    Aura_OS.System.CustomConsole.WriteLineOK("FileSystem Registration");
                }
                else
                {
                    Aura_OS.System.CustomConsole.WriteLineError("FileSystem Registration");
                }

                NetworkInit.Init();

                Aura_OS.System.CustomConsole.WriteLineOK("Uszka-OS successfully started!");

                SU.InitSetup();

                if (SystemExists)
                {
                    if (!JustInstalled)
                    {
                        Settings config = new Settings(@"0:\System\settings.conf");
                        langSelected = config.GetValue("language");

                        #region Language

                        Lang.Keyboard.Init();

                        #endregion

                        Info.getComputerName();

                        Aura_OS.System.Network.NetworkInterfaces.Init();

                        running = true;
                    }
                }
                else
                {
                    running = true;
                }
            }
            catch (Exception ex)
            {
                CrashHandler CH = new CrashHandler();
                CH.Whoops(ex);
            }

            #region Obsolete

            /*if (!File.Exists(@"0:\fs.cfg"))
             * {
             *  printLogoConsole();
             *
             *  Console.WriteLine(@"The filesystem was not formatted with Uszka OS, so it cannot be used.");
             *  Console.WriteLine(@"Would you like to format it? (y/n)");
             *  Console.WriteLine("WARNING: THIS WILL DELETE ALL DATA.\n");
             *  if (Console.ReadLine() == "y")
             *  {
             *      Console.WriteLine("\nFormatting...");
             *      try
             *      {
             *          fs.Format(@"0:\", "FAT32", true);
             *          FileStream writeStream = File.Create(@"0:\fs.cfg");
             *          byte[] toWrite = Encoding.ASCII.GetBytes("true");
             *          writeStream.Write(toWrite, 0, toWrite.Length);
             *          writeStream.Close();
             *      }
             *      catch
             *      {
             *          deathScreen("0x0100 No Hard Drive to format!");
             *      }
             *  }
             *  else
             *  {
             *      Console.WriteLine("\nThe filesystem is being disabled as it was not formatted with Uszka OS.");
             *      enableFs = false;
             *      WaitSeconds(2);
             *  }
             *
             *  if (File.Exists("0:\\Flags.flg"))
             *  {
             *      Flags = new char[99];
             *      Flags = File.ReadAllText("0:\\Flags.flg").ToCharArray();
             *      Flags[1] = '1';//Force GFX mode
             *      if (Flags[0] == '1')
             *      {
             *          Uszka.Installer.Installer inst = new Installer.Installer();
             *          inst.start_inst(fs);
             *      }
             *      else if (Flags[0] == '2')
             *      {
             *          Console.ReadKey();
             *      }
             *      if (Flags[1] == '0')//GUI Mode
             *      {
             *          Console.WriteLine("Vga Driver Booting");
             *          try
             *          {
             *              GM = new GraphicsManager();
             *          }
             *          catch (Exception ex)
             *          {
             *              CrashHandler CH = new CrashHandler();
             *              CH.Whoops(ex);
             *          }
             *          DD.Startup();
             *          //GM.start();
             *      }
             *      else if (Flags[1] == '1')//Text Mode/Console Mode
             *      {
             *
             *      }
             *  }
             *  if (!File.Exists("0:\\Uszaka32\\System.cx") && !File.Exists("0:\\Flags.flg"))
             *  {
             *      // There is no SYSTEM directory yet, so we just shut the computer down there after setting flags
             *      if (!File.Exists("0:\\Flags.flg"))
             *      {
             *          // Create a file to write to.
             *          using (StreamWriter sw = File.CreateText("0:\\Flags.flg"))
             *          {
             *              sw.Write("1");
             *          }
             *      }
             *      Power.ACPIReboot();
             *  }
             *  else
             *  {
             *      File.ReadAllText("0:\\Uszaka32\\System.cx");
             *  }
             * }*/
            #endregion
        }
Ejemplo n.º 4
0
        public void start_inst(CosmosVFS fs)
        {
            try
            {
                //This is in the if.. statement. Remove the Kernel.Stop();
                Console.Clear();
                Console.WriteLine("-----Uszka Installer-----");

                /*
                 * Console.WriteLine("Create a username and password:"******"Username: "******"Password: "******"Starting Installation Process...");
                Console.WriteLine("Creating System Directory...");
                fs.CreateDirectory("0:\\SYSTEM\\");
                Console.WriteLine("Creating System Files");
                fs.CreateFile("0:\\SYSTEM\\System.cx");
                fs.CreateFile("0:\\SYSTEM\\users.db");
                fs.CreateFile("0:\\SYSTEM\\readme.txt");
                fs.CreateFile("0:\\SYSTEM\\sysinfo.txt");
                Console.WriteLine("Setting User Preferences...");
                File.WriteAllText("0:\\SYSTEM\\System.cx", "using Jajka_OS;" +
                                  "namespace System { " +
                                  "class System" +
                                  "{" +
                                  "public void Main()" +
                                  "{" +
                                  "Console.WriteLine(\"System File. Do not edit.\"" +
                                  ") } } }");
                File.WriteAllText("0:\\SYSTEM\\users.db", "No Users need run afterinstall");
                File.WriteAllText("0:\\SYSTEM\\readme.txt", "Note: Put the license here!");
                File.WriteAllText("0:\\SYSTEM\\sysinfo.txt", "Uszka Version 0.0.1 [8 GB]");
                fs.CreateDirectory("0:\\Documents\\");
                try
                {
                    Console.WriteLine("Deleting Preinstalled CosmosVFS Files");
                    Directory.Delete("0:\\Dir Testing\\");
                    Directory.Delete("0:\\TEST\\");
                    //fs.DeleteDirectory("0:\\Dir Testing\\");
                    //fs.DeleteDirectory("0:\\TEST\\");
                    File.Delete("0:\\Kudzu.txt");
                    File.Delete("0:\\Root.txt");
                }
                catch (Exception ex) { }
                Console.WriteLine("Setting Flags");
                if (!File.Exists("0:\\Flags.flg"))
                {
                    // Create a file to write to.
                    using (StreamWriter sw = File.CreateText("0:\\Flags.flg"))
                    {
                        sw.Write("2");
                    }
                }
                Console.Write("Press R to reboot...");

                /*
                 * char readkey = Console.ReadKey().KeyChar;
                 * if (readkey == 'R' || readkey == 'r')
                 * {
                 *  Power.ACPIReboot();
                 * }
                 * else if (readkey == 'E' || readkey == 'e')
                 * {
                 *  CrashHandler CH = new CrashHandler();
                 *  try
                 *  {
                 *      TestingException ex = new TestingException();
                 *      CH.Whoops(ex);
                 *  }
                 *  catch (Exception ex)
                 *  {
                 *      CH.Whoops(ex);
                 *  }
                 * }*/
            }
            catch (Exception ex)
            {
                CrashHandler CH = new CrashHandler();
                CH.Whoops(ex);
            }
        }