Beispiel #1
0
        private static unsafe void InitializeUserMode()
        {
            if (!KConfig.UseUserMode)
            {
                return;
            }

            if (KConfig.UseTaskStateSegment)
            {
                TssAddr = VirtualPageManager.AllocatePages(1);
                PageTable.KernelTable.SetWritable(TssAddr, 4096);
                KernelMemoryMapManager.Header->Used.Add(new KernelMemoryMap(TssAddr, 4096, BootInfoMemoryType.TSS, AddressSpaceKind.Virtual));
            }

            // Disabling Interrupts here is very important, otherwise we will get randomly an Invalid TSS Exception.
            Uninterruptible.Execute(() =>
            {
                GDT.SetupUserMode(TssAddr);
            });
        }
Beispiel #2
0
 /// <summary>
 /// Signal the Integration tests, that Test was successful.
 /// </summary>
 public static void TriggerTestPassed()
 {
     Uninterruptible.Execute(() => KernelMessage.WriteLine(KConfig.SelfTestPassedMarker));
 }