Example #1
0
        /// <summary>
        /// Kernel entrypoint
        /// </summary>
        /// <param name="header">The multiboot header</param>
        /// <param name="magic">The magic</param>
        /// <param name="end">The end address of the kernel</param>
        public static unsafe void KernelMain(Multiboot.Header *header, uint magic, void *end)
        {
            heapStart = end;
            Console.Clear();
            X86Arch.EarlyInit();

            processMultiboot(header, magic);
            Heap.InitTempHeap(heapStart);


            X86Arch.Init();


            Random.Init();

            VFS.Init();
            initPCIDevices();
            Keyboard.Init();

            Tasking.Init();

            BootParams.Init(Util.CharPtrToString((char *)header->CMDLine));

            initUSB();
            initStorage();

            mountBootPartition();

            //initNetworking();
            initSound();
            runUserspace();

            // Idle loop
            while (true)
            {
                CPU.HLT();
            }
        }