示例#1
0
文件: Kernel.cs 项目: zrbruce/FlingOS
        private static void ThrowNullReferenceException(uint eip)
        {
            UART.Write('N');
            UART.Write('u');
            UART.Write('l');
            UART.Write('l');
            UART.Write(' ');
            UART.Write('r');
            UART.Write('e');
            UART.Write('f');
            UART.Write('\r');
            UART.Write('\n');

            while (true)
            {
                LED.Red();
                LED.Blue();
            }
        }
示例#2
0
文件: Kernel.cs 项目: zrbruce/FlingOS
        private static void ThrowIndexOutOfRangeException(uint eip)
        {
            UART.Write('I');
            UART.Write('n');
            UART.Write('d');
            UART.Write('e');
            UART.Write('x');
            UART.Write(' ');
            UART.Write('O');
            UART.Write('O');
            UART.Write('R');
            UART.Write('\r');
            UART.Write('\n');

            while (true)
            {
                LED.Red();
                LED.Blue();
            }
        }
示例#3
0
文件: Kernel.cs 项目: zrbruce/FlingOS
        public static unsafe void Main()
        {
            LED.Blue();
            Delay();
            LED.Red();
            Delay();

            UART.Init();

            UART.Write("Hello, world!\r\n");

            while (true)
            {
                char c = UART.ReadChar();

                if (c == 'r' || c == 'R')
                {
                    LED.Red();
                }
                else if (c == 'b' || c == 'B')
                {
                    LED.Blue();
                }
                else if (c == 'p' || c == 'P')
                {
                    for (int i = 0; i < 10000 * 2; i++)
                    {
                        LED.Red();
                        LED.Blue();
                    }
                }
                else if (c == 'f' || c == 'F')
                {
                    int bProp = 0;
                    for (int i = 0; i < 1000; i++)
                    {
                        for (int x = 0; x < 1000; x++)
                        {
                            if (bProp < x)
                            {
                                LED.Blue();
                            }
                            else
                            {
                                LED.Red();
                            }
                        }
                        bProp++;
                    }
                }
                else
                {
                    LED.Red();
                    Delay();
                    LED.Blue();
                    Delay();
                }

                UART.Write(c);
            }
        }