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

besure that the access bit is set

- required to create valid checkpoints
This commit is contained in:
Stefan Lankes 2017-04-20 10:46:31 +02:00
parent 3c754de83a
commit 48d6ae118d
2 changed files with 5 additions and 5 deletions

View file

@ -176,7 +176,7 @@ start64:
mov rdi, rax
shr rdi, 9 ; (edi >> 12) * 8 (index for boot_pgt)
add rdi, boot_pgt
or rax, 0x103 ; set present, global and writable bits
or rax, 0x23 ; set present, accessed and writable bits
mov QWORD [rdi], rax
Lno_mbinfo:
; remap kernel
@ -184,7 +184,7 @@ Lno_mbinfo:
shr rdi, 18 ; (edi >> 21) * 8 (index for boot_pgd)
add rdi, boot_pgd
mov rax, [base]
or rax, 0x83 ; PG_GLOBAL isn't required because HermitCore is a single-address space OS
or rax, 0xA3 ; PG_GLOBAL isn't required because HermitCore is a single-address space OS
xor rcx, rcx
mov rsi, 510*0x200000
sub rsi, kernel_start

View file

@ -160,9 +160,9 @@ int __page_map(size_t viraddr, size_t phyaddr, size_t npages, size_t bits, uint8
/* Reference the new table within its parent */
#if 0
self[lvl][vpn] = paddr | bits | PG_PRESENT | PG_USER | PG_RW | PG_ACCESSED;
self[lvl][vpn] = paddr | bits | PG_PRESENT | PG_USER | PG_RW | PG_ACCESSED | PG_DIRTY;
#else
self[lvl][vpn] = (paddr | bits | PG_PRESENT | PG_USER | PG_RW | PG_ACCESSED) & ~PG_XD;
self[lvl][vpn] = (paddr | bits | PG_PRESENT | PG_USER | PG_RW | PG_ACCESSED | PG_DIRTY) & ~PG_XD;
#endif
/* Fill new table with zeros */
@ -178,7 +178,7 @@ int __page_map(size_t viraddr, size_t phyaddr, size_t npages, size_t bits, uint8
send_ipi = flush = 1;
}
self[lvl][vpn] = phyaddr | bits | PG_PRESENT | PG_ACCESSED;
self[lvl][vpn] = phyaddr | bits | PG_PRESENT | PG_ACCESSED | PG_DIRTY;
if (flush)
/* There's already a page mapped at this address.