示例#1
0
        public static unsafe void Start()
        {
            Console.Clear();
            Console.WriteLine("                                         ");

            // Load System Elements
            Global.Init();
            Console.WriteLine("Welcome to AtomixOS!");
            Console.WriteLine();

            Console.WriteLine("Shutdown: Ctrl+S");
            Console.WriteLine("Reboot: Ctrl+R");

            // Just for mouse testing
            Multitasking.CreateTask(pTask1, true);
            Multitasking.CreateTask(pTask2, true);
            Console.WriteLine("Block Device Count::" + Global.Devices.Count.ToString());
            uint c = 0;

            for (int i = 0; i < Global.Devices.Count; i++)
            {
                if (Global.Devices[i] is Drivers.Partition)
                {
                    c++;
                }
            }

            Console.WriteLine("Partition Count::" + c.ToString());
            Console.WriteLine();
            Multitasking.CreateTask(pFAT32test, true);
            Multitasking.CreateTask(pSerialTest, true);
            Multitasking.CreateTask(pIdleTask, true);
            //Screen.Setup();
            //Screen.Clear(0xFFBB977E);
        }
示例#2
0
        public static unsafe void Start(uint magic, uint address)
        {
            /* Setup Multiboot */
            Multiboot.Setup(magic, address);

            /* Placement Address */
            Heap.PlacementAddress = Native.EndOfKernel();

            /* Clear Interrupts */
            Native.ClearInterrupt();

            /* Setup PIC */
            PIC.Setup();

            /* Setup GDT & Enter into protected mode */
            GDT.Setup();

            /* Setup IDT */
            IDT.Setup();

            /* Enable Interrupts */
            Native.SetInterrupt();

            /* Setup Paging */
            Paging.Setup(Multiboot.RAM);

            /* Setup Multitasking */
            Multitasking.CreateTask(0, true); //This is System Update thread
            Multitasking.Init();              //Start Multitasking

            /* Call our kernel instance now */
            try
            {
                Caller.Start();
                while (true)
                {
                    Caller.Update();
                }
            }
            catch (Exception e)
            {
                //Kernel PANIC !!
                Console.WriteLine(e.Message);
            }

            while (true)  //Set CPU in Infinite loop DON'T REMOVE THIS ELSE I'll KILL YOU (^ . ^)
            {
                Native.ClearInterrupt();
                Native.Halt();
            }
            ;
        }