Example #1
0
        public static void Update()
        {
            // get current key down
            if (KB.KeyAvailable)
            {
                if (KB.TryReadKey(out currentKey))
                {
                    previousKey = currentKey;
                }
            }
            else
            {
                currentKey = null;
            }

            // check enter
            if (currentKey.Key == Sys.ConsoleKeyEx.Enter)
            {
                ENTER_DOWN = true;
            }
            else
            {
                ENTER_DOWN = false;
            }

            // check control keys
            CAPS_LOCK    = KB.CapsLock;
            SHIFT_DOWN   = KB.ShiftPressed;
            CONTROL_DOWN = KB.ControlPressed;
            ALT_DOWN     = KB.AltPressed;
        }
Example #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());

                //Start with a PS2Keyboard
                KeyboardManager.AddKeyboard(new PS2Keyboard());

                // 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());
            }
        }
Example #3
0
 protected void SetKeyboardScanMap(ScanMapBase ScanMap)
 {
     KeyboardManager.SetKeyLayout(ScanMap);
 }
Example #4
0
 protected ScanMapBase GetKeyboardScanMap()
 {
     return(KeyboardManager.GetKeyLayout());
 }
Example #5
0
 /// <summary>
 /// Change keyboard layout. Initially set to US_Standard.
 /// <para>
 /// Currently available:
 /// <list type="bullet">
 /// <item>US_Standard.</item>
 /// <item>FR_Standard.</item>
 /// <item>DE_Standard.</item>
 /// <item>TR_StandardQ.</item>
 /// </list>
 /// </para>
 /// </summary>
 /// <param name="scanMap">A key mapping.</param>
 public static void ChangeKeyLayout(ScanMapBase scanMap)
 {
     KeyboardManager.SetKeyLayout(scanMap);
 }
Example #6
0
 /// <summary>
 /// Add fake scan codes to the keyboard, fake pressing keys.
 /// Used to test kernals.
 /// </summary>
 /// <param name="aScanCode">A key code.</param>
 /// <param name="aReleased">Is key pressed.</param>
 /// <exception cref="sysIO.IOException">An I/O error occurred.</exception>
 internal static void KeyboardAddFakeScanCode(byte aScanCode, bool aReleased)
 {
     Global.mDebugger.Send("Before HandleFakeScanCode");
     KeyboardManager.HandleFakeScanCode(aScanCode, aReleased);
     Global.mDebugger.Send("After HandleFakeScanCode");
 }