mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:17:36 +00:00
Kernel: Fix GDT and segment selectors to make userland work on x86_64
Userland faulted on the very first instruction before because the PML4T/PDPT/etc. weren't marked as user-accessible. For some reason x86 doesn't care about that. Also, we need to provide an appropriate userspace stack segment selector to iretq.
This commit is contained in:
parent
04fc7d708c
commit
b5aad1c81d
4 changed files with 16 additions and 9 deletions
|
@ -28,8 +28,9 @@ static_assert(GDT_SELECTOR_CODE0 + 24 == GDT_SELECTOR_DATA3); // SS3 = CS0 + 32
|
|||
#else
|
||||
# define GDT_SELECTOR_CODE0 0x08
|
||||
# define GDT_SELECTOR_CODE3 0x10
|
||||
# define GDT_SELECTOR_TSS 0x18
|
||||
# define GDT_SELECTOR_TSS_PART2 0x20
|
||||
# define GDT_SELECTOR_DATA3 0x18
|
||||
# define GDT_SELECTOR_TSS 0x20
|
||||
# define GDT_SELECTOR_TSS_PART2 0x28
|
||||
#endif
|
||||
|
||||
namespace Kernel {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue