1
0
Fork 0
mirror of https://github.com/hermitcore/libhermit.git synced 2025-03-09 00:00:03 +01:00

"deactivate" page table flag PG_GLOBAL

- HermitCore is a single-address space OS => CR3 never changed
=> PG_GLOBAL isn't required => set PG_GLOBAL to 0
- could avoid collisions with Linux, which uses PG_GLOBAL for the kernel
  space
This commit is contained in:
Stefan Lankes 2016-03-20 00:41:45 +01:00
parent 1ff778ecbc
commit 317d3300b4
2 changed files with 11 additions and 3 deletions

View file

@ -120,8 +120,16 @@ static inline size_t sign_extend(ssize_t addr, int bits)
#define PG_PSE (1 << 7)
/// Page attribute table
#define PG_PAT PG_PSE
/// Global TLB entry (Pentium Pro and later)
#if 1
/* @brief Global TLB entry (Pentium Pro and later)
*
* HermitCore is a single-address space operating system
* => CR3 never changed => The flag isn't required for HermitCore
*/
#define PG_GLOBAL 0
#else
#define PG_GLOBAL (1 << 8)
#endif
/// This table is a self-reference and should skipped by page_map_copy()
#define PG_SELF (1 << 9)

View file

@ -160,10 +160,10 @@ start64:
; remap kernel
mov rdi, kernel_start
shr rdi, 18 ; (edi >> 21) * 8 (index for boot_pgd)
shr rdi, 18 ; (edi >> 21) * 8 (index for boot_pgd)
add rdi, boot_pgd
mov rax, [base]
or rax, 0x183
or rax, 0x83 ; PG_GLOBAL isn't required because HermitCore is a single-address space OS
xor rcx, rcx
Lremap:
mov QWORD [rdi], rax