fix: memory: protect kernel code

This commit is contained in:
2024-11-26 12:43:09 +01:00
parent 0c280d971b
commit da804296c6
4 changed files with 63 additions and 35 deletions

View File

@ -68,13 +68,16 @@ void kernel_main(multiboot_info_t *mbd, uint32_t magic)
"Martin 03:50, 22 March 2009 (UTC)\n");
// PRINT_PTR(alloc_frame());
/*void *ptr;
while ((ptr = alloc_pages(PAGE_SIZE * 1020))) {
if (ptr)
memset(ptr, ~0, PAGE_SIZE * 1020);
}*/
if (false) {
void *ptr;
while ((ptr = alloc_pages(PAGE_SIZE * 1))) {
if (ptr)
memset(ptr, ~0, PAGE_SIZE * 1);
}
} else {
while (vmalloc(10))
;
}
/* vmalloc(10); */
while (vmalloc(10))
;
shell_init();
}