1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 07:25:07 +00:00

Kernel: Implement initializing threads on x86_64

This commit is contained in:
Gunnar Beutner 2021-06-27 13:59:41 +02:00 committed by Andreas Kling
parent f285241cb8
commit 9ed051fe25
5 changed files with 59 additions and 44 deletions

View file

@ -105,7 +105,13 @@ Thread::Thread(NonnullRefPtr<Process> process, NonnullOwnPtr<Region> kernel_stac
m_regs.gs = GDT_SELECTOR_TLS | 3;
}
#else
// Only IF is set when a process boots.
m_regs.rflags = 0x0202;
if (m_process->is_kernel_process())
m_regs.cs = GDT_SELECTOR_CODE0;
else
m_regs.cs = GDT_SELECTOR_CODE3 | 3;
#endif
m_regs.cr3 = m_process->space().page_directory().cr3();