Exemplo n.º 1
0
        public static void Setup()
        {
            // Initialize GDT before IDT, because IDT Entries requires a valid Segment Selector
            Multiboot.Setup();
            GDT.Setup();

            // At this stage, allocating memory does not work, so you are only allowed to use ValueTypes or static classes.
            IDT.SetInterruptHandler(null);
            Panic.Setup();

            // Initialize interrupts
            PIC.Setup();
            IDT.Setup();

            // Initializing the memory management
            PageFrameAllocator.Setup();
            PageTable.Setup();
            VirtualPageAllocator.Setup();
            GC.Setup();

            // At this point we can use objects
            Scheduler.Setup();
            SmbiosManager.Setup();
            ConsoleManager.Setup();

            Logger.Log("Kernel initialized");
        }
Exemplo n.º 2
0
        public static void Setup()
        {
            // At this stage, allocating memory does not work, so you are only allowed to use ValueTypes or static classes.
            IDT.SetInterruptHandler(null);
            Panic.Setup();
            Debugger.Setup(Serial.COM1);

            // Initialize interrupts
            PIC.Setup();
            IDT.Setup();

            // Initializing the memory management
            Multiboot.Setup();
            GDT.Setup();
            PageFrameAllocator.Setup();
            PageTable.Setup();
            VirtualPageAllocator.Setup();
            GC.Setup();

            // At this point we can use objects
            Scheduler.Setup();
            SmbiosManager.Setup();
            ConsoleManager.Setup();
            Internal.Setup();
        }
Exemplo n.º 3
0
        public static void Setup()
        {
            // Initialize GDT before IDT, because IDT Entries requies a valid Segment Selector
            // This never happend before, because on fast computers GDT.Setup() was called
            // before a Interrupt,for example clock, got triggered.
            Multiboot.Setup();
            GDT.Setup();

            // At this stage, allocating memory does not work, so you are only allowed to use ValueTypes or static classes.
            IDT.SetInterruptHandler(null);
            Panic.Setup();
            Debugger.Setup(Serial.COM1);

            // Initialize interrupts
            PIC.Setup();
            IDT.Setup();

            // Initializing the memory management
            PageFrameAllocator.Setup();
            PageTable.Setup();
            VirtualPageAllocator.Setup();
            GC.Setup();

            // At this point we can use objects
            Scheduler.Setup();
            SmbiosManager.Setup();
            ConsoleManager.Setup();
            Internal.Setup();
        }
Exemplo n.º 4
0
        public static void Error(string message)
        {
            IDT.SetInterruptHandler(null);

            Screen.BackgroundColor = Color.Blue;

            Screen.Clear();
            Screen.Goto(1, 0);
            Screen.Color = Color.White;
            Screen.Write("*** Kernel Panic ***");

            if (firstError)
            {
                firstError = false;
            }
            else
            {
                Screen.Write(" (multiple)");
            }

            Screen.NextLine();
            Screen.NextLine();
            Screen.Write(message);
            Screen.NextLine();
            Screen.NextLine();
            Screen.Write("REGISTERS:");
            Screen.NextLine();
            Screen.NextLine();
            DumpRegisters();
            Screen.NextLine();
            Screen.Write("STACK TRACE:");
            Screen.NextLine();
            Screen.NextLine();
            DumpStackTrace();

            while (true)
            {
                // keep debugger running
                unsafe
                {
                    Debugger.Process(null);
                }

                //Native.Hlt();
            }
        }
Exemplo n.º 5
0
        private static void PrepareScreen(string title)
        {
            IDT.SetInterruptHandler(null);
            Screen.BackgroundColor = Colors.Black;
            Screen.Clear();
            Screen.Goto(1, 1);
            Screen.Color = Colors.LightGray;
            Screen.Write("*** ");
            Screen.Write(title);

            if (firstError)
            {
                firstError = false;
            }
            else
            {
                Screen.Write(" (multiple)");
            }

            Screen.Write(" ***");
            Screen.Goto(3, 1);
        }
Exemplo n.º 6
0
 public static void Setup()
 {
     SmbiosManager.Setup();
     Screen.Clear();
     Screen.Color = 0x0E;
     Screen.Goto(24, 0);
     Screen.Write('1');
     Multiboot.Setup();
     Screen.Goto(24, 1);
     Screen.Write('2');
     PIC.Setup();
     Screen.Goto(24, 2);
     Screen.Write('3');
     GDT.Setup();
     Screen.Goto(24, 3);
     Screen.Write('4');
     IDT.Setup();
     Screen.Goto(24, 4);
     Screen.Write('5');
     PageFrameAllocator.Setup();
     Screen.Goto(24, 5);
     Screen.Write('6');
     PageTable.Setup();
     Screen.Goto(24, 6);
     Screen.Write('7');
     VirtualPageAllocator.Setup();
     Screen.Goto(24, 7);
     Screen.Write('8');
     Screen.Goto(24, 8);
     ProcessManager.Setup();
     Screen.Write('9');
     Screen.Goto(24, 9);
     TaskManager.Setup();
     Screen.Write('A');
     Screen.Goto(24, 10);
     SmbiosManager.Setup();
 }