wip: debug memory pages persistency

This commit is contained in:
2024-10-21 13:36:42 +02:00
parent 8c936f6323
commit 4337bc11c8
5 changed files with 24 additions and 10 deletions

View File

@ -1,4 +1,5 @@
#include "alloc.h"
#include "debug.h"
#include "drivers.h"
#include "gdt.h"
#include "idt.h"
@ -35,10 +36,23 @@ void kernel_main(void)
"I see no way to confuse an array of 256 seg:off pairs with a "
"complex 8*unknown quantity -byte descriptor table. -- Troy "
"Martin 03:50, 22 March 2009 (UTC)\n");
/* kprintf("%p\n", vmalloc(10)); */
int i = 0;
while (vmalloc(10))
if (i++ > 11000)
kprintf("%d\n", i++);
/* char *str = vmalloc(10); */
/* strcpy(str, "hello"); */
/* int i = 0; */
/* while (vmalloc(10)) */
/* if (i++ > 11000) */
/* kprintf("str: %s at %d\n", str, i); */
void *tab[1024];
for (int i = 0; i < 1024; i++) {
tab[i] = alloc_pages(1);
/* PRINT_INT(i); */
/* PRINT_PTR(tab[i]); */
if (tab[i])
memset(tab[i], i, 4096);
}
/* PRINT_UINT(((uint8_t *)tab[0])[0]); */
for (int i = 0; i < 10; i++)
PRINT_PTR(tab[i]);
/* PRINT_UINT(((uint8_t *)tab[i])[0]); */
shell_init();
}