Esempio n. 1
0
 /// <summary>
 /// This Method controls the Driver initialisation process and is intended for
 /// Advanced users developing their drivers and takes 4 additional booleans.
 /// 1. Mousewheel, if you experience your mouse cursors being stuck in the lower left corner set this to "false", default: true
 /// 2. PS2 Driver initialisation, true/false , default: true
 /// 3. Network Driver initialisation, true/false, default: true
 /// 4. IDE initialisation, true/false, default: true
 /// If you need anything else to be initialised really early on, place it here.
 /// </summary>
 protected virtual void OnBoot()
 {
     Global.Init(GetTextScreen());
 }
Esempio n. 2
0
        /// <summary>
        /// Start the system up using the properties for configuration.
        /// </summary>
        public virtual void Start()
        {
            try
            {
                Global.mDebugger.Send("Starting kernel");
                if (mStarted)
                {
                    Global.mDebugger.Send("ERROR: Kernel Already Started");
                    throw new Exception("Kernel has already been started. A kernel cannot be started twice.");
                }
                mStarted = true;

                if (string.Empty == null)
                {
                    throw new Exception("Compiler didn't initialize System.String.Empty!");
                }

                Global.mDebugger.Send("HW Bootstrap Init");
                HAL.Bootstrap.Init();

                Global.mDebugger.Send("Global Init");
                Global.Init(GetTextScreen(), GetKeyboard());

                // Provide the user with a clear screen if they requested it
                if (ClearScreen)
                {
                    Global.mDebugger.Send("Cls");
                    //Global.Console.Clear();
                }

                Global.mDebugger.Send("Before Run");
                BeforeRun();

                // now enable interrupts:
                HAL.Global.EnableInterrupts();

                Global.mDebugger.Send("Run");
                if (mStopped)
                {
                    Global.mDebugger.Send("Already stopped");
                }
                else
                {
                    Global.mDebugger.Send("Not yet stopped");
                }
                while (!mStopped)
                {
                    //Network.NetworkStack.Update();
                    Global.mDebugger.Send("Really before Run");
                    Run();
                    Global.mDebugger.Send("Really after Run");
                }
                Global.mDebugger.Send("AfterRun");
                AfterRun();
                //bool xTest = 1 != 3;
                //while (xTest) {
                //}
            }
            catch (Exception E)
            {
                // todo: better ways to handle?
                global::System.Console.WriteLine("Exception occurred while running kernel:");
                global::System.Console.WriteLine(E.ToString());
            }
        }