Example #1
0
        // TODO: continue adding exceptions to the list, as HAL and Core would be documented.
        /// <summary>
        /// Init <see cref="Global"/> instance.
        /// </summary>
        /// <param name="textScreen">Text screen.</param>
        /// <exception cref="System.IO.IOException">Thrown on IO error.</exception>
        static public void Init(TextScreenBase textScreen)
        {
            if (textScreen != null)
            {
                TextScreen = textScreen;
            }

            mDebugger.Send("Before Core.Global.Init");
            Core.Global.Init();

            //TODO Redo this - Global init should be other.
            // Move PCI detection to hardware? Or leave it in core? Is Core PC specific, or deeper?
            // If we let hardware do it, we need to protect it from being used by System.
            // Probably belongs in hardware, and core is more specific stuff like CPU, memory, etc.
            //Core.PCI.OnPCIDeviceFound = PCIDeviceFound;

            //TODO: Since this is FCL, its "common". Otherwise it should be
            // system level and not accessible from Core. Need to think about this
            // for the future.
            Console.Clear();
            Console.WriteLine("Finding PCI Devices");
            mDebugger.Send("PCI Devices");
            PCI.Setup();

            Console.WriteLine("Starting ACPI");
            mDebugger.Send("ACPI Init");
            ACPI.Start();

            // http://wiki.osdev.org/%228042%22_PS/2_Controller#Initialising_the_PS.2F2_Controller
            // TODO: USB should be initialized before the PS/2 controller
            // TODO: ACPI should be used to check if a PS/2 controller exists
            mDebugger.Send("PS/2 Controller Init");
            PS2Controller.Initialize();

            IDE.InitDriver();
            AHCI.InitDriver();
            //EHCI.InitDriver();

            mDebugger.Send("Network Devices Init");
            NetworkInit.Init();

            mDebugger.Send("Done initializing Cosmos.HAL.Global");
        }
        protected override void BeforeRun()
        {
            try
            {
                #region Console Encoding Provider

                Encoding.RegisterProvider(CosmosEncodingProvider.Instance);
                Console.InputEncoding  = Encoding.Unicode;
                Console.OutputEncoding = Encoding.Unicode;

                #endregion

                #region Commmand Manager Init

                CommandManager.RegisterAllCommands();

                #endregion

                System.CustomConsole.WriteLineInfo("Booting Aura Operating System...");

                #region Filesystem Init

                Sys.FileSystem.VFS.VFSManager.RegisterVFS(vFS);
                if (ContainsVolumes())
                {
                    System.CustomConsole.WriteLineOK("FileSystem Registration");
                }
                else
                {
                    System.CustomConsole.WriteLineError("FileSystem Registration");
                }

                #endregion

                #region Network Init

                NetworkInit.Init();

                #endregion

                System.CustomConsole.WriteLineOK("Aura successfully started!");

                #region Installation Init

                setup.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();
                 *
                 *      System.Network.NetworkInterfaces.Init();
                 *
                 *      running = true;
                 *
                 *  }
                 * }
                 * else
                 * {
                 *  running = true;
                 * }*/

                running = true;

                #endregion

                boottime = Time.MonthString() + "/" + Time.DayString() + "/" + Time.YearString() + ", " + Time.TimeString(true, true, true);
            }
            catch (Exception ex)
            {
                running = false;
                Crash.StopKernel(ex);
            }
        }
Example #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
        }
Example #4
0
        protected override void BeforeRun()
        {
            try
            {
                CommandManager.RegisterAllCommands();

                //AConsole = new System.Shell.VGA.VGAConsole(null);

                Encoding.RegisterProvider(CosmosEncodingProvider.Instance);
                Console.InputEncoding  = Encoding.GetEncoding(437);
                Console.OutputEncoding = Encoding.GetEncoding(437);

                System.CustomConsole.WriteLineInfo("Booting Aura Operating System...");

                /*System.CustomConsole.WriteLineInfo("VBE Informations:");
                 * System.CustomConsole.WriteLineInfo("VBE Version: " + Graphics.VBEVersion);
                 * System.CustomConsole.WriteLineInfo("VBE Signature: " + Graphics.VBESignature);
                 * System.CustomConsole.WriteLineInfo("BPP: " + Graphics.ModeInfo.bpp);
                 * System.CustomConsole.WriteLineInfo("Height: " + Graphics.ModeInfo.height);
                 * System.CustomConsole.WriteLineInfo("Width: " + Graphics.ModeInfo.width);*/

                #region Register Filesystem
                Sys.FileSystem.VFS.VFSManager.RegisterVFS(vFS);
                if (ContainsVolumes())
                {
                    System.CustomConsole.WriteLineOK("FileSystem Registration");
                }
                else
                {
                    System.CustomConsole.WriteLineError("FileSystem Registration");
                }
                #endregion

                NetworkInit.Init();

                System.CustomConsole.WriteLineOK("Aura successfully started!");

                setup.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();

                        System.Network.NetworkInterfaces.Init();

                        running = true;
                    }
                }
                else
                {
                    running = true;
                }

                boottime = Time.MonthString() + "/" + Time.DayString() + "/" + Time.YearString() + ", " + Time.TimeString(true, true, true);
            }
            catch (Exception ex)
            {
                running = false;
                Crash.StopKernel(ex);
            }
        }